ChibiOS/HAL  6.1.0
hal_buffers.h File Reference

I/O Buffers macros and structures. More...

Go to the source code of this file.

Data Structures

struct  io_buffers_queue
 Structure of a generic buffers queue. More...
 

Macros

#define BQ_BUFFER_SIZE(n, size)   (((size_t)(size) + sizeof (size_t)) * (size_t)(n))
 Computes the size of a buffers queue buffer size. More...
 
Macro Functions
#define bqSizeX(bqp)   ((bqp)->bn)
 Returns the queue's number of buffers. More...
 
#define bqSpaceI(bqp)   ((bqp)->bcounter)
 Return the ready buffers number. More...
 
#define bqGetLinkX(bqp)   ((bqp)->link)
 Returns the queue application-defined link. More...
 
#define bqIsSuspendedX(bqp)   ((bqp)->suspended)
 Return the suspended state of the queue. More...
 
#define bqSuspendI(bqp)
 Puts the queue in suspended state. More...
 
#define bqResumeX(bqp)
 Resumes normal queue operations. More...
 
#define ibqIsEmptyI(ibqp)   ((bool)(bqSpaceI(ibqp) == 0U))
 Evaluates to true if the specified input buffers queue is empty. More...
 
#define ibqIsFullI(ibqp)
 Evaluates to true if the specified input buffers queue is full. More...
 
#define obqIsEmptyI(obqp)
 Evaluates to true if the specified output buffers queue is empty. More...
 
#define obqIsFullI(obqp)   ((bool)(bqSpaceI(obqp) == 0U))
 Evaluates to true if the specified output buffers queue is full. More...
 

Typedefs

typedef struct io_buffers_queue io_buffers_queue_t
 Type of a generic queue of buffers. More...
 
typedef void(* bqnotify_t) (io_buffers_queue_t *bqp)
 Double buffer notification callback type. More...
 
typedef io_buffers_queue_t input_buffers_queue_t
 Type of an input buffers queue. More...
 
typedef io_buffers_queue_t output_buffers_queue_t
 Type of an output buffers queue. More...
 

Functions

void ibqObjectInit (input_buffers_queue_t *ibqp, bool suspended, uint8_t *bp, size_t size, size_t n, bqnotify_t infy, void *link)
 Initializes an input buffers queue object. More...
 
void ibqResetI (input_buffers_queue_t *ibqp)
 Resets an input buffers queue. More...
 
uint8_t * ibqGetEmptyBufferI (input_buffers_queue_t *ibqp)
 Gets the next empty buffer from the queue. More...
 
void ibqPostFullBufferI (input_buffers_queue_t *ibqp, size_t size)
 Posts a new filled buffer to the queue. More...
 
msg_t ibqGetFullBufferTimeout (input_buffers_queue_t *ibqp, sysinterval_t timeout)
 Gets the next filled buffer from the queue. More...
 
msg_t ibqGetFullBufferTimeoutS (input_buffers_queue_t *ibqp, sysinterval_t timeout)
 Gets the next filled buffer from the queue. More...
 
void ibqReleaseEmptyBuffer (input_buffers_queue_t *ibqp)
 Releases the buffer back in the queue. More...
 
void ibqReleaseEmptyBufferS (input_buffers_queue_t *ibqp)
 Releases the buffer back in the queue. More...
 
msg_t ibqGetTimeout (input_buffers_queue_t *ibqp, sysinterval_t timeout)
 Input queue read with timeout. More...
 
size_t ibqReadTimeout (input_buffers_queue_t *ibqp, uint8_t *bp, size_t n, sysinterval_t timeout)
 Input queue read with timeout. More...
 
void obqObjectInit (output_buffers_queue_t *obqp, bool suspended, uint8_t *bp, size_t size, size_t n, bqnotify_t onfy, void *link)
 Initializes an output buffers queue object. More...
 
void obqResetI (output_buffers_queue_t *obqp)
 Resets an output buffers queue. More...
 
uint8_t * obqGetFullBufferI (output_buffers_queue_t *obqp, size_t *sizep)
 Gets the next filled buffer from the queue. More...
 
void obqReleaseEmptyBufferI (output_buffers_queue_t *obqp)
 Releases the next filled buffer back in the queue. More...
 
msg_t obqGetEmptyBufferTimeout (output_buffers_queue_t *obqp, sysinterval_t timeout)
 Gets the next empty buffer from the queue. More...
 
msg_t obqGetEmptyBufferTimeoutS (output_buffers_queue_t *obqp, sysinterval_t timeout)
 Gets the next empty buffer from the queue. More...
 
void obqPostFullBuffer (output_buffers_queue_t *obqp, size_t size)
 Posts a new filled buffer to the queue. More...
 
void obqPostFullBufferS (output_buffers_queue_t *obqp, size_t size)
 Posts a new filled buffer to the queue. More...
 
msg_t obqPutTimeout (output_buffers_queue_t *obqp, uint8_t b, sysinterval_t timeout)
 Output queue write with timeout. More...
 
size_t obqWriteTimeout (output_buffers_queue_t *obqp, const uint8_t *bp, size_t n, sysinterval_t timeout)
 Output queue write with timeout. More...
 
bool obqTryFlushI (output_buffers_queue_t *obqp)
 Flushes the current, partially filled, buffer to the queue. More...
 
void obqFlush (output_buffers_queue_t *obqp)
 Flushes the current, partially filled, buffer to the queue. More...
 

Detailed Description

I/O Buffers macros and structures.

Definition in file hal_buffers.h.