NetBurner 3.3.8a
PDF Version
OS_FLAGS Class Reference

An OS_FLAGS object is used to set, clear, and pend on a set of flags that is held and maintained by the object. 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)
 This function sets the corresponding bits asserted in bits_to_set. More...
 
void Clear (uint32_t bits_to_clr)
 This function clears the bits asserted in bits_to_clr. More...
 
void Write (uint32_t bits_to_force)
 This function forces the bits to match the passe din bits`. More...
 
uint8_t PendAny (uint32_t bit_mask, uint16_t timeout=WAIT_FOREVER)
 This function waits a number of time ticks specified by timeout until any of the flags indicated by bit_mask are set. More...
 
uint8_t PendAnyNoWait (uint32_t bit_mask)
 This function immediately checks to see if any of the flag bits indicated by bit_mask are set; it does not wait. More...
 
uint8_t PendAll (uint32_t bit_mask, uint16_t timeout=WAIT_FOREVER)
 This function waits a number of time ticks specified by timeout until all the flags indicated by bit_mask are set. More...
 
uint8_t PendAllNoWait (uint32_t bit_mask)
 This function immediately checks to see if all the flag bits indicated by bit_mask are set; it does not wait. More...
 
uint32_t State ()
 This function returns the current values of the flags stored in the OS_FLAGS object structure. More...
 

Detailed Description

An OS_FLAGS object is used to set, clear, and pend on a set of flags that is held and maintained by the object.

Member Function Documentation

◆ Clear()

void OS_FLAGS::Clear ( uint32_t  bits_to_clr)

This function clears the bits asserted in bits_to_clr.

Parameters
bits_to_clrA bit or set of bits to be cleared.
See also
Set()
State()

◆ PendAll()

uint8_t OS_FLAGS::PendAll ( uint32_t  bit_mask,
uint16_t  timeout = WAIT_FOREVER 
)
inline

This function waits a number of time ticks specified by timeout until all the flags indicated by bit_mask are set.

Parameters
bit_maskA bit or set of bits to wait on.
timeoutNumber of time ticks to wait for all specified flag bits to be set.
Return values
OS_NO_ERRIf the flags condition is satisfied
OS_TIMEOUTIf the timeout expired
See also
PendAllNoWait()
PendAny()

◆ PendAllNoWait()

uint8_t OS_FLAGS::PendAllNoWait ( uint32_t  bit_mask)

This function immediately checks to see if all the flag bits indicated by bit_mask are set; it does not wait.

Parameters
bit_maskA bit or set of bits to wait on.
Return values
OS_NO_ERRAll flags indicated by bit_mask are set.
OS_TIMEOUTNot all of the flags indicated by bit_mask are set.
See also
PendAll()
PendAnyNoWait()

◆ PendAny()

uint8_t OS_FLAGS::PendAny ( uint32_t  bit_mask,
uint16_t  timeout = WAIT_FOREVER 
)
inline

This function waits a number of time ticks specified by timeout until any of the flags indicated by bit_mask are set.

Parameters
bit_maskA bit or set of bits to wait on.
timeoutNumber of time ticks to wait for all specified flag bits to be set.
Return values
OS_NO_ERRAt least one of the flag bits are set before timeout expires.
OS_TIMEOUTNone of the flag bits are set before timeout expires.
See also
PendAnyNoWait()
PendAll()

◆ PendAnyNoWait()

uint8_t OS_FLAGS::PendAnyNoWait ( uint32_t  bit_mask)

This function immediately checks to see if any of the flag bits indicated by bit_mask are set; it does not wait.

Parameters
bit_maskA bit or set of bits to wait on.
Return values
OS_NO_ERRAt least one of the flags indicated by bit_mask are set.
OS_TIMEOUTNone of the flags indicated by bit_mask are set.
See also
PendAny()
PendAllNoWait()

◆ Set()

void OS_FLAGS::Set ( uint32_t  bits_to_set)

This function sets the corresponding bits asserted in bits_to_set.

Parameters
bits_to_setA bit or set of bits to be set.
See also
Clear()
State()

◆ State()

uint32_t OS_FLAGS::State ( )

This function returns the current values of the flags stored in the OS_FLAGS object structure.

Returns
The state of the OS_FLAGS object.
See also
Set()
Clear()

◆ Write()

void OS_FLAGS::Write ( uint32_t  bits_to_force)

This function forces the bits to match the passe din bits`.

Parameters
bits_to_forceValue to set all flags to.
See also
Set()
Clear()
State()

The documentation for this class was generated from the following files: