data availability in serial buffer

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

data availability in serial buffer

Postby taufiqwidi » Mon Jul 08, 2019 12:39 am

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: data availability in serial buffer

Postby Giovanni » Mon Jul 08, 2019 7:56 am

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

Postby taufiqwidi » Mon Jul 08, 2019 11:33 pm

hello,

okay i will check that. thank you Giovanni

Taufiq


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 8 guests