ChibiOS/RT  6.0.3
chfactory.h File Reference

ChibiOS objects factory structures and macros. More...

Go to the source code of this file.

Data Structures

struct  ch_dyn_element
 Type of a dynamic object list element. More...
 
struct  ch_dyn_list
 Type of a dynamic object list. More...
 
struct  ch_registered_static_object
 Type of a registered object. More...
 
struct  ch_dyn_object
 Type of a dynamic buffer object. More...
 
struct  ch_dyn_semaphore
 Type of a dynamic semaphore. More...
 
struct  ch_dyn_mailbox
 Type of a dynamic buffer object. More...
 
struct  ch_dyn_objects_fifo
 Type of a dynamic buffer object. More...
 
struct  ch_dyn_pipe
 Type of a dynamic pipe object. More...
 
struct  ch_objects_factory
 Type of the factory main object. More...
 

Macros

#define CH_CFG_FACTORY_MAX_NAMES_LENGTH   8
 Maximum length for object names. More...
 
#define CH_CFG_FACTORY_OBJECTS_REGISTRY   TRUE
 Enables the registry of generic objects. More...
 
#define CH_CFG_FACTORY_GENERIC_BUFFERS   TRUE
 Enables factory for generic buffers. More...
 
#define CH_CFG_FACTORY_SEMAPHORES   TRUE
 Enables factory for semaphores. More...
 
#define CH_CFG_FACTORY_MAILBOXES   TRUE
 Enables factory for mailboxes. More...
 
#define CH_CFG_FACTORY_OBJ_FIFOS   TRUE
 Enables factory for objects FIFOs. More...
 
#define CH_CFG_FACTORY_OBJ_FIFOS   TRUE
 Enables factory for objects FIFOs. More...
 
#define CH_CFG_FACTORY_PIPES   TRUE
 Enables factory for Pipes. More...
 
#define CH_CFG_FACTORY_SEMAPHORES   FALSE
 Enables factory for semaphores. More...
 
#define CH_CFG_FACTORY_MAILBOXES   FALSE
 Enables factory for mailboxes. More...
 
#define CH_CFG_FACTORY_OBJ_FIFOS   FALSE
 Enables factory for objects FIFOs. More...
 
#define CH_CFG_FACTORY_PIPES   FALSE
 Enables factory for Pipes. More...
 

Typedefs

typedef struct ch_dyn_element dyn_element_t
 Type of a dynamic object list element. More...
 
typedef struct ch_dyn_list dyn_list_t
 Type of a dynamic object list. More...
 
typedef struct ch_registered_static_object registered_object_t
 Type of a registered object. More...
 
typedef struct ch_dyn_object dyn_buffer_t
 Type of a dynamic buffer object. More...
 
typedef struct ch_dyn_semaphore dyn_semaphore_t
 Type of a dynamic semaphore. More...
 
typedef struct ch_dyn_mailbox dyn_mailbox_t
 Type of a dynamic buffer object. More...
 
typedef struct ch_dyn_objects_fifo dyn_objects_fifo_t
 Type of a dynamic buffer object. More...
 
typedef struct ch_dyn_pipe dyn_pipe_t
 Type of a dynamic pipe object. More...
 
typedef struct ch_objects_factory objects_factory_t
 Type of the factory main object. More...
 

Functions

void _factory_init (void)
 Initializes the objects factory. More...
 
registered_object_tchFactoryRegisterObject (const char *name, void *objp)
 Registers a generic object. More...
 
registered_object_tchFactoryFindObject (const char *name)
 Retrieves a registered object. More...
 
registered_object_tchFactoryFindObjectByPointer (void *objp)
 Retrieves a registered object by pointer. More...
 
void chFactoryReleaseObject (registered_object_t *rop)
 Releases a registered object. More...
 
dyn_buffer_tchFactoryCreateBuffer (const char *name, size_t size)
 Creates a generic dynamic buffer object. More...
 
dyn_buffer_tchFactoryFindBuffer (const char *name)
 Retrieves a dynamic buffer object. More...
 
void chFactoryReleaseBuffer (dyn_buffer_t *dbp)
 Releases a dynamic buffer object. More...
 
dyn_semaphore_tchFactoryCreateSemaphore (const char *name, cnt_t n)
 Creates a dynamic semaphore object. More...
 
dyn_semaphore_tchFactoryFindSemaphore (const char *name)
 Retrieves a dynamic semaphore object. More...
 
void chFactoryReleaseSemaphore (dyn_semaphore_t *dsp)
 Releases a dynamic semaphore object. More...
 
dyn_mailbox_tchFactoryCreateMailbox (const char *name, size_t n)
 Creates a dynamic mailbox object. More...
 
dyn_mailbox_tchFactoryFindMailbox (const char *name)
 Retrieves a dynamic mailbox object. More...
 
void chFactoryReleaseMailbox (dyn_mailbox_t *dmp)
 Releases a dynamic mailbox object. More...
 
dyn_objects_fifo_tchFactoryCreateObjectsFIFO (const char *name, size_t objsize, size_t objn, unsigned objalign)
 Creates a dynamic "objects FIFO" object. More...
 
dyn_objects_fifo_tchFactoryFindObjectsFIFO (const char *name)
 Retrieves a dynamic "objects FIFO" object. More...
 
void chFactoryReleaseObjectsFIFO (dyn_objects_fifo_t *dofp)
 Releases a dynamic "objects FIFO" object. More...
 
dyn_pipe_tchFactoryCreatePipe (const char *name, size_t size)
 Creates a dynamic pipe object. More...
 
dyn_pipe_tchFactoryFindPipe (const char *name)
 Retrieves a dynamic pipe object. More...
 
void chFactoryReleasePipe (dyn_pipe_t *dpp)
 Releases a dynamic pipe object. More...
 
static dyn_element_tchFactoryDuplicateReference (dyn_element_t *dep)
 Duplicates an object reference. More...
 
static void * chFactoryGetObject (registered_object_t *rop)
 Returns the pointer to the inner registered object. More...
 
static size_t chFactoryGetBufferSize (dyn_buffer_t *dbp)
 Returns the size of a generic dynamic buffer object. More...
 
static uint8_t * chFactoryGetBuffer (dyn_buffer_t *dbp)
 Returns the pointer to the inner buffer. More...
 
static semaphore_tchFactoryGetSemaphore (dyn_semaphore_t *dsp)
 Returns the pointer to the inner semaphore. More...
 
static mailbox_tchFactoryGetMailbox (dyn_mailbox_t *dmp)
 Returns the pointer to the inner mailbox. More...
 
static objects_fifo_tchFactoryGetObjectsFIFO (dyn_objects_fifo_t *dofp)
 Returns the pointer to the inner objects FIFO. More...
 
static pipe_tchFactoryGetPipe (dyn_pipe_t *dpp)
 Returns the pointer to the inner pipe. More...
 

Detailed Description

ChibiOS objects factory structures and macros.

Definition in file chfactory.h.