![]() |
m2mb API docs
25.30.003
m2mb API sets documentation
|
OS event prototypes. More...
Go to the source code of this file.
Macros | |
| #define | M2MB_OS_EV_INVALID 0 |
| #define | M2MB_OS_EV_INVALID_ATTR 0 |
| #define | m2mb_os_ev_setAttrItem_(h, args...) m2mb_os_ev_setAttrItem( h, CMDS_ARGS( args ) ) |
Typedefs | |
| typedef struct M2MB_OS_EV_HANDLE_TAG * | M2MB_OS_EV_HANDLE |
| typedef struct M2MB_OS_EV_ATTR_HANDLE_TAG * | M2MB_OS_EV_ATTR_HANDLE |
Functions | |
| M2MB_OS_RESULT_E | m2mb_os_ev_init (M2MB_OS_EV_HANDLE *pEvHandle, M2MB_OS_EV_ATTR_HANDLE *pEvAttrHandle) |
| Application Event Set Creation. More... | |
| M2MB_OS_RESULT_E | m2mb_os_ev_deinit (M2MB_OS_EV_HANDLE evHandle) |
| Application Event deinit or deletion. More... | |
| M2MB_OS_RESULT_E | m2mb_os_ev_set (M2MB_OS_EV_HANDLE evHandle, UINT32 evBits, M2MB_OS_EV_SET_OPT_E optSet) |
| Set bits of event in a specified event. More... | |
| M2MB_OS_RESULT_E | m2mb_os_ev_get (M2MB_OS_EV_HANDLE evHandle, UINT32 reqEvBits, M2MB_OS_EV_GET_OPT_E optGet, UINT32 *pCurEvBits, UINT32 timeout) |
| Get an application event. More... | |
| M2MB_OS_RESULT_E | m2mb_os_ev_setAttrItem (M2MB_OS_EV_ATTR_HANDLE *pEvAttrHandle, UINT8 nCmds,...) |
| Set specific attribute for event init or creation. More... | |
| M2MB_OS_RESULT_E | m2mb_os_ev_getItem (M2MB_OS_EV_HANDLE evHandle, M2MB_OS_EV_SEL_CMD_E selCmd, MEM_W *pOut, void *pIn) |
| Get specific properties of the event. More... | |
| M2MB_OS_RESULT_E | m2mb_os_ev_setItem (M2MB_OS_EV_HANDLE evHandle, M2MB_OS_EV_SEL_CMD_E selCmd, void *pIn) |
| Set specific properties of the event. More... | |
OS event prototypes.
m2m/m2m_generic/common/m2mb_inc/m2mb_os_ev.h
basic functions for OS event are provided
@notes Dependencies: m2mb_types.h m2mb_os_types.h
| M2MB_OS_RESULT_E m2mb_os_ev_deinit | ( | M2MB_OS_EV_HANDLE | evHandle | ) |
Application Event deinit or deletion.
This service deletes the specified os event. All tasks suspended waiting for this event are resumed with a return value egual to M2MB_OS_DELETED The resources will be released. It is the application’s responsibility to prevent use of a deleted event.
| [in] | evHandle | handle of the event |
Example
| M2MB_OS_RESULT_E m2mb_os_ev_get | ( | M2MB_OS_EV_HANDLE | evHandle, |
| UINT32 | reqEvBits, | ||
| M2MB_OS_EV_GET_OPT_E | optGet, | ||
| UINT32 * | pCurEvBits, | ||
| UINT32 | timeout | ||
| ) |
Get an application event.
This service retrieves bits event from the specified event. Each event contains 32 event bits. This service can retrieve a variety of event bits combinations, as selected by the input reqEvBits.
| [in] | evHandle | handle of event |
| [in] | reqEvBits | requested bits event |
| [in] | optGet | option for get the event (see M2MB_OS_EV_GET_OPT_E) |
| [out] | pCurEvBits | pointer to where current bits events are written to. It contains all the currents bits as found before any actions are taken (e.g cleared as requested) Can be set to NULL if information is not needed |
| [in] | timeout | wait option in case of not success in getting requested bit event |
Example
| M2MB_OS_RESULT_E m2mb_os_ev_getItem | ( | M2MB_OS_EV_HANDLE | evHandle, |
| M2MB_OS_EV_SEL_CMD_E | selCmd, | ||
| MEM_W * | pOut, | ||
| void * | pIn | ||
| ) |
Get specific properties of the event.
This service retrieve value for specified parameter of the specified event Selecting cmd, a parameter to be retrieved can be set. To be used when event is already created: it is under application responsibility
| [in] | selCmd | Select parameter to be retrieved (see M2MB_OS_EV_SEL_CMD_E) |
| [in] | evHandle | handle of event param [out] pOut pointer Output parameter got: its meaning depend on selCmd used See examples as general pointer it is set to UINT32 |
| [in] | pIn | pointer to void general Parameter to be specified, if any, to get right output See examples If parameter is not needed, use NULL |
Example
| M2MB_OS_RESULT_E m2mb_os_ev_init | ( | M2MB_OS_EV_HANDLE * | pEvHandle, |
| M2MB_OS_EV_ATTR_HANDLE * | pEvAttrHandle | ||
| ) |
Application Event Set Creation.
This service creates a group of 32 event bits. All 32 event bits in the event are initialized to zero.
| [out] | pEvHandle | pointer to event handle |
| [in] | pEvAttrHandle | pointer to event attribute handle |
Example
| M2MB_OS_RESULT_E m2mb_os_ev_set | ( | M2MB_OS_EV_HANDLE | evHandle, |
| UINT32 | evBits, | ||
| M2MB_OS_EV_SET_OPT_E | optSet | ||
| ) |
Set bits of event in a specified event.
This service sets or clears event bits in an event, depending upon the specified set-option. All suspended tasks whose event bits request is now satisfied are resumed.
| [in] | evHandle | handle of event |
| [in] | evBits | event bits to set\clear |
| [in] | optSet | option for set or clear specified bit (see M2MB_OS_EV_SET_OPT_E) |
Allowed From Initialization, tasks, events and ISRs Preemption Possible Yes
Example
| M2MB_OS_RESULT_E m2mb_os_ev_setAttrItem | ( | M2MB_OS_EV_ATTR_HANDLE * | pEvAttrHandle, |
| UINT8 | nCmds, | ||
| ... | |||
| ) |
Set specific attribute for event init or creation.
This service set the attribute (or create it) to be used for event creation
| [in] | pEvAttrHandle | pointer to event attribute handle of event |
| [in] | nCmds | number of commands to be issued at once |
| [in] | ... | variable inputs, N cmds (see M2MB_OS_EV_SEL_CMD_E) followed by N arguments for their respective issued commands. CMDS(...) and CMDS_ARGS(...) macro can be used to better insert cmd and parameters and to better control right insertion |
Example
| M2MB_OS_RESULT_E m2mb_os_ev_setItem | ( | M2MB_OS_EV_HANDLE | evHandle, |
| M2MB_OS_EV_SEL_CMD_E | selCmd, | ||
| void * | pIn | ||
| ) |
Set specific properties of the event.
This service set value for specified parameter of the specified event if available To be used when event is already created: its right use is under application responsibility By Selecting cmd, a specified parameter to be set can be selected
| [in] | evHandle | handle of event |
| [in] | selCmd | Select parameter to be set (see M2MB_OS_EV_SEL_CMD_E) |
| [in] | pIn | pointer to value to be set. If a simple value, can be easily casted to (void*) e.g. int value -3 has to be passed, use (void*)-3 NULL if no value is needed |
Example