Public QF-nano interface. More...
Go to the source code of this file.
Data Structures | |
struct | QTimer |
struct | QActive |
struct | QActiveVtable |
struct | QActiveCB |
Macros | |
#define | QF_MAX_TICK_RATE 1U |
#define | QF_NO_MARGIN ((uint_fast8_t)0xFF) |
#define | QACTIVE_POST(me_, sig_, par_) |
#define | QACTIVE_POST_X(me_, margin_, sig_, par_) |
#define | QACTIVE_POST_ISR(me_, sig_, par_) |
#define | QACTIVE_POST_X_ISR(me_, margin_, sig_, par_) |
#define | QF_ROM_QUEUE_AT_(ao_, i_) (((QEvt *)Q_ROM_PTR((ao_)->queue))[(i_)]) |
#define | QF_ROM_ACTIVE_GET_(p_) ((QActive *)Q_ROM_PTR(QF_active[(p_)].act)) |
#define | QF_ACTIVE_CAST(a_) ((QActive *)(a_)) |
Typedefs | |
typedef uint16_t | QTimeEvtCtr |
Functions | |
void | QActive_ctor (QActive *const me, QStateHandler initial) |
void | QF_tickXISR (uint_fast8_t const tickRate) |
void | QF_init (uint_fast8_t maxActive) |
void | QF_stop (void) |
void | QF_onStartup (void) |
int_t | QF_run (void) |
Variables | |
QActiveCB const Q_ROM | QF_active [] |
active object control blocks More... | |
uint_fast8_t | QF_maxActive_ |
uint_fast8_t volatile | QF_readySet_ |
uint8_t const Q_ROM | QF_log2Lkup [16] |
uint_fast8_t volatile | QF_timerSetX_ [QF_MAX_TICK_RATE] |
uint8_t const Q_ROM | QF_invPow2Lkup [9] |
struct QTimer |
Data Fields | ||
---|---|---|
QTimeEvtCtr | nTicks |
timer tick counter |
QTimeEvtCtr | interval |
timer interval |
struct QActiveCB |
QActive Control Block
QActiveCB represents the read-only information that the QF-nano needs to manage the active object. QActiveCB objects are grouped in the array QF_active[], which typically can be placed in ROM.
Data Fields | ||
---|---|---|
QActive * | act |
pointer to the active object structure |
QEvt * | queue |
pointer to the event queue buffer |
uint8_t | qlen |
the length of the queue ring buffer |
#define QF_MAX_TICK_RATE 1U |
#define QF_NO_MARGIN ((uint_fast8_t)0xFF) |
#define QACTIVE_POST | ( | me_, | |
sig_, | |||
par_ | |||
) |
Polymorphically posts an event to an active object (FIFO) with delivery guarantee (task context).
[in,out] | me_ | pointer (see Object Orientation) |
[in] | sig_ | signal of the event to post |
[in] | par_ | parameter of the event to post. |
#define QACTIVE_POST_X | ( | me_, | |
margin_, | |||
sig_, | |||
par_ | |||
) |
Polymorphically posts an event to an active object (FIFO) without delivery guarantee (task context).
[in,out] | me_ | pointer (see Object Orientation) |
[in] | margin_ | the minimum free slots in the queue, which must still be available after posting the event. The special value QF_NO_MARGIN causes asserting failure in case event allocation fails. |
[in] | sig_ | signal of the event to post |
[in] | par_ | parameter of the event to post. |
#define QACTIVE_POST_ISR | ( | me_, | |
sig_, | |||
par_ | |||
) |
Polymorphically posts an event to an active object (FIFO) with delivery guarantee (ISR context).
[in,out] | me_ | pointer (see Object Orientation) |
[in] | sig_ | signal of the event to post |
[in] | par_ | parameter of the event to post. |
#define QACTIVE_POST_X_ISR | ( | me_, | |
margin_, | |||
sig_, | |||
par_ | |||
) |
Polymorphically posts an event to an active object (FIFO) without delivery guarantee (ISR context).
[in,out] | me_ | pointer (see Object Orientation) |
[in] | margin_ | the minimum free slots in the queue, which must still be available after posting the event. The special value QF_NO_MARGIN causes asserting failure in case event allocation fails. |
[in] | sig_ | signal of the event to post |
[in] | par_ | parameter of the event to post. |
#define QF_ACTIVE_CAST | ( | a_ | ) | ((QActive *)(a_)) |
typedef uint16_t QTimeEvtCtr |
type of the Time Event counter, which determines the dynamic range of the time delays measured in clock ticks.
void QActive_ctor | ( | QActive *const | me, |
QStateHandler | initial | ||
) |
protected "constructor" of an QActive active object.
void QF_tickXISR | ( | uint_fast8_t const | tickRate | ) |
Processes all armed time events at every clock tick.
[in] | tickRate | system clock tick rate serviced in this call. |
void QF_init | ( | uint_fast8_t | maxActive | ) |
QF-nano initialization.
void QF_stop | ( | void | ) |
QF-nano termination.
void QF_onStartup | ( | void | ) |
Startup QF-nano callback.
int_t QF_run | ( | void | ) |
Transfers control to QF-nano to run the application.
|
extern |
|
extern |
Ready set of QF-nano.
|
extern |
|
extern |
Timer set of QF-nano.
|
extern |
Lookup table for ~(1 << (n - 1)), where n is the index into the table.