usart dynamic length

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

usart dynamic length

2,025 次查看
sachinn434
Contributor I

HI all,

i am using a lpc54so18 nxp controller i want usart data transmission with dynamic length how achieve this please help me to solve this and thank you

0 项奖励
回复
1 回复

1,976 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

For your current software architecture, pls refer to the example in SDK package:

......\LPC_SDK_MCUExpresso\SDK_2_12_0_LPCXpresso54S018 (1)\boards\lpcxpresso54s018\driver_examples\usart\interrupt_transfer

 

The interrupt transfer example uses interrupt mechanism, for each character, it uses interrupt mode to transfer. In the ISR, the code will check if the predefined size of characters have been transferred, if the predefined size of characters have been completed, the callback function is called, you can write the callback function, set a flag or whatever so that the main can poll the flag to know if the transfer is over or not. But you have to call USART_TransferCreateHandle(DEMO_USART, &g_uartHandle, USART_UserCallback, NULL); so that you can install the callback function.

Hope it can help you

BR

XiangJun Rong

 

 

 

0 项奖励
回复