ChibiOS/NIL  3.2.2
chlib.h
Go to the documentation of this file.
1 /*
2  ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio.
3 
4  This file is part of ChibiOS.
5 
6  ChibiOS is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 3 of the License, or
9  (at your option) any later version.
10 
11  ChibiOS is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 /**
21  * @file chlib.h
22  * @brief ChibiOS/LIB main include file.
23  * @details This header includes all the required library headers. This file
24  * is meant do be included by @p ch.h not directly by user.
25  *
26  * @addtogroup oslib_info
27  * @details OS Library related info.
28  * @{
29  */
30 
31 #ifndef CHLIB_H
32 #define CHLIB_H
33 
34 /*===========================================================================*/
35 /* Module constants. */
36 /*===========================================================================*/
37 
38 /**
39  * @brief ChibiOS/LIB identification macro.
40  */
41 #define _CHIBIOS_OSLIB_
42 
43 /**
44  * @brief Stable release flag.
45  */
46 #define CH_OSLIB_STABLE 1
47 
48 /**
49  * @name ChibiOS/LIB version identification
50  * @{
51  */
52 /**
53  * @brief OS Library version string.
54  */
55 #define CH_OSLIB_VERSION "1.1.2"
56 
57 /**
58  * @brief OS Library version major number.
59  */
60 #define CH_OSLIB_MAJOR 1
61 
62 /**
63  * @brief OS Library version minor number.
64  */
65 #define CH_OSLIB_MINOR 1
66 
67 /**
68  * @brief OS Library version patch number.
69  */
70 #define CH_OSLIB_PATCH 2
71 /** @} */
72 
73 /*===========================================================================*/
74 /* Module pre-compile time settings. */
75 /*===========================================================================*/
76 
77 /*===========================================================================*/
78 /* Derived constants and error checks. */
79 /*===========================================================================*/
80 
81 /* Host OS checks.*/
82 #if !defined(_CHIBIOS_RT_) && !defined(_CHIBIOS_NIL_)
83 #error "OS check failed, must be included after ch.h"
84 #endif
85 
86 /* Configuration file checks.*/
87 #if !defined(CH_CFG_USE_MAILBOXES)
88 #error "CH_CFG_USE_MAILBOXES not defined in chconf.h"
89 #endif
90 
91 #if !defined(CH_CFG_USE_MEMCORE)
92 #error "CH_CFG_USE_MEMCORE not defined in chconf.h"
93 #endif
94 
95 #if !defined(CH_CFG_USE_HEAP)
96 #error "CH_CFG_USE_HEAP not defined in chconf.h"
97 #endif
98 
99 #if !defined(CH_CFG_USE_MEMPOOLS)
100 #error "CH_CFG_USE_MEMPOOLS not defined in chconf.h"
101 #endif
102 
103 #if !defined(CH_CFG_USE_OBJ_FIFOS)
104 #error "CH_CFG_USE_OBJ_FIFOS not defined in chconf.h"
105 #endif
106 
107 #if !defined(CH_CFG_USE_PIPES)
108 #error "CH_CFG_USE_PIPES not defined in chconf.h"
109 #endif
110 
111 /* Objects factory options checks.*/
112 #if !defined(CH_CFG_USE_FACTORY)
113 #error "CH_CFG_USE_FACTORY not defined in chconf.h"
114 #endif
115 
116 #if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
117 #error "CH_CFG_FACTORY_MAX_NAMES_LENGTH not defined in chconf.h"
118 #endif
119 
120 #if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
121 #error "CH_CFG_FACTORY_OBJECTS_REGISTRY not defined in chconf.h"
122 #endif
123 
124 #if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
125 #error "CH_CFG_FACTORY_GENERIC_BUFFERS not defined in chconf.h"
126 #endif
127 
128 #if !defined(CH_CFG_FACTORY_SEMAPHORES)
129 #error "CH_CFG_FACTORY_SEMAPHORES not defined in chconf.h"
130 #endif
131 
132 #if !defined(CH_CFG_FACTORY_MAILBOXES)
133 #error "CH_CFG_FACTORY_MAILBOXES not defined in chconf.h"
134 #endif
135 
136 #if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
137 #error "CH_CFG_FACTORY_OBJ_FIFOS not defined in chconf.h"
138 #endif
139 
140 /* License checks.*/
141 #if !defined(CH_CUSTOMER_LIC_OSLIB) || !defined(CH_LICENSE_FEATURES)
142 #error "malformed chlicense.h"
143 #endif
144 
145 #if CH_CUSTOMER_LIC_OSLIB== FALSE
146 #error "ChibiOS/LIB not licensed"
147 #endif
148 
149 #if (CH_LICENSE_FEATURES != CH_FEATURES_FULL) && \
150  (CH_LICENSE_FEATURES != CH_FEATURES_INTERMEDIATE) && \
151  (CH_LICENSE_FEATURES != CH_FEATURES_BASIC)
152 #error "invalid CH_LICENSE_FEATURES setting"
153 #endif
154 
155 /* Restrictions in basic and intermediate modes.*/
156 #if (CH_CUSTOMER_LIC_OSLIB == FALSE) || \
157  (CH_LICENSE_FEATURES == CH_FEATURES_INTERMEDIATE) || \
158  (CH_LICENSE_FEATURES == CH_FEATURES_BASIC)
159 
160 /* Restricted subsystems.*/
161 #undef CH_CFG_USE_FACTORY
162 
163 #define CH_CFG_USE_FACTORY FALSE
164 
165 #endif /* (CH_CUSTOMER_LIC_OSLIB == FALSE) ||
166  (CH_LICENSE_FEATURES == CH_FEATURES_INTERMEDIATE) ||
167  (CH_LICENSE_FEATURES == CH_FEATURES_BASIC) */
168 
169 /* Restrictions in basic mode.*/
170 #if (CH_CUSTOMER_LIC_OSLIB == FALSE) || \
171  (CH_LICENSE_FEATURES == CH_FEATURES_BASIC)
172 
173 /* Restricted subsystems.*/
174 #undef CH_CFG_USE_MEMCORE
175 #undef CH_CFG_USE_HEAP
176 #undef CH_CFG_USE_MEMPOOLS
177 #undef CH_CFG_USE_OBJ_FIFOS
178 #undef CH_CFG_USE_PIPES
179 
180 #define CH_CFG_USE_MEMCORE FALSE
181 #define CH_CFG_USE_HEAP FALSE
182 #define CH_CFG_USE_MEMPOOLS FALSE
183 #define CH_CFG_USE_OBJ_FIFOS FALSE
184 #define CH_CFG_USE_PIPES FALSE
185 
186 #endif /* (CH_CUSTOMER_LIC_OSLIB == FALSE) ||
187  (CH_LICENSE_FEATURES == CH_FEATURES_BASIC) */
188 
189 /*===========================================================================*/
190 /* Module data structures and types. */
191 /*===========================================================================*/
192 
193 /*===========================================================================*/
194 /* Module macros. */
195 /*===========================================================================*/
196 
197 /*===========================================================================*/
198 /* External declarations. */
199 /*===========================================================================*/
200 
201 /*===========================================================================*/
202 /* Late inclusions. */
203 /*===========================================================================*/
204 
205 /* OS Library headers.*/
206 #include "chbsem.h"
207 #include "chmboxes.h"
208 #include "chmemcore.h"
209 #include "chmemheaps.h"
210 #include "chmempools.h"
211 #include "chobjfifos.h"
212 #include "chpipes.h"
213 #include "chfactory.h"
214 
215 #endif /* CHLIB_H */
216 
217 /** @} */
ChibiOS objects factory structures and macros.
Binary semaphores structures and macros.
Memory Pools macros and structures.
Core memory manager macros and structures.
Objects FIFO structures and macros.
Mailboxes macros and structures.
Memory heaps macros and structures.
Pipes macros and structures.