VSF Documented
vsf_simple_bmpevt.h File Reference

Go to the source code of this file.

Macros

#define using_grouped_evt   vsf_bmpevt_pender_t pender
 Declare the grouped-event pender member in the task-local control block; required by the wait_for_* statement macros.
 
#define __declare_grouped_evts(__name)
 
#define declare_grouped_evts(__name)
 Declare a bitmap-event group type.
 
#define __def_grouped_evts(__name)
 
#define __end_def_grouped_evts(__name)
 
#define end_def_grouped_evts(__name)
 End the definition of a bitmap-event group started with def_grouped_evts().
 
#define __def_evt(__name, __evt)
 
#define def_evt(__name, __evt)
 Define an event bit of a bitmap-event group.
 
#define def_adapter(__name, __evt)
 Define an event bit of a bitmap-event group that is driven by an adapter.
 
#define def_grouped_evts(__name)
 Begin the definition of a bitmap-event group.
 
#define __implement_grouped_evts(__name, ...)
 
#define implement_grouped_evts(__name, ...)
 Define the adapter list of a bitmap-event group.
 
#define add_sync_adapter(__SYNC, __MSK, ...)
 Create an adapter entry mapping a sync object (e.g. a semaphore) onto event bits of a bitmap-event group.
 
#define __init_grouped_evts(__name, __evt_group, __auto_reset)
 
#define init_grouped_evts(__name, __evt_group, __auto_reset)
 Initialize a bitmap-event group instance with its adapter list.
 
#define __grouped_evts_info(__name)
 
#define grouped_evts_info(__name)
 Get the info symbol of a bitmap-event group.
 
#define __grouped_evts_adapter(__name, __INDEX)
 
#define grouped_evts_adapter(__name, __INDEX)
 Get an adapter of a bitmap-event group by index.
 
#define wait_for_all_timeout(__group, __msk, __timeout)
 Wait until all event bits of a mask in a bitmap-event group are set (AND), with a timeout in system timer ticks (cooperative, non-blocking for other tasks).
 
#define wait_for_all_timeout_ms(__group, __msk, __timeout)
 Wait until all event bits of a mask in a bitmap-event group are set (AND), with a timeout in milliseconds (cooperative, non-blocking for other tasks).
 
#define wait_for_all_timeout_us(__group, __msk, __timeout)
 Wait until all event bits of a mask in a bitmap-event group are set (AND), with a timeout in microseconds (cooperative, non-blocking for other tasks).
 
#define wait_for_all(__group, __msk)
 Wait until all event bits of a mask in a bitmap-event group are set (AND), waiting forever (cooperative, non-blocking for other tasks).
 
#define wait_for_any_timeout(__group, __msk, __timeout)
 Wait until any event bit of a mask in a bitmap-event group is set (OR), with a timeout in system timer ticks (cooperative, non-blocking for other tasks).
 
#define wait_for_any_timeout_ms(__group, __msk, __timeout)
 Wait until any event bit of a mask in a bitmap-event group is set (OR), with a timeout in milliseconds (cooperative, non-blocking for other tasks).
 
#define wait_for_any_timeout_us(__group, __msk, __timeout)
 Wait until any event bit of a mask in a bitmap-event group is set (OR), with a timeout in microseconds (cooperative, non-blocking for other tasks).
 
#define wait_for_any(__group, __msk)
 Wait until any event bit of a mask in a bitmap-event group is set (OR), waiting forever (cooperative, non-blocking for other tasks).
 
#define wait_for_one(__group, __msk)
 Wait until any event bit of a mask in a bitmap-event group is set (alias of wait_for_any(), OR), waiting forever (cooperative, non-blocking for other tasks).
 
#define wait_for_one_timeout(__group, __msk, __timeout)
 Wait until any event bit of a mask in a bitmap-event group is set (alias of wait_for_any_timeout(), OR), with a timeout in system timer ticks (cooperative, non-blocking for other tasks).
 
#define wait_for_one_timeout_ms(__group, __msk, __timeout)
 Wait until any event bit of a mask in a bitmap-event group is set (alias of wait_for_any_timeout_ms(), OR), with a timeout in milliseconds (cooperative, non-blocking for other tasks).
 
#define wait_for_one_timeout_us(__group, __msk, __timeout)
 Wait until any event bit of a mask in a bitmap-event group is set (alias of wait_for_any_timeout_us(), OR), with a timeout in microseconds (cooperative, non-blocking for other tasks).
 
#define reset_grouped_evts(__group, __msk)
 Reset event bits of a bitmap-event group.
 
#define set_grouped_evts(__group, __msk)
 Set event bits of a bitmap-event group, waking up the tasks waiting for them if any.
 

Functions

void __vsf_grouped_evts_init (vsf_bmpevt_t *this_ptr, vsf_bmpevt_adapter_t **adapters_pptr, uint_fast8_t adapter_count, uint_fast32_t auto_reset)
 Low-level initialization helper backing the init_grouped_evts() macro.
 
vsf_sync_reason_t __vsf_bmpevt_wait_for (vsf_bmpevt_t *bmpevt_ptr, const vsf_bmpevt_pender_t *pender_ptr, int_fast32_t time_out)
 Low-level bitmap-event wait helper backing the wait_for_one()/ wait_for_any()/wait_for_all() statement macros.
 

Macro Definition Documentation

◆ using_grouped_evt

#define using_grouped_evt   vsf_bmpevt_pender_t pender

Declare the grouped-event pender member in the task-local control block; required by the wait_for_* statement macros.

Note
Expands to a vsf_bmpevt_pender_t member named pender, which the wait_for_one()/wait_for_any()/wait_for_all() macros use through vsf_this. Typically placed inside a features_used()/mem_sharable() block of the task definition.

◆ __declare_grouped_evts

#define __declare_grouped_evts ( __name)
Value:
typedef vsf_bmpevt_t __name; \
typedef enum enum_of_##__name enum_of_##__name;
Bitmap-event group.
Definition vsf_eda.h:2129
#define __name
Definition hci_transport_aic8800.c:555

◆ declare_grouped_evts

#define declare_grouped_evts ( __name)
Value:
#define __declare_grouped_evts(__name)
Definition vsf_simple_bmpevt.h:57

Declare a bitmap-event group type.

Parameters
[in]__namename of the group; a typedef of vsf_bmpevt_t and a forward declaration of the enumeration enum_of_<__name> are generated
Note
Pair with def_grouped_evts()/end_def_grouped_evts(), which define the event bits of the group.

◆ __def_grouped_evts

#define __def_grouped_evts ( __name)
Value:
enum enum_of_##__name{ \
__##__name##_start = __COUNTER__ + 1,
void _start(void)
Definition startup_CMSDK_ARMv8MBL.c:62

◆ __end_def_grouped_evts

#define __end_def_grouped_evts ( __name)
Value:
all_evts_msk_of_##__name = \
((uint64_t)1<<(__COUNTER__ - __##__name##_start)) - 1, \
};
unsigned long long uint64_t
Definition stdint.h:11

◆ end_def_grouped_evts

#define end_def_grouped_evts ( __name)
Value:
#define __end_def_grouped_evts(__name)
Definition vsf_simple_bmpevt.h:84

End the definition of a bitmap-event group started with def_grouped_evts().

Parameters
[in]__namename of the group; also generates the enumerator all_evts_msk_of_<__name> covering all defined event bits

◆ __def_evt

#define __def_evt ( __name,
__evt )
Value:
__evt##_idx = __COUNTER__ - __##__name##_start, \
__evt##_msk = (uint32_t)(1<<(__evt##_idx))
unsigned uint32_t
Definition stdint.h:9

◆ def_evt

#define def_evt ( __name,
__evt )
Value:
#define __def_evt(__name, __evt)
Definition vsf_simple_bmpevt.h:101

Define an event bit of a bitmap-event group.

Parameters
[in]__namename of the group
[in]__evtname of the event bit; generates the enumerators <__evt>_idx (bit index) and <__evt>_msk (bit mask)
Note
Must be used between def_grouped_evts() and end_def_grouped_evts(), with entries separated by commas.

◆ def_adapter

#define def_adapter ( __name,
__evt )
Value:

Define an event bit of a bitmap-event group that is driven by an adapter.

Parameters
[in]__namename of the group
[in]__evtname of the event bit; generates the enumerators <__evt>_idx (bit index) and <__evt>_msk (bit mask)
Note
Same expansion as def_evt(); the distinct name documents that the bit is mapped onto an IPC object by an adapter (see add_sync_adapter()).

◆ def_grouped_evts

#define def_grouped_evts ( __name)
Value:
#define __def_grouped_evts(__name)
Definition vsf_simple_bmpevt.h:79

Begin the definition of a bitmap-event group.

Parameters
[in]__namename of the group previously declared with declare_grouped_evts()
Note
Expands to the opening of the enumeration enum_of_<__name>; list the event bits with def_evt()/def_adapter() entries and close the definition with end_def_grouped_evts().

◆ __implement_grouped_evts

#define __implement_grouped_evts ( __name,
... )
Value:
static const vsf_bmpevt_adapter_t *__adapters_of_##__name[] = { \
__VA_ARGS__ \
};
Adapter mapping an IPC object (e.g. a semaphore) onto bitmap-event bits, so one task can wait on mult...
Definition vsf_eda.h:2062

◆ implement_grouped_evts

#define implement_grouped_evts ( __name,
... )
Value:
#define __implement_grouped_evts(__name,...)
Definition vsf_simple_bmpevt.h:165

Define the adapter list of a bitmap-event group.

Parameters
[in]__namename of the group
[in]...adapter entries, typically created with add_sync_adapter()
Note
Adapters map IPC objects (e.g. semaphores) onto event bits of the group, so that a task can wait for events from different IPC objects at once. The list is referenced by init_grouped_evts().

◆ add_sync_adapter

#define add_sync_adapter ( __SYNC,
__MSK,
... )
Value:
.sync = (__SYNC), \
.use_as__vsf_bmpevt_adapter_eda_t.use_as__vsf_bmpevt_adapter_t = { \
.mask = (__MSK), \
}, \
__VA_ARGS__ \
}.use_as__vsf_bmpevt_adapter_eda_t.use_as__vsf_bmpevt_adapter_t)
const vsf_bmpevt_adapter_op_t vsf_eda_bmpevt_adapter_sync_op
Adapter operation table vsf_bmpevt_adapter_op_t used to bind a sync object to a bitmap event.
struct vsf_bmpevt_adapter_sync_t vsf_bmpevt_adapter_sync_t
Adapter mapping a vsf_sync_t onto bitmap-event bits.

Create an adapter entry mapping a sync object (e.g. a semaphore) onto event bits of a bitmap-event group.

Parameters
[in]__SYNCpointer to the sync object vsf_sync_t (e.g. vsf_sem_t)
[in]__MSKmask of the event bits driven by this sync object
[in]...optional additional initializers for vsf_bmpevt_adapter_sync_t
Returns
pointer to the adapter vsf_bmpevt_adapter_t
Note
Used inside the adapter list of implement_grouped_evts().

◆ __init_grouped_evts

#define __init_grouped_evts ( __name,
__evt_group,
__auto_reset )
Value:
__vsf_grouped_evts_init((__evt_group), \
(vsf_bmpevt_adapter_t **)&(__adapters_of_##__name), \
dimof(__adapters_of_##__name), \
(__auto_reset))
#define dimof(a)
Definition vsf_fbcon.c:25
void __vsf_grouped_evts_init(vsf_bmpevt_t *this_ptr, vsf_bmpevt_adapter_t **adapters_pptr, uint_fast8_t adapter_count, uint_fast32_t auto_reset)
Low-level initialization helper backing the init_grouped_evts() macro.
Definition vsf_simple_bmpevt.c:124

◆ init_grouped_evts

#define init_grouped_evts ( __name,
__evt_group,
__auto_reset )
Value:
__init_grouped_evts(__name, __evt_group, (__auto_reset))
#define __init_grouped_evts(__name, __evt_group, __auto_reset)
Definition vsf_simple_bmpevt.h:226

Initialize a bitmap-event group instance with its adapter list.

Parameters
[in]__namename of the group (selects the adapter list defined by implement_grouped_evts())
[in]__evt_grouppointer to the group instance vsf_bmpevt_t
[in]__auto_resetmask of the event bits that are reset automatically after a successful wait

◆ __grouped_evts_info

#define __grouped_evts_info ( __name)
Value:
__grouped_evts_##__name##_info

◆ grouped_evts_info

#define grouped_evts_info ( __name)
Value:
#define __grouped_evts_info(__name)
Definition vsf_simple_bmpevt.h:250

Get the info symbol of a bitmap-event group.

Parameters
[in]__namename of the group
Returns
expands to the symbol __grouped_evts_<__name>_info

◆ __grouped_evts_adapter

#define __grouped_evts_adapter ( __name,
__INDEX )
Value:
__adapters_of_##__name[(__INDEX)]

◆ grouped_evts_adapter

#define grouped_evts_adapter ( __name,
__INDEX )
Value:
#define __grouped_evts_adapter(__name, __INDEX)
Definition vsf_simple_bmpevt.h:262

Get an adapter of a bitmap-event group by index.

Parameters
[in]__namename of the group
[in]__INDEXindex of the adapter in the list defined by implement_grouped_evts()
Returns
pointer to the adapter vsf_bmpevt_adapter_t

◆ wait_for_all_timeout

#define wait_for_all_timeout ( __group,
__msk,
__timeout )
Value:
vsf_this.pender.mask = (__msk); \
vsf_this.pender.op = VSF_BMPEVT_AND; \
reason == VSF_SYNC_CANCEL;) \
if ((reason = __vsf_bmpevt_wait_for( \
(__group), \
&vsf_this.pender, (__timeout)), \
(reason == VSF_SYNC_GET || reason == VSF_SYNC_TIMEOUT)))
Wait condition of a bitmap-event wait.
Definition vsf_eda.h:2104
#define VSF_BMPEVT_AND
bmpevt pender op value: the wait completes when all bits of the mask are set
Definition vsf_eda.h:2037
vsf_sync_reason_t
Result of a sync wait, returned by the *_get_reason() APIs and thread IPC.
Definition vsf_eda.h:2262
@ VSF_SYNC_GET
Obtained.
Definition vsf_eda.h:2282
@ VSF_SYNC_CANCEL
Cancelled.
Definition vsf_eda.h:2287
@ VSF_SYNC_TIMEOUT
Timed out.
Definition vsf_eda.h:2272
#define vsf_this
Definition vsf_fsm.h:60
vsf_sync_reason_t __vsf_bmpevt_wait_for(vsf_bmpevt_t *bmpevt_ptr, const vsf_bmpevt_pender_t *pender_ptr, int_fast32_t time_out)
Low-level bitmap-event wait helper backing the wait_for_one()/ wait_for_any()/wait_for_all() statemen...
Definition vsf_simple_bmpevt.c:79

Wait until all event bits of a mask in a bitmap-event group are set (AND), with a timeout in system timer ticks (cooperative, non-blocking for other tasks).

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to wait for
[in]__timeouttimeout in system timer ticks; a negative value waits forever
Note
Statement macro: the following brace block runs when all bits of the mask are set (VSF_SYNC_GET) or the wait times out (VSF_SYNC_TIMEOUT); use on_timeout() to catch the timeout case. Usage: wait_for_all_timeout(group, msk, timeout) { ... }. Must be used inside a simple-shell event handler whose task declares using_grouped_evt.

◆ wait_for_all_timeout_ms

#define wait_for_all_timeout_ms ( __group,
__msk,
__timeout )
Value:
(__msk), \
vsf_systimer_tick_t vsf_systimer_ms_to_tick(uint_fast32_t time_ms)
Definition linux_generic.c:440
#define wait_for_all_timeout(__group, __msk, __timeout)
Wait until all event bits of a mask in a bitmap-event group are set (AND), with a timeout in system t...
Definition vsf_simple_bmpevt.h:310

Wait until all event bits of a mask in a bitmap-event group are set (AND), with a timeout in milliseconds (cooperative, non-blocking for other tasks).

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to wait for
[in]__timeouttimeout in milliseconds, converted to ticks via vsf_systimer_ms_to_tick()
Note
Statement macro: the following brace block runs when all bits of the mask are set (VSF_SYNC_GET) or the wait times out (VSF_SYNC_TIMEOUT); use on_timeout() to catch the timeout case. Usage: wait_for_all_timeout_ms(group, msk, timeout) { ... }. Must be used inside a simple-shell event handler whose task declares using_grouped_evt.

◆ wait_for_all_timeout_us

#define wait_for_all_timeout_us ( __group,
__msk,
__timeout )
Value:
(__msk), \
vsf_systimer_tick_t vsf_systimer_us_to_tick(uint_fast32_t time_us)
Definition linux_generic.c:435

Wait until all event bits of a mask in a bitmap-event group are set (AND), with a timeout in microseconds (cooperative, non-blocking for other tasks).

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to wait for
[in]__timeouttimeout in microseconds, converted to ticks via vsf_systimer_us_to_tick()
Note
Statement macro: the following brace block runs when all bits of the mask are set (VSF_SYNC_GET) or the wait times out (VSF_SYNC_TIMEOUT); use on_timeout() to catch the timeout case. Usage: wait_for_all_timeout_us(group, msk, timeout) { ... }. Must be used inside a simple-shell event handler whose task declares using_grouped_evt.

◆ wait_for_all

#define wait_for_all ( __group,
__msk )
Value:
wait_for_all_timeout( __group, (__msk), -1)

Wait until all event bits of a mask in a bitmap-event group are set (AND), waiting forever (cooperative, non-blocking for other tasks).

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to wait for
Note
Statement macro: the following brace block runs after all bits of the mask are set. Usage: wait_for_all(group, msk) { ... }. Must be used inside a simple-shell event handler whose task declares using_grouped_evt.

◆ wait_for_any_timeout

#define wait_for_any_timeout ( __group,
__msk,
__timeout )
Value:
vsf_this.pender.mask = (__msk); \
vsf_this.pender.op = VSF_BMPEVT_OR; \
reason == VSF_SYNC_CANCEL;) \
if ((reason = __vsf_bmpevt_wait_for( \
(__group), \
&vsf_this.pender, (__timeout)), \
(reason == VSF_SYNC_GET || reason == VSF_SYNC_TIMEOUT)))
#define VSF_BMPEVT_OR
bmpevt pender op value: the wait completes when any bit of the mask is set
Definition vsf_eda.h:2029

Wait until any event bit of a mask in a bitmap-event group is set (OR), with a timeout in system timer ticks (cooperative, non-blocking for other tasks).

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to wait for
[in]__timeouttimeout in system timer ticks; a negative value waits forever
Note
Statement macro: the following brace block runs when any bit of the mask is set (VSF_SYNC_GET) or the wait times out (VSF_SYNC_TIMEOUT); use on_timeout() to catch the timeout case. Usage: wait_for_any_timeout(group, msk, timeout) { ... }. Must be used inside a simple-shell event handler whose task declares using_grouped_evt.

◆ wait_for_any_timeout_ms

#define wait_for_any_timeout_ms ( __group,
__msk,
__timeout )
Value:
(__msk), \
#define wait_for_any_timeout(__group, __msk, __timeout)
Wait until any event bit of a mask in a bitmap-event group is set (OR), with a timeout in system time...
Definition vsf_simple_bmpevt.h:446

Wait until any event bit of a mask in a bitmap-event group is set (OR), with a timeout in milliseconds (cooperative, non-blocking for other tasks).

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to wait for
[in]__timeouttimeout in milliseconds, converted to ticks via vsf_systimer_ms_to_tick()
Note
Statement macro: the following brace block runs when any bit of the mask is set (VSF_SYNC_GET) or the wait times out (VSF_SYNC_TIMEOUT); use on_timeout() to catch the timeout case. Usage: wait_for_any_timeout_ms(group, msk, timeout) { ... }. Must be used inside a simple-shell event handler whose task declares using_grouped_evt.

◆ wait_for_any_timeout_us

#define wait_for_any_timeout_us ( __group,
__msk,
__timeout )
Value:
(__msk), \

Wait until any event bit of a mask in a bitmap-event group is set (OR), with a timeout in microseconds (cooperative, non-blocking for other tasks).

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to wait for
[in]__timeouttimeout in microseconds, converted to ticks via vsf_systimer_us_to_tick()
Note
Statement macro: the following brace block runs when any bit of the mask is set (VSF_SYNC_GET) or the wait times out (VSF_SYNC_TIMEOUT); use on_timeout() to catch the timeout case. Usage: wait_for_any_timeout_us(group, msk, timeout) { ... }. Must be used inside a simple-shell event handler whose task declares using_grouped_evt.

◆ wait_for_any

#define wait_for_any ( __group,
__msk )
Value:
wait_for_any_timeout( __group, (__msk), -1)

Wait until any event bit of a mask in a bitmap-event group is set (OR), waiting forever (cooperative, non-blocking for other tasks).

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to wait for
Note
Statement macro: the following brace block runs after any bit of the mask is set. Usage: wait_for_any(group, msk) { ... }. Must be used inside a simple-shell event handler whose task declares using_grouped_evt.

◆ wait_for_one

#define wait_for_one ( __group,
__msk )
Value:
wait_for_any((__group), (__msk))
#define wait_for_any(__group, __msk)
Wait until any event bit of a mask in a bitmap-event group is set (OR), waiting forever (cooperative,...
Definition vsf_simple_bmpevt.h:550

Wait until any event bit of a mask in a bitmap-event group is set (alias of wait_for_any(), OR), waiting forever (cooperative, non-blocking for other tasks).

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to wait for
Note
Statement macro: the following brace block runs after any bit of the mask is set. Usage: wait_for_one(group, msk) { ... }. Must be used inside a simple-shell event handler whose task declares using_grouped_evt.

◆ wait_for_one_timeout

#define wait_for_one_timeout ( __group,
__msk,
__timeout )
Value:
wait_for_any_timeout((__group), (__msk), (__timeout))

Wait until any event bit of a mask in a bitmap-event group is set (alias of wait_for_any_timeout(), OR), with a timeout in system timer ticks (cooperative, non-blocking for other tasks).

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to wait for
[in]__timeouttimeout in system timer ticks; a negative value waits forever
Note
Statement macro: the following brace block runs when any bit of the mask is set (VSF_SYNC_GET) or the wait times out (VSF_SYNC_TIMEOUT); use on_timeout() to catch the timeout case. Usage: wait_for_one_timeout(group, msk, timeout) { ... }. Must be used inside a simple-shell event handler whose task declares using_grouped_evt.

◆ wait_for_one_timeout_ms

#define wait_for_one_timeout_ms ( __group,
__msk,
__timeout )
Value:
wait_for_any_timeout_ms((__group), (__msk), (__timeout))
#define wait_for_any_timeout_ms(__group, __msk, __timeout)
Wait until any event bit of a mask in a bitmap-event group is set (OR), with a timeout in millisecond...
Definition vsf_simple_bmpevt.h:488

Wait until any event bit of a mask in a bitmap-event group is set (alias of wait_for_any_timeout_ms(), OR), with a timeout in milliseconds (cooperative, non-blocking for other tasks).

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to wait for
[in]__timeouttimeout in milliseconds, converted to ticks via vsf_systimer_ms_to_tick()
Note
Statement macro: the following brace block runs when any bit of the mask is set (VSF_SYNC_GET) or the wait times out (VSF_SYNC_TIMEOUT); use on_timeout() to catch the timeout case. Usage: wait_for_one_timeout_ms(group, msk, timeout) { ... }. Must be used inside a simple-shell event handler whose task declares using_grouped_evt.

◆ wait_for_one_timeout_us

#define wait_for_one_timeout_us ( __group,
__msk,
__timeout )
Value:
wait_for_any_timeout_us((__group), (__msk), (__timeout))
#define wait_for_any_timeout_us(__group, __msk, __timeout)
Wait until any event bit of a mask in a bitmap-event group is set (OR), with a timeout in microsecond...
Definition vsf_simple_bmpevt.h:524

Wait until any event bit of a mask in a bitmap-event group is set (alias of wait_for_any_timeout_us(), OR), with a timeout in microseconds (cooperative, non-blocking for other tasks).

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to wait for
[in]__timeouttimeout in microseconds, converted to ticks via vsf_systimer_us_to_tick()
Note
Statement macro: the following brace block runs when any bit of the mask is set (VSF_SYNC_GET) or the wait times out (VSF_SYNC_TIMEOUT); use on_timeout() to catch the timeout case. Usage: wait_for_one_timeout_us(group, msk, timeout) { ... }. Must be used inside a simple-shell event handler whose task declares using_grouped_evt.

◆ reset_grouped_evts

#define reset_grouped_evts ( __group,
__msk )
Value:
vsf_eda_bmpevt_reset((__group),(__msk))
vsf_err_t vsf_eda_bmpevt_reset(vsf_bmpevt_t *pthis, uint_fast32_t mask)
Reset (clear) event bits of a bitmap event, resetting the bound adapters whose bits are cleared.

Reset event bits of a bitmap-event group.

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to reset
Returns
vsf_err_t: always VSF_ERR_NONE

◆ set_grouped_evts

#define set_grouped_evts ( __group,
__msk )
Value:
vsf_eda_bmpevt_set((__group),(__msk))
vsf_err_t vsf_eda_bmpevt_set(vsf_bmpevt_t *pthis, uint_fast32_t mask)
Set event bits of a bitmap event, polling the pending tasks.

Set event bits of a bitmap-event group, waking up the tasks waiting for them if any.

Parameters
[in]__grouppointer to the group instance vsf_bmpevt_t
[in]__mskmask of the event bits to set
Returns
vsf_err_t: always VSF_ERR_NONE

Function Documentation

◆ __vsf_grouped_evts_init()

void __vsf_grouped_evts_init ( vsf_bmpevt_t * this_ptr,
vsf_bmpevt_adapter_t ** adapters_pptr,
uint_fast8_t adapter_count,
uint_fast32_t auto_reset )
extern

Low-level initialization helper backing the init_grouped_evts() macro.

Parameters
[in]this_ptrpointer to the group instance vsf_bmpevt_t
[in]adapters_pptrpointer to the adapter list defined by implement_grouped_evts()
[in]adapter_countnumber of adapters in the list
[in]auto_resetmask of the event bits that are reset automatically after a successful wait
Returns
none
Note
Internal use only.

◆ __vsf_bmpevt_wait_for()

vsf_sync_reason_t __vsf_bmpevt_wait_for ( vsf_bmpevt_t * bmpevt_ptr,
const vsf_bmpevt_pender_t * pender_ptr,
int_fast32_t time_out )
extern

Low-level bitmap-event wait helper backing the wait_for_one()/ wait_for_any()/wait_for_all() statement macros.

Parameters
[in]bmpevt_ptrpointer to the group instance vsf_bmpevt_t
[in]pender_ptrpointer to the pender vsf_bmpevt_pender_t holding the mask and the operation (VSF_BMPEVT_AND/VSF_BMPEVT_OR)
[in]time_outtimeout in system timer ticks; a negative value waits forever
Returns
vsf_sync_reason_t: VSF_SYNC_GET when the wait condition is met, VSF_SYNC_TIMEOUT on timeout, VSF_SYNC_CANCEL when the wait is cancelled, VSF_SYNC_FAIL on error, otherwise VSF_SYNC_PENDING while the wait is still in progress
Note
Internal use only.
Generated from commit: vsfteam/vsf@a5104db