data availability in serial buffer

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
User avatar
taufiqwidi
Posts: 7
Joined: Fri Jul 05, 2019 11:19 pm
Has thanked: 1 time

data availability in serial buffer

Post by taufiqwidi »

Hello,

first, sorry if i ask this question in the wrong place or maybe someone just asked this before.
how to know the size of the data that available in the serial buffer (using serial driver) ? or at least to know there are available data in the serial buffer.

thank you,
Taufiq.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: data availability in serial buffer

Post by Giovanni »

Hi,

You need to use the queues functions for that kind of approach, see the HAL queues macros/functions, you can check the empty/full status or get the number of used/free slots in the queue.

Giovanni
User avatar
taufiqwidi
Posts: 7
Joined: Fri Jul 05, 2019 11:19 pm
Has thanked: 1 time

Re: data availability in serial buffer

Post by taufiqwidi »

hello,

okay i will check that. thank you Giovanni

Taufiq
Post Reply