31 #if (CH_CFG_USE_PIPES == TRUE) || defined(__DOXYGEN__) 63 #if (CH_CFG_USE_MUTEXES == TRUE) || defined(__DOXYGEN__) 83 #if (CH_CFG_USE_MUTEXES == TRUE) || defined(__DOXYGEN__) 84 #define _PIPE_DATA(name, buffer, size) { \ 85 (uint8_t *)(buffer), \ 86 (uint8_t *)(buffer) + size, \ 87 (uint8_t *)(buffer), \ 88 (uint8_t *)(buffer), \ 91 _THREADS_QUEUE_DATA(name.qw), \ 92 _THREADS_QUEUE_DATA(name.qr), \ 93 _MUTEX_DATA(name.mtx), \ 96 #define _PIPE_DATA(name, buffer, size) { \ 97 (uint8_t *)(buffer), \ 98 (uint8_t *)(buffer) + size, \ 99 (uint8_t *)(buffer), \ 100 (uint8_t *)(buffer), \ 103 _THREADS_QUEUE_DATA(name.qw), \ 104 _THREADS_QUEUE_DATA(name.qr), \ 105 _SEMAPHORE_DATA(name.sem, (cnt_t)1), \ 118 #define PIPE_DECL(name, buffer, size) \ 119 pipe_t name = _PIPE_DATA(name, buffer, size) threads_queue_t qw
Queued writers.
bool reset
True if in reset state.
static void chPipeResumeX(pipe_t *pp)
Terminates the reset state.
uint64_t sysinterval_t
Type of time interval.
uint8_t * rdptr
Read pointer.
static size_t chPipeGetFreeCountI(const pipe_t *pp)
Returns the number of free byte slots into a pipe.
size_t chPipeReadTimeout(pipe_t *pp, uint8_t *bp, size_t n, sysinterval_t timeout)
Pipe read with timeout.
uint8_t * top
Pointer to the location after the buffer.
size_t cnt
Messages in queue.
Structure representing a pipe object.
static uint8_t chPipePeekI(const pipe_t *pp)
Returns the next byte in the queue without removing it.
size_t chPipeWriteTimeout(pipe_t *pp, const uint8_t *bp, size_t n, sysinterval_t timeout)
Pipe write with timeout.
mutex_t mtx
Heap access mutex.
uint8_t * buffer
Pointer to the pipe buffer.
uint8_t * wrptr
Write pointer.
void chPipeReset(pipe_t *pp)
Resets a pipe_t object.
static size_t chPipeGetSizeI(const pipe_t *pp)
Returns the pipe buffer size as number of bytes.
threads_queue_t qr
Queued readers.
void chPipeObjectInit(pipe_t *pp, uint8_t *buf, size_t n)
Initializes a mailbox_t object.
static size_t chPipeGetUsedCountI(const pipe_t *pp)
Returns the number of used byte slots into a pipe.