How can I separate RX/TX of the UART interrupt?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I separate RX/TX of the UART interrupt?

2,440 Views
seunghyunum
Contributor I

Hi, 

I'm testing the S32K144 chip in S32DS v2.0. There is one example, named lpuart_echo_s32k144. It takes the RX data using polling method.

I want to change this to interrupt method.

lpuart_echo_s32k144 example uses the SDK. I could add the api easily as below.

INT_SYS_InstallHandler(LPUART1_RxTx_IRQn, LPUART1_RxTx_IRQHandler, (isr_t *)0);
INT_SYS_EnableIRQ(LPUART1_RxTx_IRQn);

And I added ISR like below.

void LPUART1_RxTx_IRQHandler(void){

...

}

I think this ISR calls both RX and TX cases. When I checked CTRL register, TIE and RIE are enabled.

Then, how can I seperate RX and TX? Is there any state register?

Please give me a sample.

Thanks,

BR, Seunghyun Um

Labels (1)
Tags (1)
0 Kudos
2 Replies

1,388 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Yes, there is one interrupt for both.

Unfortunately, I don't have such a sample code.

But it is explained in Chapter 48.4.6 of the RM.

Regards,

Daniel

0 Kudos

1,388 Views
seunghyunum
Contributor I

Thanks Daniel. Chapter 48.4.6 of the RM is very helpful for me.

And I found one sample (S32K144 LPUART1_RxTx_IRQHandler )

Thank you,

BR, SHUm

0 Kudos