3 Replies Latest reply on Aug 1, 2019 3:34 AM by YashwantK_46

    How to implement CDC to UART bridge on FX3 (i.e. cyfxusbuart example) without CTS/RTS handshake?

    IzMa_4105896

      I'm trying to implement a CDC to UART bridge similar to the cyusbuart example working but without hardware handshake (no CTS/RTS).  The cyusbuart example depends on CTS/RTS handshake to disable data into the UART when transferring partial messages that do not fill the entire DMA buffer to the USB (see code from example below).    How to do get this same functionality without the CTS/RTS handshake?

      Thanks,

      Iztok

       

      /* Entry function for the USBUARTAppThread */

      void

      USBUARTAppThread_Entry (

      uint32_t input)

      {  

      uint32_t regValueEn = 0, regValueDs = 0;

       

      /* Initialize the USBUART Example Application */

      CyFxUSBUARTAppInit();

       

      /* UART Config Value for Enabling Rx Block */

      regValueEn = UART->lpp_uart_config;

       

      /* UART Config Value for Disabling the Rx Block  */

      regValueDs = UART->lpp_uart_config & (~(CY_U3P_LPP_UART_RTS | CY_U3P_LPP_UART_RX_ENABLE));

       

      for (;;)

      {

      if (glIsApplnActive)

      {

      /* While the application is active, check for data sent during the last 50 ms. If no data

         has been sent to the host, use the channel wrap-up feature to send any partial buffer to

         the USB host.

      */

      if (glPktsPending == 0)

      {

      /* Disable UART Receiver Block */

      UART->lpp_uart_config = regValueDs;

       

       

      CyU3PDmaChannelSetWrapUp (&glChHandleUarttoUsb);

       

       

      /* Enable UART Receiver Block */

      UART->lpp_uart_config = regValueEn;

      }

      glPktsPending = 0;

      }

      CyU3PThreadSleep (50);

      }

      }