xWRL6432 MMWAVE-L-SDK  05.04.00.01
TaskP.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018-2021 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * 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
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef TASKP_H
34 #define TASKP_H
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 #include <stdint.h>
41 #include <kernel/dpl/SystemP.h>
42 
55 typedef void (*TaskP_FxnMain)(void *args);
56 
60 #define TaskP_PRIORITY_LOWEST (0u)
61 
65 #define TaskP_PRIORITY_HIGHEST (15u)
66 
70 #define TaskP_OBJECT_SIZE_MAX (160u)
71 
74 typedef struct TaskP_Object_ {
75 
76  uint32_t rsv[TaskP_OBJECT_SIZE_MAX/sizeof(uint32_t)];
78 } TaskP_Object;
79 
83 typedef struct TaskP_Params_ {
84 
85  const char *name;
86  uint32_t stackSize;
87  uint8_t *stack;
88  uint32_t priority;
89  void *args;
92 } TaskP_Params;
93 
102 
112 
119 
123 void TaskP_yield();
124 
132 void TaskP_exit();
133 
136 #ifdef __cplusplus
137 }
138 #endif
139 
140 #endif /* TASKP_H */
TaskP_FxnMain
void(* TaskP_FxnMain)(void *args)
Entry point to the task.
Definition: TaskP.h:55
TaskP_Params
Parameters passed during TaskP_construct.
Definition: TaskP.h:83
SystemP.h
TaskP_Object
Opaque task object used with the task APIs.
Definition: TaskP.h:74
TaskP_Params::args
void * args
Definition: TaskP.h:89
TaskP_construct
int32_t TaskP_construct(TaskP_Object *obj, TaskP_Params *params)
Create a task object.
TaskP_Params::name
const char * name
Definition: TaskP.h:85
TaskP_Params::taskMain
TaskP_FxnMain taskMain
Definition: TaskP.h:90
TaskP_yield
void TaskP_yield()
Yield current task.
TaskP_Params::stackSize
uint32_t stackSize
Definition: TaskP.h:86
TaskP_Params::priority
uint32_t priority
Definition: TaskP.h:88
TaskP_exit
void TaskP_exit()
Exit current task.
TaskP_OBJECT_SIZE_MAX
#define TaskP_OBJECT_SIZE_MAX
Max size of task object across all OS's.
Definition: TaskP.h:70
TaskP_Params::stack
uint8_t * stack
Definition: TaskP.h:87
TaskP_Params_init
void TaskP_Params_init(TaskP_Params *params)
Set default values to TaskP_Params.
TaskP_destruct
void TaskP_destruct(TaskP_Object *obj)
Cleanup, delete, destruct a task object.