ChibiOS/HAL 9.0.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 BUFFERS_CHUNKS_SIZE   64
 Maximum size of blocks copied in critical sections.
#define BQ_BUFFER_SIZE(n, size)
 Computes the size of a buffers queue buffer size.
Macro Functions
#define bqSizeX(bqp)
 Returns the queue's number of buffers.
#define bqSpaceI(bqp)
 Return the ready buffers number.
#define bqGetLinkX(bqp)
 Returns the queue application-defined link.
#define bqSetLinkX(bqp, lk)
 Sets the queue application-defined link.
#define bqIsSuspendedX(bqp)
 Return the suspended state of the queue.
#define bqSuspendI(bqp)
 Puts the queue in suspended state.
#define bqResumeX(bqp)
 Resumes normal queue operations.
#define ibqIsEmptyI(ibqp)
 Evaluates to true if the specified input buffers queue is empty.
#define ibqIsFullI(ibqp)
 Evaluates to true if the specified input buffers queue is full.
#define obqIsEmptyI(obqp)
 Evaluates to true if the specified output buffers queue is empty.
#define obqIsFullI(obqp)
 Evaluates to true if the specified output buffers queue is full.

Typedefs

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

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.
void ibqResetI (input_buffers_queue_t *ibqp)
 Resets an input buffers queue.
uint8_t * ibqGetEmptyBufferI (input_buffers_queue_t *ibqp)
 Gets the next empty buffer from the queue.
void ibqPostFullBufferI (input_buffers_queue_t *ibqp, size_t size)
 Posts a new filled buffer to the queue.
msg_t ibqGetFullBufferTimeout (input_buffers_queue_t *ibqp, sysinterval_t timeout)
 Gets the next filled buffer from the queue.
msg_t ibqGetFullBufferTimeoutS (input_buffers_queue_t *ibqp, sysinterval_t timeout)
 Gets the next filled buffer from the queue.
void ibqReleaseEmptyBuffer (input_buffers_queue_t *ibqp)
 Releases the buffer back in the queue.
void ibqReleaseEmptyBufferS (input_buffers_queue_t *ibqp)
 Releases the buffer back in the queue.
msg_t ibqGetTimeout (input_buffers_queue_t *ibqp, sysinterval_t timeout)
 Input queue read with timeout.
size_t ibqReadTimeout (input_buffers_queue_t *ibqp, uint8_t *bp, size_t n, sysinterval_t timeout)
 Input queue read with timeout.
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.
void obqResetI (output_buffers_queue_t *obqp)
 Resets an output buffers queue.
uint8_t * obqGetFullBufferI (output_buffers_queue_t *obqp, size_t *sizep)
 Gets the next filled buffer from the queue.
void obqReleaseEmptyBufferI (output_buffers_queue_t *obqp)
 Releases the next filled buffer back in the queue.
msg_t obqGetEmptyBufferTimeout (output_buffers_queue_t *obqp, sysinterval_t timeout)
 Gets the next empty buffer from the queue.
msg_t obqGetEmptyBufferTimeoutS (output_buffers_queue_t *obqp, sysinterval_t timeout)
 Gets the next empty buffer from the queue.
void obqPostFullBuffer (output_buffers_queue_t *obqp, size_t size)
 Posts a new filled buffer to the queue.
void obqPostFullBufferS (output_buffers_queue_t *obqp, size_t size)
 Posts a new filled buffer to the queue.
msg_t obqPutTimeout (output_buffers_queue_t *obqp, uint8_t b, sysinterval_t timeout)
 Output queue write with timeout.
size_t obqWriteTimeout (output_buffers_queue_t *obqp, const uint8_t *bp, size_t n, sysinterval_t timeout)
 Output queue write with timeout.
bool obqTryFlushI (output_buffers_queue_t *obqp)
 Flushes the current, partially filled, buffer to the queue.
void obqFlush (output_buffers_queue_t *obqp)
 Flushes the current, partially filled, buffer to the queue.

Detailed Description

I/O Buffers macros and structures.

Definition in file hal_buffers.h.