LPC845: uart_transfer_dma example : how to read buffer before callback?

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

LPC845: uart_transfer_dma example : how to read buffer before callback?

2,029 次查看
v_canoz
Contributor III

Hi,

I'm working on the uart_transfer_dma example for the LPC845 with ping pong buffers which are each 8 bytes sized. This works well when there is a continuous data stream.

I wonder what is the proper way to handle the case when less than 8 bytes are received and we want to process them anyway. This happens when the communication rate is very low.

Let's say I have a software timer that expires each 10ms, and I want to check if a few bytes were received on the UART. How can I check if they are some available without risk of loosing any byte?

Thanks,

Victor

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

1,936 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Victor,

You can just transfer 4 bytes to have a try,  check whether can received.

0 项奖励
回复

1,936 次查看
v_canoz
Contributor III

Hello Alice,

The question is, can I flush the DMA transfer before receiving the 8 bytes?

0 项奖励
回复

1,936 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Update DMA descriptor.

0 项奖励
回复