ChibiOS/HAL  6.1.0
hal_queues.h File Reference

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

Go to the source code of this file.

Data Structures

struct  io_queue
 Generic I/O queue structure. More...
 

Macros

Queue functions returned status value
#define Q_OK   MSG_OK
 Operation successful. More...
 
#define Q_TIMEOUT   MSG_TIMEOUT
 Timeout condition. More...
 
#define Q_RESET   MSG_RESET
 Queue has been reset. More...
 
#define Q_EMPTY   MSG_TIMEOUT
 Queue empty. More...
 
#define Q_FULL   MSG_TIMEOUT
 Queue full,. More...
 
Macro Functions
#define qSizeX(qp)
 Returns the queue's buffer size. More...
 
#define qSpaceI(qp)   ((qp)->q_counter)
 Queue space. More...
 
#define qGetLink(qp)   ((qp)->q_link)
 Returns the queue application-defined link. More...
 
#define qSetLink(qp, lk)   ((qp)->q_link = lk)
 Sets the queue application-defined link. More...
 
#define iqGetFullI(iqp)   qSpaceI(iqp)
 Returns the filled space into an input queue. More...
 
#define iqGetEmptyI(iqp)   (qSizeX(iqp) - qSpaceI(iqp))
 Returns the empty space into an input queue. More...
 
#define iqIsEmptyI(iqp)   ((bool)(qSpaceI(iqp) == 0U))
 Evaluates to true if the specified input queue is empty. More...
 
#define iqIsFullI(iqp)
 Evaluates to true if the specified input queue is full. More...
 
#define iqGet(iqp)   iqGetTimeout(iqp, TIME_INFINITE)
 Input queue read. More...
 
#define oqGetFullI(oqp)   (qSizeX(oqp) - qSpaceI(oqp))
 Returns the filled space into an output queue. More...
 
#define oqGetEmptyI(oqp)   qSpaceI(oqp)
 Returns the empty space into an output queue. More...
 
#define oqIsEmptyI(oqp)
 Evaluates to true if the specified output queue is empty. More...
 
#define oqIsFullI(oqp)   ((bool)(qSpaceI(oqp) == 0U))
 Evaluates to true if the specified output queue is full. More...
 
#define oqPut(oqp, b)   oqPutTimeout(oqp, b, TIME_INFINITE)
 Output queue write. More...
 

Typedefs

typedef struct io_queue io_queue_t
 Type of a generic I/O queue structure. More...
 
typedef void(* qnotify_t) (io_queue_t *qp)
 Queue notification callback type. More...
 
typedef io_queue_t input_queue_t
 Type of an input queue structure. More...
 
typedef io_queue_t output_queue_t
 Type of an output queue structure. More...
 

Functions

void iqObjectInit (input_queue_t *iqp, uint8_t *bp, size_t size, qnotify_t infy, void *link)
 Initializes an input queue. More...
 
void iqResetI (input_queue_t *iqp)
 Resets an input queue. More...
 
msg_t iqPutI (input_queue_t *iqp, uint8_t b)
 Input queue write. More...
 
msg_t iqGetI (input_queue_t *iqp)
 Input queue non-blocking read. More...
 
msg_t iqGetTimeout (input_queue_t *iqp, sysinterval_t timeout)
 Input queue read with timeout. More...
 
size_t iqReadI (input_queue_t *iqp, uint8_t *bp, size_t n)
 Input queue non-blocking read. More...
 
size_t iqReadTimeout (input_queue_t *iqp, uint8_t *bp, size_t n, sysinterval_t timeout)
 Input queue read with timeout. More...
 
void oqObjectInit (output_queue_t *oqp, uint8_t *bp, size_t size, qnotify_t onfy, void *link)
 Initializes an output queue. More...
 
void oqResetI (output_queue_t *oqp)
 Resets an output queue. More...
 
msg_t oqPutI (output_queue_t *oqp, uint8_t b)
 Output queue non-blocking write. More...
 
msg_t oqPutTimeout (output_queue_t *oqp, uint8_t b, sysinterval_t timeout)
 Output queue write with timeout. More...
 
msg_t oqGetI (output_queue_t *oqp)
 Output queue read. More...
 
size_t oqWriteI (output_queue_t *oqp, const uint8_t *bp, size_t n)
 Output queue non-blocking write. More...
 
size_t oqWriteTimeout (output_queue_t *oqp, const uint8_t *bp, size_t n, sysinterval_t timeout)
 Output queue write with timeout. More...
 

Detailed Description

I/O Queues macros and structures.

Definition in file hal_queues.h.