timer
Header:
timer.hContains definitions common to timers.
timer
struct timer
{
// Timer modes.
struct mode
{
enum
{
SINGLE_SHOT = false,
REPEATING = true
};
typedef bool type;
};
// Timer start status.
struct start
{
enum
{
DELAYED = false,
IMMEDIATE = true
};
typedef bool type;
};
// Timer id.
struct id
{
enum
{
NO_TIMER = 255
};
typedef uint_least8_t type;
};
// Timer state.
struct state
{
enum
{
INACTIVE = 0xFFFFFFFF
};
};
};mode
Typestype
The type for timer mode.
Defined as bool.
ConstantsSINGLE_SHOT
The timer expires once and then stops.
REPEATING
The timer is restarted after every timeout.
start
Typestype
The type for timer start mode.
Defined as bool.
ConstantsIMMEDIATE
Single Shot
The timer is triggered on the next tick. The normal timeout does not occur.Repeating
The timer is triggered on the next tick and then on subsequent timeouts.
DELAYED
The timer is triggered on the timeout.
id
Typestype
The type for timer identifiers.
Defined as uint_least8_t.
ConstantsNO_TIMER
The id of an unregistered timer.