ChibiOS/RT  5.1.0
chfifo.h File Reference

Objects FIFO structures and macros. More...

Go to the source code of this file.

Data Structures

struct  ch_objects_fifo
 Type of an objects FIFO. More...
 

Typedefs

typedef struct ch_objects_fifo objects_fifo_t
 Type of an objects FIFO. More...
 

Functions

static void chFifoObjectInit (objects_fifo_t *ofp, size_t objsize, size_t objn, unsigned objalign, void *objbuf, msg_t *msgbuf)
 Initializes a FIFO object. More...
 
static void * chFifoTakeObjectI (objects_fifo_t *ofp)
 Allocates a free object. More...
 
static void * chFifoTakeObjectTimeoutS (objects_fifo_t *ofp, sysinterval_t timeout)
 Allocates a free object. More...
 
static void * chFifoTakeObjectTimeout (objects_fifo_t *ofp, sysinterval_t timeout)
 Allocates a free object. More...
 
static void chFifoReturnObjectI (objects_fifo_t *ofp, void *objp)
 Releases a fetched object. More...
 
static void chFifoReturnObjectS (objects_fifo_t *ofp, void *objp)
 Releases a fetched object. More...
 
static void chFifoReturnObject (objects_fifo_t *ofp, void *objp)
 Releases a fetched object. More...
 
static void chFifoSendObjectI (objects_fifo_t *ofp, void *objp)
 Posts an object. More...
 
static void chFifoSendObjectS (objects_fifo_t *ofp, void *objp)
 Posts an object. More...
 
static void chFifoSendObject (objects_fifo_t *ofp, void *objp)
 Posts an object. More...
 
static void chFifoSendObjectAheadI (objects_fifo_t *ofp, void *objp)
 Posts an high priority object. More...
 
static void chFifoSendObjectAheadS (objects_fifo_t *ofp, void *objp)
 Posts an high priority object. More...
 
static void chFifoSendObjectAhead (objects_fifo_t *ofp, void *objp)
 Posts an high priority object. More...
 
static msg_t chFifoReceiveObjectI (objects_fifo_t *ofp, void **objpp)
 Fetches an object. More...
 
static msg_t chFifoReceiveObjectTimeoutS (objects_fifo_t *ofp, void **objpp, sysinterval_t timeout)
 Fetches an object. More...
 
static msg_t chFifoReceiveObjectTimeout (objects_fifo_t *ofp, void **objpp, sysinterval_t timeout)
 Fetches an object. More...
 

Detailed Description

Objects FIFO structures and macros.

This module implements a generic FIFO queue of objects by coupling a Guarded Memory Pool (for objects storage) and a MailBox.
On the sender side free objects are taken from the pool, filled and then sent to the receiver, on the receiver side objects are fetched, used and then returned to the pool. Operations defined for object FIFOs:

  • Take: An object is taken from the pool of the free objects, can be blocking.
  • Return: An object is returned to the pool of the free objects, it is guaranteed to be non-blocking.
  • Send: An object is sent through the mailbox, it is guaranteed to be non-blocking
  • Receive: An object is received from the mailbox, can be blocking.

Definition in file chfifo.h.