ubinos
ubik.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 Sung Ho Park
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef UBIK_H_
8 #define UBIK_H_
9 
10 #ifdef __cplusplus
11 extern "C"
12 {
13 #endif
14 
23 #include <ubinos_config.h>
24 #include <ubinos/type.h>
25 
27 #define UBIK_ERR__SUCCESS 0
29 #define UBIK_ERR__FAIL -1
30 
32 #define UBIK_ERR__TIMEOUT -20
34 #define UBIK_ERR__DEADLOCK -21
36 #define UBIK_ERR__TERMINATED -30
38 #define UBIK_ERR__OVERFLOWED -50
39 
41 #define UBIK_TAG__USRSTART 0x8000
42 
44 typedef int (*idletaskhookfunc_ft)(void *);
45 
47 #define IDLEHOOKFUNC_OPT__REPEAT 0x00
49 #define IDLEHOOKFUNC_OPT__ONCE 0x80
50 
52 typedef void (*tickhookfunc_ft)(void);
53 
55 typedef struct _tickcount_t
56 {
57  unsigned int high;
58  unsigned int low;
60 
75 int ubik_comp_init(unsigned int idle_stackdepth);
76 
86 int ubik_comp_start(void);
87 
93 unsigned int ubik_gettickpersec(void);
94 
101 
116 
126 unsigned int ubik_timemstotick(unsigned int timems);
127 
137 unsigned int ubik_ticktotimems(unsigned int tick);
138 
149 
163 
170 int ubik_isactive(void);
171 
176 void ubik_entercrit(void);
177 
182 void ubik_exitcrit(void);
183 
190 int ubik_iscrit(void);
191 
198 int ubik_istask(void);
199 
208 
223 int ubik_sprintkernelinfo(char * buf, int max);
224 
233 
265  const char * name, unsigned int option);
266 
280 int ubik_setrtpriority(int rtpriority);
281 
291 
301 int ubik_isrt(void);
302 
303 #include <ubinos/ubik/task.h>
304 #include <ubinos/ubik/signal.h>
305 #include <ubinos/ubik/sem.h>
306 #include <ubinos/ubik/mutex.h>
307 #include <ubinos/ubik/msgq.h>
308 #include <ubinos/ubik/condv.h>
309 #include <ubinos/ubik/hrtick.h>
310 #include <ubinos/ubik/stimer.h>
311 
312 #ifdef __cplusplus
313 }
314 #endif
315 
316 #endif /* UBIK_H_ */
ubik condition variable API
ubik high resolution tick API
ubik message queue API
ubik mutex API
ubik semaphore API
ubik signal API
ubik semaphore timer API
Definition: ubik.h:56
unsigned int high
Definition: ubik.h:57
unsigned int low
Definition: ubik.h:58
ubik task API
ubinos basic data type
void ubik_entercrit(void)
int ubik_getrtpriority(void)
int ubik_setrtpriority(int rtpriority)
unsigned int ubik_ticktotimems(unsigned int tick)
int ubik_setidletaskhookfunc(idletaskhookfunc_ft func, void *arg, const char *name, unsigned int option)
int(* idletaskhookfunc_ft)(void *)
Definition: ubik.h:44
int ubik_collectgarbage(void)
int ubik_settickhookfunc(tickhookfunc_ft tickhookfunc)
struct _tickcount_t tickcount_t
void ubik_exitcrit(void)
unsigned int ubik_gettickpersec(void)
void(* tickhookfunc_ft)(void)
Definition: ubik.h:52
tickcount_t ubik_gettickcount(void)
int ubik_comp_start(void)
int ubik_iscrit(void)
unsigned long ubik_tickcouttotimems(tickcount_t tc)
int ubik_comp_init(unsigned int idle_stackdepth)
tickcount_t ubik_gettickdiff(tickcount_t tick1, tickcount_t tick2)
int ubik_isrt(void)
int ubik_isactive(void)
int ubik_istask(void)
int ubik_printkernelinfo(void)
int ubik_sprintkernelinfo(char *buf, int max)
unsigned int ubik_timemstotick(unsigned int timems)