ChibiOS/NIL  3.2.2
chconf.h
Go to the documentation of this file.
1 /*
2  ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
17 /**
18  * @file nil/templates/chconf.h
19  * @brief Configuration file template.
20  * @details A copy of this file must be placed in each project directory, it
21  * contains the application specific kernel settings.
22  *
23  * @addtogroup NIL_CONFIG
24  * @details Kernel related settings and hooks.
25  * @{
26  */
27 
28 #ifndef CHCONF_H
29 #define CHCONF_H
30 
31 #define _CHIBIOS_NIL_CONF_
32 #define _CHIBIOS_NIL_CONF_VER_3_2_
33 
34 /*===========================================================================*/
35 /**
36  * @name Kernel parameters and options
37  * @{
38  */
39 /*===========================================================================*/
40 
41 /**
42  * @brief Number of user threads in the application.
43  * @note This number is not inclusive of the idle thread which is
44  * Implicitly handled.
45  */
46 #define CH_CFG_NUM_THREADS 3
47 
48 /** @} */
49 
50 /*===========================================================================*/
51 /**
52  * @name System timer settings
53  * @{
54  */
55 /*===========================================================================*/
56 
57 /**
58  * @brief System time counter resolution.
59  * @note Allowed values are 16 or 32 bits.
60  */
61 #define CH_CFG_ST_RESOLUTION 32
62 
63 /**
64  * @brief System tick frequency.
65  * @note This value together with the @p CH_CFG_ST_RESOLUTION
66  * option defines the maximum amount of time allowed for
67  * timeouts.
68  */
69 #define CH_CFG_ST_FREQUENCY 1000
70 
71 /**
72  * @brief Time delta constant for the tick-less mode.
73  * @note If this value is zero then the system uses the classic
74  * periodic tick. This value represents the minimum number
75  * of ticks that is safe to specify in a timeout directive.
76  * The value one is not valid, timeouts are rounded up to
77  * this value.
78  */
79 #define CH_CFG_ST_TIMEDELTA 0
80 
81 /** @} */
82 
83 /*===========================================================================*/
84 /**
85  * @name Subsystem options
86  * @{
87  */
88 /*===========================================================================*/
89 
90 /**
91  * @brief Semaphores APIs.
92  * @details If enabled then the Semaphores APIs are included in the kernel.
93  *
94  * @note The default is @p TRUE.
95  */
96 #define CH_CFG_USE_SEMAPHORES TRUE
97 
98 /**
99  * @brief Mutexes APIs.
100  * @details If enabled then the mutexes APIs are included in the kernel.
101  *
102  * @note Feature not currently implemented.
103  * @note The default is @p FALSE.
104  */
105 #define CH_CFG_USE_MUTEXES FALSE
106 
107 /**
108  * @brief Events Flags APIs.
109  * @details If enabled then the event flags APIs are included in the kernel.
110  *
111  * @note The default is @p TRUE.
112  */
113 #define CH_CFG_USE_EVENTS TRUE
114 
115 /**
116  * @brief Mailboxes APIs.
117  * @details If enabled then the asynchronous messages (mailboxes) APIs are
118  * included in the kernel.
119  *
120  * @note The default is @p TRUE.
121  * @note Requires @p CH_CFG_USE_SEMAPHORES.
122  */
123 #define CH_CFG_USE_MAILBOXES TRUE
124 
125 /**
126  * @brief Core Memory Manager APIs.
127  * @details If enabled then the core memory manager APIs are included
128  * in the kernel.
129  *
130  * @note The default is @p TRUE.
131  */
132 #define CH_CFG_USE_MEMCORE TRUE
133 
134 /**
135  * @brief Heap Allocator APIs.
136  * @details If enabled then the memory heap allocator APIs are included
137  * in the kernel.
138  *
139  * @note The default is @p TRUE.
140  */
141 #define CH_CFG_USE_HEAP TRUE
142 
143 /**
144  * @brief Memory Pools Allocator APIs.
145  * @details If enabled then the memory pools allocator APIs are included
146  * in the kernel.
147  *
148  * @note The default is @p TRUE.
149  */
150 #define CH_CFG_USE_MEMPOOLS TRUE
151 
152 /**
153  * @brief Objects FIFOs APIs.
154  * @details If enabled then the objects FIFOs APIs are included
155  * in the kernel.
156  *
157  * @note The default is @p TRUE.
158  */
159 #define CH_CFG_USE_OBJ_FIFOS TRUE
160 
161 /**
162  * @brief Pipes APIs.
163  * @details If enabled then the pipes APIs are included
164  * in the kernel.
165  *
166  * @note The default is @p TRUE.
167  */
168 #define CH_CFG_USE_PIPES TRUE
169 
170 /**
171  * @brief Managed RAM size.
172  * @details Size of the RAM area to be managed by the OS. If set to zero
173  * then the whole available RAM is used. The core memory is made
174  * available to the heap allocator and/or can be used directly through
175  * the simplified core memory allocator.
176  *
177  * @note In order to let the OS manage the whole RAM the linker script must
178  * provide the @p __heap_base__ and @p __heap_end__ symbols.
179  * @note Requires @p CH_CFG_USE_MEMCORE.
180  */
181 #define CH_CFG_MEMCORE_SIZE 0
182 
183 /** @} */
184 
185 /*===========================================================================*/
186 /**
187  * @name Objects factory options
188  * @{
189  */
190 /*===========================================================================*/
191 
192 /**
193  * @brief Objects Factory APIs.
194  * @details If enabled then the objects factory APIs are included in the
195  * kernel.
196  *
197  * @note The default is @p FALSE.
198  */
199 #define CH_CFG_USE_FACTORY TRUE
200 
201 /**
202  * @brief Maximum length for object names.
203  * @details If the specified length is zero then the name is stored by
204  * pointer but this could have unintended side effects.
205  */
206 #define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8
207 
208 /**
209  * @brief Enables the registry of generic objects.
210  */
211 #define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
212 
213 /**
214  * @brief Enables factory for generic buffers.
215  */
216 #define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
217 
218 /**
219  * @brief Enables factory for semaphores.
220  */
221 #define CH_CFG_FACTORY_SEMAPHORES TRUE
222 
223 /**
224  * @brief Enables factory for mailboxes.
225  */
226 #define CH_CFG_FACTORY_MAILBOXES TRUE
227 
228 /**
229  * @brief Enables factory for objects FIFOs.
230  */
231 #define CH_CFG_FACTORY_OBJ_FIFOS TRUE
232 
233 /**
234  * @brief Enables factory for Pipes.
235  */
236 #define CH_CFG_FACTORY_PIPES TRUE
237 
238 /** @} */
239 
240 /*===========================================================================*/
241 /**
242  * @name Debug options
243  * @{
244  */
245 /*===========================================================================*/
246 
247 /**
248  * @brief Debug option, kernel statistics.
249  *
250  * @note Feature not currently implemented.
251  * @note The default is @p FALSE.
252  */
253 #define CH_DBG_STATISTICS FALSE
254 
255 /**
256  * @brief Debug option, system state check.
257  *
258  * @note The default is @p FALSE.
259  */
260 #define CH_DBG_SYSTEM_STATE_CHECK TRUE
261 
262 /**
263  * @brief Debug option, parameters checks.
264  *
265  * @note The default is @p FALSE.
266  */
267 #define CH_DBG_ENABLE_CHECKS TRUE
268 
269 /**
270  * @brief System assertions.
271  *
272  * @note The default is @p FALSE.
273  */
274 #define CH_DBG_ENABLE_ASSERTS TRUE
275 
276 /**
277  * @brief Stack check.
278  *
279  * @note The default is @p FALSE.
280  */
281 #define CH_DBG_ENABLE_STACK_CHECK TRUE
282 
283 /** @} */
284 
285 /*===========================================================================*/
286 /**
287  * @name Kernel hooks
288  * @{
289  */
290 /*===========================================================================*/
291 
292 /**
293  * @brief System initialization hook.
294  */
295 #if !defined(CH_CFG_SYSTEM_INIT_HOOK) || defined(__DOXYGEN__)
296 #define CH_CFG_SYSTEM_INIT_HOOK() { \
297 }
298 #endif
299 
300 /**
301  * @brief Threads descriptor structure extension.
302  * @details User fields added to the end of the @p thread_t structure.
303  */
304 #define CH_CFG_THREAD_EXT_FIELDS \
305  /* Add threads custom fields here.*/
306 
307 /**
308  * @brief Threads initialization hook.
309  */
310 #define CH_CFG_THREAD_EXT_INIT_HOOK(tr) { \
311  /* Add custom threads initialization code here.*/ \
312 }
313 
314 /**
315  * @brief Idle thread enter hook.
316  * @note This hook is invoked within a critical zone, no OS functions
317  * should be invoked from here.
318  * @note This macro can be used to activate a power saving mode.
319  */
320 #define CH_CFG_IDLE_ENTER_HOOK() { \
321 }
322 
323 /**
324  * @brief Idle thread leave hook.
325  * @note This hook is invoked within a critical zone, no OS functions
326  * should be invoked from here.
327  * @note This macro can be used to deactivate a power saving mode.
328  */
329 #define CH_CFG_IDLE_LEAVE_HOOK() { \
330 }
331 
332 /**
333  * @brief System halt hook.
334  */
335 #if !defined(CH_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
336 #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
337 }
338 #endif
339 
340 /** @} */
341 
342 /*===========================================================================*/
343 /* Port-specific settings (override port settings defaulted in nilcore.h). */
344 /*===========================================================================*/
345 
346 #endif /* CHCONF_H */
347 
348 /** @} */