dpl_tasks.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Inria
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef DPL_DPL_TASKS_H
21 #define DPL_DPL_TASKS_H
22 
23 #include "dpl_types.h"
24 
25 #include "sched.h"
26 #include "thread.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
35 struct dpl_task {
37 };
38 
43 
63 int dpl_task_init(struct dpl_task *t, const char *name, dpl_task_func_t func,
64  void *arg, uint8_t prio, dpl_time_t sanity_itvl,
65  dpl_stack_t *stack_bottom, uint16_t stack_size);
66 
72 int dpl_task_remove(struct dpl_task *t);
73 
79 uint8_t dpl_task_count(void);
80 
84 void dpl_task_yield(void);
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif /* DPL_DPL_TASKS_H */
kernel_pid_t
int16_t kernel_pid_t
Unique process identifier.
Definition: sched.h:125
dpl_task_init
int dpl_task_init(struct dpl_task *t, const char *name, dpl_task_func_t func, void *arg, uint8_t prio, dpl_time_t sanity_itvl, dpl_stack_t *stack_bottom, uint16_t stack_size)
Initialize a task.
dpl_task_remove
int dpl_task_remove(struct dpl_task *t)
removes specified task
sched.h
Scheduler API definition.
dpl_time_t
uint32_t dpl_time_t
dpl time type
Definition: dpl_types.h:55
thread_task_func_t
void *(* thread_task_func_t)(void *arg)
Prototype for a thread entry function.
Definition: thread.h:149
dpl_task_func_t
thread_task_func_t dpl_task_func_t
dpl task function
Definition: dpl_tasks.h:42
dpl_stack_t
char dpl_stack_t
dpl stack buffer type
Definition: dpl_types.h:60
dpl_task_count
uint8_t dpl_task_count(void)
Return the number of tasks initialized.
dpl_types.h
uwb-core DPL (Decawave Porting Layer) types
dpl_task::pid
kernel_pid_t pid
the process id
Definition: dpl_tasks.h:36
dpl_task_yield
void dpl_task_yield(void)
Lets current thread yield.
dpl_task
dpl task wrapper
Definition: dpl_tasks.h:35