OS
v7.3.3
Documentation
|
Kernel API interface to create/remove tasks and perform special OS operations. More...
Macros | |
#define | qLowest_Priority |
A macro directive to indicate the lowest priority level. | |
#define | qMedium_Priority |
A macro directive to indicate the medium priority level. | |
#define | qHigh_Priority |
A macro directive to indicate the highest priority level. | |
#define | qPeriodic |
A directive indicating that the task will run every time its timeout has expired. | |
#define | qIndefinite |
Same as qPeriodic. A directive indicating that the task will run every time its timeout has expired. | |
#define | qSingleShot |
A directive that indicates that the task will be executed only once after its time has expired. | |
Functions | |
qBool_t | qOS_Setup (const qGetTickFcn_t tFcn, const qTimingBase_t t, qTaskFcn_t idleCallback) |
Task Scheduler Setup. This function is required and must be called once in the application main thread before any task is being added to the OS. More... | |
qBool_t | qOS_Set_IdleTask (qTaskFcn_t callbackFcn) |
Set/Change the callback for the Idle-task. More... | |
qBool_t | qOS_Scheduler_Release (void) |
Disables the kernel scheduling. The main thread will continue after the qOS_Run() call. More... | |
qBool_t | qOS_Set_SchedulerReleaseCallback (qTaskFcn_t rCallback) |
Set/Change the scheduler release callback function. More... | |
qBool_t | qOS_Add_Task (qTask_t *const Task, qTaskFcn_t callbackFcn, const qPriority_t p, const qTime_t t, const qIteration_t n, const qState_t init, void *arg) |
Add a task to the scheduling scheme. The task is scheduled to run every t seconds, n times and executing callbackFcn method on every pass. More... | |
qBool_t | qOS_Add_EventTask (qTask_t *const Task, qTaskFcn_t callbackFcn, const qPriority_t p, void *arg) |
Add a task to the scheduling scheme. This API creates a task with a qDisabled state by default, so this task will be executed only, when asynchronous events occurs. However, this behavior can be changed in execution time using qTask_Set_Time() or qTask_Set_Iterations(). More... | |
qBool_t | qOS_Add_StateMachineTask (qTask_t *const Task, qSM_t *m, const qPriority_t p, const qTime_t t, const qState_t init, void *arg) |
Add a task to the scheduling scheme running a dedicated state-machine. The task is scheduled to run every t seconds in qPeriodic mode. The event info will be available as a generic pointer inside the qSM_Handler_t::Data field. More... | |
qBool_t | qOS_Add_ATCLITask (qTask_t *const Task, qATCLI_t *cli, const qPriority_t p, void *arg) |
Add a task to the scheduling scheme running an AT Command Line Interface. Task will be scheduled as event-triggered task. The parser address will be stored in the qEvent_t::TaskData storage-Pointer. More... | |
qBool_t | qOS_Remove_Task (qTask_t *const Task) |
Remove the task from the scheduling scheme. More... | |
qBool_t | qOS_Run (void) |
Executes the scheduling scheme. It must be called once after the task pool has been defined. More... | |
qBool_t | qOS_YieldToTask (qTask_t *const Task) |
Yield the control of the current running task to another task. More... | |
Kernel API interface to create/remove tasks and perform special OS operations.
qBool_t qOS_Add_ATCLITask | ( | qTask_t *const | Task, |
qATCLI_t * | cli, | ||
const qPriority_t | p, | ||
void * | arg | ||
) |
Add a task to the scheduling scheme running an AT Command Line Interface. Task will be scheduled as event-triggered task. The parser address will be stored in the qEvent_t::TaskData storage-Pointer.
[in] | Task | A pointer to the task node. |
[in] | cli | A pointer to the AT Command Line Inteface instance. |
[in] | p | Task priority Value. [0(min) - Q_PRIORITY_LEVELS (max)] |
[in] | arg | Represents the task arguments. All arguments must be passed by reference and cast to void* . Only one argument is allowed, so, for multiple arguments, create a structure that contains all of the arguments and pass a pointer to that structure. |
qBool_t qOS_Add_EventTask | ( | qTask_t *const | Task, |
qTaskFcn_t | callbackFcn, | ||
const qPriority_t | p, | ||
void * | arg | ||
) |
Add a task to the scheduling scheme. This API creates a task with a qDisabled state by default, so this task will be executed only, when asynchronous events occurs. However, this behavior can be changed in execution time using qTask_Set_Time() or qTask_Set_Iterations().
[in] | Task | A pointer to the task node. |
[in] | callbackFcn | A pointer to a the task callback method with a qEvent_t parameter as input argument. |
[in] | p | Task priority Value. [0(min) - Q_PRIORITY_LEVELS (max)] |
[in] | arg | Represents the task arguments. All arguments must be passed by reference and cast to void* . Only one argument is allowed, so, for multiple arguments, create a structure that contains all of the arguments and pass a pointer to that structure. |
qBool_t qOS_Add_StateMachineTask | ( | qTask_t *const | Task, |
qSM_t * | m, | ||
const qPriority_t | p, | ||
const qTime_t | t, | ||
const qState_t | init, | ||
void * | arg | ||
) |
Add a task to the scheduling scheme running a dedicated state-machine. The task is scheduled to run every t seconds in qPeriodic mode. The event info will be available as a generic pointer inside the qSM_Handler_t::Data field.
[in] | Task | A pointer to the task node. |
[in] | m | A pointer to the Finite State-Machine (FSM) object. |
[in] | p | Task priority Value. [0(min) - Q_PRIORITY_LEVELS (max)] |
[in] | t | Execution interval defined in seconds (floating-point format). For immediate execution (tValue = qTimeImmediate). |
[in] | init | Specifies the initial operational state of the task (qEnabled, qDisabled, qAsleep or qAwake(implies qEnabled)). |
[in] | arg | Represents the task arguments. All arguments must be passed by reference and cast to void* . Only one argument is allowed, so, for multiple arguments, create a structure that contains all of the arguments and pass a pointer to that structure. |
qBool_t qOS_Add_Task | ( | qTask_t *const | Task, |
qTaskFcn_t | callbackFcn, | ||
const qPriority_t | p, | ||
const qTime_t | t, | ||
const qIteration_t | n, | ||
const qState_t | init, | ||
void * | arg | ||
) |
Add a task to the scheduling scheme. The task is scheduled to run every t seconds, n times and executing callbackFcn method on every pass.
[in] | Task | A pointer to the task node. |
[in] | callbackFcn | A pointer to a void callback method with a qEvent_t parameter as input argument. |
[in] | p | Task priority Value. [0(min) - Q_PRIORITY_LEVELS(max) ] |
[in] | t | Execution interval defined in seconds (floating-point format). For immediate execution (tValue = qTimeImmediate). |
[in] | n | Number of task executions (Integer value). For indefinite execution ( n = qPeriodic or qIndefinite ). Tasks do not remember the number of iteration set initially. After the iterations are done, internal iteration counter is 0. To perform another set of iterations, set the number of iterations again. |
[in] | init | Specifies the initial operational state of the task (qEnabled, qDisabled, qAsleep or qAwake(implies qEnabled)). |
[in] | arg | Represents the task arguments. All arguments must be passed by reference and cast to void* . Only one argument is allowed, so, for multiple arguments, create a structure that contains all of the arguments and pass a pointer to that structure. |
qBool_t qOS_Run | ( | void | ) |
Executes the scheduling scheme. It must be called once after the task pool has been defined.
qBool_t qOS_Scheduler_Release | ( | void | ) |
Disables the kernel scheduling. The main thread will continue after the qOS_Run() call.
qBool_t qOS_Set_IdleTask | ( | qTaskFcn_t | callbackFcn | ) |
qBool_t qOS_Set_SchedulerReleaseCallback | ( | qTaskFcn_t | rCallback | ) |
qBool_t qOS_Setup | ( | const qGetTickFcn_t | tFcn, |
const qTimingBase_t | t, | ||
qTaskFcn_t | idleCallback | ||
) |
Task Scheduler Setup. This function is required and must be called once in the application main thread before any task is being added to the OS.
[in] | tFcn | The function that provides the tick value. If the user application uses the qClock_SysTick() from the ISR, this parameter can be NULL . |
[in] | t | (Optional) This parameter specifies the ISR background timer base time. This can be the period in seconds(Floating-point format) or frequency in Herzt(if Q_SETUP_TICK_IN_HERTZ is enabled). |
[in] | idleCallback | Callback function to the Idle Task. To disable the Idle-Task activities, pass NULL as argument. |
Example : When tick is already provided
Example : When the tick is not provided
Yield the control of the current running task to another task.
[in] | Task | A pointer to the task to which current control will be yielded. Pass NULL to discard a previous request. |