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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

2,028件の閲覧回数
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,935件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Victor,

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

0 件の賞賛
返信

1,935件の閲覧回数
v_canoz
Contributor III

Hello Alice,

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

0 件の賞賛
返信

1,935件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Update DMA descriptor.

0 件の賞賛
返信