C API event flags definitions. More...
Classes | |
struct | os_evflags_attr_s |
Event flags attributes. More... | |
struct | os_evflags_s |
Event flags object storage. More... | |
Typedefs | |
typedef struct os_evflags_attr_s | os_evflags_attr_t |
Event flags attributes. | |
typedef struct os_evflags_s | os_evflags_t |
Event flags object storage. | |
Event Flags Attributes Functions | |
void | os_evflags_attr_init (os_evflags_attr_t *attr) |
Initialise the event flags attributes. | |
Event Flags Creation Functions | |
void | os_evflags_construct (os_evflags_t *evflags, const char *name, const os_evflags_attr_t *attr) |
Construct a statically allocated event flags object instance. | |
void | os_evflags_destruct (os_evflags_t *evflags) |
Destruct the statically allocated event flags object instance. | |
os_evflags_t * | os_evflags_new (const char *name, const os_evflags_attr_t *attr) |
Allocate an event flags object instance and construct it. | |
void | os_evflags_delete (os_evflags_t *evflags) |
Destruct the event flags object instance and deallocate it. | |
Compatibility Macros | |
#define | os_evflags_create os_evflags_construct |
#define | os_evflags_destroy os_evflags_destruct |
C API event flags definitions.
#define os_evflags_create os_evflags_construct |
Definition at line 2637 of file os-c-api.h.
#define os_evflags_destroy os_evflags_destruct |
Definition at line 2638 of file os-c-api.h.
typedef struct os_evflags_attr_s os_evflags_attr_t |
Event flags attributes.
Initialise this structure with os_evflags_attr_init()
and then set any of the individual members directly.
typedef struct os_evflags_s os_evflags_t |
Event flags object storage.
This C structure has the same size as the C++ os::rtos::event_flags
object and must be initialised with os_evflags_create()
.
Later on a pointer to it can be used both in C and C++ to refer to the event flags object instance.
The members of this structure are hidden and should not be used directly, but only through specific functions.
bool os_evflags_are_waiting | ( | os_evflags_t * | evflags | ) |
Check if there are threads waiting.
[in] | evflags | Pointer to event flags object instance. |
true | There are threads waiting. |
false | There are no threads waiting. |
Definition at line 2998 of file os-c-wrapper.cpp.
void os_evflags_attr_init | ( | os_evflags_attr_t * | attr | ) |
Initialise the event flags attributes.
[in] | attr | Pointer to event flags attributes object instance. |
Definition at line 2801 of file os-c-wrapper.cpp.
os_result_t os_evflags_clear | ( | os_evflags_t * | evflags, |
os_flags_mask_t | mask, | ||
os_flags_mask_t * | oflags | ||
) |
Clear event flags.
[in] | evflags | Pointer to event flags object instance. |
[in] | mask | The OR-ed flags to clear. Zero means 'all'. |
[out] | oflags | Optional pointer where to store the previous value of the flags; may be NULL . |
os_ok | The flags were cleared. |
EINVAL | The mask is zero. |
Definition at line 2968 of file os-c-wrapper.cpp.
void os_evflags_construct | ( | os_evflags_t * | evflags, |
const char * | name, | ||
const os_evflags_attr_t * | attr | ||
) |
Construct a statically allocated event flags object instance.
[in] | evflags | Pointer to event flags object instance storage. |
[in] | name | Pointer to name (may be NULL). |
[in] | attr | Pointer to attributes (may be NULL). |
os_evflags_destruct()
.Definition at line 2816 of file os-c-wrapper.cpp.
void os_evflags_delete | ( | os_evflags_t * | evflags | ) |
Destruct the event flags object instance and deallocate it.
[in] | evflags | Pointer to dynamically allocated event flags object instance. |
Destruct the event flags and deallocate the dynamically allocated space using the RTOS system allocator.
delete ptr_evflags
. os_evflags_new()
.Definition at line 2880 of file os-c-wrapper.cpp.
void os_evflags_destruct | ( | os_evflags_t * | evflags | ) |
Destruct the statically allocated event flags object instance.
[in] | evflags | Pointer to event flags object instance. |
os_evflags_construct()
.Definition at line 2836 of file os-c-wrapper.cpp.
os_flags_mask_t os_evflags_get | ( | os_evflags_t * | evflags, |
os_flags_mask_t | mask, | ||
os_flags_mode_t | mode | ||
) |
Get (and possibly clear) event flags.
[in] | evflags | Pointer to event flags object instance. |
[in] | mask | The OR-ed flags to get/clear; may be zero. |
[in] | mode | Mode bits to select if the flags should be cleared (the other bits are ignored). |
Definition at line 2983 of file os-c-wrapper.cpp.
const char * os_evflags_get_name | ( | os_evflags_t * | evflags | ) |
Get the event flags name.
[in] | evflags | Pointer to event flags object instance. |
Definition at line 2893 of file os-c-wrapper.cpp.
os_evflags_t * os_evflags_new | ( | const char * | name, |
const os_evflags_attr_t * | attr | ||
) |
Allocate an event flags object instance and construct it.
[in] | name | Pointer to name (may be NULL). |
[in] | attr | Pointer to attributes (may be NULL). |
Dynamically allocate the event flags object instance using the RTOS system allocator and construct it.
new event_flags(...)
. os_evflags_delete()
.Definition at line 2856 of file os-c-wrapper.cpp.
os_result_t os_evflags_raise | ( | os_evflags_t * | evflags, |
os_flags_mask_t | mask, | ||
os_flags_mask_t * | oflags | ||
) |
Raise event flags.
[in] | evflags | Pointer to event flags object instance. |
[in] | mask | The OR-ed flags to raise. |
[out] | oflags | Optional pointer where to store the new value of the flags; may be NULL . |
os_ok | The flags were raised. |
EINVAL | The mask is zero. |
ENOTRECOVERABLE | Raise failed. |
Definition at line 2953 of file os-c-wrapper.cpp.
os_result_t os_evflags_timed_wait | ( | os_evflags_t * | evflags, |
os_flags_mask_t | mask, | ||
os_clock_duration_t | timeout, | ||
os_flags_mask_t * | oflags, | ||
os_flags_mode_t | mode | ||
) |
Timed wait for event flags.
[in] | evflags | Pointer to event flags object instance. |
[in] | mask | The expected flags (OR-ed bit-mask); may be zero. |
[out] | oflags | Pointer where to store the current flags; may be NULL . |
[in] | mode | Mode bits to select if either all or any flags are expected, and if the flags should be cleared. |
[in] | timeout | Timeout to wait. |
os_ok | All expected flags are raised. |
EPERM | Cannot be invoked from an Interrupt Service Routines. |
ETIMEDOUT | The expected condition did not occur during the entire timeout duration. |
EINVAL | The mask is outside of the permitted range. |
EINTR | The operation was interrupted. |
ENOTRECOVERABLE | Wait failed. |
Definition at line 2937 of file os-c-wrapper.cpp.
os_result_t os_evflags_try_wait | ( | os_evflags_t * | evflags, |
os_flags_mask_t | mask, | ||
os_flags_mask_t * | oflags, | ||
os_flags_mode_t | mode | ||
) |
Try to wait for event flags.
[in] | evflags | Pointer to event flags object instance. |
[in] | mask | The expected flags (OR-ed bit-mask); may be zero. |
[out] | oflags | Pointer where to store the current flags; may be NULL . |
[in] | mode | Mode bits to select if either all or any flags are expected, and if the flags should be cleared. |
os_ok | All expected flags were raised. |
EINVAL | The mask is outside of the permitted range. |
EWOULDBLOCK | The expected condition did not occur. |
ENOTRECOVERABLE | Wait failed. |
Definition at line 2922 of file os-c-wrapper.cpp.
os_result_t os_evflags_wait | ( | os_evflags_t * | evflags, |
os_flags_mask_t | mask, | ||
os_flags_mask_t * | oflags, | ||
os_flags_mode_t | mode | ||
) |
Wait for event flags.
[in] | evflags | Pointer to event flags object instance. |
[in] | mask | The expected flags (OR-ed bit-mask); may be zero. |
[out] | oflags | Pointer where to store the current flags; may be NULL . |
[in] | mode | Mode bits to select if either all or any flags are expected, and if the flags should be cleared. |
os_ok | All expected flags were raised. |
EPERM | Cannot be invoked from an Interrupt Service Routines. |
EINVAL | The mask is outside of the permitted range. |
EINTR | The operation was interrupted. |
ENOTRECOVERABLE | Wait failed. |
Definition at line 2906 of file os-c-wrapper.cpp.