|
IntrOS
|
hierarchical state machine More...
Macros | |
| #define | OS_HSM_STATE(state, parent) |
| define and initialize an hsm state object | |
| #define | static_HSM_STATE(state, parent) |
| static alias of OS_HSM_STATE() | |
| #define | HSM_STATE_INIT(parent) |
| create and initialize hsm state object | |
| #define | HSM_STATE_CREATE(parent) |
| create and initialize hsm state object | |
| #define | HSM_STATE_NEW HSM_STATE_CREATE |
| alias of HSM_STATE_CREATE() | |
| #define | OS_HSM_ACTION(action, owner, event, target, handler) |
| define and initialize an hsm action object | |
| #define | static_HSM_ACTION(action, owner, event, target, handler) |
| static alias of OS_HSM_ACTION() | |
| #define | HSM_ACTION_INIT(owner, event, target, handler) |
| create and initialize an hsm action object | |
| #define | HSM_ACTION_CREATE(owner, event, target, handler) |
| create and initialize an hsm action object | |
| #define | HSM_ACTION_NEW HSM_ACTION_CREATE |
| alias of HSM_ACTION_CREATE() | |
| #define | OS_HSM(hsm, limit) |
| define and initialize complete hsm object | |
| #define | static_HSM(hsm, limit) |
| static alias of OS_HSM() | |
| #define | HSM_INIT(limit) |
| create and initialize complete hsm object | |
| #define | HSM_CREATE(limit) |
| create and initialize complete hsm object | |
| #define | HSM_NEW HSM_CREATE |
| alias of HSM_CREATE() | |
Typedefs | |
| typedef void | hsm_handler_t(hsm_t *, unsigned) |
| hierarchical state machine - event handler definition | |
Enumerations | |
| enum | { hsmALL = 0 , hsmStop , hsmExit , hsmEntry , hsmInit , hsmUser } |
Functions | |
| void | hsm_initState (hsm_state_t *state, hsm_state_t *parent) |
| initialize hsm object | |
| void | hsm_initAction (hsm_action_t *action, hsm_state_t *owner, unsigned event, hsm_state_t *target, hsm_handler_t *handler) |
| initialize hsm state action object | |
| void | hsm_init (hsm_t *hsm, void *data, size_t bufsize) |
| initialize hsm object | |
| void | hsm_link (hsm_action_t *action) |
| link hsm state action to the state action queue | |
| void | hsm_start (hsm_t *hsm, tsk_t *tsk, hsm_state_t *initState) |
| start hsm event dispatcher | |
| void | hsm_startAsync (hsm_t *hsm, tsk_t *tsk, hsm_state_t *initState) |
| Async alias of hsm_start(). | |
| void | hsm_reset (hsm_t *hsm) |
| reset the hsm object, stop the hsm event dispatcher and wake up all waiting tasks with 'E_STOPPED' event value | |
| void | hsm_kill (hsm_t *hsm) |
| alias of hsm_reset() | |
| int | hsm_give (hsm_t *hsm, unsigned event) |
| try to transfer event data to the hsm event queue, don't wait if the hsm event queue is full | |
| int | hsm_giveAsync (hsm_t *hsm, unsigned event) |
| Async alias of hsm_give(). | |
| int | hsm_sendFor (hsm_t *hsm, unsigned event, cnt_t delay) |
| try to transfer event value to the hsm event queue, wait for given duration of time while the hsm event queue is full | |
| int | hsm_sendUntil (hsm_t *hsm, unsigned event, cnt_t time) |
| try to transfer event value to the hsm event queue, wait until given timepoint while the hsm event queue is full | |
| int | hsm_send (hsm_t *hsm, unsigned event) |
| try to transfer event data to the hsm event queue, wait indefinitely while the hsm event queue is full | |
| int | hsm_sendAsync (hsm_t *hsm, unsigned event) |
| Async alias of hsm_send(). | |
| void | hsm_push (hsm_t *hsm, unsigned event) |
| transfer event data to the hsm event queue, remove the oldest event data if the hsm event queue is full | |
| hsm_state_t * | hsm_getState (hsm_t *hsm) |
| get current hsm state | |
hierarchical state machine
| #define OS_HSM_STATE | ( | state, | |
| parent ) |
define and initialize an hsm state object
| state | name of a pointer to hsm state object |
| parent | pointer to parent state in the hsm tree (NULL for root) |
| #define static_HSM_STATE | ( | state, | |
| parent ) |
static alias of OS_HSM_STATE()
| #define HSM_STATE_INIT | ( | parent | ) |
create and initialize hsm state object
| parent | pointer to parent state in the hsm tree (NULL for root) |
| #define HSM_STATE_CREATE | ( | parent | ) |
create and initialize hsm state object
| parent | pointer to parent state in the hsm tree (NULL for root) |
| #define OS_HSM_ACTION | ( | action, | |
| owner, | |||
| event, | |||
| target, | |||
| handler ) |
define and initialize an hsm action object
| action | name of a pointer to hsm action object |
| owner | action owner |
| event | event value |
| target | pointer to transition target state (NULL, if no transition) |
| handler | event handler |
| #define static_HSM_ACTION | ( | action, | |
| owner, | |||
| event, | |||
| target, | |||
| handler ) |
static alias of OS_HSM_ACTION()
| #define HSM_ACTION_INIT | ( | owner, | |
| event, | |||
| target, | |||
| handler ) |
create and initialize an hsm action object
| owner | action owner |
| event | event value |
| target | pointer to transition target state (NULL, if no transition) |
| handler | event handler |
| #define HSM_ACTION_CREATE | ( | owner, | |
| event, | |||
| target, | |||
| handler ) |
create and initialize an hsm action object
| owner | action owner |
| event | event value |
| target | pointer to transition target state (NULL, if no transition) |
| handler | event handler |
| #define OS_HSM | ( | hsm, | |
| limit ) |
define and initialize complete hsm object
| hsm | name of a pointer to hsm object |
| limit | size of an hsm event queue (max number of stored events) |
| #define static_HSM | ( | hsm, | |
| limit ) |
static alias of OS_HSM()
| #define HSM_INIT | ( | limit | ) |
create and initialize complete hsm object
| limit | size of an hsm event queue (max number of stored events) |
| #define HSM_CREATE | ( | limit | ) |
create and initialize complete hsm object
| limit | size of an hsm event queue (max number of stored events) |
| void hsm_initState | ( | hsm_state_t * | state, |
| hsm_state_t * | parent ) |
initialize hsm object
| state | pointer to hsm state object |
| parent | pointer to parent state in the hsm tree (NULL for root) |
| void hsm_initAction | ( | hsm_action_t * | action, |
| hsm_state_t * | owner, | ||
| unsigned | event, | ||
| hsm_state_t * | target, | ||
| hsm_handler_t * | handler ) |
initialize hsm state action object
| action | pointer to hsm state action object |
| owner | action owner |
| event | event value |
| target | pointer to transition target state (NULL, if no transition) |
| handler | event handler |
| void hsm_init | ( | hsm_t * | hsm, |
| void * | data, | ||
| size_t | bufsize ) |
initialize hsm object
| hsm | pointer to hsm object |
| data | hsm event queue data buffer |
| bufsize | size of the buffer |
| void hsm_link | ( | hsm_action_t * | action | ) |
link hsm state action to the state action queue
| action | pointer to hsm state action object |
| void hsm_start | ( | hsm_t * | hsm, |
| tsk_t * | tsk, | ||
| hsm_state_t * | initState ) |
start hsm event dispatcher
| hsm | pointer to hsm object |
| tsk | pointer to hsm dispatcher |
| initState | pointer to initial hsm state |
| void hsm_reset | ( | hsm_t * | hsm | ) |
reset the hsm object, stop the hsm event dispatcher and wake up all waiting tasks with 'E_STOPPED' event value
| hsm | pointer to hsm object |
| int hsm_give | ( | hsm_t * | hsm, |
| unsigned | event ) |
try to transfer event data to the hsm event queue, don't wait if the hsm event queue is full
| hsm | pointer to hsm object |
| event | event value |
| E_SUCCESS | event data was successfully transferred to the hsm object |
| E_TIMEOUT | hsm event queue is full, try again |
| int hsm_sendFor | ( | hsm_t * | hsm, |
| unsigned | event, | ||
| cnt_t | delay ) |
try to transfer event value to the hsm event queue, wait for given duration of time while the hsm event queue is full
| hsm | pointer to hsm object |
| event | event value |
| delay | duration of time (maximum number of ticks to wait while the hsm event queue is full)
|
| int hsm_sendUntil | ( | hsm_t * | hsm, |
| unsigned | event, | ||
| cnt_t | time ) |
try to transfer event value to the hsm event queue, wait until given timepoint while the hsm event queue is full
| hsm | pointer to hsm object |
| event | event value |
| time | timepoint value |
|
inline |
try to transfer event data to the hsm event queue, wait indefinitely while the hsm event queue is full
| hsm | pointer to hsm object |
| event | event value |
| E_SUCCESS | event data was successfully transferred to the hsm object |
| E_STOPPED | hsm object was reseted (unavailable for async version) |
| void hsm_push | ( | hsm_t * | hsm, |
| unsigned | event ) |
transfer event data to the hsm event queue, remove the oldest event data if the hsm event queue is full
| hsm | pointer to hsm object |
| event | event value |
| hsm_state_t * hsm_getState | ( | hsm_t * | hsm | ) |
get current hsm state
| hsm | pointer to hsm object |