37 #define Q_TIMEOUT MSG_TIMEOUT 38 #define Q_RESET MSG_RESET 39 #define Q_EMPTY MSG_TIMEOUT 40 #define Q_FULL MSG_TIMEOUT 129 ((size_t)((qp)->q_top - (qp)->q_buffer)) \ 142 #define qSpaceI(qp) ((qp)->q_counter) 153 #define qGetLink(qp) ((qp)->q_link) 164 #define qSetLink(qp, lk) ((qp)->q_link = lk) 175 #define iqGetFullI(iqp) qSpaceI(iqp) 186 #define iqGetEmptyI(iqp) (qSizeX(iqp) - qSpaceI(iqp)) 198 #define iqIsEmptyI(iqp) ((bool)(qSpaceI(iqp) == 0U)) 210 #define iqIsFullI(iqp) \ 212 ((bool)(((iqp)->q_wrptr == (iqp)->q_rdptr) && ((iqp)->q_counter != 0U))) \ 227 #define iqGet(iqp) iqGetTimeout(iqp, TIME_INFINITE) 238 #define oqGetFullI(oqp) (qSizeX(oqp) - qSpaceI(oqp)) 249 #define oqGetEmptyI(oqp) qSpaceI(oqp) 261 #define oqIsEmptyI(oqp) \ 263 ((bool)(((oqp)->q_wrptr == (oqp)->q_rdptr) && ((oqp)->q_counter != 0U))) \ 276 #define oqIsFullI(oqp) ((bool)(qSpaceI(oqp) == 0U)) 292 #define oqPut(oqp, b) oqPutTimeout(oqp, b, TIME_INFINITE) Generic I/O queue structure.
void iqObjectInit(input_queue_t *iqp, uint8_t *bp, size_t size, qnotify_t infy, void *link)
Initializes an input queue.
msg_t iqGetTimeout(input_queue_t *iqp, sysinterval_t timeout)
Input queue read with timeout.
void oqObjectInit(output_queue_t *oqp, uint8_t *bp, size_t size, qnotify_t onfy, void *link)
Initializes an output queue.
size_t iqReadI(input_queue_t *iqp, uint8_t *bp, size_t n)
Input queue non-blocking read.
uint8_t * q_wrptr
Write pointer.
void iqResetI(input_queue_t *iqp)
Resets an input queue.
void oqResetI(output_queue_t *oqp)
Resets an output queue.
uint8_t * q_top
Pointer to the first location after the buffer.
threads_queue_t q_waiting
Queue of waiting threads.
io_queue_t input_queue_t
Type of an input queue structure.
int32_t msg_t
Type of a message.
void(* qnotify_t)(io_queue_t *qp)
Queue notification callback type.
void * q_link
Application defined field.
size_t oqWriteTimeout(output_queue_t *oqp, const uint8_t *bp, size_t n, sysinterval_t timeout)
Output queue write with timeout.
uint8_t * q_buffer
Pointer to the queue buffer.
msg_t oqPutTimeout(output_queue_t *oqp, uint8_t b, sysinterval_t timeout)
Output queue write with timeout.
uint32_t sysinterval_t
Type of system time interval.
msg_t oqGetI(output_queue_t *oqp)
Output queue read.
msg_t oqPutI(output_queue_t *oqp, uint8_t b)
Output queue non-blocking write.
msg_t iqPutI(input_queue_t *iqp, uint8_t b)
Input queue write.
volatile size_t q_counter
Resources counter.
uint8_t * q_rdptr
Read pointer.
qnotify_t q_notify
Data notification callback.
msg_t iqGetI(input_queue_t *iqp)
Input queue non-blocking read.
size_t iqReadTimeout(input_queue_t *iqp, uint8_t *bp, size_t n, sysinterval_t timeout)
Input queue read with timeout.
size_t oqWriteI(output_queue_t *oqp, const uint8_t *bp, size_t n)
Output queue non-blocking write.
io_queue_t output_queue_t
Type of an output queue structure.