Go to the documentation of this file.
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)
thread_reference_t wtr
Waiting writer.
size_t cnt
Bytes in the pipe.
static void chPipeResume(pipe_t *pp)
Terminates the reset state.
uint8_t * wrptr
Write pointer.
mutex_t cmtx
Common access mutex.
static size_t chPipeGetSize(const pipe_t *pp)
Returns the pipe buffer size as number of bytes.
void chPipeReset(pipe_t *pp)
Resets a pipe_t object.
size_t chPipeWriteTimeout(pipe_t *pp, const uint8_t *bp, size_t n, sysinterval_t timeout)
Pipe write with timeout.
Structure representing a thread.
mutex_t rmtx
Read access mutex.
Structure representing a pipe object.
uint64_t sysinterval_t
Type of time interval.
static size_t chPipeGetUsedCount(const pipe_t *pp)
Returns the number of used byte slots into a pipe.
uint8_t * top
Pointer to the location after the buffer.
bool reset
True if in reset state.
uint8_t * rdptr
Read pointer.
void chPipeObjectInit(pipe_t *pp, uint8_t *buf, size_t n)
Initializes a mailbox_t object.
static size_t chPipeGetFreeCount(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.
mutex_t wmtx
Write access mutex.
thread_reference_t rtr
Waiting reader.
uint8_t * buffer
Pointer to the pipe buffer.