ChibiOS 21.11.4
chpipes.c File Reference

Pipes code. More...

#include <string.h>
#include "ch.h"

Go to the source code of this file.

Macros

#define PC_INIT(p)
#define PC_LOCK(p)
#define PC_UNLOCK(p)
#define PW_INIT(p)
#define PW_LOCK(p)
#define PW_UNLOCK(p)
#define PR_INIT(p)
#define PR_LOCK(p)
#define PR_UNLOCK(p)

Functions

static size_t pipe_write (pipe_t *pp, const uint8_t *bp, size_t n)
 Non-blocking pipe write.
static size_t pipe_read (pipe_t *pp, uint8_t *bp, size_t n)
 Non-blocking pipe read.
void chPipeObjectInit (pipe_t *pp, uint8_t *buf, size_t n)
 Initializes a mailbox_t object.
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.
size_t chPipeReadTimeout (pipe_t *pp, uint8_t *bp, size_t n, sysinterval_t timeout)
 Pipe read with timeout.

Detailed Description

Pipes code.

Byte pipes.

Operation mode

A pipe is an asynchronous communication mechanism.
Operations defined for mailboxes:

  • Write: Writes a buffer of data in the pipe in FIFO order.
  • Read: A buffer of data is read from the read and removed.
  • Reset: The pipe is emptied and all the stored data is lost.
Precondition
In order to use the pipes APIs the CH_CFG_USE_PIPES option must be enabled in chconf.h.
Note
Compatible with RT and NIL.

Definition in file chpipes.c.