ChibiOS  0.0.0
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_LIB_
42 
43 /**
44  * @brief Stable release flag.
45  */
46 #define CH_OSLIB_STABLE 0
47 
48 /**
49  * @name ChibiOS/LIB version identification
50  * @{
51  */
52 /**
53  * @brief OS Library version string.
54  */
55 #define CH_OSLIB_VERSION "1.0.0"
56 
57 /**
58  * @brief Kernel version major number.
59  */
60 #define CH_OSLIB_MAJOR 1
61 
62 /**
63  * @brief Kernel version minor number.
64  */
65 #define CH_OSLIB_MINOR 0
66 
67 /**
68  * @brief Kernel version patch number.
69  */
70 #define CH_OSLIB_PATCH 0
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 /* License checks.*/
87 #if !defined(CH_CUSTOMER_LIC_LIB) || !defined(CH_LICENSE_FEATURES)
88 #error "malformed chlicense.h"
89 #endif
90 
91 #if CH_CUSTOMER_LIC_LIB== FALSE
92 #error "ChibiOS/LIB not licensed"
93 #endif
94 
95 #if (CH_LICENSE_FEATURES != CH_FEATURES_FULL) && \
96  (CH_LICENSE_FEATURES != CH_FEATURES_INTERMEDIATE) && \
97  (CH_LICENSE_FEATURES != CH_FEATURES_BASIC)
98 #error "invalid CH_LICENSE_FEATURES setting"
99 #endif
100 
101 /* Restrictions in basic and intermediate modes.*/
102 #if (CH_CUSTOMER_LIC_LIB == FALSE) || \
103  (CH_LICENSE_FEATURES == CH_FEATURES_INTERMEDIATE) || \
104  (CH_LICENSE_FEATURES == CH_FEATURES_BASIC)
105 
106 /* Restricted subsystems.*/
107 #undef CH_CFG_USE_FACTORY
108 
109 #define CH_CFG_USE_FACTORY FALSE
110 
111 #endif /* (CH_CUSTOMER_LIC_LIB == FALSE) || \
112  (CH_LICENSE_FEATURES == CH_FEATURES_INTERMEDIATE) ||
113  (CH_LICENSE_FEATURES == CH_FEATURES_BASIC) */
114 
115 /* Restrictions in basic mode.*/
116 #if (CH_CUSTOMER_LIC_LIB == FALSE) || \
117  (CH_LICENSE_FEATURES == CH_FEATURES_BASIC)
118 
119 /* Restricted subsystems.*/
120 #undef CH_CFG_USE_MEMCORE
121 #undef CH_CFG_USE_HEAP
122 #undef CH_CFG_USE_MEMPOOLS
123 #undef CH_CFG_USE_OBJ_FIFOS
124 #undef CH_CFG_USE_PIPES
125 
126 #define CH_CFG_USE_MEMCORE FALSE
127 #define CH_CFG_USE_HEAP FALSE
128 #define CH_CFG_USE_MEMPOOLS FALSE
129 #define CH_CFG_USE_OBJ_FIFOS FALSE
130 #define CH_CFG_USE_PIPES FALSE
131 
132 #endif /* (CH_CUSTOMER_LIC_LIB == FALSE) || \
133  (CH_LICENSE_FEATURES == CH_FEATURES_BASIC) */
134 
135 /* Configuration file checks.*/
136 #if !defined(CH_CFG_USE_SEMAPHORES)
137 #error "CH_CFG_USE_SEMAPHORES not defined in chconf.h"
138 #endif
139 
140 #if !defined(CH_CFG_USE_MAILBOXES)
141 #error "CH_CFG_USE_MAILBOXES not defined in chlibconf.h"
142 #endif
143 
144 #if !defined(CH_CFG_USE_MEMCORE)
145 #error "CH_CFG_USE_MEMCORE not defined in chlibconf.h"
146 #endif
147 
148 #if !defined(CH_CFG_USE_HEAP)
149 #error "CH_CFG_USE_HEAP not defined in chlibconf.h"
150 #endif
151 
152 #if !defined(CH_CFG_USE_MEMPOOLS)
153 #error "CH_CFG_USE_MEMPOOLS not defined in chlibconf.h"
154 #endif
155 
156 #if !defined(CH_CFG_USE_OBJ_FIFOS)
157 #error "CH_CFG_USE_OBJ_FIFOS not defined in chlibconf.h"
158 #endif
159 
160 //#if !defined(CH_CFG_USE_PIPES)
161 //#error "CH_CFG_USE_PIPES not defined in chlibconf.h"
162 //#endif
163 
164 /* Objects factory options checks.*/
165 #if !defined(CH_CFG_USE_FACTORY)
166 #error "CH_CFG_USE_FACTORY not defined in chlibconf.h"
167 #endif
168 
169 #if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
170 #error "CH_CFG_FACTORY_MAX_NAMES_LENGTH not defined in chlibconf.h"
171 #endif
172 
173 #if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
174 #error "CH_CFG_FACTORY_OBJECTS_REGISTRY not defined in chlibconf.h"
175 #endif
176 
177 #if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
178 #error "CH_CFG_FACTORY_GENERIC_BUFFERS not defined in chlibconf.h"
179 #endif
180 
181 #if !defined(CH_CFG_FACTORY_SEMAPHORES)
182 #error "CH_CFG_FACTORY_SEMAPHORES not defined in chlibconf.h"
183 #endif
184 
185 #if !defined(CH_CFG_FACTORY_MAILBOXES)
186 #error "CH_CFG_FACTORY_MAILBOXES not defined in chlibconf.h"
187 #endif
188 
189 #if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
190 #error "CH_CFG_FACTORY_OBJ_FIFOS not defined in chlibconf.h"
191 #endif
192 
193 /*===========================================================================*/
194 /* Module data structures and types. */
195 /*===========================================================================*/
196 
197 /*===========================================================================*/
198 /* Module macros. */
199 /*===========================================================================*/
200 
201 /*===========================================================================*/
202 /* External declarations. */
203 /*===========================================================================*/
204 
205 /*===========================================================================*/
206 /* Late inclusions. */
207 /*===========================================================================*/
208 
209 /* OS Library headers.*/
210 #include "chbsem.h"
211 #include "chmboxes.h"
212 #include "chmemcore.h"
213 #include "chmemheaps.h"
214 #include "chmempools.h"
215 #include "chobjfifos.h"
216 //#include "chpipes.h"
217 #include "chfactory.h"
218 
219 #endif /* CHLIB_H */
220 
221 /** @} */
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.