StateOS
Loading...
Searching...
No Matches
List

lists of memory objects More...

Macros

#define OS_LST(lst)
 define and initialize a list object
#define static_LST(lst)
 static alias of OS_LST()
#define LST_INIT()
 create and initialize a list object
#define LST_CREATE()
 create and initialize a list object
#define LST_NEW   LST_CREATE
 alias of LST_CREATE()

Functions

void lst_init (lst_t *lst)
 initialize a list object
lst_t * lst_create (void)
 create and initialize a new list object
lst_t * lst_new (void)
 alias of lst_create()
void lst_reset (lst_t *lst)
 wake up all waiting tasks with 'E_STOPPED' event value
void lst_kill (lst_t *lst)
 alias of lst_reset()
void lst_destroy (lst_t *lst)
 reset the list object, wake up all waiting tasks with 'E_DELETED' event value and free allocated resource
void lst_delete (lst_t *lst)
 alias of lst_destroy()
int lst_take (lst_t *lst, void **data)
 try to get memory object from the list object, don't wait if the list object is empty
int lst_tryWait (lst_t *lst, void **data)
 alias of lst_take()
int lst_takeISR (lst_t *lst, void **data)
 ISR alias of lst_take().
int lst_waitFor (lst_t *lst, void **data, cnt_t delay)
 try to get memory object from the list object, wait for given duration of time while the list object is empty
int lst_waitUntil (lst_t *lst, void **data, cnt_t time)
 try to get memory object from the list object, wait until given timepoint while the list object is empty
int lst_wait (lst_t *lst, void **data)
 try to get memory object from the list object, wait indefinitely while the list object is empty
void lst_give (lst_t *lst, void *data)
 transfer memory object to the list object,
void lst_giveISR (lst_t *lst, void *data)
 ISR alias of lst_give().

Detailed Description

lists of memory objects

Macro Definition Documentation

◆ OS_LST

#define OS_LST ( lst)
Value:
lst_t lst[] = { _LST_INIT() }

define and initialize a list object

Parameters
lstname of a pointer to list object

◆ static_LST

#define static_LST ( lst)
Value:
static lst_t lst[] = { _LST_INIT() }

static alias of OS_LST()

◆ LST_INIT

#define LST_INIT ( )
Value:
_LST_INIT()

create and initialize a list object

Returns
list object
Note
use only in 'C' code

◆ LST_CREATE

#define LST_CREATE ( )
Value:
{ LST_INIT () }
#define LST_INIT()
create and initialize a list object
Definition oslist.h:123

create and initialize a list object

Returns
list object as array (id)
Note
use only in 'C' code

Function Documentation

◆ lst_init()

void lst_init ( lst_t * lst)

initialize a list object

Parameters
lstpointer to list object
Note
use only in thread mode

◆ lst_create()

lst_t * lst_create ( void )

create and initialize a new list object

Returns
pointer to list object
Return values
NULLobject not created (not enough free memory)
Note
use only in thread mode

◆ lst_reset()

void lst_reset ( lst_t * lst)

wake up all waiting tasks with 'E_STOPPED' event value

Parameters
lstpointer to list object
Note
use only in thread mode

◆ lst_destroy()

void lst_destroy ( lst_t * lst)

reset the list object, wake up all waiting tasks with 'E_DELETED' event value and free allocated resource

Parameters
lstpointer to list object
Note
use only in thread mode

◆ lst_take()

int lst_take ( lst_t * lst,
void ** data )

try to get memory object from the list object, don't wait if the list object is empty

Parameters
lstpointer to list object
datapointer to store the pointer to the memory object
Return values
E_SUCCESSpointer to memory object was successfully transferred to the data pointer
E_TIMEOUTlist object is empty, try again
Note
may be used both in thread and handler mode

◆ lst_waitFor()

int lst_waitFor ( lst_t * lst,
void ** data,
cnt_t delay )

try to get memory object from the list object, wait for given duration of time while the list object is empty

Parameters
lstpointer to list object
datapointer to store the pointer to the memory object
delayduration of time (maximum number of ticks to wait while the list object is empty)
  • IMMEDIATE: don't wait if the list object is empty
  • INFINITE: wait indefinitely while the list object is empty
Return values
E_SUCCESSpointer to memory object was successfully transferred to the data pointer
E_STOPPEDlist object was reseted before the specified timeout expired
E_DELETEDlist object was deleted before the specified timeout expired
E_TIMEOUTlist object is empty and was not received data before the specified timeout expired
Note
use only in thread mode

◆ lst_waitUntil()

int lst_waitUntil ( lst_t * lst,
void ** data,
cnt_t time )

try to get memory object from the list object, wait until given timepoint while the list object is empty

Parameters
lstpointer to list object
datapointer to store the pointer to the memory object
timetimepoint value
Return values
E_SUCCESSpointer to memory object was successfully transferred to the data pointer
E_STOPPEDlist object was reseted before the specified timeout expired
E_DELETEDlist object was deleted before the specified timeout expired
E_TIMEOUTlist object is empty and was not received data before the specified timeout expired
Note
use only in thread mode

◆ lst_wait()

int lst_wait ( lst_t * lst,
void ** data )
inline

try to get memory object from the list object, wait indefinitely while the list object is empty

Parameters
lstpointer to list object
datapointer to store the pointer to the memory object
Return values
E_SUCCESSpointer to memory object was successfully transferred to the data pointer
E_STOPPEDlist object was reseted
E_DELETEDlist object was deleted
Note
use only in thread mode

◆ lst_give()

void lst_give ( lst_t * lst,
void * data )

transfer memory object to the list object,

Parameters
lstpointer to list object
datapointer to memory object (taken from a memory pool: the list uses the header preceding the memory object)
Note
may be used both in thread and handler mode