2 Replies Latest reply on Mar 13, 2020 1:14 AM by MaMi_1205306

    PSoC5LP : UART API Difference between _GetChar() and _GetReadData()

    MaMi_1205306

      Hi,

       

      We use the UART component of PSoC5LP.

       

       

      The UART component has "UARTRX-On Byte Received" enabled.
      Interrupt is generated by receiving byte data,
      The following processing is performed in the interrupt.

       

      /* UART Rx interrupt routine */

      while ((UART_1_ReadRxStatus() & UART_1_RX_STS_FIFO_NOTEMPTY) !=0) {

      uint8 data = UART_1_GetChar();

      }

       

      In this process, data cannot be obtained normally by the _GetChar() API.

      However, it can be received normally if modified as follows.

       

      /* UART Rx interrupt routine */

      while ((UART_1_ReadRxStatus() & UART_1_RX_STS_FIFO_NOTEMPTY) !=0) {

      uint8 data = UART_1_GetReadRxData(); // Change API

      }

       

      In this case,
      What is the difference between Get_Char function and ReadRxData function?

       

      I confirm for the contents of each API,
      The GetChar function checks the status flag, and the ReadRxData function does not check the status flag.

      I think the difference is only checking the status flag.
      Does this difference affect the behavior?

       

      Regards,