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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

3,301 次查看
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

标签 (1)
标记 (1)
0 项奖励
回复
2 回复数

2,249 次查看
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 项奖励
回复

2,249 次查看
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 项奖励
回复