31 #if (CH_CFG_USE_PIPES == TRUE) || defined(__DOXYGEN__) 63 #if (CH_CFG_USE_MUTEXES == TRUE) || defined(__DOXYGEN__) 87 #if (CH_CFG_USE_MUTEXES == TRUE) || defined(__DOXYGEN__) 88 #define _PIPE_DATA(name, buffer, size) { \ 89 (uint8_t *)(buffer), \ 90 (uint8_t *)(buffer) + size, \ 91 (uint8_t *)(buffer), \ 92 (uint8_t *)(buffer), \ 97 _MUTEX_DATA(name.cmtx), \ 98 _MUTEX_DATA(name.wmtx), \ 99 _MUTEX_DATA(name.rmtx), \ 102 #define _PIPE_DATA(name, buffer, size) { \ 103 (uint8_t *)(buffer), \ 104 (uint8_t *)(buffer) + size, \ 105 (uint8_t *)(buffer), \ 106 (uint8_t *)(buffer), \ 111 _SEMAPHORE_DATA(name.csem, (cnt_t)1), \ 112 _SEMAPHORE_DATA(name.wsem, (cnt_t)1), \ 113 _SEMAPHORE_DATA(name.rsem, (cnt_t)1), \ 126 #define PIPE_DECL(name, buffer, size) \ 127 pipe_t name = _PIPE_DATA(name, buffer, size) bool reset
True if in reset state.
static size_t chPipeGetSize(const pipe_t *pp)
Returns the pipe buffer size as number of bytes.
mutex_t wmtx
Write access mutex.
uint64_t sysinterval_t
Type of time interval.
uint8_t * rdptr
Read pointer.
size_t chPipeReadTimeout(pipe_t *pp, uint8_t *bp, size_t n, sysinterval_t timeout)
Pipe read with timeout.
static size_t chPipeGetFreeCount(const pipe_t *pp)
Returns the number of free byte slots into a pipe.
uint8_t * top
Pointer to the location after the buffer.
size_t cnt
Bytes in the pipe.
Structure representing a pipe object.
thread_reference_t rtr
Waiting reader.
static size_t chPipeGetUsedCount(const pipe_t *pp)
Returns the number of used byte slots into a pipe.
size_t chPipeWriteTimeout(pipe_t *pp, const uint8_t *bp, size_t n, sysinterval_t timeout)
Pipe write with timeout.
static void chPipeResume(pipe_t *pp)
Terminates the reset state.
uint8_t * buffer
Pointer to the pipe buffer.
mutex_t rmtx
Read access mutex.
uint8_t * wrptr
Write pointer.
void chPipeReset(pipe_t *pp)
Resets a pipe_t object.
thread_reference_t wtr
Waiting writer.
void chPipeObjectInit(pipe_t *pp, uint8_t *buf, size_t n)
Initializes a mailbox_t object.
mutex_t cmtx
Common access mutex.
Structure representing a thread.