]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blob - rpp/lib/rpp/include/types.h
8d2d0541b62a94b8b614f5698afdca56604d1edf
[pes-rpp/rpp-test-sw.git] / rpp / lib / rpp / include / types.h
1 /**
2  * RPP API types definition header file.
3  *
4  * @file types.h
5  *
6  * @copyright Copyright (C) 2013 Czech Technical University in Prague
7  *
8  * @author Carlos Jenkins <carlos@jenkins.co.cr>
9  */
10
11 #ifndef __RPP_TYPES_H
12 #define __RPP_TYPES_H
13
14
15 #ifndef NULL
16 /**
17  * NULL definition
18  */
19 #define NULL ((void *) 0U)
20 #endif
21
22
23 #ifndef TRUE
24 /**
25  * Boolean definition for TRUE
26  */
27 #define TRUE 1
28 #endif
29
30
31 #ifndef FALSE
32 /**
33  * Boolean definition for FALSE
34  */
35 #define FALSE 0
36 #endif
37
38
39 /**
40  * Logic definition for logic HIGH
41  */
42 #define HIGH TRUE
43
44
45 /**
46  * Logic definition for logic LOW
47  */
48 #define LOW FALSE
49
50
51 /**
52  * Definition for SUCCESS
53  */
54 #define SUCCESS 0
55
56
57 /**
58  * Definition for FAILURE
59  */
60 #define FAILURE -1
61
62
63 // Note: Sadly <stdint.h> is not available with CCS tools.
64 #ifdef __GNUC__
65
66 #include <stdint.h>
67 #include <stdbool.h>
68 typedef bool boolean_t;
69
70 #else
71
72 /**
73  * Unsigned 64 bits integer datatype definition.
74  */
75 typedef unsigned long long uint64_t;
76
77
78 /**
79  * Unsigned 32 bits integer datatype definition.
80  */
81 typedef unsigned int uint32_t;
82
83
84 /**
85  * Unsigned 16 bits integer datatype definition.
86  */
87 typedef unsigned short uint16_t;
88
89
90 /**
91  * Unsigned 8 bits integer datatype definition.
92  */
93 typedef unsigned char uint8_t;
94
95
96 /**
97  * Signed 64 bits integer datatype definition.
98  */
99 typedef signed long long int64_t;
100
101
102 /**
103  * Signed 32 bits integer datatype definition.
104  */
105 typedef signed int int32_t;
106
107
108 /**
109  * Signed 16 bits integer datatype definition.
110  */
111 typedef signed short int16_t;
112
113
114 /**
115  * Signed 8 bits integer datatype definition.
116  */
117 typedef signed char int8_t;
118
119
120 /**
121  * Boolean datatype definition.
122  */
123 typedef unsigned char boolean_t;
124
125 #endif /* __GNUC__ */
126
127 #endif /* __RPP_TYPES_H */