How can I use RxCallback for fsl_uart component

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

How can I use RxCallback for fsl_uart component

1,313 Views
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?.

Labels (1)
0 Kudos
3 Replies

673 Views
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 Kudos

673 Views
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 Kudos

673 Views
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 Kudos