PDK API Guide for AM64x
TaskP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
48 #ifndef ti_osal_TaskP__include
49 #define ti_osal_TaskP__include
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 #include <stdint.h>
56 #include <stdbool.h>
57 #include <stddef.h>
58 
62 typedef enum TaskP_Status_e
63 {
65  TaskP_OK = 0,
67  TaskP_FAILURE = (-(int32_t)1)
68 } TaskP_Status;
69 
73 #define OS_TICKS_IN_MILLI_SEC 1 /* 1000us tick */
74 
81 typedef void *TaskP_Handle;
82 
89 typedef struct TaskP_Params_s
90 {
91  uint8_t *name;
92  void *pErrBlk;
93  int8_t priority;
94  uint32_t stacksize;
95  void *arg0;
96  void *arg1;
97  void *stack;
98 } TaskP_Params;
99 
109 extern TaskP_Handle TaskP_create(void *taskfxn,
110  const TaskP_Params *params);
111 
121 extern TaskP_Status TaskP_delete(TaskP_Handle *handle);
122 
128 extern void TaskP_Params_init(TaskP_Params *params);
129 
135 extern void TaskP_sleep(uint32_t timeout);
136 
137 
143 extern void TaskP_sleepInMsecs(uint32_t timeoutInMsecs);
144 
151 extern void TaskP_setPrio(TaskP_Handle handle, uint32_t priority);
152 
157 extern TaskP_Handle TaskP_self(void);
158 
163 extern TaskP_Handle TaskP_selfmacro(void);
164 
169 extern void TaskP_yield(void);
170 
178 extern uint32_t TaskP_isTerminated(TaskP_Handle handle);
179 
180 #ifdef __cplusplus
181 }
182 #endif
183 
184 #endif /* ti_osal_TaskP__include */
185 /* @} */
void * arg1
Definition: TaskP.h:96
void TaskP_Params_init(TaskP_Params *params)
Initialize params structure to default values.
void * stack
Definition: TaskP.h:97
void TaskP_sleepInMsecs(uint32_t timeoutInMsecs)
Function for Task sleep in units of msecs.
Basic SemaphoreP Parameters.
Definition: TaskP.h:89
void TaskP_yield(void)
Function Yield processor to equal priority task.
TaskP_Handle TaskP_self(void)
Function returns the Task handle of current task.
TaskP_Status
Status codes for TaskP APIs.
Definition: TaskP.h:62
void * TaskP_Handle
Opaque client reference to an instance of a TaskP.
Definition: TaskP.h:81
uint32_t TaskP_isTerminated(TaskP_Handle handle)
Check if task is terminated.
int8_t priority
Definition: TaskP.h:93
Definition: TaskP.h:67
void TaskP_sleep(uint32_t timeout)
Function for Task sleep in units of OS tick.
void * pErrBlk
Definition: TaskP.h:92
void * arg0
Definition: TaskP.h:95
TaskP_Handle TaskP_create(void *taskfxn, const TaskP_Params *params)
Function to create a task.
uint32_t stacksize
Definition: TaskP.h:94
TaskP_Handle TaskP_selfmacro(void)
Function returns the Task handle of current task.This is an inline function.
uint8_t * name
Definition: TaskP.h:91
TaskP_Status TaskP_delete(TaskP_Handle *handle)
Function to delete a task.
Definition: TaskP.h:65
void TaskP_setPrio(TaskP_Handle handle, uint32_t priority)
Function to update Task priority.