How can I use RxCallback for fsl_uart component

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

How can I use RxCallback for fsl_uart component

2,121 次查看
sergiosaucedo
Contributor I

I'm new in KDS and Kinetis FRDM, but I wanna use a interruption for receive data from UART.

I'm using fsl_uart component whit the Rx configuration in the image.

Can someone tell me, how and when is the UART_RxCallback(uint32_t instance, void * uartState) works?

or if I can use it as interrupt for mi program?.

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

1,481 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi.

you can find api RxCallback() usage in  Kinetis SDK v.1.3 API Reference Manual.pdf under KSDK1.3 install folder.

you can also refer thread:

https://community.nxp.com/message/567462#comment-567462

can this help you?


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,481 次查看
sergiosaucedo
Contributor I

Thanks ZhangJennie!

I saw the example and it looks easy, but if I wanna send back the information I can't visualize that information.

I have checked the uart_non_blocking example and it works when I send/receive information directly from main.c but my purpose is use interupts to receive and send the information I received to another or the same uart.

the code I used is:

void UART_1_RxCallback(uint32_t instance, void * uartState)

{

  uint8_t rxChar[5]={0};

  UART_DRV_ReceiveData(instance, rxChar, 1);

  UART_DRV_SendData(instance, rxChar, 1u);

}

0 项奖励
回复

1,481 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

yes, you can use interrupt with KSDK. I suggest you refer this document

Interrupt handling with KSDK and Kinetis Design Studio

Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复