1 Reply Latest reply on Feb 6, 2020 7:50 AM by BragadeeshV_41

    detecting IRQ cause at SCB_UART Irq TIME



      I need to detect UART Irq cause   at  "CY_ISR(UART2_SCB_IRQ_Interrupt)" functon


      If I well understand UART does not have separate Tx/Rx Irq vectors

      so internally the avobe function I have to switch to the right code.....


      I'm developing in PSoC Creator 4.2 on  "CYBLE-022001-00"  module.


      Can anyone help me?





        • 1. Re: detecting IRQ cause at SCB_UART Irq TIME

          Hi LUBA_1714456,


          1. First you need to setup which all events can trigger an interrupt event in either the component (UART advanced Tab) or by writing to the interrupt mask register, using the API SCB_SetTxInterruptMode() or SCB_SetTxInterruptMode()


          2. If you are using internal interrupt handler, register a callback function using SCB_SetCustomInterruptHandler() to handle the interrupt events.

          If you are using external interrupt handler, then use CY_ISR(CustomFunction).


          3. In the ISR, use SCB_GetTxInterruptSourceMasked()  and SCB_GetRxInterruptSourceMasked() APIs to determine the reason for the interrupts.


          4. Clear the particular interrupt source using SCB_ClearRxInterruptSource() or SCB_ClearTxInterruptSource()


          Please refer to the component datasheet for these information.