OS  v7.3.3
Documentation
Loading...
Searching...
No Matches
qtypes.h
1
8#ifndef QTYPES_H
9 #define QTYPES_H
10
11 #include <stdlib.h>
12
13 #ifndef QCONFIG_H /*if this file available?*/
14 #include "qconfig.h"
15 #endif
16
17 #ifndef Q_USE_STDINT_H
18 #define Q_USE_STDINT_H ( 1 )
19 #endif
20
21 #if ( Q_USE_STDINT_H != 1 )
22 #warning Disposing standard types can cause portability issues and undefined behaviors. QuarkTS produce similar definitions based on the common sizes of native types, however, this sizes can vary because they are implementation-defined across different compilers and cores. Use this setting at your own risk.
23 #endif
24
25 #ifndef NULL
26 #define NULL ( (void*)0 )
27 #endif
28
29 #define Q_UNUSED(arg) (void)(arg)
30 #define Q_NONE /*EMPTY MACRO*/
31
39 #if ( Q_USE_STDINT_H == 1 )
40 #include <stdint.h>
41 /*Unsigned types*/
42
44 typedef uint8_t qUINT8_t;
46 typedef uint16_t qUINT16_t;
48 typedef uint32_t qUINT32_t;
49 /*Signed types*/
51 typedef int8_t qINT8_t;
53 typedef int16_t qINT16_t;
55 typedef int32_t qINT32_t;
56 #else
57 #ifndef INT8_MIN
58 #define INT8_MIN ( -128 )
59 #endif
60 #ifndef INT8_MAX
61 #define INT8_MAX ( 127 )
62 #endif
63 #ifndef UINT8_MAX
64 #define UINT8_MAX ( 255U )
65 #endif
66 #ifndef INT16_MIN
67 #define INT16_MIN ( -32768 )
68 #endif
69 #ifndef INT16_MAX
70 #define INT16_MAX ( 32767 )
71 #endif
72 #ifndef UINT16_MAX
73 #define UINT16_MAX ( 65535U )
74 #endif
75 #ifndef INT32_MIN
76 #define INT32_MIN ( -2147483647-1 )
77 #endif
78 #ifndef INT32_MAX
79 #define INT32_MAX ( 2147483647 )
80 #endif
81 #ifndef UINT32_MAX
82 #define UINT32_MAX ( 4294967295U )
83 #endif
84 /*Unsigned types*/
85 typedef unsigned char qUINT8_t;
86 typedef unsigned short qUINT16_t;
87 typedef unsigned long qUINT32_t; /*Not always true, be careful with this definition */
88
89 /*Signed types*/
90 typedef signed char qINT8_t;
91 typedef short qINT16_t;
92 typedef long qINT32_t; /*Not always true, be careful with this definition */
93
94 #endif
95
100
105 typedef int qBase_t;
106
111 typedef float qFloat32_t; /*this is not always true in some compilers*/
112
117 typedef double qFloat64_t; /*this is not always true in some compilers*/
118
124
130
135
140
146 typedef size_t qIndex_t; /*better portability*/
147
153
157 #define qFalse ( (qBool_t)0x00U )
158
162 #define qTrue ( (qBool_t)0x01U )
163
167 #define qEnabled ( (qState_t)0x01U )
168
172 #define qDisabled ( (qState_t)0x00U )
173
177 #define qAwake ( 2U )
178
182 #define qAsleep ( 3U )
183
187 #define qLink ( qTrue )
188
192 #define qUnLink ( qFalse )
193
195 #define qIgnore ( (qBool_t)0xFEU )
196 #define qLINK ( qTrue )
197 #define qUNLINK ( qFalse )
198 #define qATTACH ( qTrue )
199 #define qDETACH ( qFalse )
200 #define qAttach ( qTrue )
201 #define qDetach ( qFalse )
207 #define qResponseTimeout ( (qBool_t)0x02U )
208
212 #define qRising ( (qBool_t)0x03U )
213
217 #define qFalling ( (qBool_t)0x04U )
218
222 #define qUnknown ( (qBool_t)0xFFU )
223
227 #define qRESPONSETIMEOUT ( qResponseTimeout )
228 #define qRISING ( qRising )
229 #define qFALLING ( qFalling )
230 #define qUNKNOWN ( qUnknown )
233#endif
double qFloat64_t
A type to instantiate a double-precision variable of 64-bits IEEE 754.
Definition qtypes.h:117
qUINT32_t qCycles_t
A type to instantiate a variable that hold the number of task cycles.
Definition qtypes.h:152
qUINT8_t qBool_t
A type to instantiate an OS boolean variable.
Definition qtypes.h:139
int qBase_t
A type to instantiate a integer-base variable. This type is compiler implementation-defined.
Definition qtypes.h:105
uint8_t qUINT8_t
Unsigned integer type with width of exactly 8 bits respectively.
Definition qtypes.h:44
size_t qIndex_t
A type to instantiate an OS index variable. Can store the maximum size of a theoretically possible ob...
Definition qtypes.h:146
qUINT8_t qByte_t
A type to instantiate a byte variable.
Definition qtypes.h:99
qINT32_t qIteration_t
A type to instantiate a variable that hold the number of task iterations.
Definition qtypes.h:129
qUINT8_t qState_t
A type to instantiate an OS state value.
Definition qtypes.h:134
int16_t qINT16_t
Signed integer type with width of exactly 16 bits respectively.
Definition qtypes.h:53
uint32_t qUINT32_t
Unsigned integer type with width of exactly 32 bits respectively.
Definition qtypes.h:48
int32_t qINT32_t
Signed integer type with width of exactly 32 bits respectively.
Definition qtypes.h:55
uint16_t qUINT16_t
Unsigned integer type with width of exactly 16 bits respectively.
Definition qtypes.h:46
int8_t qINT8_t
Signed integer type with width of exactly 8 bits respectively.
Definition qtypes.h:51
qUINT8_t qPriority_t
A type to instantiate a variable to hold the priority value of a task.
Definition qtypes.h:123
float qFloat32_t
A type to instantiate a single-precision variable of 32-bits IEEE 754.
Definition qtypes.h:111