Task API summary. STMicroelectronics ST200-TOOLSET
Publicitate
Publicitate
OS21 Tasks
4.19 Task API summary
All the definitions related to tasks are obtained by including the header file os21.h, which
itself includes the header file task.h. See
Table 9
Table 10
Table 11
for a complete list.
Table 9.
task_context() task_create() task_create_p() task_data() task_data_set() task_delay() task_delay_until() task_delete() task_exit() task_id() task_immortal() task_kill() task_list_next() task_lock() task_lock_task() task_mortal() task_name() task_onexit_set() task_priority() task_priority_set() task_private_data() task_private_data_set() task_private_onexit_set() task_reschedule() task_resume() task_stack_fill() task_stack_fill_set() task_stackinfo() task_stackinfo_set() task_status() task_suspend()
Functions defined in task.h
Function Description
Returns the current execution context
Creates an OS21 task
Creates an OS21 task using specific partitions
Retrieves a task’s data pointer
Sets a task’s data pointer
Delays the calling task for a period of time
Delays the calling task until a specified time
Deletes a task
Exits the current task
Returns the current task’s ID
Makes the current task immortal
Kills a task
Returns the next task in the list
Locks current task to prevent task rescheduling
Locks any task
Makes the current task mortal
Returns the task’s name
Sets up a function to be called when a task exits
Returns a task’s priority
Sets a task’s priority
Retrieves some task private data
Registers some task private data
Registers a task private onexit handler.
Current task yields the CPU if not locked
Resumes a suspended task
Returns the task fill configuration
Sets the task stack fill configuration
Obtain basic task stack information
Set basic task stack information
Returns status information about the task
Suspends a task
7358306 55/226
Tasks
Table 9.
Functions defined in task.h (continued)
Function
task_unlock() task_unlock_task() task_wait() task_yield()
Description
Unlocks current task to allow task rescheduling
Unlocks any task
Waits until one of a list of tasks completes
Current task unconditionally yields the CPU
Table 10.
Types defined in task.h
Type
task_context_t task_flags_t task_kill_flags_t task_onexit_fn_t task_state_t task_stack_fill_state_t task_stack_fill_t task_status_flags_t task_status_t task_t
Table 11.
Macros defined in task.h
Macro
OS21_PRIORITY_LEVELS
MAX_USER_PRIORITY
MIN_USER_PRIORITY
Description
Execution context
Additional flags for task_create() and task_create_p()
Additional flags for task_kill
Function to be called on task exit
State of a task (for example, active, deleted)
Whether stack filling is enabled or disabled
Stack filling state (specifies enables and value)
Additional flags for task_status
Result of task_status
A task’s state
Description
Number of OS21 priority levels (default is 256)
Highest user task priority (default is 255)
Lowest task priority (default is 0)
OS21
56/226 7358306
Descarcă
Publicitate