NetBurner 3.5.0
PDF Version |
|
OSFlags enables a function or task to pend on multiple flags or events. More...
#include <nbrtos.h>
Public Member Functions | |
OS_FLAGS () | |
Create and initialize an OS_FLAG object. | |
void | Init () |
Initialize an OS_FLAG object to its default value. | |
void | Set (uint32_t bits_to_set) |
Sets the specified flag bits. | |
void | Clear (uint32_t bits_to_clr) |
Clear the specified flag bits. | |
void | Write (uint32_t bits_to_force) |
Set the flag bits to match the specified value. | |
uint32_t | State () |
Returns the current values of the flags stored in the OS_FLAGS object. | |
uint8_t | PendAny (uint32_t bit_mask, uint16_t timeout=WAIT_FOREVER) |
Wait the specified number of system TimeTicks for any of the flags in the bit mask to be set. | |
uint8_t | PendAny (uint32_t bit_mask, TickTimeout &timeout) |
Wait the specified number of TickTimeout time ticks for any of the flags in the bit mask to be set. | |
uint8_t | PendAnyUntil (uint32_t bit_mask, uint32_t end_time) |
Wait until the specified system TimeTicks value for any of the flags in the bit mask to be set. | |
uint8_t | PendAnyNoWait (uint32_t bit_mask) |
Check for the specified flags and return immediately. | |
uint8_t | PendAll (uint32_t bit_mask, uint16_t timeout=WAIT_FOREVER) |
Wait the specified number of system time ticks until all the specified flags are set. | |
uint8_t | PendAll (uint32_t bit_mask, TickTimeout &timeout) |
Wait the specified number of TickTimeout time ticks until all the specified flags are set. | |
uint8_t | PendAllUntil (uint32_t bit_mask, uint32_t end_time) |
Wait until the specified system TimeTicks value for all of the flags in the bit mask to be set. | |
uint8_t | PendAllNoWait (uint32_t bit_mask) |
Wait the specified number of system time ticks until all the specified flags are set. | |
OSFlags enables a function or task to pend on multiple flags or events.
In contrast to a OSSemaphore which can pend on only a single event. The OSFlag implementation is essentially a 32-bit bitmap in which each bit position represents a flag. You create a OSFlag object with OSFlagCreate(), then set, clean and read the flags with the appropriate function. There are a number of functions used to monitor or pend on the flags, and provide the ability to pend on any one or more of the flags being set, or pending on all of flags being set at one time.
OS_FLAGS::OS_FLAGS | ( | ) |
Create and initialize an OS_FLAG object.
void OS_FLAGS::Clear | ( | uint32_t | bits_to_clr | ) |
void OS_FLAGS::Init | ( | ) |
Initialize an OS_FLAG object to its default value.
uint8_t OS_FLAGS::PendAll | ( | uint32_t | bit_mask, |
TickTimeout & | timeout ) |
Wait the specified number of TickTimeout time ticks until all the specified flags are set.
bit_mask | A bit or set of bits to wait on. |
timeout | Number of time ticks to wait for all specified flag bits to be set. A value of 0 waits forever. |
OS_NO_ERR | If the flags condition is satisfied |
OS_TIMEOUT | If the timeout expired |
|
inline |
Wait the specified number of system time ticks until all the specified flags are set.
bit_mask | A bit or set of bits to wait on. |
timeout | Number of time ticks to wait for all specified flag bits to be set. A value of 0 waits forever. |
OS_NO_ERR | If the flags condition is satisfied |
OS_TIMEOUT | If the timeout expired |
uint8_t OS_FLAGS::PendAllNoWait | ( | uint32_t | bit_mask | ) |
Wait the specified number of system time ticks until all the specified flags are set.
bit_mask | A bit or set of bits to wait on. |
|
inline |
Wait until the specified system TimeTicks value for all of the flags in the bit mask to be set.
bit_mask | A bit or set of bits to wait on. |
end_time | System TimeTick value to wait for. |
OS_NO_ERR | At least one of the flag bits are set before end_time . |
OS_TIMEOUT | None of the flag bits are set before end_time . |
uint8_t OS_FLAGS::PendAny | ( | uint32_t | bit_mask, |
TickTimeout & | timeout ) |
Wait the specified number of TickTimeout time ticks for any of the flags in the bit mask to be set.
bit_mask | A bit or set of bits to wait on. |
timeout | Number of time ticks to wait for all specified flag bits to be set. If not specified or 0 will wait forever. |
OS_NO_ERR | At least one of the flag bits are set before timeout expires. A value of 0 waits forever. |
OS_TIMEOUT | None of the flag bits are set before timeout expires. |
|
inline |
Wait the specified number of system TimeTicks for any of the flags in the bit mask to be set.
bit_mask | A bit or set of bits to wait on. |
timeout | Number of time ticks to wait for all specified flag bits to be set. If not specified or 0 will wait forever. |
OS_NO_ERR | At least one of the flag bits are set before timeout expires. A value of 0 waits forever. |
OS_TIMEOUT | None of the flag bits are set before timeout expires. |
uint8_t OS_FLAGS::PendAnyNoWait | ( | uint32_t | bit_mask | ) |
Check for the specified flags and return immediately.
bit_mask | A bit or set of bits to wait on. |
|
inline |
Wait until the specified system TimeTicks value for any of the flags in the bit mask to be set.
bit_mask | A bit or set of bits to wait on. |
end_time | System TimeTick value to wait for. |
OS_NO_ERR | At least one of the flag bits are set before end_time . |
OS_TIMEOUT | None of the flag bits are set before end_time . |
void OS_FLAGS::Set | ( | uint32_t | bits_to_set | ) |
uint32_t OS_FLAGS::State | ( | ) |
void OS_FLAGS::Write | ( | uint32_t | bits_to_force | ) |