4 Replies Latest reply on Feb 12, 2020 8:21 PM by MoTa_728816

    CE219656 - PSoC 6 MCU UART using Low Level APIs; clearing interrupt


      I am looking at, and running, the UART_Low_Level_User_ISR code sample. I have a question about this function:



      * Function Name: ISR_UART



      * Summary:

      *  This function is registered to be called when UART interrupt occurs.

      *  (Note that only RX fifo not empty interrupt is unmasked)

      *  Whenever there is a data in UART RX fifo, Get that data and Put it into

      *  UART TX fifo which will be transmitted to terminal


      void ISR_UART(void)


          /* Check for "RX fifo not empty interrupt" */



              /* Clear UART "RX fifo not empty interrupt" */



              /* Get the character from terminal */

      read_data = Cy_SCB_UART_Get(UART_HW);





      1) How does bitwise AND of SCB_INTR_RX_NOT_EMPTY_Msk (0x4UL) with UART_HW->INTR_RX clear the interrupt? Also, is this the preferred way to clear the interrupt in the ISR?


      2) Is it even possible to clear this interrupt if the RX fifo is not empty, or it will it be redriven forever until something like Cy_SCB_UART_Get(UART_HW)empties the fifo? I'd like to defer the get.