detecting IRQ cause at SCB_UART Irq TIME

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
LUBA_1714456
Level 3
Level 3
First solution authored 10 replies posted 5 replies posted

Hello!

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?

Thanks

Regards

Luigi

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

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.

https://www.cypress.com/file/408071/download

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post

0 Likes
1 Reply
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

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.

https://www.cypress.com/file/408071/download

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes