AM62Px MCU+ SDK  10.01.00

Introduction

For more details and example usage, see Task

Data Structures

struct  TaskP_Load
 Task load statistics. More...
 
struct  TaskP_Object
 Opaque task object used with the task APIs. More...
 
struct  TaskP_Params
 Parameters passed during TaskP_construct. More...
 

Functions

void TaskP_Params_init (TaskP_Params *params)
 Set default values to TaskP_Params. More...
 
int32_t TaskP_construct (TaskP_Object *obj, TaskP_Params *params)
 Create a task object. More...
 
void TaskP_destruct (TaskP_Object *obj)
 Cleanup, delete, destruct a task object. More...
 
void * TaskP_getHndl (TaskP_Object *obj)
 Return OS defined task handle. More...
 
void TaskP_yield (void)
 Yield current task. More...
 
void TaskP_exit (void)
 Exit current task. More...
 
void TaskP_loadGet (TaskP_Object *obj, TaskP_Load *taskLoad)
 Get task load. More...
 
void TaskP_loadUpdateAll (void)
 Updated task load statistics. More...
 
void TaskP_loadResetAll (void)
 Reset task load statistics. More...
 
uint32_t TaskP_loadGetTotalCpuLoad ()
 Get total CPU load including all task and ISR execution time. More...
 
uint32_t TaskP_disable (void)
 
void TaskP_restore (uint32_t key)
 
void TaskP_endScheduler ()
 

Typedefs

typedef void(* TaskP_FxnMain) (void *args)
 Entry point to the task. More...
 

Macros

#define TaskP_PRIORITY_LOWEST   (0u)
 Value to be used for lowest priority task. More...
 
#define TaskP_PRIORITY_HIGHEST   (31u)
 Value to be used for highest priority task. More...
 
#define TaskP_LOAD_UPDATE_WINDOW_MSEC   (500u)
 The update rate at which TaskP_loadUpdateAll() is called. More...
 
#define TaskP_OBJECT_SIZE_MAX   (200U)
 Max size of task object across all OS's. More...
 

Macro Definition Documentation

◆ TaskP_PRIORITY_LOWEST

#define TaskP_PRIORITY_LOWEST   (0u)

Value to be used for lowest priority task.

◆ TaskP_PRIORITY_HIGHEST

#define TaskP_PRIORITY_HIGHEST   (31u)

Value to be used for highest priority task.

◆ TaskP_LOAD_UPDATE_WINDOW_MSEC

#define TaskP_LOAD_UPDATE_WINDOW_MSEC   (500u)

The update rate at which TaskP_loadUpdateAll() is called.

◆ TaskP_OBJECT_SIZE_MAX

#define TaskP_OBJECT_SIZE_MAX   (200U)

Max size of task object across all OS's.

Typedef Documentation

◆ TaskP_FxnMain

typedef void(* TaskP_FxnMain) (void *args)

Entry point to the task.

Function Documentation

◆ TaskP_Params_init()

void TaskP_Params_init ( TaskP_Params params)

Set default values to TaskP_Params.

Strongly recommended to be called before seting values in TaskP_Params

Parameters
params[out] parameter structure to set to default

◆ TaskP_construct()

int32_t TaskP_construct ( TaskP_Object obj,
TaskP_Params params 
)

Create a task object.

Parameters
obj[out] Created object
params[in] Task create parameters
Returns
SystemP_SUCCESS on success, SystemP_FAILURE on error

◆ TaskP_destruct()

void TaskP_destruct ( TaskP_Object obj)

Cleanup, delete, destruct a task object.

Parameters
obj[in] task object

◆ TaskP_getHndl()

void* TaskP_getHndl ( TaskP_Object obj)

Return OS defined task handle.

Parameters
obj[in] task object
Returns
OS specific task handle

◆ TaskP_yield()

void TaskP_yield ( void  )

Yield current task.

◆ TaskP_exit()

void TaskP_exit ( void  )

Exit current task.

In FreeRTOS, task cannot simply return from a function. It needs to call vTaskDelete(NULL) instead. To keep the task exit portable, call this function when a task wants to terminate itself.

◆ TaskP_loadGet()

void TaskP_loadGet ( TaskP_Object obj,
TaskP_Load taskLoad 
)

Get task load.

Parameters
obj[out] Created object
taskLoad[out] Task load statistics

◆ TaskP_loadUpdateAll()

void TaskP_loadUpdateAll ( void  )

Updated task load statistics.

This updates task load statistics for all tasks created with TaskP_construct(). This also updates idle task load.

This function is called, every TaskP_LOAD_UPDATE_WINDOW_MSEC msecs within the IDLE task. It is important that idle task get to run atleast once every TaskP_LOAD_UPDATE_WINDOW_MSEC msecs for the load statistics to be correct

◆ TaskP_loadResetAll()

void TaskP_loadResetAll ( void  )

Reset task load statistics.

Until load statistics is reset the load statistics keep getting accumulated

◆ TaskP_loadGetTotalCpuLoad()

uint32_t TaskP_loadGetTotalCpuLoad ( )

Get total CPU load including all task and ISR execution time.

Returns
CPU load in units of percentage with 2 decimal point precision, i.e 1234 means 12.34%

◆ TaskP_disable()

uint32_t TaskP_disable ( void  )

◆ TaskP_restore()

void TaskP_restore ( uint32_t  key)

◆ TaskP_endScheduler()

void TaskP_endScheduler ( )