diff options
author | Akshay <[email protected]> | 2022-04-10 12:13:40 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2022-04-10 12:13:40 +0100 |
commit | dc90387ce7d8ba7b607d9c48540bf6d8b560f14d (patch) | |
tree | 4ccb8fa5886b66fa9d480edef74236c27f035e16 /lib/chibios/testex/STM32 |
Diffstat (limited to 'lib/chibios/testex/STM32')
98 files changed, 30403 insertions, 0 deletions
diff --git a/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/Makefile b/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/Makefile new file mode 100644 index 000000000..37e27715a --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/Makefile | |||
@@ -0,0 +1,189 @@ | |||
1 | ############################################################################## | ||
2 | # Build global options | ||
3 | # NOTE: Can be overridden externally. | ||
4 | # | ||
5 | |||
6 | # Compiler options here. | ||
7 | ifeq ($(USE_OPT),) | ||
8 | USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 | ||
9 | endif | ||
10 | |||
11 | # C specific options here (added to USE_OPT). | ||
12 | ifeq ($(USE_COPT),) | ||
13 | USE_COPT = | ||
14 | endif | ||
15 | |||
16 | # C++ specific options here (added to USE_OPT). | ||
17 | ifeq ($(USE_CPPOPT),) | ||
18 | USE_CPPOPT = -fno-rtti | ||
19 | endif | ||
20 | |||
21 | # Enable this if you want the linker to remove unused code and data. | ||
22 | ifeq ($(USE_LINK_GC),) | ||
23 | USE_LINK_GC = yes | ||
24 | endif | ||
25 | |||
26 | # Linker extra options here. | ||
27 | ifeq ($(USE_LDOPT),) | ||
28 | USE_LDOPT = | ||
29 | endif | ||
30 | |||
31 | # Enable this if you want link time optimizations (LTO). | ||
32 | ifeq ($(USE_LTO),) | ||
33 | USE_LTO = yes | ||
34 | endif | ||
35 | |||
36 | # Enable this if you want to see the full log while compiling. | ||
37 | ifeq ($(USE_VERBOSE_COMPILE),) | ||
38 | USE_VERBOSE_COMPILE = no | ||
39 | endif | ||
40 | |||
41 | # If enabled, this option makes the build process faster by not compiling | ||
42 | # modules not used in the current configuration. | ||
43 | ifeq ($(USE_SMART_BUILD),) | ||
44 | USE_SMART_BUILD = yes | ||
45 | endif | ||
46 | |||
47 | # | ||
48 | # Build global options | ||
49 | ############################################################################## | ||
50 | |||
51 | ############################################################################## | ||
52 | # Architecture or project specific options | ||
53 | # | ||
54 | |||
55 | # Stack size to be allocated to the Cortex-M process stack. This stack is | ||
56 | # the stack used by the main() thread. | ||
57 | ifeq ($(USE_PROCESS_STACKSIZE),) | ||
58 | USE_PROCESS_STACKSIZE = 0x400 | ||
59 | endif | ||
60 | |||
61 | # Stack size to the allocated to the Cortex-M main/exceptions stack. This | ||
62 | # stack is used for processing interrupts and exceptions. | ||
63 | ifeq ($(USE_EXCEPTIONS_STACKSIZE),) | ||
64 | USE_EXCEPTIONS_STACKSIZE = 0x400 | ||
65 | endif | ||
66 | |||
67 | # Enables the use of FPU (no, softfp, hard). | ||
68 | ifeq ($(USE_FPU),) | ||
69 | USE_FPU = hard | ||
70 | endif | ||
71 | |||
72 | # FPU-related options. | ||
73 | ifeq ($(USE_FPU_OPT),) | ||
74 | USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 | ||
75 | endif | ||
76 | |||
77 | # | ||
78 | # Architecture or project specific options | ||
79 | ############################################################################## | ||
80 | |||
81 | ############################################################################## | ||
82 | # Project, target, sources and paths | ||
83 | # | ||
84 | |||
85 | # Define project name here | ||
86 | PROJECT = ch | ||
87 | |||
88 | # Target settings. | ||
89 | MCU = cortex-m4 | ||
90 | |||
91 | # Imported source files and paths. | ||
92 | CHIBIOS := ../../../.. | ||
93 | CONFDIR := ./cfg | ||
94 | BUILDDIR := ./build | ||
95 | DEPDIR := ./.dep | ||
96 | |||
97 | # Licensing files. | ||
98 | include $(CHIBIOS)/os/license/license.mk | ||
99 | # Startup files. | ||
100 | include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk | ||
101 | # HAL-OSAL files (optional). | ||
102 | include $(CHIBIOS)/os/hal/hal.mk | ||
103 | include $(CHIBIOS)/os/hal/ports/STM32/STM32F3xx/platform.mk | ||
104 | include $(CHIBIOS)/os/hal/boards/ST_STM32F3_DISCOVERY/board.mk | ||
105 | include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk | ||
106 | # RTOS files (optional). | ||
107 | include $(CHIBIOS)/os/rt/rt.mk | ||
108 | include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk | ||
109 | # EX files (optional). | ||
110 | include $(CHIBIOS)/os/ex/devices/ST/lsm303dlhc.mk | ||
111 | # Auto-build files in ./source recursively. | ||
112 | include $(CHIBIOS)/tools/mk/autobuild.mk | ||
113 | # Other files (optional). | ||
114 | include $(CHIBIOS)/os/hal/lib/streams/streams.mk | ||
115 | |||
116 | # Define linker script file here | ||
117 | LDSCRIPT= $(STARTUPLD)/STM32F303xC.ld | ||
118 | |||
119 | # C sources that can be compiled in ARM or THUMB mode depending on the global | ||
120 | # setting. | ||
121 | CSRC = $(ALLCSRC) \ | ||
122 | $(TESTSRC) \ | ||
123 | main.c | ||
124 | |||
125 | # C++ sources that can be compiled in ARM or THUMB mode depending on the global | ||
126 | # setting. | ||
127 | CPPSRC = $(ALLCPPSRC) | ||
128 | |||
129 | # List ASM source files here. | ||
130 | ASMSRC = $(ALLASMSRC) | ||
131 | |||
132 | # List ASM with preprocessor source files here. | ||
133 | ASMXSRC = $(ALLXASMSRC) | ||
134 | |||
135 | # Inclusion directories. | ||
136 | INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) | ||
137 | |||
138 | # Define C warning options here. | ||
139 | CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes | ||
140 | |||
141 | # Define C++ warning options here. | ||
142 | CPPWARN = -Wall -Wextra -Wundef | ||
143 | |||
144 | # | ||
145 | # Project, target, sources and paths | ||
146 | ############################################################################## | ||
147 | |||
148 | ############################################################################## | ||
149 | # Start of user section | ||
150 | # | ||
151 | |||
152 | # List all user C define here, like -D_DEBUG=1 | ||
153 | UDEFS = -DCHPRINTF_USE_FLOAT=1 | ||
154 | |||
155 | # Define ASM defines here | ||
156 | UADEFS = | ||
157 | |||
158 | # List all user directories here | ||
159 | UINCDIR = | ||
160 | |||
161 | # List the user directory to look for the libraries here | ||
162 | ULIBDIR = | ||
163 | |||
164 | # List all user libraries here | ||
165 | ULIBS = | ||
166 | |||
167 | # | ||
168 | # End of user section | ||
169 | ############################################################################## | ||
170 | |||
171 | ############################################################################## | ||
172 | # Common rules | ||
173 | # | ||
174 | |||
175 | RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk | ||
176 | include $(RULESPATH)/arm-none-eabi.mk | ||
177 | include $(RULESPATH)/rules.mk | ||
178 | |||
179 | # | ||
180 | # Common rules | ||
181 | ############################################################################## | ||
182 | |||
183 | ############################################################################## | ||
184 | # Custom rules | ||
185 | # | ||
186 | |||
187 | # | ||
188 | # Custom rules | ||
189 | ############################################################################## | ||
diff --git a/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/cfg/chconf.h b/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/cfg/chconf.h new file mode 100644 index 000000000..68759e0dd --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/cfg/chconf.h | |||
@@ -0,0 +1,756 @@ | |||
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 rt/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 config | ||
24 | * @details Kernel related settings and hooks. | ||
25 | * @{ | ||
26 | */ | ||
27 | |||
28 | #ifndef CHCONF_H | ||
29 | #define CHCONF_H | ||
30 | |||
31 | #define _CHIBIOS_RT_CONF_ | ||
32 | #define _CHIBIOS_RT_CONF_VER_6_1_ | ||
33 | |||
34 | /*===========================================================================*/ | ||
35 | /** | ||
36 | * @name System timers settings | ||
37 | * @{ | ||
38 | */ | ||
39 | /*===========================================================================*/ | ||
40 | |||
41 | /** | ||
42 | * @brief System time counter resolution. | ||
43 | * @note Allowed values are 16, 32 or 64 bits. | ||
44 | */ | ||
45 | #if !defined(CH_CFG_ST_RESOLUTION) | ||
46 | #define CH_CFG_ST_RESOLUTION 32 | ||
47 | #endif | ||
48 | |||
49 | /** | ||
50 | * @brief System tick frequency. | ||
51 | * @details Frequency of the system timer that drives the system ticks. This | ||
52 | * setting also defines the system tick time unit. | ||
53 | */ | ||
54 | #if !defined(CH_CFG_ST_FREQUENCY) | ||
55 | #define CH_CFG_ST_FREQUENCY 10000 | ||
56 | #endif | ||
57 | |||
58 | /** | ||
59 | * @brief Time intervals data size. | ||
60 | * @note Allowed values are 16, 32 or 64 bits. | ||
61 | */ | ||
62 | #if !defined(CH_CFG_INTERVALS_SIZE) | ||
63 | #define CH_CFG_INTERVALS_SIZE 32 | ||
64 | #endif | ||
65 | |||
66 | /** | ||
67 | * @brief Time types data size. | ||
68 | * @note Allowed values are 16 or 32 bits. | ||
69 | */ | ||
70 | #if !defined(CH_CFG_TIME_TYPES_SIZE) | ||
71 | #define CH_CFG_TIME_TYPES_SIZE 32 | ||
72 | #endif | ||
73 | |||
74 | /** | ||
75 | * @brief Time delta constant for the tick-less mode. | ||
76 | * @note If this value is zero then the system uses the classic | ||
77 | * periodic tick. This value represents the minimum number | ||
78 | * of ticks that is safe to specify in a timeout directive. | ||
79 | * The value one is not valid, timeouts are rounded up to | ||
80 | * this value. | ||
81 | */ | ||
82 | #if !defined(CH_CFG_ST_TIMEDELTA) | ||
83 | #define CH_CFG_ST_TIMEDELTA 2 | ||
84 | #endif | ||
85 | |||
86 | /** @} */ | ||
87 | |||
88 | /*===========================================================================*/ | ||
89 | /** | ||
90 | * @name Kernel parameters and options | ||
91 | * @{ | ||
92 | */ | ||
93 | /*===========================================================================*/ | ||
94 | |||
95 | /** | ||
96 | * @brief Round robin interval. | ||
97 | * @details This constant is the number of system ticks allowed for the | ||
98 | * threads before preemption occurs. Setting this value to zero | ||
99 | * disables the preemption for threads with equal priority and the | ||
100 | * round robin becomes cooperative. Note that higher priority | ||
101 | * threads can still preempt, the kernel is always preemptive. | ||
102 | * @note Disabling the round robin preemption makes the kernel more compact | ||
103 | * and generally faster. | ||
104 | * @note The round robin preemption is not supported in tickless mode and | ||
105 | * must be set to zero in that case. | ||
106 | */ | ||
107 | #if !defined(CH_CFG_TIME_QUANTUM) | ||
108 | #define CH_CFG_TIME_QUANTUM 0 | ||
109 | #endif | ||
110 | |||
111 | /** | ||
112 | * @brief Idle thread automatic spawn suppression. | ||
113 | * @details When this option is activated the function @p chSysInit() | ||
114 | * does not spawn the idle thread. The application @p main() | ||
115 | * function becomes the idle thread and must implement an | ||
116 | * infinite loop. | ||
117 | */ | ||
118 | #if !defined(CH_CFG_NO_IDLE_THREAD) | ||
119 | #define CH_CFG_NO_IDLE_THREAD FALSE | ||
120 | #endif | ||
121 | |||
122 | /** @} */ | ||
123 | |||
124 | /*===========================================================================*/ | ||
125 | /** | ||
126 | * @name Performance options | ||
127 | * @{ | ||
128 | */ | ||
129 | /*===========================================================================*/ | ||
130 | |||
131 | /** | ||
132 | * @brief OS optimization. | ||
133 | * @details If enabled then time efficient rather than space efficient code | ||
134 | * is used when two possible implementations exist. | ||
135 | * | ||
136 | * @note This is not related to the compiler optimization options. | ||
137 | * @note The default is @p TRUE. | ||
138 | */ | ||
139 | #if !defined(CH_CFG_OPTIMIZE_SPEED) | ||
140 | #define CH_CFG_OPTIMIZE_SPEED TRUE | ||
141 | #endif | ||
142 | |||
143 | /** @} */ | ||
144 | |||
145 | /*===========================================================================*/ | ||
146 | /** | ||
147 | * @name Subsystem options | ||
148 | * @{ | ||
149 | */ | ||
150 | /*===========================================================================*/ | ||
151 | |||
152 | /** | ||
153 | * @brief Time Measurement APIs. | ||
154 | * @details If enabled then the time measurement APIs are included in | ||
155 | * the kernel. | ||
156 | * | ||
157 | * @note The default is @p TRUE. | ||
158 | */ | ||
159 | #if !defined(CH_CFG_USE_TM) | ||
160 | #define CH_CFG_USE_TM TRUE | ||
161 | #endif | ||
162 | |||
163 | /** | ||
164 | * @brief Threads registry APIs. | ||
165 | * @details If enabled then the registry APIs are included in the kernel. | ||
166 | * | ||
167 | * @note The default is @p TRUE. | ||
168 | */ | ||
169 | #if !defined(CH_CFG_USE_REGISTRY) | ||
170 | #define CH_CFG_USE_REGISTRY TRUE | ||
171 | #endif | ||
172 | |||
173 | /** | ||
174 | * @brief Threads synchronization APIs. | ||
175 | * @details If enabled then the @p chThdWait() function is included in | ||
176 | * the kernel. | ||
177 | * | ||
178 | * @note The default is @p TRUE. | ||
179 | */ | ||
180 | #if !defined(CH_CFG_USE_WAITEXIT) | ||
181 | #define CH_CFG_USE_WAITEXIT TRUE | ||
182 | #endif | ||
183 | |||
184 | /** | ||
185 | * @brief Semaphores APIs. | ||
186 | * @details If enabled then the Semaphores APIs are included in the kernel. | ||
187 | * | ||
188 | * @note The default is @p TRUE. | ||
189 | */ | ||
190 | #if !defined(CH_CFG_USE_SEMAPHORES) | ||
191 | #define CH_CFG_USE_SEMAPHORES TRUE | ||
192 | #endif | ||
193 | |||
194 | /** | ||
195 | * @brief Semaphores queuing mode. | ||
196 | * @details If enabled then the threads are enqueued on semaphores by | ||
197 | * priority rather than in FIFO order. | ||
198 | * | ||
199 | * @note The default is @p FALSE. Enable this if you have special | ||
200 | * requirements. | ||
201 | * @note Requires @p CH_CFG_USE_SEMAPHORES. | ||
202 | */ | ||
203 | #if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY) | ||
204 | #define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE | ||
205 | #endif | ||
206 | |||
207 | /** | ||
208 | * @brief Mutexes APIs. | ||
209 | * @details If enabled then the mutexes APIs are included in the kernel. | ||
210 | * | ||
211 | * @note The default is @p TRUE. | ||
212 | */ | ||
213 | #if !defined(CH_CFG_USE_MUTEXES) | ||
214 | #define CH_CFG_USE_MUTEXES TRUE | ||
215 | #endif | ||
216 | |||
217 | /** | ||
218 | * @brief Enables recursive behavior on mutexes. | ||
219 | * @note Recursive mutexes are heavier and have an increased | ||
220 | * memory footprint. | ||
221 | * | ||
222 | * @note The default is @p FALSE. | ||
223 | * @note Requires @p CH_CFG_USE_MUTEXES. | ||
224 | */ | ||
225 | #if !defined(CH_CFG_USE_MUTEXES_RECURSIVE) | ||
226 | #define CH_CFG_USE_MUTEXES_RECURSIVE FALSE | ||
227 | #endif | ||
228 | |||
229 | /** | ||
230 | * @brief Conditional Variables APIs. | ||
231 | * @details If enabled then the conditional variables APIs are included | ||
232 | * in the kernel. | ||
233 | * | ||
234 | * @note The default is @p TRUE. | ||
235 | * @note Requires @p CH_CFG_USE_MUTEXES. | ||
236 | */ | ||
237 | #if !defined(CH_CFG_USE_CONDVARS) | ||
238 | #define CH_CFG_USE_CONDVARS TRUE | ||
239 | #endif | ||
240 | |||
241 | /** | ||
242 | * @brief Conditional Variables APIs with timeout. | ||
243 | * @details If enabled then the conditional variables APIs with timeout | ||
244 | * specification are included in the kernel. | ||
245 | * | ||
246 | * @note The default is @p TRUE. | ||
247 | * @note Requires @p CH_CFG_USE_CONDVARS. | ||
248 | */ | ||
249 | #if !defined(CH_CFG_USE_CONDVARS_TIMEOUT) | ||
250 | #define CH_CFG_USE_CONDVARS_TIMEOUT TRUE | ||
251 | #endif | ||
252 | |||
253 | /** | ||
254 | * @brief Events Flags APIs. | ||
255 | * @details If enabled then the event flags APIs are included in the kernel. | ||
256 | * | ||
257 | * @note The default is @p TRUE. | ||
258 | */ | ||
259 | #if !defined(CH_CFG_USE_EVENTS) | ||
260 | #define CH_CFG_USE_EVENTS TRUE | ||
261 | #endif | ||
262 | |||
263 | /** | ||
264 | * @brief Events Flags APIs with timeout. | ||
265 | * @details If enabled then the events APIs with timeout specification | ||
266 | * are included in the kernel. | ||
267 | * | ||
268 | * @note The default is @p TRUE. | ||
269 | * @note Requires @p CH_CFG_USE_EVENTS. | ||
270 | */ | ||
271 | #if !defined(CH_CFG_USE_EVENTS_TIMEOUT) | ||
272 | #define CH_CFG_USE_EVENTS_TIMEOUT TRUE | ||
273 | #endif | ||
274 | |||
275 | /** | ||
276 | * @brief Synchronous Messages APIs. | ||
277 | * @details If enabled then the synchronous messages APIs are included | ||
278 | * in the kernel. | ||
279 | * | ||
280 | * @note The default is @p TRUE. | ||
281 | */ | ||
282 | #if !defined(CH_CFG_USE_MESSAGES) | ||
283 | #define CH_CFG_USE_MESSAGES TRUE | ||
284 | #endif | ||
285 | |||
286 | /** | ||
287 | * @brief Synchronous Messages queuing mode. | ||
288 | * @details If enabled then messages are served by priority rather than in | ||
289 | * FIFO order. | ||
290 | * | ||
291 | * @note The default is @p FALSE. Enable this if you have special | ||
292 | * requirements. | ||
293 | * @note Requires @p CH_CFG_USE_MESSAGES. | ||
294 | */ | ||
295 | #if !defined(CH_CFG_USE_MESSAGES_PRIORITY) | ||
296 | #define CH_CFG_USE_MESSAGES_PRIORITY FALSE | ||
297 | #endif | ||
298 | |||
299 | /** | ||
300 | * @brief Dynamic Threads APIs. | ||
301 | * @details If enabled then the dynamic threads creation APIs are included | ||
302 | * in the kernel. | ||
303 | * | ||
304 | * @note The default is @p TRUE. | ||
305 | * @note Requires @p CH_CFG_USE_WAITEXIT. | ||
306 | * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. | ||
307 | */ | ||
308 | #if !defined(CH_CFG_USE_DYNAMIC) | ||
309 | #define CH_CFG_USE_DYNAMIC TRUE | ||
310 | #endif | ||
311 | |||
312 | /** @} */ | ||
313 | |||
314 | /*===========================================================================*/ | ||
315 | /** | ||
316 | * @name OSLIB options | ||
317 | * @{ | ||
318 | */ | ||
319 | /*===========================================================================*/ | ||
320 | |||
321 | /** | ||
322 | * @brief Mailboxes APIs. | ||
323 | * @details If enabled then the asynchronous messages (mailboxes) APIs are | ||
324 | * included in the kernel. | ||
325 | * | ||
326 | * @note The default is @p TRUE. | ||
327 | * @note Requires @p CH_CFG_USE_SEMAPHORES. | ||
328 | */ | ||
329 | #if !defined(CH_CFG_USE_MAILBOXES) | ||
330 | #define CH_CFG_USE_MAILBOXES TRUE | ||
331 | #endif | ||
332 | |||
333 | /** | ||
334 | * @brief Core Memory Manager APIs. | ||
335 | * @details If enabled then the core memory manager APIs are included | ||
336 | * in the kernel. | ||
337 | * | ||
338 | * @note The default is @p TRUE. | ||
339 | */ | ||
340 | #if !defined(CH_CFG_USE_MEMCORE) | ||
341 | #define CH_CFG_USE_MEMCORE TRUE | ||
342 | #endif | ||
343 | |||
344 | /** | ||
345 | * @brief Managed RAM size. | ||
346 | * @details Size of the RAM area to be managed by the OS. If set to zero | ||
347 | * then the whole available RAM is used. The core memory is made | ||
348 | * available to the heap allocator and/or can be used directly through | ||
349 | * the simplified core memory allocator. | ||
350 | * | ||
351 | * @note In order to let the OS manage the whole RAM the linker script must | ||
352 | * provide the @p __heap_base__ and @p __heap_end__ symbols. | ||
353 | * @note Requires @p CH_CFG_USE_MEMCORE. | ||
354 | */ | ||
355 | #if !defined(CH_CFG_MEMCORE_SIZE) | ||
356 | #define CH_CFG_MEMCORE_SIZE 0 | ||
357 | #endif | ||
358 | |||
359 | /** | ||
360 | * @brief Heap Allocator APIs. | ||
361 | * @details If enabled then the memory heap allocator APIs are included | ||
362 | * in the kernel. | ||
363 | * | ||
364 | * @note The default is @p TRUE. | ||
365 | * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or | ||
366 | * @p CH_CFG_USE_SEMAPHORES. | ||
367 | * @note Mutexes are recommended. | ||
368 | */ | ||
369 | #if !defined(CH_CFG_USE_HEAP) | ||
370 | #define CH_CFG_USE_HEAP TRUE | ||
371 | #endif | ||
372 | |||
373 | /** | ||
374 | * @brief Memory Pools Allocator APIs. | ||
375 | * @details If enabled then the memory pools allocator APIs are included | ||
376 | * in the kernel. | ||
377 | * | ||
378 | * @note The default is @p TRUE. | ||
379 | */ | ||
380 | #if !defined(CH_CFG_USE_MEMPOOLS) | ||
381 | #define CH_CFG_USE_MEMPOOLS TRUE | ||
382 | #endif | ||
383 | |||
384 | /** | ||
385 | * @brief Objects FIFOs APIs. | ||
386 | * @details If enabled then the objects FIFOs APIs are included | ||
387 | * in the kernel. | ||
388 | * | ||
389 | * @note The default is @p TRUE. | ||
390 | */ | ||
391 | #if !defined(CH_CFG_USE_OBJ_FIFOS) | ||
392 | #define CH_CFG_USE_OBJ_FIFOS TRUE | ||
393 | #endif | ||
394 | |||
395 | /** | ||
396 | * @brief Pipes APIs. | ||
397 | * @details If enabled then the pipes APIs are included | ||
398 | * in the kernel. | ||
399 | * | ||
400 | * @note The default is @p TRUE. | ||
401 | */ | ||
402 | #if !defined(CH_CFG_USE_PIPES) | ||
403 | #define CH_CFG_USE_PIPES TRUE | ||
404 | #endif | ||
405 | |||
406 | /** | ||
407 | * @brief Objects Caches APIs. | ||
408 | * @details If enabled then the objects caches APIs are included | ||
409 | * in the kernel. | ||
410 | * | ||
411 | * @note The default is @p TRUE. | ||
412 | */ | ||
413 | #if !defined(CH_CFG_USE_OBJ_CACHES) | ||
414 | #define CH_CFG_USE_OBJ_CACHES TRUE | ||
415 | #endif | ||
416 | |||
417 | /** | ||
418 | * @brief Delegate threads APIs. | ||
419 | * @details If enabled then the delegate threads APIs are included | ||
420 | * in the kernel. | ||
421 | * | ||
422 | * @note The default is @p TRUE. | ||
423 | */ | ||
424 | #if !defined(CH_CFG_USE_DELEGATES) | ||
425 | #define CH_CFG_USE_DELEGATES TRUE | ||
426 | #endif | ||
427 | |||
428 | /** | ||
429 | * @brief Jobs Queues APIs. | ||
430 | * @details If enabled then the jobs queues APIs are included | ||
431 | * in the kernel. | ||
432 | * | ||
433 | * @note The default is @p TRUE. | ||
434 | */ | ||
435 | #if !defined(CH_CFG_USE_JOBS) | ||
436 | #define CH_CFG_USE_JOBS TRUE | ||
437 | #endif | ||
438 | |||
439 | /** @} */ | ||
440 | |||
441 | /*===========================================================================*/ | ||
442 | /** | ||
443 | * @name Objects factory options | ||
444 | * @{ | ||
445 | */ | ||
446 | /*===========================================================================*/ | ||
447 | |||
448 | /** | ||
449 | * @brief Objects Factory APIs. | ||
450 | * @details If enabled then the objects factory APIs are included in the | ||
451 | * kernel. | ||
452 | * | ||
453 | * @note The default is @p FALSE. | ||
454 | */ | ||
455 | #if !defined(CH_CFG_USE_FACTORY) | ||
456 | #define CH_CFG_USE_FACTORY TRUE | ||
457 | #endif | ||
458 | |||
459 | /** | ||
460 | * @brief Maximum length for object names. | ||
461 | * @details If the specified length is zero then the name is stored by | ||
462 | * pointer but this could have unintended side effects. | ||
463 | */ | ||
464 | #if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH) | ||
465 | #define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8 | ||
466 | #endif | ||
467 | |||
468 | /** | ||
469 | * @brief Enables the registry of generic objects. | ||
470 | */ | ||
471 | #if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY) | ||
472 | #define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE | ||
473 | #endif | ||
474 | |||
475 | /** | ||
476 | * @brief Enables factory for generic buffers. | ||
477 | */ | ||
478 | #if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS) | ||
479 | #define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE | ||
480 | #endif | ||
481 | |||
482 | /** | ||
483 | * @brief Enables factory for semaphores. | ||
484 | */ | ||
485 | #if !defined(CH_CFG_FACTORY_SEMAPHORES) | ||
486 | #define CH_CFG_FACTORY_SEMAPHORES TRUE | ||
487 | #endif | ||
488 | |||
489 | /** | ||
490 | * @brief Enables factory for mailboxes. | ||
491 | */ | ||
492 | #if !defined(CH_CFG_FACTORY_MAILBOXES) | ||
493 | #define CH_CFG_FACTORY_MAILBOXES TRUE | ||
494 | #endif | ||
495 | |||
496 | /** | ||
497 | * @brief Enables factory for objects FIFOs. | ||
498 | */ | ||
499 | #if !defined(CH_CFG_FACTORY_OBJ_FIFOS) | ||
500 | #define CH_CFG_FACTORY_OBJ_FIFOS TRUE | ||
501 | #endif | ||
502 | |||
503 | /** | ||
504 | * @brief Enables factory for Pipes. | ||
505 | */ | ||
506 | #if !defined(CH_CFG_FACTORY_PIPES) || defined(__DOXYGEN__) | ||
507 | #define CH_CFG_FACTORY_PIPES TRUE | ||
508 | #endif | ||
509 | |||
510 | /** @} */ | ||
511 | |||
512 | /*===========================================================================*/ | ||
513 | /** | ||
514 | * @name Debug options | ||
515 | * @{ | ||
516 | */ | ||
517 | /*===========================================================================*/ | ||
518 | |||
519 | /** | ||
520 | * @brief Debug option, kernel statistics. | ||
521 | * | ||
522 | * @note The default is @p FALSE. | ||
523 | */ | ||
524 | #if !defined(CH_DBG_STATISTICS) | ||
525 | #define CH_DBG_STATISTICS FALSE | ||
526 | #endif | ||
527 | |||
528 | /** | ||
529 | * @brief Debug option, system state check. | ||
530 | * @details If enabled the correct call protocol for system APIs is checked | ||
531 | * at runtime. | ||
532 | * | ||
533 | * @note The default is @p FALSE. | ||
534 | */ | ||
535 | #if !defined(CH_DBG_SYSTEM_STATE_CHECK) | ||
536 | #define CH_DBG_SYSTEM_STATE_CHECK FALSE | ||
537 | #endif | ||
538 | |||
539 | /** | ||
540 | * @brief Debug option, parameters checks. | ||
541 | * @details If enabled then the checks on the API functions input | ||
542 | * parameters are activated. | ||
543 | * | ||
544 | * @note The default is @p FALSE. | ||
545 | */ | ||
546 | #if !defined(CH_DBG_ENABLE_CHECKS) | ||
547 | #define CH_DBG_ENABLE_CHECKS FALSE | ||
548 | #endif | ||
549 | |||
550 | /** | ||
551 | * @brief Debug option, consistency checks. | ||
552 | * @details If enabled then all the assertions in the kernel code are | ||
553 | * activated. This includes consistency checks inside the kernel, | ||
554 | * runtime anomalies and port-defined checks. | ||
555 | * | ||
556 | * @note The default is @p FALSE. | ||
557 | */ | ||
558 | #if !defined(CH_DBG_ENABLE_ASSERTS) | ||
559 | #define CH_DBG_ENABLE_ASSERTS FALSE | ||
560 | #endif | ||
561 | |||
562 | /** | ||
563 | * @brief Debug option, trace buffer. | ||
564 | * @details If enabled then the trace buffer is activated. | ||
565 | * | ||
566 | * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. | ||
567 | */ | ||
568 | #if !defined(CH_DBG_TRACE_MASK) | ||
569 | #define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED | ||
570 | #endif | ||
571 | |||
572 | /** | ||
573 | * @brief Trace buffer entries. | ||
574 | * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is | ||
575 | * different from @p CH_DBG_TRACE_MASK_DISABLED. | ||
576 | */ | ||
577 | #if !defined(CH_DBG_TRACE_BUFFER_SIZE) | ||
578 | #define CH_DBG_TRACE_BUFFER_SIZE 128 | ||
579 | #endif | ||
580 | |||
581 | /** | ||
582 | * @brief Debug option, stack checks. | ||
583 | * @details If enabled then a runtime stack check is performed. | ||
584 | * | ||
585 | * @note The default is @p FALSE. | ||
586 | * @note The stack check is performed in a architecture/port dependent way. | ||
587 | * It may not be implemented or some ports. | ||
588 | * @note The default failure mode is to halt the system with the global | ||
589 | * @p panic_msg variable set to @p NULL. | ||
590 | */ | ||
591 | #if !defined(CH_DBG_ENABLE_STACK_CHECK) | ||
592 | #define CH_DBG_ENABLE_STACK_CHECK FALSE | ||
593 | #endif | ||
594 | |||
595 | /** | ||
596 | * @brief Debug option, stacks initialization. | ||
597 | * @details If enabled then the threads working area is filled with a byte | ||
598 | * value when a thread is created. This can be useful for the | ||
599 | * runtime measurement of the used stack. | ||
600 | * | ||
601 | * @note The default is @p FALSE. | ||
602 | */ | ||
603 | #if !defined(CH_DBG_FILL_THREADS) | ||
604 | #define CH_DBG_FILL_THREADS FALSE | ||
605 | #endif | ||
606 | |||
607 | /** | ||
608 | * @brief Debug option, threads profiling. | ||
609 | * @details If enabled then a field is added to the @p thread_t structure that | ||
610 | * counts the system ticks occurred while executing the thread. | ||
611 | * | ||
612 | * @note The default is @p FALSE. | ||
613 | * @note This debug option is not currently compatible with the | ||
614 | * tickless mode. | ||
615 | */ | ||
616 | #if !defined(CH_DBG_THREADS_PROFILING) | ||
617 | #define CH_DBG_THREADS_PROFILING FALSE | ||
618 | #endif | ||
619 | |||
620 | /** @} */ | ||
621 | |||
622 | /*===========================================================================*/ | ||
623 | /** | ||
624 | * @name Kernel hooks | ||
625 | * @{ | ||
626 | */ | ||
627 | /*===========================================================================*/ | ||
628 | |||
629 | /** | ||
630 | * @brief System structure extension. | ||
631 | * @details User fields added to the end of the @p ch_system_t structure. | ||
632 | */ | ||
633 | #define CH_CFG_SYSTEM_EXTRA_FIELDS \ | ||
634 | /* Add threads custom fields here.*/ | ||
635 | |||
636 | /** | ||
637 | * @brief System initialization hook. | ||
638 | * @details User initialization code added to the @p chSysInit() function | ||
639 | * just before interrupts are enabled globally. | ||
640 | */ | ||
641 | #define CH_CFG_SYSTEM_INIT_HOOK() { \ | ||
642 | /* Add threads initialization code here.*/ \ | ||
643 | } | ||
644 | |||
645 | /** | ||
646 | * @brief Threads descriptor structure extension. | ||
647 | * @details User fields added to the end of the @p thread_t structure. | ||
648 | */ | ||
649 | #define CH_CFG_THREAD_EXTRA_FIELDS \ | ||
650 | /* Add threads custom fields here.*/ | ||
651 | |||
652 | /** | ||
653 | * @brief Threads initialization hook. | ||
654 | * @details User initialization code added to the @p _thread_init() function. | ||
655 | * | ||
656 | * @note It is invoked from within @p _thread_init() and implicitly from all | ||
657 | * the threads creation APIs. | ||
658 | */ | ||
659 | #define CH_CFG_THREAD_INIT_HOOK(tp) { \ | ||
660 | /* Add threads initialization code here.*/ \ | ||
661 | } | ||
662 | |||
663 | /** | ||
664 | * @brief Threads finalization hook. | ||
665 | * @details User finalization code added to the @p chThdExit() API. | ||
666 | */ | ||
667 | #define CH_CFG_THREAD_EXIT_HOOK(tp) { \ | ||
668 | /* Add threads finalization code here.*/ \ | ||
669 | } | ||
670 | |||
671 | /** | ||
672 | * @brief Context switch hook. | ||
673 | * @details This hook is invoked just before switching between threads. | ||
674 | */ | ||
675 | #define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ | ||
676 | /* Context switch code here.*/ \ | ||
677 | } | ||
678 | |||
679 | /** | ||
680 | * @brief ISR enter hook. | ||
681 | */ | ||
682 | #define CH_CFG_IRQ_PROLOGUE_HOOK() { \ | ||
683 | /* IRQ prologue code here.*/ \ | ||
684 | } | ||
685 | |||
686 | /** | ||
687 | * @brief ISR exit hook. | ||
688 | */ | ||
689 | #define CH_CFG_IRQ_EPILOGUE_HOOK() { \ | ||
690 | /* IRQ epilogue code here.*/ \ | ||
691 | } | ||
692 | |||
693 | /** | ||
694 | * @brief Idle thread enter hook. | ||
695 | * @note This hook is invoked within a critical zone, no OS functions | ||
696 | * should be invoked from here. | ||
697 | * @note This macro can be used to activate a power saving mode. | ||
698 | */ | ||
699 | #define CH_CFG_IDLE_ENTER_HOOK() { \ | ||
700 | /* Idle-enter code here.*/ \ | ||
701 | } | ||
702 | |||
703 | /** | ||
704 | * @brief Idle thread leave hook. | ||
705 | * @note This hook is invoked within a critical zone, no OS functions | ||
706 | * should be invoked from here. | ||
707 | * @note This macro can be used to deactivate a power saving mode. | ||
708 | */ | ||
709 | #define CH_CFG_IDLE_LEAVE_HOOK() { \ | ||
710 | /* Idle-leave code here.*/ \ | ||
711 | } | ||
712 | |||
713 | /** | ||
714 | * @brief Idle Loop hook. | ||
715 | * @details This hook is continuously invoked by the idle thread loop. | ||
716 | */ | ||
717 | #define CH_CFG_IDLE_LOOP_HOOK() { \ | ||
718 | /* Idle loop code here.*/ \ | ||
719 | } | ||
720 | |||
721 | /** | ||
722 | * @brief System tick event hook. | ||
723 | * @details This hook is invoked in the system tick handler immediately | ||
724 | * after processing the virtual timers queue. | ||
725 | */ | ||
726 | #define CH_CFG_SYSTEM_TICK_HOOK() { \ | ||
727 | /* System tick event code here.*/ \ | ||
728 | } | ||
729 | |||
730 | /** | ||
731 | * @brief System halt hook. | ||
732 | * @details This hook is invoked in case to a system halting error before | ||
733 | * the system is halted. | ||
734 | */ | ||
735 | #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ | ||
736 | /* System halt code here.*/ \ | ||
737 | } | ||
738 | |||
739 | /** | ||
740 | * @brief Trace hook. | ||
741 | * @details This hook is invoked each time a new record is written in the | ||
742 | * trace buffer. | ||
743 | */ | ||
744 | #define CH_CFG_TRACE_HOOK(tep) { \ | ||
745 | /* Trace code here.*/ \ | ||
746 | } | ||
747 | |||
748 | /** @} */ | ||
749 | |||
750 | /*===========================================================================*/ | ||
751 | /* Port-specific settings (override port settings defaulted in chcore.h). */ | ||
752 | /*===========================================================================*/ | ||
753 | |||
754 | #endif /* CHCONF_H */ | ||
755 | |||
756 | /** @} */ | ||
diff --git a/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/cfg/halconf.h b/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/cfg/halconf.h new file mode 100644 index 000000000..849109ec5 --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/cfg/halconf.h | |||
@@ -0,0 +1,531 @@ | |||
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 templates/halconf.h | ||
19 | * @brief HAL configuration header. | ||
20 | * @details HAL configuration file, this file allows to enable or disable the | ||
21 | * various device drivers from your application. You may also use | ||
22 | * this file in order to override the device drivers default settings. | ||
23 | * | ||
24 | * @addtogroup HAL_CONF | ||
25 | * @{ | ||
26 | */ | ||
27 | |||
28 | #ifndef HALCONF_H | ||
29 | #define HALCONF_H | ||
30 | |||
31 | #define _CHIBIOS_HAL_CONF_ | ||
32 | #define _CHIBIOS_HAL_CONF_VER_7_1_ | ||
33 | |||
34 | #include "mcuconf.h" | ||
35 | |||
36 | /** | ||
37 | * @brief Enables the PAL subsystem. | ||
38 | */ | ||
39 | #if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) | ||
40 | #define HAL_USE_PAL TRUE | ||
41 | #endif | ||
42 | |||
43 | /** | ||
44 | * @brief Enables the ADC subsystem. | ||
45 | */ | ||
46 | #if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) | ||
47 | #define HAL_USE_ADC FALSE | ||
48 | #endif | ||
49 | |||
50 | /** | ||
51 | * @brief Enables the CAN subsystem. | ||
52 | */ | ||
53 | #if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) | ||
54 | #define HAL_USE_CAN FALSE | ||
55 | #endif | ||
56 | |||
57 | /** | ||
58 | * @brief Enables the cryptographic subsystem. | ||
59 | */ | ||
60 | #if !defined(HAL_USE_CRY) || defined(__DOXYGEN__) | ||
61 | #define HAL_USE_CRY FALSE | ||
62 | #endif | ||
63 | |||
64 | /** | ||
65 | * @brief Enables the DAC subsystem. | ||
66 | */ | ||
67 | #if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) | ||
68 | #define HAL_USE_DAC FALSE | ||
69 | #endif | ||
70 | |||
71 | /** | ||
72 | * @brief Enables the EFlash subsystem. | ||
73 | */ | ||
74 | #if !defined(HAL_USE_EFL) || defined(__DOXYGEN__) | ||
75 | #define HAL_USE_EFL FALSE | ||
76 | #endif | ||
77 | |||
78 | /** | ||
79 | * @brief Enables the GPT subsystem. | ||
80 | */ | ||
81 | #if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) | ||
82 | #define HAL_USE_GPT FALSE | ||
83 | #endif | ||
84 | |||
85 | /** | ||
86 | * @brief Enables the I2C subsystem. | ||
87 | */ | ||
88 | #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) | ||
89 | #define HAL_USE_I2C TRUE | ||
90 | #endif | ||
91 | |||
92 | /** | ||
93 | * @brief Enables the I2S subsystem. | ||
94 | */ | ||
95 | #if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) | ||
96 | #define HAL_USE_I2S FALSE | ||
97 | #endif | ||
98 | |||
99 | /** | ||
100 | * @brief Enables the ICU subsystem. | ||
101 | */ | ||
102 | #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) | ||
103 | #define HAL_USE_ICU FALSE | ||
104 | #endif | ||
105 | |||
106 | /** | ||
107 | * @brief Enables the MAC subsystem. | ||
108 | */ | ||
109 | #if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) | ||
110 | #define HAL_USE_MAC FALSE | ||
111 | #endif | ||
112 | |||
113 | /** | ||
114 | * @brief Enables the MMC_SPI subsystem. | ||
115 | */ | ||
116 | #if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) | ||
117 | #define HAL_USE_MMC_SPI FALSE | ||
118 | #endif | ||
119 | |||
120 | /** | ||
121 | * @brief Enables the PWM subsystem. | ||
122 | */ | ||
123 | #if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) | ||
124 | #define HAL_USE_PWM FALSE | ||
125 | #endif | ||
126 | |||
127 | /** | ||
128 | * @brief Enables the RTC subsystem. | ||
129 | */ | ||
130 | #if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) | ||
131 | #define HAL_USE_RTC FALSE | ||
132 | #endif | ||
133 | |||
134 | /** | ||
135 | * @brief Enables the SDC subsystem. | ||
136 | */ | ||
137 | #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) | ||
138 | #define HAL_USE_SDC FALSE | ||
139 | #endif | ||
140 | |||
141 | /** | ||
142 | * @brief Enables the SERIAL subsystem. | ||
143 | */ | ||
144 | #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) | ||
145 | #define HAL_USE_SERIAL TRUE | ||
146 | #endif | ||
147 | |||
148 | /** | ||
149 | * @brief Enables the SERIAL over USB subsystem. | ||
150 | */ | ||
151 | #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) | ||
152 | #define HAL_USE_SERIAL_USB FALSE | ||
153 | #endif | ||
154 | |||
155 | /** | ||
156 | * @brief Enables the SIO subsystem. | ||
157 | */ | ||
158 | #if !defined(HAL_USE_SIO) || defined(__DOXYGEN__) | ||
159 | #define HAL_USE_SIO FALSE | ||
160 | #endif | ||
161 | |||
162 | /** | ||
163 | * @brief Enables the SPI subsystem. | ||
164 | */ | ||
165 | #if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) | ||
166 | #define HAL_USE_SPI FALSE | ||
167 | #endif | ||
168 | |||
169 | /** | ||
170 | * @brief Enables the TRNG subsystem. | ||
171 | */ | ||
172 | #if !defined(HAL_USE_TRNG) || defined(__DOXYGEN__) | ||
173 | #define HAL_USE_TRNG FALSE | ||
174 | #endif | ||
175 | |||
176 | /** | ||
177 | * @brief Enables the UART subsystem. | ||
178 | */ | ||
179 | #if !defined(HAL_USE_UART) || defined(__DOXYGEN__) | ||
180 | #define HAL_USE_UART FALSE | ||
181 | #endif | ||
182 | |||
183 | /** | ||
184 | * @brief Enables the USB subsystem. | ||
185 | */ | ||
186 | #if !defined(HAL_USE_USB) || defined(__DOXYGEN__) | ||
187 | #define HAL_USE_USB FALSE | ||
188 | #endif | ||
189 | |||
190 | /** | ||
191 | * @brief Enables the WDG subsystem. | ||
192 | */ | ||
193 | #if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) | ||
194 | #define HAL_USE_WDG FALSE | ||
195 | #endif | ||
196 | |||
197 | /** | ||
198 | * @brief Enables the WSPI subsystem. | ||
199 | */ | ||
200 | #if !defined(HAL_USE_WSPI) || defined(__DOXYGEN__) | ||
201 | #define HAL_USE_WSPI FALSE | ||
202 | #endif | ||
203 | |||
204 | /*===========================================================================*/ | ||
205 | /* PAL driver related settings. */ | ||
206 | /*===========================================================================*/ | ||
207 | |||
208 | /** | ||
209 | * @brief Enables synchronous APIs. | ||
210 | * @note Disabling this option saves both code and data space. | ||
211 | */ | ||
212 | #if !defined(PAL_USE_CALLBACKS) || defined(__DOXYGEN__) | ||
213 | #define PAL_USE_CALLBACKS FALSE | ||
214 | #endif | ||
215 | |||
216 | /** | ||
217 | * @brief Enables synchronous APIs. | ||
218 | * @note Disabling this option saves both code and data space. | ||
219 | */ | ||
220 | #if !defined(PAL_USE_WAIT) || defined(__DOXYGEN__) | ||
221 | #define PAL_USE_WAIT FALSE | ||
222 | #endif | ||
223 | |||
224 | /*===========================================================================*/ | ||
225 | /* ADC driver related settings. */ | ||
226 | /*===========================================================================*/ | ||
227 | |||
228 | /** | ||
229 | * @brief Enables synchronous APIs. | ||
230 | * @note Disabling this option saves both code and data space. | ||
231 | */ | ||
232 | #if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) | ||
233 | #define ADC_USE_WAIT TRUE | ||
234 | #endif | ||
235 | |||
236 | /** | ||
237 | * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. | ||
238 | * @note Disabling this option saves both code and data space. | ||
239 | */ | ||
240 | #if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
241 | #define ADC_USE_MUTUAL_EXCLUSION TRUE | ||
242 | #endif | ||
243 | |||
244 | /*===========================================================================*/ | ||
245 | /* CAN driver related settings. */ | ||
246 | /*===========================================================================*/ | ||
247 | |||
248 | /** | ||
249 | * @brief Sleep mode related APIs inclusion switch. | ||
250 | */ | ||
251 | #if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) | ||
252 | #define CAN_USE_SLEEP_MODE TRUE | ||
253 | #endif | ||
254 | |||
255 | /** | ||
256 | * @brief Enforces the driver to use direct callbacks rather than OSAL events. | ||
257 | */ | ||
258 | #if !defined(CAN_ENFORCE_USE_CALLBACKS) || defined(__DOXYGEN__) | ||
259 | #define CAN_ENFORCE_USE_CALLBACKS FALSE | ||
260 | #endif | ||
261 | |||
262 | /*===========================================================================*/ | ||
263 | /* CRY driver related settings. */ | ||
264 | /*===========================================================================*/ | ||
265 | |||
266 | /** | ||
267 | * @brief Enables the SW fall-back of the cryptographic driver. | ||
268 | * @details When enabled, this option, activates a fall-back software | ||
269 | * implementation for algorithms not supported by the underlying | ||
270 | * hardware. | ||
271 | * @note Fall-back implementations may not be present for all algorithms. | ||
272 | */ | ||
273 | #if !defined(HAL_CRY_USE_FALLBACK) || defined(__DOXYGEN__) | ||
274 | #define HAL_CRY_USE_FALLBACK FALSE | ||
275 | #endif | ||
276 | |||
277 | /** | ||
278 | * @brief Makes the driver forcibly use the fall-back implementations. | ||
279 | */ | ||
280 | #if !defined(HAL_CRY_ENFORCE_FALLBACK) || defined(__DOXYGEN__) | ||
281 | #define HAL_CRY_ENFORCE_FALLBACK FALSE | ||
282 | #endif | ||
283 | |||
284 | /*===========================================================================*/ | ||
285 | /* DAC driver related settings. */ | ||
286 | /*===========================================================================*/ | ||
287 | |||
288 | /** | ||
289 | * @brief Enables synchronous APIs. | ||
290 | * @note Disabling this option saves both code and data space. | ||
291 | */ | ||
292 | #if !defined(DAC_USE_WAIT) || defined(__DOXYGEN__) | ||
293 | #define DAC_USE_WAIT TRUE | ||
294 | #endif | ||
295 | |||
296 | /** | ||
297 | * @brief Enables the @p dacAcquireBus() and @p dacReleaseBus() APIs. | ||
298 | * @note Disabling this option saves both code and data space. | ||
299 | */ | ||
300 | #if !defined(DAC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
301 | #define DAC_USE_MUTUAL_EXCLUSION TRUE | ||
302 | #endif | ||
303 | |||
304 | /*===========================================================================*/ | ||
305 | /* I2C driver related settings. */ | ||
306 | /*===========================================================================*/ | ||
307 | |||
308 | /** | ||
309 | * @brief Enables the mutual exclusion APIs on the I2C bus. | ||
310 | */ | ||
311 | #if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
312 | #define I2C_USE_MUTUAL_EXCLUSION TRUE | ||
313 | #endif | ||
314 | |||
315 | /*===========================================================================*/ | ||
316 | /* MAC driver related settings. */ | ||
317 | /*===========================================================================*/ | ||
318 | |||
319 | /** | ||
320 | * @brief Enables the zero-copy API. | ||
321 | */ | ||
322 | #if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) | ||
323 | #define MAC_USE_ZERO_COPY FALSE | ||
324 | #endif | ||
325 | |||
326 | /** | ||
327 | * @brief Enables an event sources for incoming packets. | ||
328 | */ | ||
329 | #if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) | ||
330 | #define MAC_USE_EVENTS TRUE | ||
331 | #endif | ||
332 | |||
333 | /*===========================================================================*/ | ||
334 | /* MMC_SPI driver related settings. */ | ||
335 | /*===========================================================================*/ | ||
336 | |||
337 | /** | ||
338 | * @brief Delays insertions. | ||
339 | * @details If enabled this options inserts delays into the MMC waiting | ||
340 | * routines releasing some extra CPU time for the threads with | ||
341 | * lower priority, this may slow down the driver a bit however. | ||
342 | * This option is recommended also if the SPI driver does not | ||
343 | * use a DMA channel and heavily loads the CPU. | ||
344 | */ | ||
345 | #if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) | ||
346 | #define MMC_NICE_WAITING TRUE | ||
347 | #endif | ||
348 | |||
349 | /*===========================================================================*/ | ||
350 | /* SDC driver related settings. */ | ||
351 | /*===========================================================================*/ | ||
352 | |||
353 | /** | ||
354 | * @brief Number of initialization attempts before rejecting the card. | ||
355 | * @note Attempts are performed at 10mS intervals. | ||
356 | */ | ||
357 | #if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) | ||
358 | #define SDC_INIT_RETRY 100 | ||
359 | #endif | ||
360 | |||
361 | /** | ||
362 | * @brief Include support for MMC cards. | ||
363 | * @note MMC support is not yet implemented so this option must be kept | ||
364 | * at @p FALSE. | ||
365 | */ | ||
366 | #if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) | ||
367 | #define SDC_MMC_SUPPORT FALSE | ||
368 | #endif | ||
369 | |||
370 | /** | ||
371 | * @brief Delays insertions. | ||
372 | * @details If enabled this options inserts delays into the MMC waiting | ||
373 | * routines releasing some extra CPU time for the threads with | ||
374 | * lower priority, this may slow down the driver a bit however. | ||
375 | */ | ||
376 | #if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) | ||
377 | #define SDC_NICE_WAITING TRUE | ||
378 | #endif | ||
379 | |||
380 | /** | ||
381 | * @brief OCR initialization constant for V20 cards. | ||
382 | */ | ||
383 | #if !defined(SDC_INIT_OCR_V20) || defined(__DOXYGEN__) | ||
384 | #define SDC_INIT_OCR_V20 0x50FF8000U | ||
385 | #endif | ||
386 | |||
387 | /** | ||
388 | * @brief OCR initialization constant for non-V20 cards. | ||
389 | */ | ||
390 | #if !defined(SDC_INIT_OCR) || defined(__DOXYGEN__) | ||
391 | #define SDC_INIT_OCR 0x80100000U | ||
392 | #endif | ||
393 | |||
394 | /*===========================================================================*/ | ||
395 | /* SERIAL driver related settings. */ | ||
396 | /*===========================================================================*/ | ||
397 | |||
398 | /** | ||
399 | * @brief Default bit rate. | ||
400 | * @details Configuration parameter, this is the baud rate selected for the | ||
401 | * default configuration. | ||
402 | */ | ||
403 | #if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) | ||
404 | #define SERIAL_DEFAULT_BITRATE 38400 | ||
405 | #endif | ||
406 | |||
407 | /** | ||
408 | * @brief Serial buffers size. | ||
409 | * @details Configuration parameter, you can change the depth of the queue | ||
410 | * buffers depending on the requirements of your application. | ||
411 | * @note The default is 16 bytes for both the transmission and receive | ||
412 | * buffers. | ||
413 | */ | ||
414 | #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) | ||
415 | #define SERIAL_BUFFERS_SIZE 16 | ||
416 | #endif | ||
417 | |||
418 | /*===========================================================================*/ | ||
419 | /* SERIAL_USB driver related setting. */ | ||
420 | /*===========================================================================*/ | ||
421 | |||
422 | /** | ||
423 | * @brief Serial over USB buffers size. | ||
424 | * @details Configuration parameter, the buffer size must be a multiple of | ||
425 | * the USB data endpoint maximum packet size. | ||
426 | * @note The default is 256 bytes for both the transmission and receive | ||
427 | * buffers. | ||
428 | */ | ||
429 | #if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) | ||
430 | #define SERIAL_USB_BUFFERS_SIZE 256 | ||
431 | #endif | ||
432 | |||
433 | /** | ||
434 | * @brief Serial over USB number of buffers. | ||
435 | * @note The default is 2 buffers. | ||
436 | */ | ||
437 | #if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) | ||
438 | #define SERIAL_USB_BUFFERS_NUMBER 2 | ||
439 | #endif | ||
440 | |||
441 | /*===========================================================================*/ | ||
442 | /* SPI driver related settings. */ | ||
443 | /*===========================================================================*/ | ||
444 | |||
445 | /** | ||
446 | * @brief Enables synchronous APIs. | ||
447 | * @note Disabling this option saves both code and data space. | ||
448 | */ | ||
449 | #if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) | ||
450 | #define SPI_USE_WAIT TRUE | ||
451 | #endif | ||
452 | |||
453 | /** | ||
454 | * @brief Enables circular transfers APIs. | ||
455 | * @note Disabling this option saves both code and data space. | ||
456 | */ | ||
457 | #if !defined(SPI_USE_CIRCULAR) || defined(__DOXYGEN__) | ||
458 | #define SPI_USE_CIRCULAR FALSE | ||
459 | #endif | ||
460 | |||
461 | /** | ||
462 | * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. | ||
463 | * @note Disabling this option saves both code and data space. | ||
464 | */ | ||
465 | #if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
466 | #define SPI_USE_MUTUAL_EXCLUSION TRUE | ||
467 | #endif | ||
468 | |||
469 | /** | ||
470 | * @brief Handling method for SPI CS line. | ||
471 | * @note Disabling this option saves both code and data space. | ||
472 | */ | ||
473 | #if !defined(SPI_SELECT_MODE) || defined(__DOXYGEN__) | ||
474 | #define SPI_SELECT_MODE SPI_SELECT_MODE_PAD | ||
475 | #endif | ||
476 | |||
477 | /*===========================================================================*/ | ||
478 | /* UART driver related settings. */ | ||
479 | /*===========================================================================*/ | ||
480 | |||
481 | /** | ||
482 | * @brief Enables synchronous APIs. | ||
483 | * @note Disabling this option saves both code and data space. | ||
484 | */ | ||
485 | #if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) | ||
486 | #define UART_USE_WAIT FALSE | ||
487 | #endif | ||
488 | |||
489 | /** | ||
490 | * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. | ||
491 | * @note Disabling this option saves both code and data space. | ||
492 | */ | ||
493 | #if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
494 | #define UART_USE_MUTUAL_EXCLUSION FALSE | ||
495 | #endif | ||
496 | |||
497 | /*===========================================================================*/ | ||
498 | /* USB driver related settings. */ | ||
499 | /*===========================================================================*/ | ||
500 | |||
501 | /** | ||
502 | * @brief Enables synchronous APIs. | ||
503 | * @note Disabling this option saves both code and data space. | ||
504 | */ | ||
505 | #if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) | ||
506 | #define USB_USE_WAIT FALSE | ||
507 | #endif | ||
508 | |||
509 | /*===========================================================================*/ | ||
510 | /* WSPI driver related settings. */ | ||
511 | /*===========================================================================*/ | ||
512 | |||
513 | /** | ||
514 | * @brief Enables synchronous APIs. | ||
515 | * @note Disabling this option saves both code and data space. | ||
516 | */ | ||
517 | #if !defined(WSPI_USE_WAIT) || defined(__DOXYGEN__) | ||
518 | #define WSPI_USE_WAIT TRUE | ||
519 | #endif | ||
520 | |||
521 | /** | ||
522 | * @brief Enables the @p wspiAcquireBus() and @p wspiReleaseBus() APIs. | ||
523 | * @note Disabling this option saves both code and data space. | ||
524 | */ | ||
525 | #if !defined(WSPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
526 | #define WSPI_USE_MUTUAL_EXCLUSION TRUE | ||
527 | #endif | ||
528 | |||
529 | #endif /* HALCONF_H */ | ||
530 | |||
531 | /** @} */ | ||
diff --git a/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/cfg/mcuconf.h b/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/cfg/mcuconf.h new file mode 100644 index 000000000..cefd777a7 --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/cfg/mcuconf.h | |||
@@ -0,0 +1,273 @@ | |||
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 | #ifndef MCUCONF_H | ||
18 | #define MCUCONF_H | ||
19 | |||
20 | /* | ||
21 | * STM32F3xx drivers configuration. | ||
22 | * The following settings override the default settings present in | ||
23 | * the various device driver implementation headers. | ||
24 | * Note that the settings for each driver only have effect if the whole | ||
25 | * driver is enabled in halconf.h. | ||
26 | * | ||
27 | * IRQ priorities: | ||
28 | * 15...0 Lowest...Highest. | ||
29 | * | ||
30 | * DMA priorities: | ||
31 | * 0...3 Lowest...Highest. | ||
32 | */ | ||
33 | |||
34 | #define STM32F3xx_MCUCONF | ||
35 | #define STM32F303_MCUCONF | ||
36 | |||
37 | /* | ||
38 | * HAL driver system settings. | ||
39 | */ | ||
40 | #define STM32_NO_INIT FALSE | ||
41 | #define STM32_PVD_ENABLE FALSE | ||
42 | #define STM32_PLS STM32_PLS_LEV0 | ||
43 | #define STM32_HSI_ENABLED TRUE | ||
44 | #define STM32_LSI_ENABLED TRUE | ||
45 | #define STM32_HSE_ENABLED TRUE | ||
46 | #define STM32_LSE_ENABLED FALSE | ||
47 | #define STM32_SW STM32_SW_PLL | ||
48 | #define STM32_PLLSRC STM32_PLLSRC_HSE | ||
49 | #define STM32_PREDIV_VALUE 1 | ||
50 | #define STM32_PLLMUL_VALUE 9 | ||
51 | #define STM32_HPRE STM32_HPRE_DIV1 | ||
52 | #define STM32_PPRE1 STM32_PPRE1_DIV2 | ||
53 | #define STM32_PPRE2 STM32_PPRE2_DIV2 | ||
54 | #define STM32_MCOSEL STM32_MCOSEL_NOCLOCK | ||
55 | #define STM32_ADC12PRES STM32_ADC12PRES_DIV1 | ||
56 | #define STM32_ADC34PRES STM32_ADC34PRES_DIV1 | ||
57 | #define STM32_USART1SW STM32_USART1SW_PCLK | ||
58 | #define STM32_USART2SW STM32_USART2SW_PCLK | ||
59 | #define STM32_USART3SW STM32_USART3SW_PCLK | ||
60 | #define STM32_UART4SW STM32_UART4SW_PCLK | ||
61 | #define STM32_UART5SW STM32_UART5SW_PCLK | ||
62 | #define STM32_I2C1SW STM32_I2C1SW_SYSCLK | ||
63 | #define STM32_I2C2SW STM32_I2C2SW_SYSCLK | ||
64 | #define STM32_TIM1SW STM32_TIM1SW_PCLK2 | ||
65 | #define STM32_TIM8SW STM32_TIM8SW_PCLK2 | ||
66 | #define STM32_RTCSEL STM32_RTCSEL_LSI | ||
67 | #define STM32_USB_CLOCK_REQUIRED TRUE | ||
68 | #define STM32_USBPRE STM32_USBPRE_DIV1P5 | ||
69 | |||
70 | /* | ||
71 | * IRQ system settings. | ||
72 | */ | ||
73 | #define STM32_IRQ_EXTI0_PRIORITY 6 | ||
74 | #define STM32_IRQ_EXTI1_PRIORITY 6 | ||
75 | #define STM32_IRQ_EXTI2_PRIORITY 6 | ||
76 | #define STM32_IRQ_EXTI3_PRIORITY 6 | ||
77 | #define STM32_IRQ_EXTI4_PRIORITY 6 | ||
78 | #define STM32_IRQ_EXTI5_9_PRIORITY 6 | ||
79 | #define STM32_IRQ_EXTI10_15_PRIORITY 6 | ||
80 | #define STM32_IRQ_EXTI16_PRIORITY 6 | ||
81 | #define STM32_IRQ_EXTI17_PRIORITY 6 | ||
82 | #define STM32_IRQ_EXTI18_PRIORITY 6 | ||
83 | #define STM32_IRQ_EXTI19_PRIORITY 6 | ||
84 | #define STM32_IRQ_EXTI20_PRIORITY 6 | ||
85 | #define STM32_IRQ_EXTI21_22_29_PRIORITY 6 | ||
86 | #define STM32_IRQ_EXTI30_32_PRIORITY 6 | ||
87 | #define STM32_IRQ_EXTI33_PRIORITY 6 | ||
88 | #define STM32_IRQ_TIM1_BRK_TIM15_PRIORITY 7 | ||
89 | #define STM32_IRQ_TIM1_UP_TIM16_PRIORITY 7 | ||
90 | #define STM32_IRQ_TIM1_TRGCO_TIM17_PRIORITY 7 | ||
91 | #define STM32_IRQ_TIM1_CC_PRIORITY 7 | ||
92 | |||
93 | /* | ||
94 | * ADC driver system settings. | ||
95 | */ | ||
96 | #define STM32_ADC_DUAL_MODE FALSE | ||
97 | #define STM32_ADC_COMPACT_SAMPLES FALSE | ||
98 | #define STM32_ADC_USE_ADC1 FALSE | ||
99 | #define STM32_ADC_USE_ADC2 FALSE | ||
100 | #define STM32_ADC_USE_ADC3 FALSE | ||
101 | #define STM32_ADC_USE_ADC4 FALSE | ||
102 | #define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) | ||
103 | #define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) | ||
104 | #define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) | ||
105 | #define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) | ||
106 | #define STM32_ADC_ADC1_DMA_PRIORITY 2 | ||
107 | #define STM32_ADC_ADC2_DMA_PRIORITY 2 | ||
108 | #define STM32_ADC_ADC3_DMA_PRIORITY 2 | ||
109 | #define STM32_ADC_ADC4_DMA_PRIORITY 2 | ||
110 | #define STM32_ADC_ADC12_IRQ_PRIORITY 5 | ||
111 | #define STM32_ADC_ADC3_IRQ_PRIORITY 5 | ||
112 | #define STM32_ADC_ADC4_IRQ_PRIORITY 5 | ||
113 | #define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 | ||
114 | #define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 | ||
115 | #define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 | ||
116 | #define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 | ||
117 | #define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 | ||
118 | #define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 | ||
119 | |||
120 | /* | ||
121 | * CAN driver system settings. | ||
122 | */ | ||
123 | #define STM32_CAN_USE_CAN1 FALSE | ||
124 | #define STM32_CAN_CAN1_IRQ_PRIORITY 11 | ||
125 | |||
126 | /* | ||
127 | * DAC driver system settings. | ||
128 | */ | ||
129 | #define STM32_DAC_DUAL_MODE FALSE | ||
130 | #define STM32_DAC_USE_DAC1_CH1 TRUE | ||
131 | #define STM32_DAC_USE_DAC1_CH2 TRUE | ||
132 | #define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 | ||
133 | #define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 | ||
134 | #define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 | ||
135 | #define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 | ||
136 | |||
137 | /* | ||
138 | * GPT driver system settings. | ||
139 | */ | ||
140 | #define STM32_GPT_USE_TIM1 FALSE | ||
141 | #define STM32_GPT_USE_TIM2 FALSE | ||
142 | #define STM32_GPT_USE_TIM3 FALSE | ||
143 | #define STM32_GPT_USE_TIM4 FALSE | ||
144 | #define STM32_GPT_USE_TIM6 FALSE | ||
145 | #define STM32_GPT_USE_TIM7 FALSE | ||
146 | #define STM32_GPT_USE_TIM8 FALSE | ||
147 | #define STM32_GPT_USE_TIM15 FALSE | ||
148 | #define STM32_GPT_USE_TIM16 FALSE | ||
149 | #define STM32_GPT_USE_TIM17 FALSE | ||
150 | #define STM32_GPT_TIM1_IRQ_PRIORITY 7 | ||
151 | #define STM32_GPT_TIM2_IRQ_PRIORITY 7 | ||
152 | #define STM32_GPT_TIM3_IRQ_PRIORITY 7 | ||
153 | #define STM32_GPT_TIM4_IRQ_PRIORITY 7 | ||
154 | #define STM32_GPT_TIM6_IRQ_PRIORITY 7 | ||
155 | #define STM32_GPT_TIM7_IRQ_PRIORITY 7 | ||
156 | #define STM32_GPT_TIM8_IRQ_PRIORITY 7 | ||
157 | |||
158 | /* | ||
159 | * I2C driver system settings. | ||
160 | */ | ||
161 | #define STM32_I2C_USE_I2C1 TRUE | ||
162 | #define STM32_I2C_USE_I2C2 FALSE | ||
163 | #define STM32_I2C_BUSY_TIMEOUT 50 | ||
164 | #define STM32_I2C_I2C1_IRQ_PRIORITY 10 | ||
165 | #define STM32_I2C_I2C2_IRQ_PRIORITY 10 | ||
166 | #define STM32_I2C_USE_DMA TRUE | ||
167 | #define STM32_I2C_I2C1_DMA_PRIORITY 1 | ||
168 | #define STM32_I2C_I2C2_DMA_PRIORITY 1 | ||
169 | #define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") | ||
170 | |||
171 | /* | ||
172 | * ICU driver system settings. | ||
173 | */ | ||
174 | #define STM32_ICU_USE_TIM1 FALSE | ||
175 | #define STM32_ICU_USE_TIM2 FALSE | ||
176 | #define STM32_ICU_USE_TIM3 FALSE | ||
177 | #define STM32_ICU_USE_TIM4 FALSE | ||
178 | #define STM32_ICU_USE_TIM8 FALSE | ||
179 | #define STM32_ICU_USE_TIM15 FALSE | ||
180 | #define STM32_ICU_TIM1_IRQ_PRIORITY 7 | ||
181 | #define STM32_ICU_TIM2_IRQ_PRIORITY 7 | ||
182 | #define STM32_ICU_TIM3_IRQ_PRIORITY 7 | ||
183 | #define STM32_ICU_TIM4_IRQ_PRIORITY 7 | ||
184 | #define STM32_ICU_TIM8_IRQ_PRIORITY 7 | ||
185 | |||
186 | /* | ||
187 | * PWM driver system settings. | ||
188 | */ | ||
189 | #define STM32_PWM_USE_ADVANCED FALSE | ||
190 | #define STM32_PWM_USE_TIM1 FALSE | ||
191 | #define STM32_PWM_USE_TIM2 FALSE | ||
192 | #define STM32_PWM_USE_TIM3 FALSE | ||
193 | #define STM32_PWM_USE_TIM4 FALSE | ||
194 | #define STM32_PWM_USE_TIM8 FALSE | ||
195 | #define STM32_PWM_USE_TIM15 FALSE | ||
196 | #define STM32_PWM_USE_TIM16 FALSE | ||
197 | #define STM32_PWM_USE_TIM17 FALSE | ||
198 | #define STM32_PWM_TIM1_IRQ_PRIORITY 7 | ||
199 | #define STM32_PWM_TIM2_IRQ_PRIORITY 7 | ||
200 | #define STM32_PWM_TIM3_IRQ_PRIORITY 7 | ||
201 | #define STM32_PWM_TIM4_IRQ_PRIORITY 7 | ||
202 | #define STM32_PWM_TIM8_IRQ_PRIORITY 7 | ||
203 | |||
204 | /* | ||
205 | * RTC driver system settings. | ||
206 | */ | ||
207 | #define STM32_RTC_PRESA_VALUE 32 | ||
208 | #define STM32_RTC_PRESS_VALUE 1024 | ||
209 | #define STM32_RTC_CR_INIT 0 | ||
210 | #define STM32_RTC_TAMPCR_INIT 0 | ||
211 | |||
212 | /* | ||
213 | * SERIAL driver system settings. | ||
214 | */ | ||
215 | #define STM32_SERIAL_USE_USART1 TRUE | ||
216 | #define STM32_SERIAL_USE_USART2 FALSE | ||
217 | #define STM32_SERIAL_USE_USART3 FALSE | ||
218 | #define STM32_SERIAL_USE_UART4 FALSE | ||
219 | #define STM32_SERIAL_USE_UART5 FALSE | ||
220 | #define STM32_SERIAL_USART1_PRIORITY 12 | ||
221 | #define STM32_SERIAL_USART2_PRIORITY 12 | ||
222 | #define STM32_SERIAL_USART3_PRIORITY 12 | ||
223 | #define STM32_SERIAL_UART4_PRIORITY 12 | ||
224 | #define STM32_SERIAL_UART5_PRIORITY 12 | ||
225 | |||
226 | /* | ||
227 | * SPI driver system settings. | ||
228 | */ | ||
229 | #define STM32_SPI_USE_SPI1 FALSE | ||
230 | #define STM32_SPI_USE_SPI2 FALSE | ||
231 | #define STM32_SPI_USE_SPI3 FALSE | ||
232 | #define STM32_SPI_SPI1_DMA_PRIORITY 1 | ||
233 | #define STM32_SPI_SPI2_DMA_PRIORITY 1 | ||
234 | #define STM32_SPI_SPI3_DMA_PRIORITY 1 | ||
235 | #define STM32_SPI_SPI1_IRQ_PRIORITY 10 | ||
236 | #define STM32_SPI_SPI2_IRQ_PRIORITY 10 | ||
237 | #define STM32_SPI_SPI3_IRQ_PRIORITY 10 | ||
238 | #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") | ||
239 | |||
240 | /* | ||
241 | * ST driver system settings. | ||
242 | */ | ||
243 | #define STM32_ST_IRQ_PRIORITY 8 | ||
244 | #define STM32_ST_USE_TIMER 2 | ||
245 | |||
246 | /* | ||
247 | * UART driver system settings. | ||
248 | */ | ||
249 | #define STM32_UART_USE_USART1 FALSE | ||
250 | #define STM32_UART_USE_USART2 FALSE | ||
251 | #define STM32_UART_USE_USART3 FALSE | ||
252 | #define STM32_UART_USART1_IRQ_PRIORITY 12 | ||
253 | #define STM32_UART_USART2_IRQ_PRIORITY 12 | ||
254 | #define STM32_UART_USART3_IRQ_PRIORITY 12 | ||
255 | #define STM32_UART_USART1_DMA_PRIORITY 0 | ||
256 | #define STM32_UART_USART2_DMA_PRIORITY 0 | ||
257 | #define STM32_UART_USART3_DMA_PRIORITY 0 | ||
258 | #define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") | ||
259 | |||
260 | /* | ||
261 | * USB driver system settings. | ||
262 | */ | ||
263 | #define STM32_USB_USE_USB1 FALSE | ||
264 | #define STM32_USB_LOW_POWER_ON_SUSPEND FALSE | ||
265 | #define STM32_USB_USB1_HP_IRQ_PRIORITY 13 | ||
266 | #define STM32_USB_USB1_LP_IRQ_PRIORITY 14 | ||
267 | |||
268 | /* | ||
269 | * WDG driver system settings. | ||
270 | */ | ||
271 | #define STM32_WDG_USE_IWDG FALSE | ||
272 | |||
273 | #endif /* MCUCONF_H */ | ||
diff --git a/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/main.c b/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/main.c new file mode 100644 index 000000000..ff9aa8668 --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/main.c | |||
@@ -0,0 +1,146 @@ | |||
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 | #include "ch.h" | ||
18 | #include "hal.h" | ||
19 | |||
20 | #include "chprintf.h" | ||
21 | #include "lsm303dlhc.h" | ||
22 | |||
23 | #define cls(chp) chprintf(chp, "\033[2J\033[1;1H") | ||
24 | |||
25 | /*===========================================================================*/ | ||
26 | /* LSM303DLHC related. */ | ||
27 | /*===========================================================================*/ | ||
28 | |||
29 | /* LSM303DLHC Driver: This object represent an LSM303DLHC instance */ | ||
30 | static LSM303DLHCDriver LSM303DLHCD1; | ||
31 | |||
32 | static int32_t accraw[LSM303DLHC_ACC_NUMBER_OF_AXES]; | ||
33 | static int32_t compraw[LSM303DLHC_COMP_NUMBER_OF_AXES]; | ||
34 | |||
35 | static float acccooked[LSM303DLHC_ACC_NUMBER_OF_AXES]; | ||
36 | static float compcooked[LSM303DLHC_COMP_NUMBER_OF_AXES]; | ||
37 | |||
38 | static char axisID[LSM303DLHC_ACC_NUMBER_OF_AXES] = {'X', 'Y', 'Z'}; | ||
39 | static uint32_t i; | ||
40 | |||
41 | static const I2CConfig i2ccfg = { | ||
42 | STM32_TIMINGR_PRESC(15U) | | ||
43 | STM32_TIMINGR_SCLDEL(4U) | STM32_TIMINGR_SDADEL(2U) | | ||
44 | STM32_TIMINGR_SCLH(15U) | STM32_TIMINGR_SCLL(21U), | ||
45 | 0, | ||
46 | 0 | ||
47 | }; | ||
48 | |||
49 | static const LSM303DLHCConfig lsm303dlhccfg = { | ||
50 | &I2CD1, | ||
51 | &i2ccfg, | ||
52 | NULL, | ||
53 | NULL, | ||
54 | LSM303DLHC_ACC_FS_4G, | ||
55 | LSM303DLHC_ACC_ODR_100Hz, | ||
56 | #if LSM303DLHC_USE_ADVANCED | ||
57 | LSM303DLHC_ACC_LP_DISABLED, | ||
58 | LSM303DLHC_ACC_HR_DISABLED, | ||
59 | LSM303DLHC_ACC_BDU_BLOCK, | ||
60 | LSM303DLHC_ACC_END_LITTLE, | ||
61 | #endif | ||
62 | NULL, | ||
63 | NULL, | ||
64 | LSM303DLHC_COMP_FS_1P3GA, | ||
65 | LSM303DLHC_COMP_ODR_30HZ, | ||
66 | #if LSM303DLHC_USE_ADVANCED | ||
67 | LSM303DLHC_COMP_MD_BLOCK | ||
68 | #endif | ||
69 | }; | ||
70 | |||
71 | /*===========================================================================*/ | ||
72 | /* Generic code. */ | ||
73 | /*===========================================================================*/ | ||
74 | |||
75 | static BaseSequentialStream* chp = (BaseSequentialStream*)&SD1; | ||
76 | /* | ||
77 | * Red LED blinker thread, times are in milliseconds. | ||
78 | */ | ||
79 | static THD_WORKING_AREA(waThread1, 128); | ||
80 | static THD_FUNCTION(Thread1, arg) { | ||
81 | |||
82 | (void)arg; | ||
83 | chRegSetThreadName("blinker"); | ||
84 | while (true) { | ||
85 | palToggleLine(LINE_LED3_RED); | ||
86 | chThdSleepMilliseconds(250); | ||
87 | } | ||
88 | } | ||
89 | |||
90 | /* | ||
91 | * Application entry point. | ||
92 | */ | ||
93 | int main(void) { | ||
94 | |||
95 | /* | ||
96 | * System initializations. | ||
97 | * - HAL initialization, this also initializes the configured device drivers | ||
98 | * and performs the board-specific initializations. | ||
99 | * - Kernel initialization, the main() function becomes a thread and the | ||
100 | * RTOS is active. | ||
101 | */ | ||
102 | halInit(); | ||
103 | chSysInit(); | ||
104 | |||
105 | /* Activates the serial driver 1 using the driver default configuration.*/ | ||
106 | sdStart(&SD1, NULL); | ||
107 | |||
108 | /* Creates the blinker thread.*/ | ||
109 | chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); | ||
110 | |||
111 | /* LSM303DLHC Object Initialization.*/ | ||
112 | lsm303dlhcObjectInit(&LSM303DLHCD1); | ||
113 | |||
114 | /* Activates the LSM303DLHC driver.*/ | ||
115 | lsm303dlhcStart(&LSM303DLHCD1, &lsm303dlhccfg); | ||
116 | |||
117 | /* Normal main() thread activity, printing MEMS data on the SD1. */ | ||
118 | while (true) { | ||
119 | lsm303dlhcAccelerometerReadRaw(&LSM303DLHCD1, accraw); | ||
120 | chprintf(chp, "LSM303DLHC Accelerometer raw data...\r\n"); | ||
121 | for(i = 0; i < LSM303DLHC_ACC_NUMBER_OF_AXES; i++) { | ||
122 | chprintf(chp, "%c-axis: %d\r\n", axisID[i], accraw[i]); | ||
123 | } | ||
124 | |||
125 | lsm303dlhcCompassReadRaw(&LSM303DLHCD1, compraw); | ||
126 | chprintf(chp, "LSM303DLHC Compass raw data...\r\n"); | ||
127 | for(i = 0; i < LSM303DLHC_COMP_NUMBER_OF_AXES; i++) { | ||
128 | chprintf(chp, "%c-axis: %d\r\n", axisID[i], compraw[i]); | ||
129 | } | ||
130 | |||
131 | lsm303dlhcAccelerometerReadCooked(&LSM303DLHCD1, acccooked); | ||
132 | chprintf(chp, "LSM303DLHC Accelerometer cooked data...\r\n"); | ||
133 | for(i = 0; i < LSM303DLHC_ACC_NUMBER_OF_AXES; i++) { | ||
134 | chprintf(chp, "%c-axis: %.3f\r\n", axisID[i], acccooked[i]); | ||
135 | } | ||
136 | |||
137 | lsm303dlhcCompassReadCooked(&LSM303DLHCD1, compcooked); | ||
138 | chprintf(chp, "LSM303DLHC Compass cooked data...\r\n"); | ||
139 | for(i = 0; i < LSM303DLHC_COMP_NUMBER_OF_AXES; i++) { | ||
140 | chprintf(chp, "%c-axis: %.3f\r\n", axisID[i], compcooked[i]); | ||
141 | } | ||
142 | chThdSleepMilliseconds(100); | ||
143 | cls(chp); | ||
144 | } | ||
145 | lsm303dlhcStop(&LSM303DLHCD1); | ||
146 | } | ||
diff --git a/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/readme.txt b/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/readme.txt new file mode 100644 index 000000000..3081e0559 --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F3xx/I2C-LSM303DLHC/readme.txt | |||
@@ -0,0 +1,26 @@ | |||
1 | ***************************************************************************** | ||
2 | ** ChibiOS/HAL + ChibiOS/EX - I2C + LSM303DLHC demo for STM32F3xx. ** | ||
3 | ***************************************************************************** | ||
4 | |||
5 | ** TARGET ** | ||
6 | |||
7 | The demo runs on an ST STM32F3-Discovery board. | ||
8 | |||
9 | ** The Demo ** | ||
10 | |||
11 | The demo prints LSM303DLHC data on the SD1 BaseSequentialStream. | ||
12 | |||
13 | ** Build Procedure ** | ||
14 | |||
15 | The demo has been tested using the free Codesourcery GCC-based toolchain | ||
16 | and YAGARTO. | ||
17 | Just modify the TRGT line in the makefile in order to use different GCC ports. | ||
18 | |||
19 | ** Notes ** | ||
20 | |||
21 | Some files used by the demo are not part of ChibiOS/RT but are copyright of | ||
22 | ST Microelectronics and are licensed under a different license. | ||
23 | Also note that not all the files present in the ST library are distributed | ||
24 | with ChibiOS/RT, you can find the whole library on the ST web site: | ||
25 | |||
26 | http://www.st.com | ||
diff --git a/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/Makefile b/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/Makefile new file mode 100644 index 000000000..afdb623ba --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/Makefile | |||
@@ -0,0 +1,189 @@ | |||
1 | ############################################################################## | ||
2 | # Build global options | ||
3 | # NOTE: Can be overridden externally. | ||
4 | # | ||
5 | |||
6 | # Compiler options here. | ||
7 | ifeq ($(USE_OPT),) | ||
8 | USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 | ||
9 | endif | ||
10 | |||
11 | # C specific options here (added to USE_OPT). | ||
12 | ifeq ($(USE_COPT),) | ||
13 | USE_COPT = | ||
14 | endif | ||
15 | |||
16 | # C++ specific options here (added to USE_OPT). | ||
17 | ifeq ($(USE_CPPOPT),) | ||
18 | USE_CPPOPT = -fno-rtti | ||
19 | endif | ||
20 | |||
21 | # Enable this if you want the linker to remove unused code and data. | ||
22 | ifeq ($(USE_LINK_GC),) | ||
23 | USE_LINK_GC = yes | ||
24 | endif | ||
25 | |||
26 | # Linker extra options here. | ||
27 | ifeq ($(USE_LDOPT),) | ||
28 | USE_LDOPT = | ||
29 | endif | ||
30 | |||
31 | # Enable this if you want link time optimizations (LTO). | ||
32 | ifeq ($(USE_LTO),) | ||
33 | USE_LTO = yes | ||
34 | endif | ||
35 | |||
36 | # Enable this if you want to see the full log while compiling. | ||
37 | ifeq ($(USE_VERBOSE_COMPILE),) | ||
38 | USE_VERBOSE_COMPILE = no | ||
39 | endif | ||
40 | |||
41 | # If enabled, this option makes the build process faster by not compiling | ||
42 | # modules not used in the current configuration. | ||
43 | ifeq ($(USE_SMART_BUILD),) | ||
44 | USE_SMART_BUILD = yes | ||
45 | endif | ||
46 | |||
47 | # | ||
48 | # Build global options | ||
49 | ############################################################################## | ||
50 | |||
51 | ############################################################################## | ||
52 | # Architecture or project specific options | ||
53 | # | ||
54 | |||
55 | # Stack size to be allocated to the Cortex-M process stack. This stack is | ||
56 | # the stack used by the main() thread. | ||
57 | ifeq ($(USE_PROCESS_STACKSIZE),) | ||
58 | USE_PROCESS_STACKSIZE = 0x400 | ||
59 | endif | ||
60 | |||
61 | # Stack size to the allocated to the Cortex-M main/exceptions stack. This | ||
62 | # stack is used for processing interrupts and exceptions. | ||
63 | ifeq ($(USE_EXCEPTIONS_STACKSIZE),) | ||
64 | USE_EXCEPTIONS_STACKSIZE = 0x400 | ||
65 | endif | ||
66 | |||
67 | # Enables the use of FPU (no, softfp, hard). | ||
68 | ifeq ($(USE_FPU),) | ||
69 | USE_FPU = hard | ||
70 | endif | ||
71 | |||
72 | # FPU-related options. | ||
73 | ifeq ($(USE_FPU_OPT),) | ||
74 | USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 | ||
75 | endif | ||
76 | |||
77 | # | ||
78 | # Architecture or project specific options | ||
79 | ############################################################################## | ||
80 | |||
81 | ############################################################################## | ||
82 | # Project, target, sources and paths | ||
83 | # | ||
84 | |||
85 | # Define project name here | ||
86 | PROJECT = ch | ||
87 | |||
88 | # Target settings. | ||
89 | MCU = cortex-m4 | ||
90 | |||
91 | # Imported source files and paths. | ||
92 | CHIBIOS := ../../../.. | ||
93 | CONFDIR := ./cfg | ||
94 | BUILDDIR := ./build | ||
95 | DEPDIR := ./.dep | ||
96 | |||
97 | # Licensing files. | ||
98 | include $(CHIBIOS)/os/license/license.mk | ||
99 | # Startup files. | ||
100 | include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk | ||
101 | # HAL-OSAL files (optional). | ||
102 | include $(CHIBIOS)/os/hal/hal.mk | ||
103 | include $(CHIBIOS)/os/hal/ports/STM32/STM32F3xx/platform.mk | ||
104 | include $(CHIBIOS)/os/hal/boards/ST_STM32F3_DISCOVERY/board.mk | ||
105 | include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk | ||
106 | # RTOS files (optional). | ||
107 | include $(CHIBIOS)/os/rt/rt.mk | ||
108 | include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk | ||
109 | # EX files (optional). | ||
110 | include $(CHIBIOS)/os/ex/devices/ST/l3gd20.mk | ||
111 | # Auto-build files in ./source recursively. | ||
112 | include $(CHIBIOS)/tools/mk/autobuild.mk | ||
113 | # Other files (optional). | ||
114 | include $(CHIBIOS)/os/hal/lib/streams/streams.mk | ||
115 | |||
116 | # Define linker script file here | ||
117 | LDSCRIPT= $(STARTUPLD)/STM32F303xC.ld | ||
118 | |||
119 | # C sources that can be compiled in ARM or THUMB mode depending on the global | ||
120 | # setting. | ||
121 | CSRC = $(ALLCSRC) \ | ||
122 | $(TESTSRC) \ | ||
123 | main.c | ||
124 | |||
125 | # C++ sources that can be compiled in ARM or THUMB mode depending on the global | ||
126 | # setting. | ||
127 | CPPSRC = $(ALLCPPSRC) | ||
128 | |||
129 | # List ASM source files here. | ||
130 | ASMSRC = $(ALLASMSRC) | ||
131 | |||
132 | # List ASM with preprocessor source files here. | ||
133 | ASMXSRC = $(ALLXASMSRC) | ||
134 | |||
135 | # Inclusion directories. | ||
136 | INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) | ||
137 | |||
138 | # Define C warning options here. | ||
139 | CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes | ||
140 | |||
141 | # Define C++ warning options here. | ||
142 | CPPWARN = -Wall -Wextra -Wundef | ||
143 | |||
144 | # | ||
145 | # Project, target, sources and paths | ||
146 | ############################################################################## | ||
147 | |||
148 | ############################################################################## | ||
149 | # Start of user section | ||
150 | # | ||
151 | |||
152 | # List all user C define here, like -D_DEBUG=1 | ||
153 | UDEFS = -DCHPRINTF_USE_FLOAT=1 | ||
154 | |||
155 | # Define ASM defines here | ||
156 | UADEFS = | ||
157 | |||
158 | # List all user directories here | ||
159 | UINCDIR = | ||
160 | |||
161 | # List the user directory to look for the libraries here | ||
162 | ULIBDIR = | ||
163 | |||
164 | # List all user libraries here | ||
165 | ULIBS = | ||
166 | |||
167 | # | ||
168 | # End of user section | ||
169 | ############################################################################## | ||
170 | |||
171 | ############################################################################## | ||
172 | # Common rules | ||
173 | # | ||
174 | |||
175 | RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk | ||
176 | include $(RULESPATH)/arm-none-eabi.mk | ||
177 | include $(RULESPATH)/rules.mk | ||
178 | |||
179 | # | ||
180 | # Common rules | ||
181 | ############################################################################## | ||
182 | |||
183 | ############################################################################## | ||
184 | # Custom rules | ||
185 | # | ||
186 | |||
187 | # | ||
188 | # Custom rules | ||
189 | ############################################################################## | ||
diff --git a/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/cfg/chconf.h b/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/cfg/chconf.h new file mode 100644 index 000000000..68759e0dd --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/cfg/chconf.h | |||
@@ -0,0 +1,756 @@ | |||
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 rt/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 config | ||
24 | * @details Kernel related settings and hooks. | ||
25 | * @{ | ||
26 | */ | ||
27 | |||
28 | #ifndef CHCONF_H | ||
29 | #define CHCONF_H | ||
30 | |||
31 | #define _CHIBIOS_RT_CONF_ | ||
32 | #define _CHIBIOS_RT_CONF_VER_6_1_ | ||
33 | |||
34 | /*===========================================================================*/ | ||
35 | /** | ||
36 | * @name System timers settings | ||
37 | * @{ | ||
38 | */ | ||
39 | /*===========================================================================*/ | ||
40 | |||
41 | /** | ||
42 | * @brief System time counter resolution. | ||
43 | * @note Allowed values are 16, 32 or 64 bits. | ||
44 | */ | ||
45 | #if !defined(CH_CFG_ST_RESOLUTION) | ||
46 | #define CH_CFG_ST_RESOLUTION 32 | ||
47 | #endif | ||
48 | |||
49 | /** | ||
50 | * @brief System tick frequency. | ||
51 | * @details Frequency of the system timer that drives the system ticks. This | ||
52 | * setting also defines the system tick time unit. | ||
53 | */ | ||
54 | #if !defined(CH_CFG_ST_FREQUENCY) | ||
55 | #define CH_CFG_ST_FREQUENCY 10000 | ||
56 | #endif | ||
57 | |||
58 | /** | ||
59 | * @brief Time intervals data size. | ||
60 | * @note Allowed values are 16, 32 or 64 bits. | ||
61 | */ | ||
62 | #if !defined(CH_CFG_INTERVALS_SIZE) | ||
63 | #define CH_CFG_INTERVALS_SIZE 32 | ||
64 | #endif | ||
65 | |||
66 | /** | ||
67 | * @brief Time types data size. | ||
68 | * @note Allowed values are 16 or 32 bits. | ||
69 | */ | ||
70 | #if !defined(CH_CFG_TIME_TYPES_SIZE) | ||
71 | #define CH_CFG_TIME_TYPES_SIZE 32 | ||
72 | #endif | ||
73 | |||
74 | /** | ||
75 | * @brief Time delta constant for the tick-less mode. | ||
76 | * @note If this value is zero then the system uses the classic | ||
77 | * periodic tick. This value represents the minimum number | ||
78 | * of ticks that is safe to specify in a timeout directive. | ||
79 | * The value one is not valid, timeouts are rounded up to | ||
80 | * this value. | ||
81 | */ | ||
82 | #if !defined(CH_CFG_ST_TIMEDELTA) | ||
83 | #define CH_CFG_ST_TIMEDELTA 2 | ||
84 | #endif | ||
85 | |||
86 | /** @} */ | ||
87 | |||
88 | /*===========================================================================*/ | ||
89 | /** | ||
90 | * @name Kernel parameters and options | ||
91 | * @{ | ||
92 | */ | ||
93 | /*===========================================================================*/ | ||
94 | |||
95 | /** | ||
96 | * @brief Round robin interval. | ||
97 | * @details This constant is the number of system ticks allowed for the | ||
98 | * threads before preemption occurs. Setting this value to zero | ||
99 | * disables the preemption for threads with equal priority and the | ||
100 | * round robin becomes cooperative. Note that higher priority | ||
101 | * threads can still preempt, the kernel is always preemptive. | ||
102 | * @note Disabling the round robin preemption makes the kernel more compact | ||
103 | * and generally faster. | ||
104 | * @note The round robin preemption is not supported in tickless mode and | ||
105 | * must be set to zero in that case. | ||
106 | */ | ||
107 | #if !defined(CH_CFG_TIME_QUANTUM) | ||
108 | #define CH_CFG_TIME_QUANTUM 0 | ||
109 | #endif | ||
110 | |||
111 | /** | ||
112 | * @brief Idle thread automatic spawn suppression. | ||
113 | * @details When this option is activated the function @p chSysInit() | ||
114 | * does not spawn the idle thread. The application @p main() | ||
115 | * function becomes the idle thread and must implement an | ||
116 | * infinite loop. | ||
117 | */ | ||
118 | #if !defined(CH_CFG_NO_IDLE_THREAD) | ||
119 | #define CH_CFG_NO_IDLE_THREAD FALSE | ||
120 | #endif | ||
121 | |||
122 | /** @} */ | ||
123 | |||
124 | /*===========================================================================*/ | ||
125 | /** | ||
126 | * @name Performance options | ||
127 | * @{ | ||
128 | */ | ||
129 | /*===========================================================================*/ | ||
130 | |||
131 | /** | ||
132 | * @brief OS optimization. | ||
133 | * @details If enabled then time efficient rather than space efficient code | ||
134 | * is used when two possible implementations exist. | ||
135 | * | ||
136 | * @note This is not related to the compiler optimization options. | ||
137 | * @note The default is @p TRUE. | ||
138 | */ | ||
139 | #if !defined(CH_CFG_OPTIMIZE_SPEED) | ||
140 | #define CH_CFG_OPTIMIZE_SPEED TRUE | ||
141 | #endif | ||
142 | |||
143 | /** @} */ | ||
144 | |||
145 | /*===========================================================================*/ | ||
146 | /** | ||
147 | * @name Subsystem options | ||
148 | * @{ | ||
149 | */ | ||
150 | /*===========================================================================*/ | ||
151 | |||
152 | /** | ||
153 | * @brief Time Measurement APIs. | ||
154 | * @details If enabled then the time measurement APIs are included in | ||
155 | * the kernel. | ||
156 | * | ||
157 | * @note The default is @p TRUE. | ||
158 | */ | ||
159 | #if !defined(CH_CFG_USE_TM) | ||
160 | #define CH_CFG_USE_TM TRUE | ||
161 | #endif | ||
162 | |||
163 | /** | ||
164 | * @brief Threads registry APIs. | ||
165 | * @details If enabled then the registry APIs are included in the kernel. | ||
166 | * | ||
167 | * @note The default is @p TRUE. | ||
168 | */ | ||
169 | #if !defined(CH_CFG_USE_REGISTRY) | ||
170 | #define CH_CFG_USE_REGISTRY TRUE | ||
171 | #endif | ||
172 | |||
173 | /** | ||
174 | * @brief Threads synchronization APIs. | ||
175 | * @details If enabled then the @p chThdWait() function is included in | ||
176 | * the kernel. | ||
177 | * | ||
178 | * @note The default is @p TRUE. | ||
179 | */ | ||
180 | #if !defined(CH_CFG_USE_WAITEXIT) | ||
181 | #define CH_CFG_USE_WAITEXIT TRUE | ||
182 | #endif | ||
183 | |||
184 | /** | ||
185 | * @brief Semaphores APIs. | ||
186 | * @details If enabled then the Semaphores APIs are included in the kernel. | ||
187 | * | ||
188 | * @note The default is @p TRUE. | ||
189 | */ | ||
190 | #if !defined(CH_CFG_USE_SEMAPHORES) | ||
191 | #define CH_CFG_USE_SEMAPHORES TRUE | ||
192 | #endif | ||
193 | |||
194 | /** | ||
195 | * @brief Semaphores queuing mode. | ||
196 | * @details If enabled then the threads are enqueued on semaphores by | ||
197 | * priority rather than in FIFO order. | ||
198 | * | ||
199 | * @note The default is @p FALSE. Enable this if you have special | ||
200 | * requirements. | ||
201 | * @note Requires @p CH_CFG_USE_SEMAPHORES. | ||
202 | */ | ||
203 | #if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY) | ||
204 | #define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE | ||
205 | #endif | ||
206 | |||
207 | /** | ||
208 | * @brief Mutexes APIs. | ||
209 | * @details If enabled then the mutexes APIs are included in the kernel. | ||
210 | * | ||
211 | * @note The default is @p TRUE. | ||
212 | */ | ||
213 | #if !defined(CH_CFG_USE_MUTEXES) | ||
214 | #define CH_CFG_USE_MUTEXES TRUE | ||
215 | #endif | ||
216 | |||
217 | /** | ||
218 | * @brief Enables recursive behavior on mutexes. | ||
219 | * @note Recursive mutexes are heavier and have an increased | ||
220 | * memory footprint. | ||
221 | * | ||
222 | * @note The default is @p FALSE. | ||
223 | * @note Requires @p CH_CFG_USE_MUTEXES. | ||
224 | */ | ||
225 | #if !defined(CH_CFG_USE_MUTEXES_RECURSIVE) | ||
226 | #define CH_CFG_USE_MUTEXES_RECURSIVE FALSE | ||
227 | #endif | ||
228 | |||
229 | /** | ||
230 | * @brief Conditional Variables APIs. | ||
231 | * @details If enabled then the conditional variables APIs are included | ||
232 | * in the kernel. | ||
233 | * | ||
234 | * @note The default is @p TRUE. | ||
235 | * @note Requires @p CH_CFG_USE_MUTEXES. | ||
236 | */ | ||
237 | #if !defined(CH_CFG_USE_CONDVARS) | ||
238 | #define CH_CFG_USE_CONDVARS TRUE | ||
239 | #endif | ||
240 | |||
241 | /** | ||
242 | * @brief Conditional Variables APIs with timeout. | ||
243 | * @details If enabled then the conditional variables APIs with timeout | ||
244 | * specification are included in the kernel. | ||
245 | * | ||
246 | * @note The default is @p TRUE. | ||
247 | * @note Requires @p CH_CFG_USE_CONDVARS. | ||
248 | */ | ||
249 | #if !defined(CH_CFG_USE_CONDVARS_TIMEOUT) | ||
250 | #define CH_CFG_USE_CONDVARS_TIMEOUT TRUE | ||
251 | #endif | ||
252 | |||
253 | /** | ||
254 | * @brief Events Flags APIs. | ||
255 | * @details If enabled then the event flags APIs are included in the kernel. | ||
256 | * | ||
257 | * @note The default is @p TRUE. | ||
258 | */ | ||
259 | #if !defined(CH_CFG_USE_EVENTS) | ||
260 | #define CH_CFG_USE_EVENTS TRUE | ||
261 | #endif | ||
262 | |||
263 | /** | ||
264 | * @brief Events Flags APIs with timeout. | ||
265 | * @details If enabled then the events APIs with timeout specification | ||
266 | * are included in the kernel. | ||
267 | * | ||
268 | * @note The default is @p TRUE. | ||
269 | * @note Requires @p CH_CFG_USE_EVENTS. | ||
270 | */ | ||
271 | #if !defined(CH_CFG_USE_EVENTS_TIMEOUT) | ||
272 | #define CH_CFG_USE_EVENTS_TIMEOUT TRUE | ||
273 | #endif | ||
274 | |||
275 | /** | ||
276 | * @brief Synchronous Messages APIs. | ||
277 | * @details If enabled then the synchronous messages APIs are included | ||
278 | * in the kernel. | ||
279 | * | ||
280 | * @note The default is @p TRUE. | ||
281 | */ | ||
282 | #if !defined(CH_CFG_USE_MESSAGES) | ||
283 | #define CH_CFG_USE_MESSAGES TRUE | ||
284 | #endif | ||
285 | |||
286 | /** | ||
287 | * @brief Synchronous Messages queuing mode. | ||
288 | * @details If enabled then messages are served by priority rather than in | ||
289 | * FIFO order. | ||
290 | * | ||
291 | * @note The default is @p FALSE. Enable this if you have special | ||
292 | * requirements. | ||
293 | * @note Requires @p CH_CFG_USE_MESSAGES. | ||
294 | */ | ||
295 | #if !defined(CH_CFG_USE_MESSAGES_PRIORITY) | ||
296 | #define CH_CFG_USE_MESSAGES_PRIORITY FALSE | ||
297 | #endif | ||
298 | |||
299 | /** | ||
300 | * @brief Dynamic Threads APIs. | ||
301 | * @details If enabled then the dynamic threads creation APIs are included | ||
302 | * in the kernel. | ||
303 | * | ||
304 | * @note The default is @p TRUE. | ||
305 | * @note Requires @p CH_CFG_USE_WAITEXIT. | ||
306 | * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. | ||
307 | */ | ||
308 | #if !defined(CH_CFG_USE_DYNAMIC) | ||
309 | #define CH_CFG_USE_DYNAMIC TRUE | ||
310 | #endif | ||
311 | |||
312 | /** @} */ | ||
313 | |||
314 | /*===========================================================================*/ | ||
315 | /** | ||
316 | * @name OSLIB options | ||
317 | * @{ | ||
318 | */ | ||
319 | /*===========================================================================*/ | ||
320 | |||
321 | /** | ||
322 | * @brief Mailboxes APIs. | ||
323 | * @details If enabled then the asynchronous messages (mailboxes) APIs are | ||
324 | * included in the kernel. | ||
325 | * | ||
326 | * @note The default is @p TRUE. | ||
327 | * @note Requires @p CH_CFG_USE_SEMAPHORES. | ||
328 | */ | ||
329 | #if !defined(CH_CFG_USE_MAILBOXES) | ||
330 | #define CH_CFG_USE_MAILBOXES TRUE | ||
331 | #endif | ||
332 | |||
333 | /** | ||
334 | * @brief Core Memory Manager APIs. | ||
335 | * @details If enabled then the core memory manager APIs are included | ||
336 | * in the kernel. | ||
337 | * | ||
338 | * @note The default is @p TRUE. | ||
339 | */ | ||
340 | #if !defined(CH_CFG_USE_MEMCORE) | ||
341 | #define CH_CFG_USE_MEMCORE TRUE | ||
342 | #endif | ||
343 | |||
344 | /** | ||
345 | * @brief Managed RAM size. | ||
346 | * @details Size of the RAM area to be managed by the OS. If set to zero | ||
347 | * then the whole available RAM is used. The core memory is made | ||
348 | * available to the heap allocator and/or can be used directly through | ||
349 | * the simplified core memory allocator. | ||
350 | * | ||
351 | * @note In order to let the OS manage the whole RAM the linker script must | ||
352 | * provide the @p __heap_base__ and @p __heap_end__ symbols. | ||
353 | * @note Requires @p CH_CFG_USE_MEMCORE. | ||
354 | */ | ||
355 | #if !defined(CH_CFG_MEMCORE_SIZE) | ||
356 | #define CH_CFG_MEMCORE_SIZE 0 | ||
357 | #endif | ||
358 | |||
359 | /** | ||
360 | * @brief Heap Allocator APIs. | ||
361 | * @details If enabled then the memory heap allocator APIs are included | ||
362 | * in the kernel. | ||
363 | * | ||
364 | * @note The default is @p TRUE. | ||
365 | * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or | ||
366 | * @p CH_CFG_USE_SEMAPHORES. | ||
367 | * @note Mutexes are recommended. | ||
368 | */ | ||
369 | #if !defined(CH_CFG_USE_HEAP) | ||
370 | #define CH_CFG_USE_HEAP TRUE | ||
371 | #endif | ||
372 | |||
373 | /** | ||
374 | * @brief Memory Pools Allocator APIs. | ||
375 | * @details If enabled then the memory pools allocator APIs are included | ||
376 | * in the kernel. | ||
377 | * | ||
378 | * @note The default is @p TRUE. | ||
379 | */ | ||
380 | #if !defined(CH_CFG_USE_MEMPOOLS) | ||
381 | #define CH_CFG_USE_MEMPOOLS TRUE | ||
382 | #endif | ||
383 | |||
384 | /** | ||
385 | * @brief Objects FIFOs APIs. | ||
386 | * @details If enabled then the objects FIFOs APIs are included | ||
387 | * in the kernel. | ||
388 | * | ||
389 | * @note The default is @p TRUE. | ||
390 | */ | ||
391 | #if !defined(CH_CFG_USE_OBJ_FIFOS) | ||
392 | #define CH_CFG_USE_OBJ_FIFOS TRUE | ||
393 | #endif | ||
394 | |||
395 | /** | ||
396 | * @brief Pipes APIs. | ||
397 | * @details If enabled then the pipes APIs are included | ||
398 | * in the kernel. | ||
399 | * | ||
400 | * @note The default is @p TRUE. | ||
401 | */ | ||
402 | #if !defined(CH_CFG_USE_PIPES) | ||
403 | #define CH_CFG_USE_PIPES TRUE | ||
404 | #endif | ||
405 | |||
406 | /** | ||
407 | * @brief Objects Caches APIs. | ||
408 | * @details If enabled then the objects caches APIs are included | ||
409 | * in the kernel. | ||
410 | * | ||
411 | * @note The default is @p TRUE. | ||
412 | */ | ||
413 | #if !defined(CH_CFG_USE_OBJ_CACHES) | ||
414 | #define CH_CFG_USE_OBJ_CACHES TRUE | ||
415 | #endif | ||
416 | |||
417 | /** | ||
418 | * @brief Delegate threads APIs. | ||
419 | * @details If enabled then the delegate threads APIs are included | ||
420 | * in the kernel. | ||
421 | * | ||
422 | * @note The default is @p TRUE. | ||
423 | */ | ||
424 | #if !defined(CH_CFG_USE_DELEGATES) | ||
425 | #define CH_CFG_USE_DELEGATES TRUE | ||
426 | #endif | ||
427 | |||
428 | /** | ||
429 | * @brief Jobs Queues APIs. | ||
430 | * @details If enabled then the jobs queues APIs are included | ||
431 | * in the kernel. | ||
432 | * | ||
433 | * @note The default is @p TRUE. | ||
434 | */ | ||
435 | #if !defined(CH_CFG_USE_JOBS) | ||
436 | #define CH_CFG_USE_JOBS TRUE | ||
437 | #endif | ||
438 | |||
439 | /** @} */ | ||
440 | |||
441 | /*===========================================================================*/ | ||
442 | /** | ||
443 | * @name Objects factory options | ||
444 | * @{ | ||
445 | */ | ||
446 | /*===========================================================================*/ | ||
447 | |||
448 | /** | ||
449 | * @brief Objects Factory APIs. | ||
450 | * @details If enabled then the objects factory APIs are included in the | ||
451 | * kernel. | ||
452 | * | ||
453 | * @note The default is @p FALSE. | ||
454 | */ | ||
455 | #if !defined(CH_CFG_USE_FACTORY) | ||
456 | #define CH_CFG_USE_FACTORY TRUE | ||
457 | #endif | ||
458 | |||
459 | /** | ||
460 | * @brief Maximum length for object names. | ||
461 | * @details If the specified length is zero then the name is stored by | ||
462 | * pointer but this could have unintended side effects. | ||
463 | */ | ||
464 | #if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH) | ||
465 | #define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8 | ||
466 | #endif | ||
467 | |||
468 | /** | ||
469 | * @brief Enables the registry of generic objects. | ||
470 | */ | ||
471 | #if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY) | ||
472 | #define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE | ||
473 | #endif | ||
474 | |||
475 | /** | ||
476 | * @brief Enables factory for generic buffers. | ||
477 | */ | ||
478 | #if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS) | ||
479 | #define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE | ||
480 | #endif | ||
481 | |||
482 | /** | ||
483 | * @brief Enables factory for semaphores. | ||
484 | */ | ||
485 | #if !defined(CH_CFG_FACTORY_SEMAPHORES) | ||
486 | #define CH_CFG_FACTORY_SEMAPHORES TRUE | ||
487 | #endif | ||
488 | |||
489 | /** | ||
490 | * @brief Enables factory for mailboxes. | ||
491 | */ | ||
492 | #if !defined(CH_CFG_FACTORY_MAILBOXES) | ||
493 | #define CH_CFG_FACTORY_MAILBOXES TRUE | ||
494 | #endif | ||
495 | |||
496 | /** | ||
497 | * @brief Enables factory for objects FIFOs. | ||
498 | */ | ||
499 | #if !defined(CH_CFG_FACTORY_OBJ_FIFOS) | ||
500 | #define CH_CFG_FACTORY_OBJ_FIFOS TRUE | ||
501 | #endif | ||
502 | |||
503 | /** | ||
504 | * @brief Enables factory for Pipes. | ||
505 | */ | ||
506 | #if !defined(CH_CFG_FACTORY_PIPES) || defined(__DOXYGEN__) | ||
507 | #define CH_CFG_FACTORY_PIPES TRUE | ||
508 | #endif | ||
509 | |||
510 | /** @} */ | ||
511 | |||
512 | /*===========================================================================*/ | ||
513 | /** | ||
514 | * @name Debug options | ||
515 | * @{ | ||
516 | */ | ||
517 | /*===========================================================================*/ | ||
518 | |||
519 | /** | ||
520 | * @brief Debug option, kernel statistics. | ||
521 | * | ||
522 | * @note The default is @p FALSE. | ||
523 | */ | ||
524 | #if !defined(CH_DBG_STATISTICS) | ||
525 | #define CH_DBG_STATISTICS FALSE | ||
526 | #endif | ||
527 | |||
528 | /** | ||
529 | * @brief Debug option, system state check. | ||
530 | * @details If enabled the correct call protocol for system APIs is checked | ||
531 | * at runtime. | ||
532 | * | ||
533 | * @note The default is @p FALSE. | ||
534 | */ | ||
535 | #if !defined(CH_DBG_SYSTEM_STATE_CHECK) | ||
536 | #define CH_DBG_SYSTEM_STATE_CHECK FALSE | ||
537 | #endif | ||
538 | |||
539 | /** | ||
540 | * @brief Debug option, parameters checks. | ||
541 | * @details If enabled then the checks on the API functions input | ||
542 | * parameters are activated. | ||
543 | * | ||
544 | * @note The default is @p FALSE. | ||
545 | */ | ||
546 | #if !defined(CH_DBG_ENABLE_CHECKS) | ||
547 | #define CH_DBG_ENABLE_CHECKS FALSE | ||
548 | #endif | ||
549 | |||
550 | /** | ||
551 | * @brief Debug option, consistency checks. | ||
552 | * @details If enabled then all the assertions in the kernel code are | ||
553 | * activated. This includes consistency checks inside the kernel, | ||
554 | * runtime anomalies and port-defined checks. | ||
555 | * | ||
556 | * @note The default is @p FALSE. | ||
557 | */ | ||
558 | #if !defined(CH_DBG_ENABLE_ASSERTS) | ||
559 | #define CH_DBG_ENABLE_ASSERTS FALSE | ||
560 | #endif | ||
561 | |||
562 | /** | ||
563 | * @brief Debug option, trace buffer. | ||
564 | * @details If enabled then the trace buffer is activated. | ||
565 | * | ||
566 | * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. | ||
567 | */ | ||
568 | #if !defined(CH_DBG_TRACE_MASK) | ||
569 | #define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED | ||
570 | #endif | ||
571 | |||
572 | /** | ||
573 | * @brief Trace buffer entries. | ||
574 | * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is | ||
575 | * different from @p CH_DBG_TRACE_MASK_DISABLED. | ||
576 | */ | ||
577 | #if !defined(CH_DBG_TRACE_BUFFER_SIZE) | ||
578 | #define CH_DBG_TRACE_BUFFER_SIZE 128 | ||
579 | #endif | ||
580 | |||
581 | /** | ||
582 | * @brief Debug option, stack checks. | ||
583 | * @details If enabled then a runtime stack check is performed. | ||
584 | * | ||
585 | * @note The default is @p FALSE. | ||
586 | * @note The stack check is performed in a architecture/port dependent way. | ||
587 | * It may not be implemented or some ports. | ||
588 | * @note The default failure mode is to halt the system with the global | ||
589 | * @p panic_msg variable set to @p NULL. | ||
590 | */ | ||
591 | #if !defined(CH_DBG_ENABLE_STACK_CHECK) | ||
592 | #define CH_DBG_ENABLE_STACK_CHECK FALSE | ||
593 | #endif | ||
594 | |||
595 | /** | ||
596 | * @brief Debug option, stacks initialization. | ||
597 | * @details If enabled then the threads working area is filled with a byte | ||
598 | * value when a thread is created. This can be useful for the | ||
599 | * runtime measurement of the used stack. | ||
600 | * | ||
601 | * @note The default is @p FALSE. | ||
602 | */ | ||
603 | #if !defined(CH_DBG_FILL_THREADS) | ||
604 | #define CH_DBG_FILL_THREADS FALSE | ||
605 | #endif | ||
606 | |||
607 | /** | ||
608 | * @brief Debug option, threads profiling. | ||
609 | * @details If enabled then a field is added to the @p thread_t structure that | ||
610 | * counts the system ticks occurred while executing the thread. | ||
611 | * | ||
612 | * @note The default is @p FALSE. | ||
613 | * @note This debug option is not currently compatible with the | ||
614 | * tickless mode. | ||
615 | */ | ||
616 | #if !defined(CH_DBG_THREADS_PROFILING) | ||
617 | #define CH_DBG_THREADS_PROFILING FALSE | ||
618 | #endif | ||
619 | |||
620 | /** @} */ | ||
621 | |||
622 | /*===========================================================================*/ | ||
623 | /** | ||
624 | * @name Kernel hooks | ||
625 | * @{ | ||
626 | */ | ||
627 | /*===========================================================================*/ | ||
628 | |||
629 | /** | ||
630 | * @brief System structure extension. | ||
631 | * @details User fields added to the end of the @p ch_system_t structure. | ||
632 | */ | ||
633 | #define CH_CFG_SYSTEM_EXTRA_FIELDS \ | ||
634 | /* Add threads custom fields here.*/ | ||
635 | |||
636 | /** | ||
637 | * @brief System initialization hook. | ||
638 | * @details User initialization code added to the @p chSysInit() function | ||
639 | * just before interrupts are enabled globally. | ||
640 | */ | ||
641 | #define CH_CFG_SYSTEM_INIT_HOOK() { \ | ||
642 | /* Add threads initialization code here.*/ \ | ||
643 | } | ||
644 | |||
645 | /** | ||
646 | * @brief Threads descriptor structure extension. | ||
647 | * @details User fields added to the end of the @p thread_t structure. | ||
648 | */ | ||
649 | #define CH_CFG_THREAD_EXTRA_FIELDS \ | ||
650 | /* Add threads custom fields here.*/ | ||
651 | |||
652 | /** | ||
653 | * @brief Threads initialization hook. | ||
654 | * @details User initialization code added to the @p _thread_init() function. | ||
655 | * | ||
656 | * @note It is invoked from within @p _thread_init() and implicitly from all | ||
657 | * the threads creation APIs. | ||
658 | */ | ||
659 | #define CH_CFG_THREAD_INIT_HOOK(tp) { \ | ||
660 | /* Add threads initialization code here.*/ \ | ||
661 | } | ||
662 | |||
663 | /** | ||
664 | * @brief Threads finalization hook. | ||
665 | * @details User finalization code added to the @p chThdExit() API. | ||
666 | */ | ||
667 | #define CH_CFG_THREAD_EXIT_HOOK(tp) { \ | ||
668 | /* Add threads finalization code here.*/ \ | ||
669 | } | ||
670 | |||
671 | /** | ||
672 | * @brief Context switch hook. | ||
673 | * @details This hook is invoked just before switching between threads. | ||
674 | */ | ||
675 | #define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ | ||
676 | /* Context switch code here.*/ \ | ||
677 | } | ||
678 | |||
679 | /** | ||
680 | * @brief ISR enter hook. | ||
681 | */ | ||
682 | #define CH_CFG_IRQ_PROLOGUE_HOOK() { \ | ||
683 | /* IRQ prologue code here.*/ \ | ||
684 | } | ||
685 | |||
686 | /** | ||
687 | * @brief ISR exit hook. | ||
688 | */ | ||
689 | #define CH_CFG_IRQ_EPILOGUE_HOOK() { \ | ||
690 | /* IRQ epilogue code here.*/ \ | ||
691 | } | ||
692 | |||
693 | /** | ||
694 | * @brief Idle thread enter hook. | ||
695 | * @note This hook is invoked within a critical zone, no OS functions | ||
696 | * should be invoked from here. | ||
697 | * @note This macro can be used to activate a power saving mode. | ||
698 | */ | ||
699 | #define CH_CFG_IDLE_ENTER_HOOK() { \ | ||
700 | /* Idle-enter code here.*/ \ | ||
701 | } | ||
702 | |||
703 | /** | ||
704 | * @brief Idle thread leave hook. | ||
705 | * @note This hook is invoked within a critical zone, no OS functions | ||
706 | * should be invoked from here. | ||
707 | * @note This macro can be used to deactivate a power saving mode. | ||
708 | */ | ||
709 | #define CH_CFG_IDLE_LEAVE_HOOK() { \ | ||
710 | /* Idle-leave code here.*/ \ | ||
711 | } | ||
712 | |||
713 | /** | ||
714 | * @brief Idle Loop hook. | ||
715 | * @details This hook is continuously invoked by the idle thread loop. | ||
716 | */ | ||
717 | #define CH_CFG_IDLE_LOOP_HOOK() { \ | ||
718 | /* Idle loop code here.*/ \ | ||
719 | } | ||
720 | |||
721 | /** | ||
722 | * @brief System tick event hook. | ||
723 | * @details This hook is invoked in the system tick handler immediately | ||
724 | * after processing the virtual timers queue. | ||
725 | */ | ||
726 | #define CH_CFG_SYSTEM_TICK_HOOK() { \ | ||
727 | /* System tick event code here.*/ \ | ||
728 | } | ||
729 | |||
730 | /** | ||
731 | * @brief System halt hook. | ||
732 | * @details This hook is invoked in case to a system halting error before | ||
733 | * the system is halted. | ||
734 | */ | ||
735 | #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ | ||
736 | /* System halt code here.*/ \ | ||
737 | } | ||
738 | |||
739 | /** | ||
740 | * @brief Trace hook. | ||
741 | * @details This hook is invoked each time a new record is written in the | ||
742 | * trace buffer. | ||
743 | */ | ||
744 | #define CH_CFG_TRACE_HOOK(tep) { \ | ||
745 | /* Trace code here.*/ \ | ||
746 | } | ||
747 | |||
748 | /** @} */ | ||
749 | |||
750 | /*===========================================================================*/ | ||
751 | /* Port-specific settings (override port settings defaulted in chcore.h). */ | ||
752 | /*===========================================================================*/ | ||
753 | |||
754 | #endif /* CHCONF_H */ | ||
755 | |||
756 | /** @} */ | ||
diff --git a/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/cfg/halconf.h b/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/cfg/halconf.h new file mode 100644 index 000000000..5756411da --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/cfg/halconf.h | |||
@@ -0,0 +1,531 @@ | |||
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 templates/halconf.h | ||
19 | * @brief HAL configuration header. | ||
20 | * @details HAL configuration file, this file allows to enable or disable the | ||
21 | * various device drivers from your application. You may also use | ||
22 | * this file in order to override the device drivers default settings. | ||
23 | * | ||
24 | * @addtogroup HAL_CONF | ||
25 | * @{ | ||
26 | */ | ||
27 | |||
28 | #ifndef HALCONF_H | ||
29 | #define HALCONF_H | ||
30 | |||
31 | #define _CHIBIOS_HAL_CONF_ | ||
32 | #define _CHIBIOS_HAL_CONF_VER_7_1_ | ||
33 | |||
34 | #include "mcuconf.h" | ||
35 | |||
36 | /** | ||
37 | * @brief Enables the PAL subsystem. | ||
38 | */ | ||
39 | #if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) | ||
40 | #define HAL_USE_PAL TRUE | ||
41 | #endif | ||
42 | |||
43 | /** | ||
44 | * @brief Enables the ADC subsystem. | ||
45 | */ | ||
46 | #if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) | ||
47 | #define HAL_USE_ADC FALSE | ||
48 | #endif | ||
49 | |||
50 | /** | ||
51 | * @brief Enables the CAN subsystem. | ||
52 | */ | ||
53 | #if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) | ||
54 | #define HAL_USE_CAN FALSE | ||
55 | #endif | ||
56 | |||
57 | /** | ||
58 | * @brief Enables the cryptographic subsystem. | ||
59 | */ | ||
60 | #if !defined(HAL_USE_CRY) || defined(__DOXYGEN__) | ||
61 | #define HAL_USE_CRY FALSE | ||
62 | #endif | ||
63 | |||
64 | /** | ||
65 | * @brief Enables the DAC subsystem. | ||
66 | */ | ||
67 | #if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) | ||
68 | #define HAL_USE_DAC FALSE | ||
69 | #endif | ||
70 | |||
71 | /** | ||
72 | * @brief Enables the EFlash subsystem. | ||
73 | */ | ||
74 | #if !defined(HAL_USE_EFL) || defined(__DOXYGEN__) | ||
75 | #define HAL_USE_EFL FALSE | ||
76 | #endif | ||
77 | |||
78 | /** | ||
79 | * @brief Enables the GPT subsystem. | ||
80 | */ | ||
81 | #if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) | ||
82 | #define HAL_USE_GPT FALSE | ||
83 | #endif | ||
84 | |||
85 | /** | ||
86 | * @brief Enables the I2C subsystem. | ||
87 | */ | ||
88 | #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) | ||
89 | #define HAL_USE_I2C FALSE | ||
90 | #endif | ||
91 | |||
92 | /** | ||
93 | * @brief Enables the I2S subsystem. | ||
94 | */ | ||
95 | #if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) | ||
96 | #define HAL_USE_I2S FALSE | ||
97 | #endif | ||
98 | |||
99 | /** | ||
100 | * @brief Enables the ICU subsystem. | ||
101 | */ | ||
102 | #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) | ||
103 | #define HAL_USE_ICU FALSE | ||
104 | #endif | ||
105 | |||
106 | /** | ||
107 | * @brief Enables the MAC subsystem. | ||
108 | */ | ||
109 | #if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) | ||
110 | #define HAL_USE_MAC FALSE | ||
111 | #endif | ||
112 | |||
113 | /** | ||
114 | * @brief Enables the MMC_SPI subsystem. | ||
115 | */ | ||
116 | #if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) | ||
117 | #define HAL_USE_MMC_SPI FALSE | ||
118 | #endif | ||
119 | |||
120 | /** | ||
121 | * @brief Enables the PWM subsystem. | ||
122 | */ | ||
123 | #if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) | ||
124 | #define HAL_USE_PWM FALSE | ||
125 | #endif | ||
126 | |||
127 | /** | ||
128 | * @brief Enables the RTC subsystem. | ||
129 | */ | ||
130 | #if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) | ||
131 | #define HAL_USE_RTC FALSE | ||
132 | #endif | ||
133 | |||
134 | /** | ||
135 | * @brief Enables the SDC subsystem. | ||
136 | */ | ||
137 | #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) | ||
138 | #define HAL_USE_SDC FALSE | ||
139 | #endif | ||
140 | |||
141 | /** | ||
142 | * @brief Enables the SERIAL subsystem. | ||
143 | */ | ||
144 | #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) | ||
145 | #define HAL_USE_SERIAL TRUE | ||
146 | #endif | ||
147 | |||
148 | /** | ||
149 | * @brief Enables the SERIAL over USB subsystem. | ||
150 | */ | ||
151 | #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) | ||
152 | #define HAL_USE_SERIAL_USB FALSE | ||
153 | #endif | ||
154 | |||
155 | /** | ||
156 | * @brief Enables the SIO subsystem. | ||
157 | */ | ||
158 | #if !defined(HAL_USE_SIO) || defined(__DOXYGEN__) | ||
159 | #define HAL_USE_SIO FALSE | ||
160 | #endif | ||
161 | |||
162 | /** | ||
163 | * @brief Enables the SPI subsystem. | ||
164 | */ | ||
165 | #if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) | ||
166 | #define HAL_USE_SPI TRUE | ||
167 | #endif | ||
168 | |||
169 | /** | ||
170 | * @brief Enables the TRNG subsystem. | ||
171 | */ | ||
172 | #if !defined(HAL_USE_TRNG) || defined(__DOXYGEN__) | ||
173 | #define HAL_USE_TRNG FALSE | ||
174 | #endif | ||
175 | |||
176 | /** | ||
177 | * @brief Enables the UART subsystem. | ||
178 | */ | ||
179 | #if !defined(HAL_USE_UART) || defined(__DOXYGEN__) | ||
180 | #define HAL_USE_UART FALSE | ||
181 | #endif | ||
182 | |||
183 | /** | ||
184 | * @brief Enables the USB subsystem. | ||
185 | */ | ||
186 | #if !defined(HAL_USE_USB) || defined(__DOXYGEN__) | ||
187 | #define HAL_USE_USB FALSE | ||
188 | #endif | ||
189 | |||
190 | /** | ||
191 | * @brief Enables the WDG subsystem. | ||
192 | */ | ||
193 | #if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) | ||
194 | #define HAL_USE_WDG FALSE | ||
195 | #endif | ||
196 | |||
197 | /** | ||
198 | * @brief Enables the WSPI subsystem. | ||
199 | */ | ||
200 | #if !defined(HAL_USE_WSPI) || defined(__DOXYGEN__) | ||
201 | #define HAL_USE_WSPI FALSE | ||
202 | #endif | ||
203 | |||
204 | /*===========================================================================*/ | ||
205 | /* PAL driver related settings. */ | ||
206 | /*===========================================================================*/ | ||
207 | |||
208 | /** | ||
209 | * @brief Enables synchronous APIs. | ||
210 | * @note Disabling this option saves both code and data space. | ||
211 | */ | ||
212 | #if !defined(PAL_USE_CALLBACKS) || defined(__DOXYGEN__) | ||
213 | #define PAL_USE_CALLBACKS FALSE | ||
214 | #endif | ||
215 | |||
216 | /** | ||
217 | * @brief Enables synchronous APIs. | ||
218 | * @note Disabling this option saves both code and data space. | ||
219 | */ | ||
220 | #if !defined(PAL_USE_WAIT) || defined(__DOXYGEN__) | ||
221 | #define PAL_USE_WAIT FALSE | ||
222 | #endif | ||
223 | |||
224 | /*===========================================================================*/ | ||
225 | /* ADC driver related settings. */ | ||
226 | /*===========================================================================*/ | ||
227 | |||
228 | /** | ||
229 | * @brief Enables synchronous APIs. | ||
230 | * @note Disabling this option saves both code and data space. | ||
231 | */ | ||
232 | #if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) | ||
233 | #define ADC_USE_WAIT TRUE | ||
234 | #endif | ||
235 | |||
236 | /** | ||
237 | * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. | ||
238 | * @note Disabling this option saves both code and data space. | ||
239 | */ | ||
240 | #if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
241 | #define ADC_USE_MUTUAL_EXCLUSION TRUE | ||
242 | #endif | ||
243 | |||
244 | /*===========================================================================*/ | ||
245 | /* CAN driver related settings. */ | ||
246 | /*===========================================================================*/ | ||
247 | |||
248 | /** | ||
249 | * @brief Sleep mode related APIs inclusion switch. | ||
250 | */ | ||
251 | #if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) | ||
252 | #define CAN_USE_SLEEP_MODE TRUE | ||
253 | #endif | ||
254 | |||
255 | /** | ||
256 | * @brief Enforces the driver to use direct callbacks rather than OSAL events. | ||
257 | */ | ||
258 | #if !defined(CAN_ENFORCE_USE_CALLBACKS) || defined(__DOXYGEN__) | ||
259 | #define CAN_ENFORCE_USE_CALLBACKS FALSE | ||
260 | #endif | ||
261 | |||
262 | /*===========================================================================*/ | ||
263 | /* CRY driver related settings. */ | ||
264 | /*===========================================================================*/ | ||
265 | |||
266 | /** | ||
267 | * @brief Enables the SW fall-back of the cryptographic driver. | ||
268 | * @details When enabled, this option, activates a fall-back software | ||
269 | * implementation for algorithms not supported by the underlying | ||
270 | * hardware. | ||
271 | * @note Fall-back implementations may not be present for all algorithms. | ||
272 | */ | ||
273 | #if !defined(HAL_CRY_USE_FALLBACK) || defined(__DOXYGEN__) | ||
274 | #define HAL_CRY_USE_FALLBACK FALSE | ||
275 | #endif | ||
276 | |||
277 | /** | ||
278 | * @brief Makes the driver forcibly use the fall-back implementations. | ||
279 | */ | ||
280 | #if !defined(HAL_CRY_ENFORCE_FALLBACK) || defined(__DOXYGEN__) | ||
281 | #define HAL_CRY_ENFORCE_FALLBACK FALSE | ||
282 | #endif | ||
283 | |||
284 | /*===========================================================================*/ | ||
285 | /* DAC driver related settings. */ | ||
286 | /*===========================================================================*/ | ||
287 | |||
288 | /** | ||
289 | * @brief Enables synchronous APIs. | ||
290 | * @note Disabling this option saves both code and data space. | ||
291 | */ | ||
292 | #if !defined(DAC_USE_WAIT) || defined(__DOXYGEN__) | ||
293 | #define DAC_USE_WAIT TRUE | ||
294 | #endif | ||
295 | |||
296 | /** | ||
297 | * @brief Enables the @p dacAcquireBus() and @p dacReleaseBus() APIs. | ||
298 | * @note Disabling this option saves both code and data space. | ||
299 | */ | ||
300 | #if !defined(DAC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
301 | #define DAC_USE_MUTUAL_EXCLUSION TRUE | ||
302 | #endif | ||
303 | |||
304 | /*===========================================================================*/ | ||
305 | /* I2C driver related settings. */ | ||
306 | /*===========================================================================*/ | ||
307 | |||
308 | /** | ||
309 | * @brief Enables the mutual exclusion APIs on the I2C bus. | ||
310 | */ | ||
311 | #if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
312 | #define I2C_USE_MUTUAL_EXCLUSION TRUE | ||
313 | #endif | ||
314 | |||
315 | /*===========================================================================*/ | ||
316 | /* MAC driver related settings. */ | ||
317 | /*===========================================================================*/ | ||
318 | |||
319 | /** | ||
320 | * @brief Enables the zero-copy API. | ||
321 | */ | ||
322 | #if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) | ||
323 | #define MAC_USE_ZERO_COPY FALSE | ||
324 | #endif | ||
325 | |||
326 | /** | ||
327 | * @brief Enables an event sources for incoming packets. | ||
328 | */ | ||
329 | #if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) | ||
330 | #define MAC_USE_EVENTS TRUE | ||
331 | #endif | ||
332 | |||
333 | /*===========================================================================*/ | ||
334 | /* MMC_SPI driver related settings. */ | ||
335 | /*===========================================================================*/ | ||
336 | |||
337 | /** | ||
338 | * @brief Delays insertions. | ||
339 | * @details If enabled this options inserts delays into the MMC waiting | ||
340 | * routines releasing some extra CPU time for the threads with | ||
341 | * lower priority, this may slow down the driver a bit however. | ||
342 | * This option is recommended also if the SPI driver does not | ||
343 | * use a DMA channel and heavily loads the CPU. | ||
344 | */ | ||
345 | #if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) | ||
346 | #define MMC_NICE_WAITING TRUE | ||
347 | #endif | ||
348 | |||
349 | /*===========================================================================*/ | ||
350 | /* SDC driver related settings. */ | ||
351 | /*===========================================================================*/ | ||
352 | |||
353 | /** | ||
354 | * @brief Number of initialization attempts before rejecting the card. | ||
355 | * @note Attempts are performed at 10mS intervals. | ||
356 | */ | ||
357 | #if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) | ||
358 | #define SDC_INIT_RETRY 100 | ||
359 | #endif | ||
360 | |||
361 | /** | ||
362 | * @brief Include support for MMC cards. | ||
363 | * @note MMC support is not yet implemented so this option must be kept | ||
364 | * at @p FALSE. | ||
365 | */ | ||
366 | #if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) | ||
367 | #define SDC_MMC_SUPPORT FALSE | ||
368 | #endif | ||
369 | |||
370 | /** | ||
371 | * @brief Delays insertions. | ||
372 | * @details If enabled this options inserts delays into the MMC waiting | ||
373 | * routines releasing some extra CPU time for the threads with | ||
374 | * lower priority, this may slow down the driver a bit however. | ||
375 | */ | ||
376 | #if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) | ||
377 | #define SDC_NICE_WAITING TRUE | ||
378 | #endif | ||
379 | |||
380 | /** | ||
381 | * @brief OCR initialization constant for V20 cards. | ||
382 | */ | ||
383 | #if !defined(SDC_INIT_OCR_V20) || defined(__DOXYGEN__) | ||
384 | #define SDC_INIT_OCR_V20 0x50FF8000U | ||
385 | #endif | ||
386 | |||
387 | /** | ||
388 | * @brief OCR initialization constant for non-V20 cards. | ||
389 | */ | ||
390 | #if !defined(SDC_INIT_OCR) || defined(__DOXYGEN__) | ||
391 | #define SDC_INIT_OCR 0x80100000U | ||
392 | #endif | ||
393 | |||
394 | /*===========================================================================*/ | ||
395 | /* SERIAL driver related settings. */ | ||
396 | /*===========================================================================*/ | ||
397 | |||
398 | /** | ||
399 | * @brief Default bit rate. | ||
400 | * @details Configuration parameter, this is the baud rate selected for the | ||
401 | * default configuration. | ||
402 | */ | ||
403 | #if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) | ||
404 | #define SERIAL_DEFAULT_BITRATE 38400 | ||
405 | #endif | ||
406 | |||
407 | /** | ||
408 | * @brief Serial buffers size. | ||
409 | * @details Configuration parameter, you can change the depth of the queue | ||
410 | * buffers depending on the requirements of your application. | ||
411 | * @note The default is 16 bytes for both the transmission and receive | ||
412 | * buffers. | ||
413 | */ | ||
414 | #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) | ||
415 | #define SERIAL_BUFFERS_SIZE 16 | ||
416 | #endif | ||
417 | |||
418 | /*===========================================================================*/ | ||
419 | /* SERIAL_USB driver related setting. */ | ||
420 | /*===========================================================================*/ | ||
421 | |||
422 | /** | ||
423 | * @brief Serial over USB buffers size. | ||
424 | * @details Configuration parameter, the buffer size must be a multiple of | ||
425 | * the USB data endpoint maximum packet size. | ||
426 | * @note The default is 256 bytes for both the transmission and receive | ||
427 | * buffers. | ||
428 | */ | ||
429 | #if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) | ||
430 | #define SERIAL_USB_BUFFERS_SIZE 256 | ||
431 | #endif | ||
432 | |||
433 | /** | ||
434 | * @brief Serial over USB number of buffers. | ||
435 | * @note The default is 2 buffers. | ||
436 | */ | ||
437 | #if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) | ||
438 | #define SERIAL_USB_BUFFERS_NUMBER 2 | ||
439 | #endif | ||
440 | |||
441 | /*===========================================================================*/ | ||
442 | /* SPI driver related settings. */ | ||
443 | /*===========================================================================*/ | ||
444 | |||
445 | /** | ||
446 | * @brief Enables synchronous APIs. | ||
447 | * @note Disabling this option saves both code and data space. | ||
448 | */ | ||
449 | #if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) | ||
450 | #define SPI_USE_WAIT TRUE | ||
451 | #endif | ||
452 | |||
453 | /** | ||
454 | * @brief Enables circular transfers APIs. | ||
455 | * @note Disabling this option saves both code and data space. | ||
456 | */ | ||
457 | #if !defined(SPI_USE_CIRCULAR) || defined(__DOXYGEN__) | ||
458 | #define SPI_USE_CIRCULAR FALSE | ||
459 | #endif | ||
460 | |||
461 | /** | ||
462 | * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. | ||
463 | * @note Disabling this option saves both code and data space. | ||
464 | */ | ||
465 | #if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
466 | #define SPI_USE_MUTUAL_EXCLUSION TRUE | ||
467 | #endif | ||
468 | |||
469 | /** | ||
470 | * @brief Handling method for SPI CS line. | ||
471 | * @note Disabling this option saves both code and data space. | ||
472 | */ | ||
473 | #if !defined(SPI_SELECT_MODE) || defined(__DOXYGEN__) | ||
474 | #define SPI_SELECT_MODE SPI_SELECT_MODE_PAD | ||
475 | #endif | ||
476 | |||
477 | /*===========================================================================*/ | ||
478 | /* UART driver related settings. */ | ||
479 | /*===========================================================================*/ | ||
480 | |||
481 | /** | ||
482 | * @brief Enables synchronous APIs. | ||
483 | * @note Disabling this option saves both code and data space. | ||
484 | */ | ||
485 | #if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) | ||
486 | #define UART_USE_WAIT FALSE | ||
487 | #endif | ||
488 | |||
489 | /** | ||
490 | * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. | ||
491 | * @note Disabling this option saves both code and data space. | ||
492 | */ | ||
493 | #if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
494 | #define UART_USE_MUTUAL_EXCLUSION FALSE | ||
495 | #endif | ||
496 | |||
497 | /*===========================================================================*/ | ||
498 | /* USB driver related settings. */ | ||
499 | /*===========================================================================*/ | ||
500 | |||
501 | /** | ||
502 | * @brief Enables synchronous APIs. | ||
503 | * @note Disabling this option saves both code and data space. | ||
504 | */ | ||
505 | #if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) | ||
506 | #define USB_USE_WAIT FALSE | ||
507 | #endif | ||
508 | |||
509 | /*===========================================================================*/ | ||
510 | /* WSPI driver related settings. */ | ||
511 | /*===========================================================================*/ | ||
512 | |||
513 | /** | ||
514 | * @brief Enables synchronous APIs. | ||
515 | * @note Disabling this option saves both code and data space. | ||
516 | */ | ||
517 | #if !defined(WSPI_USE_WAIT) || defined(__DOXYGEN__) | ||
518 | #define WSPI_USE_WAIT TRUE | ||
519 | #endif | ||
520 | |||
521 | /** | ||
522 | * @brief Enables the @p wspiAcquireBus() and @p wspiReleaseBus() APIs. | ||
523 | * @note Disabling this option saves both code and data space. | ||
524 | */ | ||
525 | #if !defined(WSPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
526 | #define WSPI_USE_MUTUAL_EXCLUSION TRUE | ||
527 | #endif | ||
528 | |||
529 | #endif /* HALCONF_H */ | ||
530 | |||
531 | /** @} */ | ||
diff --git a/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/cfg/mcuconf.h b/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/cfg/mcuconf.h new file mode 100644 index 000000000..17a9afc51 --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/cfg/mcuconf.h | |||
@@ -0,0 +1,273 @@ | |||
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 | #ifndef MCUCONF_H | ||
18 | #define MCUCONF_H | ||
19 | |||
20 | /* | ||
21 | * STM32F3xx drivers configuration. | ||
22 | * The following settings override the default settings present in | ||
23 | * the various device driver implementation headers. | ||
24 | * Note that the settings for each driver only have effect if the whole | ||
25 | * driver is enabled in halconf.h. | ||
26 | * | ||
27 | * IRQ priorities: | ||
28 | * 15...0 Lowest...Highest. | ||
29 | * | ||
30 | * DMA priorities: | ||
31 | * 0...3 Lowest...Highest. | ||
32 | */ | ||
33 | |||
34 | #define STM32F3xx_MCUCONF | ||
35 | #define STM32F303_MCUCONF | ||
36 | |||
37 | /* | ||
38 | * HAL driver system settings. | ||
39 | */ | ||
40 | #define STM32_NO_INIT FALSE | ||
41 | #define STM32_PVD_ENABLE FALSE | ||
42 | #define STM32_PLS STM32_PLS_LEV0 | ||
43 | #define STM32_HSI_ENABLED TRUE | ||
44 | #define STM32_LSI_ENABLED TRUE | ||
45 | #define STM32_HSE_ENABLED TRUE | ||
46 | #define STM32_LSE_ENABLED FALSE | ||
47 | #define STM32_SW STM32_SW_PLL | ||
48 | #define STM32_PLLSRC STM32_PLLSRC_HSE | ||
49 | #define STM32_PREDIV_VALUE 1 | ||
50 | #define STM32_PLLMUL_VALUE 9 | ||
51 | #define STM32_HPRE STM32_HPRE_DIV1 | ||
52 | #define STM32_PPRE1 STM32_PPRE1_DIV2 | ||
53 | #define STM32_PPRE2 STM32_PPRE2_DIV2 | ||
54 | #define STM32_MCOSEL STM32_MCOSEL_NOCLOCK | ||
55 | #define STM32_ADC12PRES STM32_ADC12PRES_DIV1 | ||
56 | #define STM32_ADC34PRES STM32_ADC34PRES_DIV1 | ||
57 | #define STM32_USART1SW STM32_USART1SW_PCLK | ||
58 | #define STM32_USART2SW STM32_USART2SW_PCLK | ||
59 | #define STM32_USART3SW STM32_USART3SW_PCLK | ||
60 | #define STM32_UART4SW STM32_UART4SW_PCLK | ||
61 | #define STM32_UART5SW STM32_UART5SW_PCLK | ||
62 | #define STM32_I2C1SW STM32_I2C1SW_SYSCLK | ||
63 | #define STM32_I2C2SW STM32_I2C2SW_SYSCLK | ||
64 | #define STM32_TIM1SW STM32_TIM1SW_PCLK2 | ||
65 | #define STM32_TIM8SW STM32_TIM8SW_PCLK2 | ||
66 | #define STM32_RTCSEL STM32_RTCSEL_LSI | ||
67 | #define STM32_USB_CLOCK_REQUIRED TRUE | ||
68 | #define STM32_USBPRE STM32_USBPRE_DIV1P5 | ||
69 | |||
70 | /* | ||
71 | * IRQ system settings. | ||
72 | */ | ||
73 | #define STM32_IRQ_EXTI0_PRIORITY 6 | ||
74 | #define STM32_IRQ_EXTI1_PRIORITY 6 | ||
75 | #define STM32_IRQ_EXTI2_PRIORITY 6 | ||
76 | #define STM32_IRQ_EXTI3_PRIORITY 6 | ||
77 | #define STM32_IRQ_EXTI4_PRIORITY 6 | ||
78 | #define STM32_IRQ_EXTI5_9_PRIORITY 6 | ||
79 | #define STM32_IRQ_EXTI10_15_PRIORITY 6 | ||
80 | #define STM32_IRQ_EXTI16_PRIORITY 6 | ||
81 | #define STM32_IRQ_EXTI17_PRIORITY 6 | ||
82 | #define STM32_IRQ_EXTI18_PRIORITY 6 | ||
83 | #define STM32_IRQ_EXTI19_PRIORITY 6 | ||
84 | #define STM32_IRQ_EXTI20_PRIORITY 6 | ||
85 | #define STM32_IRQ_EXTI21_22_29_PRIORITY 6 | ||
86 | #define STM32_IRQ_EXTI30_32_PRIORITY 6 | ||
87 | #define STM32_IRQ_EXTI33_PRIORITY 6 | ||
88 | #define STM32_IRQ_TIM1_BRK_TIM15_PRIORITY 7 | ||
89 | #define STM32_IRQ_TIM1_UP_TIM16_PRIORITY 7 | ||
90 | #define STM32_IRQ_TIM1_TRGCO_TIM17_PRIORITY 7 | ||
91 | #define STM32_IRQ_TIM1_CC_PRIORITY 7 | ||
92 | |||
93 | /* | ||
94 | * ADC driver system settings. | ||
95 | */ | ||
96 | #define STM32_ADC_DUAL_MODE FALSE | ||
97 | #define STM32_ADC_COMPACT_SAMPLES FALSE | ||
98 | #define STM32_ADC_USE_ADC1 FALSE | ||
99 | #define STM32_ADC_USE_ADC2 FALSE | ||
100 | #define STM32_ADC_USE_ADC3 FALSE | ||
101 | #define STM32_ADC_USE_ADC4 FALSE | ||
102 | #define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) | ||
103 | #define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) | ||
104 | #define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) | ||
105 | #define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) | ||
106 | #define STM32_ADC_ADC1_DMA_PRIORITY 2 | ||
107 | #define STM32_ADC_ADC2_DMA_PRIORITY 2 | ||
108 | #define STM32_ADC_ADC3_DMA_PRIORITY 2 | ||
109 | #define STM32_ADC_ADC4_DMA_PRIORITY 2 | ||
110 | #define STM32_ADC_ADC12_IRQ_PRIORITY 5 | ||
111 | #define STM32_ADC_ADC3_IRQ_PRIORITY 5 | ||
112 | #define STM32_ADC_ADC4_IRQ_PRIORITY 5 | ||
113 | #define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 | ||
114 | #define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 | ||
115 | #define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 | ||
116 | #define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 | ||
117 | #define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 | ||
118 | #define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 | ||
119 | |||
120 | /* | ||
121 | * CAN driver system settings. | ||
122 | */ | ||
123 | #define STM32_CAN_USE_CAN1 FALSE | ||
124 | #define STM32_CAN_CAN1_IRQ_PRIORITY 11 | ||
125 | |||
126 | /* | ||
127 | * DAC driver system settings. | ||
128 | */ | ||
129 | #define STM32_DAC_DUAL_MODE FALSE | ||
130 | #define STM32_DAC_USE_DAC1_CH1 TRUE | ||
131 | #define STM32_DAC_USE_DAC1_CH2 TRUE | ||
132 | #define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 | ||
133 | #define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 | ||
134 | #define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 | ||
135 | #define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 | ||
136 | |||
137 | /* | ||
138 | * GPT driver system settings. | ||
139 | */ | ||
140 | #define STM32_GPT_USE_TIM1 FALSE | ||
141 | #define STM32_GPT_USE_TIM2 FALSE | ||
142 | #define STM32_GPT_USE_TIM3 FALSE | ||
143 | #define STM32_GPT_USE_TIM4 FALSE | ||
144 | #define STM32_GPT_USE_TIM6 FALSE | ||
145 | #define STM32_GPT_USE_TIM7 FALSE | ||
146 | #define STM32_GPT_USE_TIM8 FALSE | ||
147 | #define STM32_GPT_USE_TIM15 FALSE | ||
148 | #define STM32_GPT_USE_TIM16 FALSE | ||
149 | #define STM32_GPT_USE_TIM17 FALSE | ||
150 | #define STM32_GPT_TIM1_IRQ_PRIORITY 7 | ||
151 | #define STM32_GPT_TIM2_IRQ_PRIORITY 7 | ||
152 | #define STM32_GPT_TIM3_IRQ_PRIORITY 7 | ||
153 | #define STM32_GPT_TIM4_IRQ_PRIORITY 7 | ||
154 | #define STM32_GPT_TIM6_IRQ_PRIORITY 7 | ||
155 | #define STM32_GPT_TIM7_IRQ_PRIORITY 7 | ||
156 | #define STM32_GPT_TIM8_IRQ_PRIORITY 7 | ||
157 | |||
158 | /* | ||
159 | * I2C driver system settings. | ||
160 | */ | ||
161 | #define STM32_I2C_USE_I2C1 FALSE | ||
162 | #define STM32_I2C_USE_I2C2 FALSE | ||
163 | #define STM32_I2C_BUSY_TIMEOUT 50 | ||
164 | #define STM32_I2C_I2C1_IRQ_PRIORITY 10 | ||
165 | #define STM32_I2C_I2C2_IRQ_PRIORITY 10 | ||
166 | #define STM32_I2C_USE_DMA TRUE | ||
167 | #define STM32_I2C_I2C1_DMA_PRIORITY 1 | ||
168 | #define STM32_I2C_I2C2_DMA_PRIORITY 1 | ||
169 | #define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") | ||
170 | |||
171 | /* | ||
172 | * ICU driver system settings. | ||
173 | */ | ||
174 | #define STM32_ICU_USE_TIM1 FALSE | ||
175 | #define STM32_ICU_USE_TIM2 FALSE | ||
176 | #define STM32_ICU_USE_TIM3 FALSE | ||
177 | #define STM32_ICU_USE_TIM4 FALSE | ||
178 | #define STM32_ICU_USE_TIM8 FALSE | ||
179 | #define STM32_ICU_USE_TIM15 FALSE | ||
180 | #define STM32_ICU_TIM1_IRQ_PRIORITY 7 | ||
181 | #define STM32_ICU_TIM2_IRQ_PRIORITY 7 | ||
182 | #define STM32_ICU_TIM3_IRQ_PRIORITY 7 | ||
183 | #define STM32_ICU_TIM4_IRQ_PRIORITY 7 | ||
184 | #define STM32_ICU_TIM8_IRQ_PRIORITY 7 | ||
185 | |||
186 | /* | ||
187 | * PWM driver system settings. | ||
188 | */ | ||
189 | #define STM32_PWM_USE_ADVANCED FALSE | ||
190 | #define STM32_PWM_USE_TIM1 FALSE | ||
191 | #define STM32_PWM_USE_TIM2 FALSE | ||
192 | #define STM32_PWM_USE_TIM3 FALSE | ||
193 | #define STM32_PWM_USE_TIM4 FALSE | ||
194 | #define STM32_PWM_USE_TIM8 FALSE | ||
195 | #define STM32_PWM_USE_TIM15 FALSE | ||
196 | #define STM32_PWM_USE_TIM16 FALSE | ||
197 | #define STM32_PWM_USE_TIM17 FALSE | ||
198 | #define STM32_PWM_TIM1_IRQ_PRIORITY 7 | ||
199 | #define STM32_PWM_TIM2_IRQ_PRIORITY 7 | ||
200 | #define STM32_PWM_TIM3_IRQ_PRIORITY 7 | ||
201 | #define STM32_PWM_TIM4_IRQ_PRIORITY 7 | ||
202 | #define STM32_PWM_TIM8_IRQ_PRIORITY 7 | ||
203 | |||
204 | /* | ||
205 | * RTC driver system settings. | ||
206 | */ | ||
207 | #define STM32_RTC_PRESA_VALUE 32 | ||
208 | #define STM32_RTC_PRESS_VALUE 1024 | ||
209 | #define STM32_RTC_CR_INIT 0 | ||
210 | #define STM32_RTC_TAMPCR_INIT 0 | ||
211 | |||
212 | /* | ||
213 | * SERIAL driver system settings. | ||
214 | */ | ||
215 | #define STM32_SERIAL_USE_USART1 TRUE | ||
216 | #define STM32_SERIAL_USE_USART2 FALSE | ||
217 | #define STM32_SERIAL_USE_USART3 FALSE | ||
218 | #define STM32_SERIAL_USE_UART4 FALSE | ||
219 | #define STM32_SERIAL_USE_UART5 FALSE | ||
220 | #define STM32_SERIAL_USART1_PRIORITY 12 | ||
221 | #define STM32_SERIAL_USART2_PRIORITY 12 | ||
222 | #define STM32_SERIAL_USART3_PRIORITY 12 | ||
223 | #define STM32_SERIAL_UART4_PRIORITY 12 | ||
224 | #define STM32_SERIAL_UART5_PRIORITY 12 | ||
225 | |||
226 | /* | ||
227 | * SPI driver system settings. | ||
228 | */ | ||
229 | #define STM32_SPI_USE_SPI1 TRUE | ||
230 | #define STM32_SPI_USE_SPI2 FALSE | ||
231 | #define STM32_SPI_USE_SPI3 FALSE | ||
232 | #define STM32_SPI_SPI1_DMA_PRIORITY 1 | ||
233 | #define STM32_SPI_SPI2_DMA_PRIORITY 1 | ||
234 | #define STM32_SPI_SPI3_DMA_PRIORITY 1 | ||
235 | #define STM32_SPI_SPI1_IRQ_PRIORITY 10 | ||
236 | #define STM32_SPI_SPI2_IRQ_PRIORITY 10 | ||
237 | #define STM32_SPI_SPI3_IRQ_PRIORITY 10 | ||
238 | #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") | ||
239 | |||
240 | /* | ||
241 | * ST driver system settings. | ||
242 | */ | ||
243 | #define STM32_ST_IRQ_PRIORITY 8 | ||
244 | #define STM32_ST_USE_TIMER 2 | ||
245 | |||
246 | /* | ||
247 | * UART driver system settings. | ||
248 | */ | ||
249 | #define STM32_UART_USE_USART1 FALSE | ||
250 | #define STM32_UART_USE_USART2 FALSE | ||
251 | #define STM32_UART_USE_USART3 FALSE | ||
252 | #define STM32_UART_USART1_IRQ_PRIORITY 12 | ||
253 | #define STM32_UART_USART2_IRQ_PRIORITY 12 | ||
254 | #define STM32_UART_USART3_IRQ_PRIORITY 12 | ||
255 | #define STM32_UART_USART1_DMA_PRIORITY 0 | ||
256 | #define STM32_UART_USART2_DMA_PRIORITY 0 | ||
257 | #define STM32_UART_USART3_DMA_PRIORITY 0 | ||
258 | #define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") | ||
259 | |||
260 | /* | ||
261 | * USB driver system settings. | ||
262 | */ | ||
263 | #define STM32_USB_USE_USB1 FALSE | ||
264 | #define STM32_USB_LOW_POWER_ON_SUSPEND FALSE | ||
265 | #define STM32_USB_USB1_HP_IRQ_PRIORITY 13 | ||
266 | #define STM32_USB_USB1_LP_IRQ_PRIORITY 14 | ||
267 | |||
268 | /* | ||
269 | * WDG driver system settings. | ||
270 | */ | ||
271 | #define STM32_WDG_USE_IWDG FALSE | ||
272 | |||
273 | #endif /* MCUCONF_H */ | ||
diff --git a/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/main.c b/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/main.c new file mode 100644 index 000000000..e1b7c61b0 --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/main.c | |||
@@ -0,0 +1,128 @@ | |||
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 | #include "ch.h" | ||
18 | #include "hal.h" | ||
19 | |||
20 | #include "chprintf.h" | ||
21 | #include "l3gd20.h" | ||
22 | |||
23 | #define cls(chp) chprintf(chp, "\033[2J\033[1;1H") | ||
24 | |||
25 | /*===========================================================================*/ | ||
26 | /* L3GD20 related. */ | ||
27 | /*===========================================================================*/ | ||
28 | |||
29 | /* L3GD20 Driver: This object represent an L3GD20 instance.*/ | ||
30 | static L3GD20Driver L3GD20D1; | ||
31 | |||
32 | static int32_t gyroraw[L3GD20_GYRO_NUMBER_OF_AXES]; | ||
33 | static float gyrocooked[L3GD20_GYRO_NUMBER_OF_AXES]; | ||
34 | |||
35 | static char axisID[L3GD20_GYRO_NUMBER_OF_AXES] = {'X', 'Y', 'Z'}; | ||
36 | static uint32_t i; | ||
37 | |||
38 | static const SPIConfig spicfg = { | ||
39 | FALSE, | ||
40 | NULL, | ||
41 | GPIOE, | ||
42 | GPIOE_L3GD20_CS, | ||
43 | SPI_CR1_BR | SPI_CR1_CPOL | SPI_CR1_CPHA, | ||
44 | 0 | ||
45 | }; | ||
46 | |||
47 | static L3GD20Config l3gd20cfg = { | ||
48 | &SPID1, | ||
49 | &spicfg, | ||
50 | NULL, | ||
51 | NULL, | ||
52 | L3GD20_FS_250DPS, | ||
53 | L3GD20_ODR_760HZ, | ||
54 | #if L3GD20_USE_ADVANCED | ||
55 | L3GD20_BDU_CONTINUOUS, | ||
56 | L3GD20_END_LITTLE, | ||
57 | L3GD20_BW3, | ||
58 | L3GD20_HPM_REFERENCE, | ||
59 | L3GD20_HPCF_8, | ||
60 | L3GD20_LP2M_ON, | ||
61 | #endif | ||
62 | }; | ||
63 | |||
64 | /*===========================================================================*/ | ||
65 | /* Generic code. */ | ||
66 | /*===========================================================================*/ | ||
67 | |||
68 | static BaseSequentialStream* chp = (BaseSequentialStream*)&SD1; | ||
69 | /* | ||
70 | * Red LED blinker thread, times are in milliseconds. | ||
71 | */ | ||
72 | static THD_WORKING_AREA(waThread1, 128); | ||
73 | static THD_FUNCTION(Thread1, arg) { | ||
74 | |||
75 | (void)arg; | ||
76 | chRegSetThreadName("blinker"); | ||
77 | while (true) { | ||
78 | palToggleLine(LINE_LED3_RED); | ||
79 | chThdSleepMilliseconds(250); | ||
80 | } | ||
81 | } | ||
82 | |||
83 | /* | ||
84 | * Application entry point. | ||
85 | */ | ||
86 | int main(void) { | ||
87 | |||
88 | /* | ||
89 | * System initializations. | ||
90 | * - HAL initialization, this also initializes the configured device drivers | ||
91 | * and performs the board-specific initializations. | ||
92 | * - Kernel initialization, the main() function becomes a thread and the | ||
93 | * RTOS is active. | ||
94 | */ | ||
95 | halInit(); | ||
96 | chSysInit(); | ||
97 | |||
98 | /* Activates the serial driver 1 using the driver default configuration.*/ | ||
99 | sdStart(&SD1, NULL); | ||
100 | |||
101 | /* Creates the blinker thread.*/ | ||
102 | chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); | ||
103 | |||
104 | /* L3GD20 Object Initialization.*/ | ||
105 | l3gd20ObjectInit(&L3GD20D1); | ||
106 | |||
107 | /* Activates the L3GD20 driver.*/ | ||
108 | l3gd20Start(&L3GD20D1, &l3gd20cfg); | ||
109 | |||
110 | /* Normal main() thread activity, printing MEMS data on the SD1.*/ | ||
111 | while (true) { | ||
112 | l3gd20GyroscopeReadRaw(&L3GD20D1, gyroraw); | ||
113 | chprintf(chp, "L3GD20 Gyroscope raw data...\r\n"); | ||
114 | for(i = 0; i < L3GD20_GYRO_NUMBER_OF_AXES; i++) { | ||
115 | chprintf(chp, "%c-axis: %d\r\n", axisID[i], gyroraw[i]); | ||
116 | } | ||
117 | |||
118 | l3gd20GyroscopeReadCooked(&L3GD20D1, gyrocooked); | ||
119 | chprintf(chp, "L3GD20 Gyroscope cooked data...\r\n"); | ||
120 | for(i = 0; i < L3GD20_GYRO_NUMBER_OF_AXES; i++) { | ||
121 | chprintf(chp, "%c-axis: %.3f\r\n", axisID[i], gyrocooked[i]); | ||
122 | } | ||
123 | |||
124 | chThdSleepMilliseconds(100); | ||
125 | cls(chp); | ||
126 | } | ||
127 | l3gd20Stop(&L3GD20D1); | ||
128 | } | ||
diff --git a/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/readme.txt b/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/readme.txt new file mode 100644 index 000000000..2e5729409 --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F3xx/SPI-L3GD20/readme.txt | |||
@@ -0,0 +1,26 @@ | |||
1 | ***************************************************************************** | ||
2 | ** ChibiOS/HAL + ChibiOS/EX - SPI + L3GD20 demo for STM32F3xx. ** | ||
3 | ***************************************************************************** | ||
4 | |||
5 | ** TARGET ** | ||
6 | |||
7 | The demo runs on an ST STM32F3-Discovery board. | ||
8 | |||
9 | ** The Demo ** | ||
10 | |||
11 | The demo prints L3GD20 data on the SD1 BaseSequentialStream. | ||
12 | |||
13 | ** Build Procedure ** | ||
14 | |||
15 | The demo has been tested using the free Codesourcery GCC-based toolchain | ||
16 | and YAGARTO. | ||
17 | Just modify the TRGT line in the makefile in order to use different GCC ports. | ||
18 | |||
19 | ** Notes ** | ||
20 | |||
21 | Some files used by the demo are not part of ChibiOS/RT but are copyright of | ||
22 | ST Microelectronics and are licensed under a different license. | ||
23 | Also note that not all the files present in the ST library are distributed | ||
24 | with ChibiOS/RT, you can find the whole library on the ST web site: | ||
25 | |||
26 | http://www.st.com | ||
diff --git a/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/Makefile b/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/Makefile new file mode 100644 index 000000000..69bd3ad4a --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/Makefile | |||
@@ -0,0 +1,189 @@ | |||
1 | ############################################################################## | ||
2 | # Build global options | ||
3 | # NOTE: Can be overridden externally. | ||
4 | # | ||
5 | |||
6 | # Compiler options here. | ||
7 | ifeq ($(USE_OPT),) | ||
8 | USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 | ||
9 | endif | ||
10 | |||
11 | # C specific options here (added to USE_OPT). | ||
12 | ifeq ($(USE_COPT),) | ||
13 | USE_COPT = | ||
14 | endif | ||
15 | |||
16 | # C++ specific options here (added to USE_OPT). | ||
17 | ifeq ($(USE_CPPOPT),) | ||
18 | USE_CPPOPT = -fno-rtti | ||
19 | endif | ||
20 | |||
21 | # Enable this if you want the linker to remove unused code and data. | ||
22 | ifeq ($(USE_LINK_GC),) | ||
23 | USE_LINK_GC = yes | ||
24 | endif | ||
25 | |||
26 | # Linker extra options here. | ||
27 | ifeq ($(USE_LDOPT),) | ||
28 | USE_LDOPT = | ||
29 | endif | ||
30 | |||
31 | # Enable this if you want link time optimizations (LTO). | ||
32 | ifeq ($(USE_LTO),) | ||
33 | USE_LTO = yes | ||
34 | endif | ||
35 | |||
36 | # Enable this if you want to see the full log while compiling. | ||
37 | ifeq ($(USE_VERBOSE_COMPILE),) | ||
38 | USE_VERBOSE_COMPILE = no | ||
39 | endif | ||
40 | |||
41 | # If enabled, this option makes the build process faster by not compiling | ||
42 | # modules not used in the current configuration. | ||
43 | ifeq ($(USE_SMART_BUILD),) | ||
44 | USE_SMART_BUILD = yes | ||
45 | endif | ||
46 | |||
47 | # | ||
48 | # Build global options | ||
49 | ############################################################################## | ||
50 | |||
51 | ############################################################################## | ||
52 | # Architecture or project specific options | ||
53 | # | ||
54 | |||
55 | # Stack size to be allocated to the Cortex-M process stack. This stack is | ||
56 | # the stack used by the main() thread. | ||
57 | ifeq ($(USE_PROCESS_STACKSIZE),) | ||
58 | USE_PROCESS_STACKSIZE = 0x400 | ||
59 | endif | ||
60 | |||
61 | # Stack size to the allocated to the Cortex-M main/exceptions stack. This | ||
62 | # stack is used for processing interrupts and exceptions. | ||
63 | ifeq ($(USE_EXCEPTIONS_STACKSIZE),) | ||
64 | USE_EXCEPTIONS_STACKSIZE = 0x400 | ||
65 | endif | ||
66 | |||
67 | # Enables the use of FPU (no, softfp, hard). | ||
68 | ifeq ($(USE_FPU),) | ||
69 | USE_FPU = hard | ||
70 | endif | ||
71 | |||
72 | # FPU-related options. | ||
73 | ifeq ($(USE_FPU_OPT),) | ||
74 | USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 | ||
75 | endif | ||
76 | |||
77 | # | ||
78 | # Architecture or project specific options | ||
79 | ############################################################################## | ||
80 | |||
81 | ############################################################################## | ||
82 | # Project, target, sources and paths | ||
83 | # | ||
84 | |||
85 | # Define project name here | ||
86 | PROJECT = ch | ||
87 | |||
88 | # Target settings. | ||
89 | MCU = cortex-m4 | ||
90 | |||
91 | # Imported source files and paths. | ||
92 | CHIBIOS := ../../../.. | ||
93 | CONFDIR := ./cfg | ||
94 | BUILDDIR := ./build | ||
95 | DEPDIR := ./.dep | ||
96 | |||
97 | # Licensing files. | ||
98 | include $(CHIBIOS)/os/license/license.mk | ||
99 | # Startup files. | ||
100 | include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk | ||
101 | # HAL-OSAL files (optional). | ||
102 | include $(CHIBIOS)/os/hal/hal.mk | ||
103 | include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk | ||
104 | include $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F401RE/board.mk | ||
105 | include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk | ||
106 | # RTOS files (optional). | ||
107 | include $(CHIBIOS)/os/rt/rt.mk | ||
108 | include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk | ||
109 | # EX files (optional). | ||
110 | include $(CHIBIOS)/os/ex/devices/ST/hts221.mk | ||
111 | # Auto-build files in ./source recursively. | ||
112 | include $(CHIBIOS)/tools/mk/autobuild.mk | ||
113 | # Other files (optional). | ||
114 | include $(CHIBIOS)/os/hal/lib/streams/streams.mk | ||
115 | |||
116 | # Define linker script file here. | ||
117 | LDSCRIPT= $(STARTUPLD)/STM32F401xE.ld | ||
118 | |||
119 | # C sources that can be compiled in ARM or THUMB mode depending on the global | ||
120 | # setting. | ||
121 | CSRC = $(ALLCSRC) \ | ||
122 | $(TESTSRC) \ | ||
123 | main.c | ||
124 | |||
125 | # C++ sources that can be compiled in ARM or THUMB mode depending on the global | ||
126 | # setting. | ||
127 | CPPSRC = $(ALLCPPSRC) | ||
128 | |||
129 | # List ASM source files here. | ||
130 | ASMSRC = $(ALLASMSRC) | ||
131 | |||
132 | # List ASM with preprocessor source files here. | ||
133 | ASMXSRC = $(ALLXASMSRC) | ||
134 | |||
135 | # Inclusion directories. | ||
136 | INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) | ||
137 | |||
138 | # Define C warning options here. | ||
139 | CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes | ||
140 | |||
141 | # Define C++ warning options here. | ||
142 | CPPWARN = -Wall -Wextra -Wundef | ||
143 | |||
144 | # | ||
145 | # Project, target, sources and paths | ||
146 | ############################################################################## | ||
147 | |||
148 | ############################################################################## | ||
149 | # Start of user section | ||
150 | # | ||
151 | |||
152 | # List all user C define here, like -D_DEBUG=1 | ||
153 | UDEFS = -DCHPRINTF_USE_FLOAT=1 | ||
154 | |||
155 | # Define ASM defines here | ||
156 | UADEFS = | ||
157 | |||
158 | # List all user directories here | ||
159 | UINCDIR = | ||
160 | |||
161 | # List the user directory to look for the libraries here | ||
162 | ULIBDIR = | ||
163 | |||
164 | # List all user libraries here | ||
165 | ULIBS = | ||
166 | |||
167 | # | ||
168 | # End of user section | ||
169 | ############################################################################## | ||
170 | |||
171 | ############################################################################## | ||
172 | # Common rules | ||
173 | # | ||
174 | |||
175 | RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk | ||
176 | include $(RULESPATH)/arm-none-eabi.mk | ||
177 | include $(RULESPATH)/rules.mk | ||
178 | |||
179 | # | ||
180 | # Common rules | ||
181 | ############################################################################## | ||
182 | |||
183 | ############################################################################## | ||
184 | # Custom rules | ||
185 | # | ||
186 | |||
187 | # | ||
188 | # Custom rules | ||
189 | ############################################################################## | ||
diff --git a/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/cfg/chconf.h b/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/cfg/chconf.h new file mode 100644 index 000000000..68759e0dd --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/cfg/chconf.h | |||
@@ -0,0 +1,756 @@ | |||
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 rt/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 config | ||
24 | * @details Kernel related settings and hooks. | ||
25 | * @{ | ||
26 | */ | ||
27 | |||
28 | #ifndef CHCONF_H | ||
29 | #define CHCONF_H | ||
30 | |||
31 | #define _CHIBIOS_RT_CONF_ | ||
32 | #define _CHIBIOS_RT_CONF_VER_6_1_ | ||
33 | |||
34 | /*===========================================================================*/ | ||
35 | /** | ||
36 | * @name System timers settings | ||
37 | * @{ | ||
38 | */ | ||
39 | /*===========================================================================*/ | ||
40 | |||
41 | /** | ||
42 | * @brief System time counter resolution. | ||
43 | * @note Allowed values are 16, 32 or 64 bits. | ||
44 | */ | ||
45 | #if !defined(CH_CFG_ST_RESOLUTION) | ||
46 | #define CH_CFG_ST_RESOLUTION 32 | ||
47 | #endif | ||
48 | |||
49 | /** | ||
50 | * @brief System tick frequency. | ||
51 | * @details Frequency of the system timer that drives the system ticks. This | ||
52 | * setting also defines the system tick time unit. | ||
53 | */ | ||
54 | #if !defined(CH_CFG_ST_FREQUENCY) | ||
55 | #define CH_CFG_ST_FREQUENCY 10000 | ||
56 | #endif | ||
57 | |||
58 | /** | ||
59 | * @brief Time intervals data size. | ||
60 | * @note Allowed values are 16, 32 or 64 bits. | ||
61 | */ | ||
62 | #if !defined(CH_CFG_INTERVALS_SIZE) | ||
63 | #define CH_CFG_INTERVALS_SIZE 32 | ||
64 | #endif | ||
65 | |||
66 | /** | ||
67 | * @brief Time types data size. | ||
68 | * @note Allowed values are 16 or 32 bits. | ||
69 | */ | ||
70 | #if !defined(CH_CFG_TIME_TYPES_SIZE) | ||
71 | #define CH_CFG_TIME_TYPES_SIZE 32 | ||
72 | #endif | ||
73 | |||
74 | /** | ||
75 | * @brief Time delta constant for the tick-less mode. | ||
76 | * @note If this value is zero then the system uses the classic | ||
77 | * periodic tick. This value represents the minimum number | ||
78 | * of ticks that is safe to specify in a timeout directive. | ||
79 | * The value one is not valid, timeouts are rounded up to | ||
80 | * this value. | ||
81 | */ | ||
82 | #if !defined(CH_CFG_ST_TIMEDELTA) | ||
83 | #define CH_CFG_ST_TIMEDELTA 2 | ||
84 | #endif | ||
85 | |||
86 | /** @} */ | ||
87 | |||
88 | /*===========================================================================*/ | ||
89 | /** | ||
90 | * @name Kernel parameters and options | ||
91 | * @{ | ||
92 | */ | ||
93 | /*===========================================================================*/ | ||
94 | |||
95 | /** | ||
96 | * @brief Round robin interval. | ||
97 | * @details This constant is the number of system ticks allowed for the | ||
98 | * threads before preemption occurs. Setting this value to zero | ||
99 | * disables the preemption for threads with equal priority and the | ||
100 | * round robin becomes cooperative. Note that higher priority | ||
101 | * threads can still preempt, the kernel is always preemptive. | ||
102 | * @note Disabling the round robin preemption makes the kernel more compact | ||
103 | * and generally faster. | ||
104 | * @note The round robin preemption is not supported in tickless mode and | ||
105 | * must be set to zero in that case. | ||
106 | */ | ||
107 | #if !defined(CH_CFG_TIME_QUANTUM) | ||
108 | #define CH_CFG_TIME_QUANTUM 0 | ||
109 | #endif | ||
110 | |||
111 | /** | ||
112 | * @brief Idle thread automatic spawn suppression. | ||
113 | * @details When this option is activated the function @p chSysInit() | ||
114 | * does not spawn the idle thread. The application @p main() | ||
115 | * function becomes the idle thread and must implement an | ||
116 | * infinite loop. | ||
117 | */ | ||
118 | #if !defined(CH_CFG_NO_IDLE_THREAD) | ||
119 | #define CH_CFG_NO_IDLE_THREAD FALSE | ||
120 | #endif | ||
121 | |||
122 | /** @} */ | ||
123 | |||
124 | /*===========================================================================*/ | ||
125 | /** | ||
126 | * @name Performance options | ||
127 | * @{ | ||
128 | */ | ||
129 | /*===========================================================================*/ | ||
130 | |||
131 | /** | ||
132 | * @brief OS optimization. | ||
133 | * @details If enabled then time efficient rather than space efficient code | ||
134 | * is used when two possible implementations exist. | ||
135 | * | ||
136 | * @note This is not related to the compiler optimization options. | ||
137 | * @note The default is @p TRUE. | ||
138 | */ | ||
139 | #if !defined(CH_CFG_OPTIMIZE_SPEED) | ||
140 | #define CH_CFG_OPTIMIZE_SPEED TRUE | ||
141 | #endif | ||
142 | |||
143 | /** @} */ | ||
144 | |||
145 | /*===========================================================================*/ | ||
146 | /** | ||
147 | * @name Subsystem options | ||
148 | * @{ | ||
149 | */ | ||
150 | /*===========================================================================*/ | ||
151 | |||
152 | /** | ||
153 | * @brief Time Measurement APIs. | ||
154 | * @details If enabled then the time measurement APIs are included in | ||
155 | * the kernel. | ||
156 | * | ||
157 | * @note The default is @p TRUE. | ||
158 | */ | ||
159 | #if !defined(CH_CFG_USE_TM) | ||
160 | #define CH_CFG_USE_TM TRUE | ||
161 | #endif | ||
162 | |||
163 | /** | ||
164 | * @brief Threads registry APIs. | ||
165 | * @details If enabled then the registry APIs are included in the kernel. | ||
166 | * | ||
167 | * @note The default is @p TRUE. | ||
168 | */ | ||
169 | #if !defined(CH_CFG_USE_REGISTRY) | ||
170 | #define CH_CFG_USE_REGISTRY TRUE | ||
171 | #endif | ||
172 | |||
173 | /** | ||
174 | * @brief Threads synchronization APIs. | ||
175 | * @details If enabled then the @p chThdWait() function is included in | ||
176 | * the kernel. | ||
177 | * | ||
178 | * @note The default is @p TRUE. | ||
179 | */ | ||
180 | #if !defined(CH_CFG_USE_WAITEXIT) | ||
181 | #define CH_CFG_USE_WAITEXIT TRUE | ||
182 | #endif | ||
183 | |||
184 | /** | ||
185 | * @brief Semaphores APIs. | ||
186 | * @details If enabled then the Semaphores APIs are included in the kernel. | ||
187 | * | ||
188 | * @note The default is @p TRUE. | ||
189 | */ | ||
190 | #if !defined(CH_CFG_USE_SEMAPHORES) | ||
191 | #define CH_CFG_USE_SEMAPHORES TRUE | ||
192 | #endif | ||
193 | |||
194 | /** | ||
195 | * @brief Semaphores queuing mode. | ||
196 | * @details If enabled then the threads are enqueued on semaphores by | ||
197 | * priority rather than in FIFO order. | ||
198 | * | ||
199 | * @note The default is @p FALSE. Enable this if you have special | ||
200 | * requirements. | ||
201 | * @note Requires @p CH_CFG_USE_SEMAPHORES. | ||
202 | */ | ||
203 | #if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY) | ||
204 | #define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE | ||
205 | #endif | ||
206 | |||
207 | /** | ||
208 | * @brief Mutexes APIs. | ||
209 | * @details If enabled then the mutexes APIs are included in the kernel. | ||
210 | * | ||
211 | * @note The default is @p TRUE. | ||
212 | */ | ||
213 | #if !defined(CH_CFG_USE_MUTEXES) | ||
214 | #define CH_CFG_USE_MUTEXES TRUE | ||
215 | #endif | ||
216 | |||
217 | /** | ||
218 | * @brief Enables recursive behavior on mutexes. | ||
219 | * @note Recursive mutexes are heavier and have an increased | ||
220 | * memory footprint. | ||
221 | * | ||
222 | * @note The default is @p FALSE. | ||
223 | * @note Requires @p CH_CFG_USE_MUTEXES. | ||
224 | */ | ||
225 | #if !defined(CH_CFG_USE_MUTEXES_RECURSIVE) | ||
226 | #define CH_CFG_USE_MUTEXES_RECURSIVE FALSE | ||
227 | #endif | ||
228 | |||
229 | /** | ||
230 | * @brief Conditional Variables APIs. | ||
231 | * @details If enabled then the conditional variables APIs are included | ||
232 | * in the kernel. | ||
233 | * | ||
234 | * @note The default is @p TRUE. | ||
235 | * @note Requires @p CH_CFG_USE_MUTEXES. | ||
236 | */ | ||
237 | #if !defined(CH_CFG_USE_CONDVARS) | ||
238 | #define CH_CFG_USE_CONDVARS TRUE | ||
239 | #endif | ||
240 | |||
241 | /** | ||
242 | * @brief Conditional Variables APIs with timeout. | ||
243 | * @details If enabled then the conditional variables APIs with timeout | ||
244 | * specification are included in the kernel. | ||
245 | * | ||
246 | * @note The default is @p TRUE. | ||
247 | * @note Requires @p CH_CFG_USE_CONDVARS. | ||
248 | */ | ||
249 | #if !defined(CH_CFG_USE_CONDVARS_TIMEOUT) | ||
250 | #define CH_CFG_USE_CONDVARS_TIMEOUT TRUE | ||
251 | #endif | ||
252 | |||
253 | /** | ||
254 | * @brief Events Flags APIs. | ||
255 | * @details If enabled then the event flags APIs are included in the kernel. | ||
256 | * | ||
257 | * @note The default is @p TRUE. | ||
258 | */ | ||
259 | #if !defined(CH_CFG_USE_EVENTS) | ||
260 | #define CH_CFG_USE_EVENTS TRUE | ||
261 | #endif | ||
262 | |||
263 | /** | ||
264 | * @brief Events Flags APIs with timeout. | ||
265 | * @details If enabled then the events APIs with timeout specification | ||
266 | * are included in the kernel. | ||
267 | * | ||
268 | * @note The default is @p TRUE. | ||
269 | * @note Requires @p CH_CFG_USE_EVENTS. | ||
270 | */ | ||
271 | #if !defined(CH_CFG_USE_EVENTS_TIMEOUT) | ||
272 | #define CH_CFG_USE_EVENTS_TIMEOUT TRUE | ||
273 | #endif | ||
274 | |||
275 | /** | ||
276 | * @brief Synchronous Messages APIs. | ||
277 | * @details If enabled then the synchronous messages APIs are included | ||
278 | * in the kernel. | ||
279 | * | ||
280 | * @note The default is @p TRUE. | ||
281 | */ | ||
282 | #if !defined(CH_CFG_USE_MESSAGES) | ||
283 | #define CH_CFG_USE_MESSAGES TRUE | ||
284 | #endif | ||
285 | |||
286 | /** | ||
287 | * @brief Synchronous Messages queuing mode. | ||
288 | * @details If enabled then messages are served by priority rather than in | ||
289 | * FIFO order. | ||
290 | * | ||
291 | * @note The default is @p FALSE. Enable this if you have special | ||
292 | * requirements. | ||
293 | * @note Requires @p CH_CFG_USE_MESSAGES. | ||
294 | */ | ||
295 | #if !defined(CH_CFG_USE_MESSAGES_PRIORITY) | ||
296 | #define CH_CFG_USE_MESSAGES_PRIORITY FALSE | ||
297 | #endif | ||
298 | |||
299 | /** | ||
300 | * @brief Dynamic Threads APIs. | ||
301 | * @details If enabled then the dynamic threads creation APIs are included | ||
302 | * in the kernel. | ||
303 | * | ||
304 | * @note The default is @p TRUE. | ||
305 | * @note Requires @p CH_CFG_USE_WAITEXIT. | ||
306 | * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. | ||
307 | */ | ||
308 | #if !defined(CH_CFG_USE_DYNAMIC) | ||
309 | #define CH_CFG_USE_DYNAMIC TRUE | ||
310 | #endif | ||
311 | |||
312 | /** @} */ | ||
313 | |||
314 | /*===========================================================================*/ | ||
315 | /** | ||
316 | * @name OSLIB options | ||
317 | * @{ | ||
318 | */ | ||
319 | /*===========================================================================*/ | ||
320 | |||
321 | /** | ||
322 | * @brief Mailboxes APIs. | ||
323 | * @details If enabled then the asynchronous messages (mailboxes) APIs are | ||
324 | * included in the kernel. | ||
325 | * | ||
326 | * @note The default is @p TRUE. | ||
327 | * @note Requires @p CH_CFG_USE_SEMAPHORES. | ||
328 | */ | ||
329 | #if !defined(CH_CFG_USE_MAILBOXES) | ||
330 | #define CH_CFG_USE_MAILBOXES TRUE | ||
331 | #endif | ||
332 | |||
333 | /** | ||
334 | * @brief Core Memory Manager APIs. | ||
335 | * @details If enabled then the core memory manager APIs are included | ||
336 | * in the kernel. | ||
337 | * | ||
338 | * @note The default is @p TRUE. | ||
339 | */ | ||
340 | #if !defined(CH_CFG_USE_MEMCORE) | ||
341 | #define CH_CFG_USE_MEMCORE TRUE | ||
342 | #endif | ||
343 | |||
344 | /** | ||
345 | * @brief Managed RAM size. | ||
346 | * @details Size of the RAM area to be managed by the OS. If set to zero | ||
347 | * then the whole available RAM is used. The core memory is made | ||
348 | * available to the heap allocator and/or can be used directly through | ||
349 | * the simplified core memory allocator. | ||
350 | * | ||
351 | * @note In order to let the OS manage the whole RAM the linker script must | ||
352 | * provide the @p __heap_base__ and @p __heap_end__ symbols. | ||
353 | * @note Requires @p CH_CFG_USE_MEMCORE. | ||
354 | */ | ||
355 | #if !defined(CH_CFG_MEMCORE_SIZE) | ||
356 | #define CH_CFG_MEMCORE_SIZE 0 | ||
357 | #endif | ||
358 | |||
359 | /** | ||
360 | * @brief Heap Allocator APIs. | ||
361 | * @details If enabled then the memory heap allocator APIs are included | ||
362 | * in the kernel. | ||
363 | * | ||
364 | * @note The default is @p TRUE. | ||
365 | * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or | ||
366 | * @p CH_CFG_USE_SEMAPHORES. | ||
367 | * @note Mutexes are recommended. | ||
368 | */ | ||
369 | #if !defined(CH_CFG_USE_HEAP) | ||
370 | #define CH_CFG_USE_HEAP TRUE | ||
371 | #endif | ||
372 | |||
373 | /** | ||
374 | * @brief Memory Pools Allocator APIs. | ||
375 | * @details If enabled then the memory pools allocator APIs are included | ||
376 | * in the kernel. | ||
377 | * | ||
378 | * @note The default is @p TRUE. | ||
379 | */ | ||
380 | #if !defined(CH_CFG_USE_MEMPOOLS) | ||
381 | #define CH_CFG_USE_MEMPOOLS TRUE | ||
382 | #endif | ||
383 | |||
384 | /** | ||
385 | * @brief Objects FIFOs APIs. | ||
386 | * @details If enabled then the objects FIFOs APIs are included | ||
387 | * in the kernel. | ||
388 | * | ||
389 | * @note The default is @p TRUE. | ||
390 | */ | ||
391 | #if !defined(CH_CFG_USE_OBJ_FIFOS) | ||
392 | #define CH_CFG_USE_OBJ_FIFOS TRUE | ||
393 | #endif | ||
394 | |||
395 | /** | ||
396 | * @brief Pipes APIs. | ||
397 | * @details If enabled then the pipes APIs are included | ||
398 | * in the kernel. | ||
399 | * | ||
400 | * @note The default is @p TRUE. | ||
401 | */ | ||
402 | #if !defined(CH_CFG_USE_PIPES) | ||
403 | #define CH_CFG_USE_PIPES TRUE | ||
404 | #endif | ||
405 | |||
406 | /** | ||
407 | * @brief Objects Caches APIs. | ||
408 | * @details If enabled then the objects caches APIs are included | ||
409 | * in the kernel. | ||
410 | * | ||
411 | * @note The default is @p TRUE. | ||
412 | */ | ||
413 | #if !defined(CH_CFG_USE_OBJ_CACHES) | ||
414 | #define CH_CFG_USE_OBJ_CACHES TRUE | ||
415 | #endif | ||
416 | |||
417 | /** | ||
418 | * @brief Delegate threads APIs. | ||
419 | * @details If enabled then the delegate threads APIs are included | ||
420 | * in the kernel. | ||
421 | * | ||
422 | * @note The default is @p TRUE. | ||
423 | */ | ||
424 | #if !defined(CH_CFG_USE_DELEGATES) | ||
425 | #define CH_CFG_USE_DELEGATES TRUE | ||
426 | #endif | ||
427 | |||
428 | /** | ||
429 | * @brief Jobs Queues APIs. | ||
430 | * @details If enabled then the jobs queues APIs are included | ||
431 | * in the kernel. | ||
432 | * | ||
433 | * @note The default is @p TRUE. | ||
434 | */ | ||
435 | #if !defined(CH_CFG_USE_JOBS) | ||
436 | #define CH_CFG_USE_JOBS TRUE | ||
437 | #endif | ||
438 | |||
439 | /** @} */ | ||
440 | |||
441 | /*===========================================================================*/ | ||
442 | /** | ||
443 | * @name Objects factory options | ||
444 | * @{ | ||
445 | */ | ||
446 | /*===========================================================================*/ | ||
447 | |||
448 | /** | ||
449 | * @brief Objects Factory APIs. | ||
450 | * @details If enabled then the objects factory APIs are included in the | ||
451 | * kernel. | ||
452 | * | ||
453 | * @note The default is @p FALSE. | ||
454 | */ | ||
455 | #if !defined(CH_CFG_USE_FACTORY) | ||
456 | #define CH_CFG_USE_FACTORY TRUE | ||
457 | #endif | ||
458 | |||
459 | /** | ||
460 | * @brief Maximum length for object names. | ||
461 | * @details If the specified length is zero then the name is stored by | ||
462 | * pointer but this could have unintended side effects. | ||
463 | */ | ||
464 | #if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH) | ||
465 | #define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8 | ||
466 | #endif | ||
467 | |||
468 | /** | ||
469 | * @brief Enables the registry of generic objects. | ||
470 | */ | ||
471 | #if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY) | ||
472 | #define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE | ||
473 | #endif | ||
474 | |||
475 | /** | ||
476 | * @brief Enables factory for generic buffers. | ||
477 | */ | ||
478 | #if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS) | ||
479 | #define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE | ||
480 | #endif | ||
481 | |||
482 | /** | ||
483 | * @brief Enables factory for semaphores. | ||
484 | */ | ||
485 | #if !defined(CH_CFG_FACTORY_SEMAPHORES) | ||
486 | #define CH_CFG_FACTORY_SEMAPHORES TRUE | ||
487 | #endif | ||
488 | |||
489 | /** | ||
490 | * @brief Enables factory for mailboxes. | ||
491 | */ | ||
492 | #if !defined(CH_CFG_FACTORY_MAILBOXES) | ||
493 | #define CH_CFG_FACTORY_MAILBOXES TRUE | ||
494 | #endif | ||
495 | |||
496 | /** | ||
497 | * @brief Enables factory for objects FIFOs. | ||
498 | */ | ||
499 | #if !defined(CH_CFG_FACTORY_OBJ_FIFOS) | ||
500 | #define CH_CFG_FACTORY_OBJ_FIFOS TRUE | ||
501 | #endif | ||
502 | |||
503 | /** | ||
504 | * @brief Enables factory for Pipes. | ||
505 | */ | ||
506 | #if !defined(CH_CFG_FACTORY_PIPES) || defined(__DOXYGEN__) | ||
507 | #define CH_CFG_FACTORY_PIPES TRUE | ||
508 | #endif | ||
509 | |||
510 | /** @} */ | ||
511 | |||
512 | /*===========================================================================*/ | ||
513 | /** | ||
514 | * @name Debug options | ||
515 | * @{ | ||
516 | */ | ||
517 | /*===========================================================================*/ | ||
518 | |||
519 | /** | ||
520 | * @brief Debug option, kernel statistics. | ||
521 | * | ||
522 | * @note The default is @p FALSE. | ||
523 | */ | ||
524 | #if !defined(CH_DBG_STATISTICS) | ||
525 | #define CH_DBG_STATISTICS FALSE | ||
526 | #endif | ||
527 | |||
528 | /** | ||
529 | * @brief Debug option, system state check. | ||
530 | * @details If enabled the correct call protocol for system APIs is checked | ||
531 | * at runtime. | ||
532 | * | ||
533 | * @note The default is @p FALSE. | ||
534 | */ | ||
535 | #if !defined(CH_DBG_SYSTEM_STATE_CHECK) | ||
536 | #define CH_DBG_SYSTEM_STATE_CHECK FALSE | ||
537 | #endif | ||
538 | |||
539 | /** | ||
540 | * @brief Debug option, parameters checks. | ||
541 | * @details If enabled then the checks on the API functions input | ||
542 | * parameters are activated. | ||
543 | * | ||
544 | * @note The default is @p FALSE. | ||
545 | */ | ||
546 | #if !defined(CH_DBG_ENABLE_CHECKS) | ||
547 | #define CH_DBG_ENABLE_CHECKS FALSE | ||
548 | #endif | ||
549 | |||
550 | /** | ||
551 | * @brief Debug option, consistency checks. | ||
552 | * @details If enabled then all the assertions in the kernel code are | ||
553 | * activated. This includes consistency checks inside the kernel, | ||
554 | * runtime anomalies and port-defined checks. | ||
555 | * | ||
556 | * @note The default is @p FALSE. | ||
557 | */ | ||
558 | #if !defined(CH_DBG_ENABLE_ASSERTS) | ||
559 | #define CH_DBG_ENABLE_ASSERTS FALSE | ||
560 | #endif | ||
561 | |||
562 | /** | ||
563 | * @brief Debug option, trace buffer. | ||
564 | * @details If enabled then the trace buffer is activated. | ||
565 | * | ||
566 | * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. | ||
567 | */ | ||
568 | #if !defined(CH_DBG_TRACE_MASK) | ||
569 | #define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED | ||
570 | #endif | ||
571 | |||
572 | /** | ||
573 | * @brief Trace buffer entries. | ||
574 | * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is | ||
575 | * different from @p CH_DBG_TRACE_MASK_DISABLED. | ||
576 | */ | ||
577 | #if !defined(CH_DBG_TRACE_BUFFER_SIZE) | ||
578 | #define CH_DBG_TRACE_BUFFER_SIZE 128 | ||
579 | #endif | ||
580 | |||
581 | /** | ||
582 | * @brief Debug option, stack checks. | ||
583 | * @details If enabled then a runtime stack check is performed. | ||
584 | * | ||
585 | * @note The default is @p FALSE. | ||
586 | * @note The stack check is performed in a architecture/port dependent way. | ||
587 | * It may not be implemented or some ports. | ||
588 | * @note The default failure mode is to halt the system with the global | ||
589 | * @p panic_msg variable set to @p NULL. | ||
590 | */ | ||
591 | #if !defined(CH_DBG_ENABLE_STACK_CHECK) | ||
592 | #define CH_DBG_ENABLE_STACK_CHECK FALSE | ||
593 | #endif | ||
594 | |||
595 | /** | ||
596 | * @brief Debug option, stacks initialization. | ||
597 | * @details If enabled then the threads working area is filled with a byte | ||
598 | * value when a thread is created. This can be useful for the | ||
599 | * runtime measurement of the used stack. | ||
600 | * | ||
601 | * @note The default is @p FALSE. | ||
602 | */ | ||
603 | #if !defined(CH_DBG_FILL_THREADS) | ||
604 | #define CH_DBG_FILL_THREADS FALSE | ||
605 | #endif | ||
606 | |||
607 | /** | ||
608 | * @brief Debug option, threads profiling. | ||
609 | * @details If enabled then a field is added to the @p thread_t structure that | ||
610 | * counts the system ticks occurred while executing the thread. | ||
611 | * | ||
612 | * @note The default is @p FALSE. | ||
613 | * @note This debug option is not currently compatible with the | ||
614 | * tickless mode. | ||
615 | */ | ||
616 | #if !defined(CH_DBG_THREADS_PROFILING) | ||
617 | #define CH_DBG_THREADS_PROFILING FALSE | ||
618 | #endif | ||
619 | |||
620 | /** @} */ | ||
621 | |||
622 | /*===========================================================================*/ | ||
623 | /** | ||
624 | * @name Kernel hooks | ||
625 | * @{ | ||
626 | */ | ||
627 | /*===========================================================================*/ | ||
628 | |||
629 | /** | ||
630 | * @brief System structure extension. | ||
631 | * @details User fields added to the end of the @p ch_system_t structure. | ||
632 | */ | ||
633 | #define CH_CFG_SYSTEM_EXTRA_FIELDS \ | ||
634 | /* Add threads custom fields here.*/ | ||
635 | |||
636 | /** | ||
637 | * @brief System initialization hook. | ||
638 | * @details User initialization code added to the @p chSysInit() function | ||
639 | * just before interrupts are enabled globally. | ||
640 | */ | ||
641 | #define CH_CFG_SYSTEM_INIT_HOOK() { \ | ||
642 | /* Add threads initialization code here.*/ \ | ||
643 | } | ||
644 | |||
645 | /** | ||
646 | * @brief Threads descriptor structure extension. | ||
647 | * @details User fields added to the end of the @p thread_t structure. | ||
648 | */ | ||
649 | #define CH_CFG_THREAD_EXTRA_FIELDS \ | ||
650 | /* Add threads custom fields here.*/ | ||
651 | |||
652 | /** | ||
653 | * @brief Threads initialization hook. | ||
654 | * @details User initialization code added to the @p _thread_init() function. | ||
655 | * | ||
656 | * @note It is invoked from within @p _thread_init() and implicitly from all | ||
657 | * the threads creation APIs. | ||
658 | */ | ||
659 | #define CH_CFG_THREAD_INIT_HOOK(tp) { \ | ||
660 | /* Add threads initialization code here.*/ \ | ||
661 | } | ||
662 | |||
663 | /** | ||
664 | * @brief Threads finalization hook. | ||
665 | * @details User finalization code added to the @p chThdExit() API. | ||
666 | */ | ||
667 | #define CH_CFG_THREAD_EXIT_HOOK(tp) { \ | ||
668 | /* Add threads finalization code here.*/ \ | ||
669 | } | ||
670 | |||
671 | /** | ||
672 | * @brief Context switch hook. | ||
673 | * @details This hook is invoked just before switching between threads. | ||
674 | */ | ||
675 | #define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ | ||
676 | /* Context switch code here.*/ \ | ||
677 | } | ||
678 | |||
679 | /** | ||
680 | * @brief ISR enter hook. | ||
681 | */ | ||
682 | #define CH_CFG_IRQ_PROLOGUE_HOOK() { \ | ||
683 | /* IRQ prologue code here.*/ \ | ||
684 | } | ||
685 | |||
686 | /** | ||
687 | * @brief ISR exit hook. | ||
688 | */ | ||
689 | #define CH_CFG_IRQ_EPILOGUE_HOOK() { \ | ||
690 | /* IRQ epilogue code here.*/ \ | ||
691 | } | ||
692 | |||
693 | /** | ||
694 | * @brief Idle thread enter hook. | ||
695 | * @note This hook is invoked within a critical zone, no OS functions | ||
696 | * should be invoked from here. | ||
697 | * @note This macro can be used to activate a power saving mode. | ||
698 | */ | ||
699 | #define CH_CFG_IDLE_ENTER_HOOK() { \ | ||
700 | /* Idle-enter code here.*/ \ | ||
701 | } | ||
702 | |||
703 | /** | ||
704 | * @brief Idle thread leave hook. | ||
705 | * @note This hook is invoked within a critical zone, no OS functions | ||
706 | * should be invoked from here. | ||
707 | * @note This macro can be used to deactivate a power saving mode. | ||
708 | */ | ||
709 | #define CH_CFG_IDLE_LEAVE_HOOK() { \ | ||
710 | /* Idle-leave code here.*/ \ | ||
711 | } | ||
712 | |||
713 | /** | ||
714 | * @brief Idle Loop hook. | ||
715 | * @details This hook is continuously invoked by the idle thread loop. | ||
716 | */ | ||
717 | #define CH_CFG_IDLE_LOOP_HOOK() { \ | ||
718 | /* Idle loop code here.*/ \ | ||
719 | } | ||
720 | |||
721 | /** | ||
722 | * @brief System tick event hook. | ||
723 | * @details This hook is invoked in the system tick handler immediately | ||
724 | * after processing the virtual timers queue. | ||
725 | */ | ||
726 | #define CH_CFG_SYSTEM_TICK_HOOK() { \ | ||
727 | /* System tick event code here.*/ \ | ||
728 | } | ||
729 | |||
730 | /** | ||
731 | * @brief System halt hook. | ||
732 | * @details This hook is invoked in case to a system halting error before | ||
733 | * the system is halted. | ||
734 | */ | ||
735 | #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ | ||
736 | /* System halt code here.*/ \ | ||
737 | } | ||
738 | |||
739 | /** | ||
740 | * @brief Trace hook. | ||
741 | * @details This hook is invoked each time a new record is written in the | ||
742 | * trace buffer. | ||
743 | */ | ||
744 | #define CH_CFG_TRACE_HOOK(tep) { \ | ||
745 | /* Trace code here.*/ \ | ||
746 | } | ||
747 | |||
748 | /** @} */ | ||
749 | |||
750 | /*===========================================================================*/ | ||
751 | /* Port-specific settings (override port settings defaulted in chcore.h). */ | ||
752 | /*===========================================================================*/ | ||
753 | |||
754 | #endif /* CHCONF_H */ | ||
755 | |||
756 | /** @} */ | ||
diff --git a/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/cfg/halconf.h b/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/cfg/halconf.h new file mode 100644 index 000000000..849109ec5 --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/cfg/halconf.h | |||
@@ -0,0 +1,531 @@ | |||
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 templates/halconf.h | ||
19 | * @brief HAL configuration header. | ||
20 | * @details HAL configuration file, this file allows to enable or disable the | ||
21 | * various device drivers from your application. You may also use | ||
22 | * this file in order to override the device drivers default settings. | ||
23 | * | ||
24 | * @addtogroup HAL_CONF | ||
25 | * @{ | ||
26 | */ | ||
27 | |||
28 | #ifndef HALCONF_H | ||
29 | #define HALCONF_H | ||
30 | |||
31 | #define _CHIBIOS_HAL_CONF_ | ||
32 | #define _CHIBIOS_HAL_CONF_VER_7_1_ | ||
33 | |||
34 | #include "mcuconf.h" | ||
35 | |||
36 | /** | ||
37 | * @brief Enables the PAL subsystem. | ||
38 | */ | ||
39 | #if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) | ||
40 | #define HAL_USE_PAL TRUE | ||
41 | #endif | ||
42 | |||
43 | /** | ||
44 | * @brief Enables the ADC subsystem. | ||
45 | */ | ||
46 | #if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) | ||
47 | #define HAL_USE_ADC FALSE | ||
48 | #endif | ||
49 | |||
50 | /** | ||
51 | * @brief Enables the CAN subsystem. | ||
52 | */ | ||
53 | #if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) | ||
54 | #define HAL_USE_CAN FALSE | ||
55 | #endif | ||
56 | |||
57 | /** | ||
58 | * @brief Enables the cryptographic subsystem. | ||
59 | */ | ||
60 | #if !defined(HAL_USE_CRY) || defined(__DOXYGEN__) | ||
61 | #define HAL_USE_CRY FALSE | ||
62 | #endif | ||
63 | |||
64 | /** | ||
65 | * @brief Enables the DAC subsystem. | ||
66 | */ | ||
67 | #if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) | ||
68 | #define HAL_USE_DAC FALSE | ||
69 | #endif | ||
70 | |||
71 | /** | ||
72 | * @brief Enables the EFlash subsystem. | ||
73 | */ | ||
74 | #if !defined(HAL_USE_EFL) || defined(__DOXYGEN__) | ||
75 | #define HAL_USE_EFL FALSE | ||
76 | #endif | ||
77 | |||
78 | /** | ||
79 | * @brief Enables the GPT subsystem. | ||
80 | */ | ||
81 | #if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) | ||
82 | #define HAL_USE_GPT FALSE | ||
83 | #endif | ||
84 | |||
85 | /** | ||
86 | * @brief Enables the I2C subsystem. | ||
87 | */ | ||
88 | #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) | ||
89 | #define HAL_USE_I2C TRUE | ||
90 | #endif | ||
91 | |||
92 | /** | ||
93 | * @brief Enables the I2S subsystem. | ||
94 | */ | ||
95 | #if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) | ||
96 | #define HAL_USE_I2S FALSE | ||
97 | #endif | ||
98 | |||
99 | /** | ||
100 | * @brief Enables the ICU subsystem. | ||
101 | */ | ||
102 | #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) | ||
103 | #define HAL_USE_ICU FALSE | ||
104 | #endif | ||
105 | |||
106 | /** | ||
107 | * @brief Enables the MAC subsystem. | ||
108 | */ | ||
109 | #if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) | ||
110 | #define HAL_USE_MAC FALSE | ||
111 | #endif | ||
112 | |||
113 | /** | ||
114 | * @brief Enables the MMC_SPI subsystem. | ||
115 | */ | ||
116 | #if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) | ||
117 | #define HAL_USE_MMC_SPI FALSE | ||
118 | #endif | ||
119 | |||
120 | /** | ||
121 | * @brief Enables the PWM subsystem. | ||
122 | */ | ||
123 | #if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) | ||
124 | #define HAL_USE_PWM FALSE | ||
125 | #endif | ||
126 | |||
127 | /** | ||
128 | * @brief Enables the RTC subsystem. | ||
129 | */ | ||
130 | #if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) | ||
131 | #define HAL_USE_RTC FALSE | ||
132 | #endif | ||
133 | |||
134 | /** | ||
135 | * @brief Enables the SDC subsystem. | ||
136 | */ | ||
137 | #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) | ||
138 | #define HAL_USE_SDC FALSE | ||
139 | #endif | ||
140 | |||
141 | /** | ||
142 | * @brief Enables the SERIAL subsystem. | ||
143 | */ | ||
144 | #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) | ||
145 | #define HAL_USE_SERIAL TRUE | ||
146 | #endif | ||
147 | |||
148 | /** | ||
149 | * @brief Enables the SERIAL over USB subsystem. | ||
150 | */ | ||
151 | #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) | ||
152 | #define HAL_USE_SERIAL_USB FALSE | ||
153 | #endif | ||
154 | |||
155 | /** | ||
156 | * @brief Enables the SIO subsystem. | ||
157 | */ | ||
158 | #if !defined(HAL_USE_SIO) || defined(__DOXYGEN__) | ||
159 | #define HAL_USE_SIO FALSE | ||
160 | #endif | ||
161 | |||
162 | /** | ||
163 | * @brief Enables the SPI subsystem. | ||
164 | */ | ||
165 | #if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) | ||
166 | #define HAL_USE_SPI FALSE | ||
167 | #endif | ||
168 | |||
169 | /** | ||
170 | * @brief Enables the TRNG subsystem. | ||
171 | */ | ||
172 | #if !defined(HAL_USE_TRNG) || defined(__DOXYGEN__) | ||
173 | #define HAL_USE_TRNG FALSE | ||
174 | #endif | ||
175 | |||
176 | /** | ||
177 | * @brief Enables the UART subsystem. | ||
178 | */ | ||
179 | #if !defined(HAL_USE_UART) || defined(__DOXYGEN__) | ||
180 | #define HAL_USE_UART FALSE | ||
181 | #endif | ||
182 | |||
183 | /** | ||
184 | * @brief Enables the USB subsystem. | ||
185 | */ | ||
186 | #if !defined(HAL_USE_USB) || defined(__DOXYGEN__) | ||
187 | #define HAL_USE_USB FALSE | ||
188 | #endif | ||
189 | |||
190 | /** | ||
191 | * @brief Enables the WDG subsystem. | ||
192 | */ | ||
193 | #if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) | ||
194 | #define HAL_USE_WDG FALSE | ||
195 | #endif | ||
196 | |||
197 | /** | ||
198 | * @brief Enables the WSPI subsystem. | ||
199 | */ | ||
200 | #if !defined(HAL_USE_WSPI) || defined(__DOXYGEN__) | ||
201 | #define HAL_USE_WSPI FALSE | ||
202 | #endif | ||
203 | |||
204 | /*===========================================================================*/ | ||
205 | /* PAL driver related settings. */ | ||
206 | /*===========================================================================*/ | ||
207 | |||
208 | /** | ||
209 | * @brief Enables synchronous APIs. | ||
210 | * @note Disabling this option saves both code and data space. | ||
211 | */ | ||
212 | #if !defined(PAL_USE_CALLBACKS) || defined(__DOXYGEN__) | ||
213 | #define PAL_USE_CALLBACKS FALSE | ||
214 | #endif | ||
215 | |||
216 | /** | ||
217 | * @brief Enables synchronous APIs. | ||
218 | * @note Disabling this option saves both code and data space. | ||
219 | */ | ||
220 | #if !defined(PAL_USE_WAIT) || defined(__DOXYGEN__) | ||
221 | #define PAL_USE_WAIT FALSE | ||
222 | #endif | ||
223 | |||
224 | /*===========================================================================*/ | ||
225 | /* ADC driver related settings. */ | ||
226 | /*===========================================================================*/ | ||
227 | |||
228 | /** | ||
229 | * @brief Enables synchronous APIs. | ||
230 | * @note Disabling this option saves both code and data space. | ||
231 | */ | ||
232 | #if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) | ||
233 | #define ADC_USE_WAIT TRUE | ||
234 | #endif | ||
235 | |||
236 | /** | ||
237 | * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. | ||
238 | * @note Disabling this option saves both code and data space. | ||
239 | */ | ||
240 | #if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
241 | #define ADC_USE_MUTUAL_EXCLUSION TRUE | ||
242 | #endif | ||
243 | |||
244 | /*===========================================================================*/ | ||
245 | /* CAN driver related settings. */ | ||
246 | /*===========================================================================*/ | ||
247 | |||
248 | /** | ||
249 | * @brief Sleep mode related APIs inclusion switch. | ||
250 | */ | ||
251 | #if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) | ||
252 | #define CAN_USE_SLEEP_MODE TRUE | ||
253 | #endif | ||
254 | |||
255 | /** | ||
256 | * @brief Enforces the driver to use direct callbacks rather than OSAL events. | ||
257 | */ | ||
258 | #if !defined(CAN_ENFORCE_USE_CALLBACKS) || defined(__DOXYGEN__) | ||
259 | #define CAN_ENFORCE_USE_CALLBACKS FALSE | ||
260 | #endif | ||
261 | |||
262 | /*===========================================================================*/ | ||
263 | /* CRY driver related settings. */ | ||
264 | /*===========================================================================*/ | ||
265 | |||
266 | /** | ||
267 | * @brief Enables the SW fall-back of the cryptographic driver. | ||
268 | * @details When enabled, this option, activates a fall-back software | ||
269 | * implementation for algorithms not supported by the underlying | ||
270 | * hardware. | ||
271 | * @note Fall-back implementations may not be present for all algorithms. | ||
272 | */ | ||
273 | #if !defined(HAL_CRY_USE_FALLBACK) || defined(__DOXYGEN__) | ||
274 | #define HAL_CRY_USE_FALLBACK FALSE | ||
275 | #endif | ||
276 | |||
277 | /** | ||
278 | * @brief Makes the driver forcibly use the fall-back implementations. | ||
279 | */ | ||
280 | #if !defined(HAL_CRY_ENFORCE_FALLBACK) || defined(__DOXYGEN__) | ||
281 | #define HAL_CRY_ENFORCE_FALLBACK FALSE | ||
282 | #endif | ||
283 | |||
284 | /*===========================================================================*/ | ||
285 | /* DAC driver related settings. */ | ||
286 | /*===========================================================================*/ | ||
287 | |||
288 | /** | ||
289 | * @brief Enables synchronous APIs. | ||
290 | * @note Disabling this option saves both code and data space. | ||
291 | */ | ||
292 | #if !defined(DAC_USE_WAIT) || defined(__DOXYGEN__) | ||
293 | #define DAC_USE_WAIT TRUE | ||
294 | #endif | ||
295 | |||
296 | /** | ||
297 | * @brief Enables the @p dacAcquireBus() and @p dacReleaseBus() APIs. | ||
298 | * @note Disabling this option saves both code and data space. | ||
299 | */ | ||
300 | #if !defined(DAC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
301 | #define DAC_USE_MUTUAL_EXCLUSION TRUE | ||
302 | #endif | ||
303 | |||
304 | /*===========================================================================*/ | ||
305 | /* I2C driver related settings. */ | ||
306 | /*===========================================================================*/ | ||
307 | |||
308 | /** | ||
309 | * @brief Enables the mutual exclusion APIs on the I2C bus. | ||
310 | */ | ||
311 | #if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
312 | #define I2C_USE_MUTUAL_EXCLUSION TRUE | ||
313 | #endif | ||
314 | |||
315 | /*===========================================================================*/ | ||
316 | /* MAC driver related settings. */ | ||
317 | /*===========================================================================*/ | ||
318 | |||
319 | /** | ||
320 | * @brief Enables the zero-copy API. | ||
321 | */ | ||
322 | #if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) | ||
323 | #define MAC_USE_ZERO_COPY FALSE | ||
324 | #endif | ||
325 | |||
326 | /** | ||
327 | * @brief Enables an event sources for incoming packets. | ||
328 | */ | ||
329 | #if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) | ||
330 | #define MAC_USE_EVENTS TRUE | ||
331 | #endif | ||
332 | |||
333 | /*===========================================================================*/ | ||
334 | /* MMC_SPI driver related settings. */ | ||
335 | /*===========================================================================*/ | ||
336 | |||
337 | /** | ||
338 | * @brief Delays insertions. | ||
339 | * @details If enabled this options inserts delays into the MMC waiting | ||
340 | * routines releasing some extra CPU time for the threads with | ||
341 | * lower priority, this may slow down the driver a bit however. | ||
342 | * This option is recommended also if the SPI driver does not | ||
343 | * use a DMA channel and heavily loads the CPU. | ||
344 | */ | ||
345 | #if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) | ||
346 | #define MMC_NICE_WAITING TRUE | ||
347 | #endif | ||
348 | |||
349 | /*===========================================================================*/ | ||
350 | /* SDC driver related settings. */ | ||
351 | /*===========================================================================*/ | ||
352 | |||
353 | /** | ||
354 | * @brief Number of initialization attempts before rejecting the card. | ||
355 | * @note Attempts are performed at 10mS intervals. | ||
356 | */ | ||
357 | #if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) | ||
358 | #define SDC_INIT_RETRY 100 | ||
359 | #endif | ||
360 | |||
361 | /** | ||
362 | * @brief Include support for MMC cards. | ||
363 | * @note MMC support is not yet implemented so this option must be kept | ||
364 | * at @p FALSE. | ||
365 | */ | ||
366 | #if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) | ||
367 | #define SDC_MMC_SUPPORT FALSE | ||
368 | #endif | ||
369 | |||
370 | /** | ||
371 | * @brief Delays insertions. | ||
372 | * @details If enabled this options inserts delays into the MMC waiting | ||
373 | * routines releasing some extra CPU time for the threads with | ||
374 | * lower priority, this may slow down the driver a bit however. | ||
375 | */ | ||
376 | #if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) | ||
377 | #define SDC_NICE_WAITING TRUE | ||
378 | #endif | ||
379 | |||
380 | /** | ||
381 | * @brief OCR initialization constant for V20 cards. | ||
382 | */ | ||
383 | #if !defined(SDC_INIT_OCR_V20) || defined(__DOXYGEN__) | ||
384 | #define SDC_INIT_OCR_V20 0x50FF8000U | ||
385 | #endif | ||
386 | |||
387 | /** | ||
388 | * @brief OCR initialization constant for non-V20 cards. | ||
389 | */ | ||
390 | #if !defined(SDC_INIT_OCR) || defined(__DOXYGEN__) | ||
391 | #define SDC_INIT_OCR 0x80100000U | ||
392 | #endif | ||
393 | |||
394 | /*===========================================================================*/ | ||
395 | /* SERIAL driver related settings. */ | ||
396 | /*===========================================================================*/ | ||
397 | |||
398 | /** | ||
399 | * @brief Default bit rate. | ||
400 | * @details Configuration parameter, this is the baud rate selected for the | ||
401 | * default configuration. | ||
402 | */ | ||
403 | #if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) | ||
404 | #define SERIAL_DEFAULT_BITRATE 38400 | ||
405 | #endif | ||
406 | |||
407 | /** | ||
408 | * @brief Serial buffers size. | ||
409 | * @details Configuration parameter, you can change the depth of the queue | ||
410 | * buffers depending on the requirements of your application. | ||
411 | * @note The default is 16 bytes for both the transmission and receive | ||
412 | * buffers. | ||
413 | */ | ||
414 | #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) | ||
415 | #define SERIAL_BUFFERS_SIZE 16 | ||
416 | #endif | ||
417 | |||
418 | /*===========================================================================*/ | ||
419 | /* SERIAL_USB driver related setting. */ | ||
420 | /*===========================================================================*/ | ||
421 | |||
422 | /** | ||
423 | * @brief Serial over USB buffers size. | ||
424 | * @details Configuration parameter, the buffer size must be a multiple of | ||
425 | * the USB data endpoint maximum packet size. | ||
426 | * @note The default is 256 bytes for both the transmission and receive | ||
427 | * buffers. | ||
428 | */ | ||
429 | #if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) | ||
430 | #define SERIAL_USB_BUFFERS_SIZE 256 | ||
431 | #endif | ||
432 | |||
433 | /** | ||
434 | * @brief Serial over USB number of buffers. | ||
435 | * @note The default is 2 buffers. | ||
436 | */ | ||
437 | #if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) | ||
438 | #define SERIAL_USB_BUFFERS_NUMBER 2 | ||
439 | #endif | ||
440 | |||
441 | /*===========================================================================*/ | ||
442 | /* SPI driver related settings. */ | ||
443 | /*===========================================================================*/ | ||
444 | |||
445 | /** | ||
446 | * @brief Enables synchronous APIs. | ||
447 | * @note Disabling this option saves both code and data space. | ||
448 | */ | ||
449 | #if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) | ||
450 | #define SPI_USE_WAIT TRUE | ||
451 | #endif | ||
452 | |||
453 | /** | ||
454 | * @brief Enables circular transfers APIs. | ||
455 | * @note Disabling this option saves both code and data space. | ||
456 | */ | ||
457 | #if !defined(SPI_USE_CIRCULAR) || defined(__DOXYGEN__) | ||
458 | #define SPI_USE_CIRCULAR FALSE | ||
459 | #endif | ||
460 | |||
461 | /** | ||
462 | * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. | ||
463 | * @note Disabling this option saves both code and data space. | ||
464 | */ | ||
465 | #if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
466 | #define SPI_USE_MUTUAL_EXCLUSION TRUE | ||
467 | #endif | ||
468 | |||
469 | /** | ||
470 | * @brief Handling method for SPI CS line. | ||
471 | * @note Disabling this option saves both code and data space. | ||
472 | */ | ||
473 | #if !defined(SPI_SELECT_MODE) || defined(__DOXYGEN__) | ||
474 | #define SPI_SELECT_MODE SPI_SELECT_MODE_PAD | ||
475 | #endif | ||
476 | |||
477 | /*===========================================================================*/ | ||
478 | /* UART driver related settings. */ | ||
479 | /*===========================================================================*/ | ||
480 | |||
481 | /** | ||
482 | * @brief Enables synchronous APIs. | ||
483 | * @note Disabling this option saves both code and data space. | ||
484 | */ | ||
485 | #if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) | ||
486 | #define UART_USE_WAIT FALSE | ||
487 | #endif | ||
488 | |||
489 | /** | ||
490 | * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. | ||
491 | * @note Disabling this option saves both code and data space. | ||
492 | */ | ||
493 | #if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
494 | #define UART_USE_MUTUAL_EXCLUSION FALSE | ||
495 | #endif | ||
496 | |||
497 | /*===========================================================================*/ | ||
498 | /* USB driver related settings. */ | ||
499 | /*===========================================================================*/ | ||
500 | |||
501 | /** | ||
502 | * @brief Enables synchronous APIs. | ||
503 | * @note Disabling this option saves both code and data space. | ||
504 | */ | ||
505 | #if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) | ||
506 | #define USB_USE_WAIT FALSE | ||
507 | #endif | ||
508 | |||
509 | /*===========================================================================*/ | ||
510 | /* WSPI driver related settings. */ | ||
511 | /*===========================================================================*/ | ||
512 | |||
513 | /** | ||
514 | * @brief Enables synchronous APIs. | ||
515 | * @note Disabling this option saves both code and data space. | ||
516 | */ | ||
517 | #if !defined(WSPI_USE_WAIT) || defined(__DOXYGEN__) | ||
518 | #define WSPI_USE_WAIT TRUE | ||
519 | #endif | ||
520 | |||
521 | /** | ||
522 | * @brief Enables the @p wspiAcquireBus() and @p wspiReleaseBus() APIs. | ||
523 | * @note Disabling this option saves both code and data space. | ||
524 | */ | ||
525 | #if !defined(WSPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
526 | #define WSPI_USE_MUTUAL_EXCLUSION TRUE | ||
527 | #endif | ||
528 | |||
529 | #endif /* HALCONF_H */ | ||
530 | |||
531 | /** @} */ | ||
diff --git a/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/cfg/mcuconf.h b/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/cfg/mcuconf.h new file mode 100644 index 000000000..7ab2064d2 --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/cfg/mcuconf.h | |||
@@ -0,0 +1,253 @@ | |||
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 | #ifndef MCUCONF_H | ||
18 | #define MCUCONF_H | ||
19 | |||
20 | /* | ||
21 | * STM32F4xx drivers configuration. | ||
22 | * The following settings override the default settings present in | ||
23 | * the various device driver implementation headers. | ||
24 | * Note that the settings for each driver only have effect if the whole | ||
25 | * driver is enabled in halconf.h. | ||
26 | * | ||
27 | * IRQ priorities: | ||
28 | * 15...0 Lowest...Highest. | ||
29 | * | ||
30 | * DMA priorities: | ||
31 | * 0...3 Lowest...Highest. | ||
32 | */ | ||
33 | |||
34 | #define STM32F4xx_MCUCONF | ||
35 | |||
36 | /* | ||
37 | * HAL driver system settings. | ||
38 | */ | ||
39 | #define STM32_NO_INIT FALSE | ||
40 | #define STM32_HSI_ENABLED TRUE | ||
41 | #define STM32_LSI_ENABLED TRUE | ||
42 | #define STM32_HSE_ENABLED FALSE | ||
43 | #define STM32_LSE_ENABLED FALSE | ||
44 | #define STM32_CLOCK48_REQUIRED TRUE | ||
45 | #define STM32_SW STM32_SW_PLL | ||
46 | #define STM32_PLLSRC STM32_PLLSRC_HSI | ||
47 | #define STM32_PLLM_VALUE 16 | ||
48 | #define STM32_PLLN_VALUE 336 | ||
49 | #define STM32_PLLP_VALUE 4 | ||
50 | #define STM32_PLLQ_VALUE 7 | ||
51 | #define STM32_HPRE STM32_HPRE_DIV1 | ||
52 | #define STM32_PPRE1 STM32_PPRE1_DIV2 | ||
53 | #define STM32_PPRE2 STM32_PPRE2_DIV1 | ||
54 | #define STM32_RTCSEL STM32_RTCSEL_LSI | ||
55 | #define STM32_RTCPRE_VALUE 8 | ||
56 | #define STM32_MCO1SEL STM32_MCO1SEL_HSI | ||
57 | #define STM32_MCO1PRE STM32_MCO1PRE_DIV1 | ||
58 | #define STM32_MCO2SEL STM32_MCO2SEL_SYSCLK | ||
59 | #define STM32_MCO2PRE STM32_MCO2PRE_DIV5 | ||
60 | #define STM32_I2SSRC STM32_I2SSRC_CKIN | ||
61 | #define STM32_PLLI2SN_VALUE 192 | ||
62 | #define STM32_PLLI2SR_VALUE 5 | ||
63 | #define STM32_PVD_ENABLE FALSE | ||
64 | #define STM32_PLS STM32_PLS_LEV0 | ||
65 | #define STM32_BKPRAM_ENABLE FALSE | ||
66 | |||
67 | /* | ||
68 | * IRQ system settings. | ||
69 | */ | ||
70 | #define STM32_IRQ_EXTI0_PRIORITY 6 | ||
71 | #define STM32_IRQ_EXTI1_PRIORITY 6 | ||
72 | #define STM32_IRQ_EXTI2_PRIORITY 6 | ||
73 | #define STM32_IRQ_EXTI3_PRIORITY 6 | ||
74 | #define STM32_IRQ_EXTI4_PRIORITY 6 | ||
75 | #define STM32_IRQ_EXTI5_9_PRIORITY 6 | ||
76 | #define STM32_IRQ_EXTI10_15_PRIORITY 6 | ||
77 | #define STM32_IRQ_EXTI16_PRIORITY 6 | ||
78 | #define STM32_IRQ_EXTI17_PRIORITY 15 | ||
79 | #define STM32_IRQ_EXTI18_PRIORITY 6 | ||
80 | #define STM32_IRQ_EXTI19_PRIORITY 6 | ||
81 | #define STM32_IRQ_EXTI20_PRIORITY 6 | ||
82 | #define STM32_IRQ_EXTI21_PRIORITY 15 | ||
83 | #define STM32_IRQ_EXTI22_PRIORITY 15 | ||
84 | |||
85 | /* | ||
86 | * ADC driver system settings. | ||
87 | */ | ||
88 | #define STM32_ADC_ADCPRE ADC_CCR_ADCPRE_DIV4 | ||
89 | #define STM32_ADC_USE_ADC1 FALSE | ||
90 | #define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(2, 4) | ||
91 | #define STM32_ADC_ADC1_DMA_PRIORITY 2 | ||
92 | #define STM32_ADC_IRQ_PRIORITY 6 | ||
93 | #define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 6 | ||
94 | |||
95 | /* | ||
96 | * GPT driver system settings. | ||
97 | */ | ||
98 | #define STM32_GPT_USE_TIM1 FALSE | ||
99 | #define STM32_GPT_USE_TIM2 FALSE | ||
100 | #define STM32_GPT_USE_TIM3 FALSE | ||
101 | #define STM32_GPT_USE_TIM4 FALSE | ||
102 | #define STM32_GPT_USE_TIM5 FALSE | ||
103 | #define STM32_GPT_USE_TIM9 FALSE | ||
104 | #define STM32_GPT_USE_TIM11 FALSE | ||
105 | #define STM32_GPT_TIM1_IRQ_PRIORITY 7 | ||
106 | #define STM32_GPT_TIM2_IRQ_PRIORITY 7 | ||
107 | #define STM32_GPT_TIM3_IRQ_PRIORITY 7 | ||
108 | #define STM32_GPT_TIM4_IRQ_PRIORITY 7 | ||
109 | #define STM32_GPT_TIM5_IRQ_PRIORITY 7 | ||
110 | #define STM32_GPT_TIM9_IRQ_PRIORITY 7 | ||
111 | #define STM32_GPT_TIM11_IRQ_PRIORITY 7 | ||
112 | |||
113 | /* | ||
114 | * I2C driver system settings. | ||
115 | */ | ||
116 | #define STM32_I2C_USE_I2C1 TRUE | ||
117 | #define STM32_I2C_USE_I2C2 FALSE | ||
118 | #define STM32_I2C_USE_I2C3 FALSE | ||
119 | #define STM32_I2C_BUSY_TIMEOUT 50 | ||
120 | #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) | ||
121 | #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) | ||
122 | #define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) | ||
123 | #define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) | ||
124 | #define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) | ||
125 | #define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) | ||
126 | #define STM32_I2C_I2C1_IRQ_PRIORITY 5 | ||
127 | #define STM32_I2C_I2C2_IRQ_PRIORITY 5 | ||
128 | #define STM32_I2C_I2C3_IRQ_PRIORITY 5 | ||
129 | #define STM32_I2C_I2C1_DMA_PRIORITY 3 | ||
130 | #define STM32_I2C_I2C2_DMA_PRIORITY 3 | ||
131 | #define STM32_I2C_I2C3_DMA_PRIORITY 3 | ||
132 | #define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") | ||
133 | |||
134 | /* | ||
135 | * I2S driver system settings. | ||
136 | */ | ||
137 | #define STM32_I2S_USE_SPI2 FALSE | ||
138 | #define STM32_I2S_USE_SPI3 FALSE | ||
139 | #define STM32_I2S_SPI2_IRQ_PRIORITY 10 | ||
140 | #define STM32_I2S_SPI3_IRQ_PRIORITY 10 | ||
141 | #define STM32_I2S_SPI2_DMA_PRIORITY 1 | ||
142 | #define STM32_I2S_SPI3_DMA_PRIORITY 1 | ||
143 | #define STM32_I2S_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) | ||
144 | #define STM32_I2S_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) | ||
145 | #define STM32_I2S_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) | ||
146 | #define STM32_I2S_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) | ||
147 | #define STM32_I2S_DMA_ERROR_HOOK(i2sp) osalSysHalt("DMA failure") | ||
148 | |||
149 | /* | ||
150 | * ICU driver system settings. | ||
151 | */ | ||
152 | #define STM32_ICU_USE_TIM1 FALSE | ||
153 | #define STM32_ICU_USE_TIM2 FALSE | ||
154 | #define STM32_ICU_USE_TIM3 FALSE | ||
155 | #define STM32_ICU_USE_TIM4 FALSE | ||
156 | #define STM32_ICU_USE_TIM5 FALSE | ||
157 | #define STM32_ICU_USE_TIM9 FALSE | ||
158 | #define STM32_ICU_TIM1_IRQ_PRIORITY 7 | ||
159 | #define STM32_ICU_TIM2_IRQ_PRIORITY 7 | ||
160 | #define STM32_ICU_TIM3_IRQ_PRIORITY 7 | ||
161 | #define STM32_ICU_TIM4_IRQ_PRIORITY 7 | ||
162 | #define STM32_ICU_TIM5_IRQ_PRIORITY 7 | ||
163 | #define STM32_ICU_TIM9_IRQ_PRIORITY 7 | ||
164 | |||
165 | /* | ||
166 | * PWM driver system settings. | ||
167 | */ | ||
168 | #define STM32_PWM_USE_ADVANCED FALSE | ||
169 | #define STM32_PWM_USE_TIM1 FALSE | ||
170 | #define STM32_PWM_USE_TIM2 FALSE | ||
171 | #define STM32_PWM_USE_TIM3 FALSE | ||
172 | #define STM32_PWM_USE_TIM4 FALSE | ||
173 | #define STM32_PWM_USE_TIM5 FALSE | ||
174 | #define STM32_PWM_USE_TIM9 FALSE | ||
175 | #define STM32_PWM_TIM1_IRQ_PRIORITY 7 | ||
176 | #define STM32_PWM_TIM2_IRQ_PRIORITY 7 | ||
177 | #define STM32_PWM_TIM3_IRQ_PRIORITY 7 | ||
178 | #define STM32_PWM_TIM4_IRQ_PRIORITY 7 | ||
179 | #define STM32_PWM_TIM5_IRQ_PRIORITY 7 | ||
180 | #define STM32_PWM_TIM9_IRQ_PRIORITY 7 | ||
181 | |||
182 | /* | ||
183 | * SERIAL driver system settings. | ||
184 | */ | ||
185 | #define STM32_SERIAL_USE_USART1 FALSE | ||
186 | #define STM32_SERIAL_USE_USART2 TRUE | ||
187 | #define STM32_SERIAL_USE_USART6 FALSE | ||
188 | #define STM32_SERIAL_USART1_PRIORITY 12 | ||
189 | #define STM32_SERIAL_USART2_PRIORITY 12 | ||
190 | #define STM32_SERIAL_USART6_PRIORITY 12 | ||
191 | |||
192 | /* | ||
193 | * SPI driver system settings. | ||
194 | */ | ||
195 | #define STM32_SPI_USE_SPI1 TRUE | ||
196 | #define STM32_SPI_USE_SPI2 TRUE | ||
197 | #define STM32_SPI_USE_SPI3 FALSE | ||
198 | #define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0) | ||
199 | #define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) | ||
200 | #define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) | ||
201 | #define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) | ||
202 | #define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) | ||
203 | #define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) | ||
204 | #define STM32_SPI_SPI1_DMA_PRIORITY 1 | ||
205 | #define STM32_SPI_SPI2_DMA_PRIORITY 1 | ||
206 | #define STM32_SPI_SPI3_DMA_PRIORITY 1 | ||
207 | #define STM32_SPI_SPI1_IRQ_PRIORITY 10 | ||
208 | #define STM32_SPI_SPI2_IRQ_PRIORITY 10 | ||
209 | #define STM32_SPI_SPI3_IRQ_PRIORITY 10 | ||
210 | #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") | ||
211 | |||
212 | /* | ||
213 | * ST driver system settings. | ||
214 | */ | ||
215 | #define STM32_ST_IRQ_PRIORITY 8 | ||
216 | #define STM32_ST_USE_TIMER 2 | ||
217 | |||
218 | /* | ||
219 | * UART driver system settings. | ||
220 | */ | ||
221 | #define STM32_UART_USE_USART1 FALSE | ||
222 | #define STM32_UART_USE_USART2 FALSE | ||
223 | #define STM32_UART_USE_USART6 FALSE | ||
224 | #define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) | ||
225 | #define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) | ||
226 | #define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) | ||
227 | #define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) | ||
228 | #define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) | ||
229 | #define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) | ||
230 | #define STM32_UART_USART1_IRQ_PRIORITY 12 | ||
231 | #define STM32_UART_USART2_IRQ_PRIORITY 12 | ||
232 | #define STM32_UART_USART6_IRQ_PRIORITY 12 | ||
233 | #define STM32_UART_USART1_DMA_PRIORITY 0 | ||
234 | #define STM32_UART_USART2_DMA_PRIORITY 0 | ||
235 | #define STM32_UART_USART6_DMA_PRIORITY 0 | ||
236 | #define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") | ||
237 | |||
238 | /* | ||
239 | * USB driver system settings. | ||
240 | */ | ||
241 | #define STM32_USB_USE_OTG1 FALSE | ||
242 | #define STM32_USB_OTG1_IRQ_PRIORITY 14 | ||
243 | #define STM32_USB_OTG1_RX_FIFO_SIZE 512 | ||
244 | #define STM32_USB_OTG_THREAD_PRIO LOWPRIO | ||
245 | #define STM32_USB_OTG_THREAD_STACK_SIZE 128 | ||
246 | #define STM32_USB_OTGFIFO_FILL_BASEPRI 0 | ||
247 | |||
248 | /* | ||
249 | * WDG driver system settings. | ||
250 | */ | ||
251 | #define STM32_WDG_USE_IWDG FALSE | ||
252 | |||
253 | #endif /* MCUCONF_H */ | ||
diff --git a/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/main.c b/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/main.c new file mode 100644 index 000000000..578526b9f --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/main.c | |||
@@ -0,0 +1,133 @@ | |||
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 | #include "ch.h" | ||
18 | #include "hal.h" | ||
19 | |||
20 | #include "chprintf.h" | ||
21 | #include "hts221.h" | ||
22 | |||
23 | #define cls(chp) chprintf(chp, "\033[2J\033[1;1H") | ||
24 | |||
25 | /*===========================================================================*/ | ||
26 | /* HTS221 related. */ | ||
27 | /*===========================================================================*/ | ||
28 | |||
29 | /* HTS221 Driver: This object represent an HTS221 instance */ | ||
30 | static HTS221Driver HTS221D1; | ||
31 | |||
32 | static int32_t hygroraw; | ||
33 | static int32_t thermoraw; | ||
34 | |||
35 | static float hygrocooked; | ||
36 | static float thermocooked; | ||
37 | |||
38 | static const I2CConfig i2ccfg = { | ||
39 | OPMODE_I2C, | ||
40 | 400000, | ||
41 | FAST_DUTY_CYCLE_2, | ||
42 | }; | ||
43 | |||
44 | static const HTS221Config hts221cfg = { | ||
45 | &I2CD1, | ||
46 | &i2ccfg, | ||
47 | NULL, | ||
48 | NULL, | ||
49 | NULL, | ||
50 | NULL, | ||
51 | HTS221_ODR_7HZ, | ||
52 | #if HTS221_USE_ADVANCED || defined(__DOXYGEN__) | ||
53 | HTS221_BDU_CONTINUOUS, | ||
54 | HTS221_AVGH_256, | ||
55 | HTS221_AVGT_256 | ||
56 | #endif | ||
57 | }; | ||
58 | |||
59 | /*===========================================================================*/ | ||
60 | /* Generic code. */ | ||
61 | /*===========================================================================*/ | ||
62 | |||
63 | static BaseSequentialStream* chp = (BaseSequentialStream*)&SD2; | ||
64 | /* | ||
65 | * LED blinker thread, times are in milliseconds. | ||
66 | */ | ||
67 | static THD_WORKING_AREA(waThread1, 128); | ||
68 | static THD_FUNCTION(Thread1, arg) { | ||
69 | |||
70 | (void)arg; | ||
71 | chRegSetThreadName("blinker"); | ||
72 | while (true) { | ||
73 | palToggleLine(LINE_LED_GREEN); | ||
74 | chThdSleepMilliseconds(500); | ||
75 | } | ||
76 | } | ||
77 | |||
78 | /* | ||
79 | * Application entry point. | ||
80 | */ | ||
81 | int main(void) { | ||
82 | |||
83 | /* | ||
84 | * System initializations. | ||
85 | * - HAL initialization, this also initializes the configured device drivers | ||
86 | * and performs the board-specific initializations. | ||
87 | * - Kernel initialization, the main() function becomes a thread and the | ||
88 | * RTOS is active. | ||
89 | */ | ||
90 | halInit(); | ||
91 | chSysInit(); | ||
92 | |||
93 | /* Configuring I2C SCK and I2C SDA related GPIOs .*/ | ||
94 | palSetLineMode(LINE_ARD_D15, PAL_MODE_ALTERNATE(4) | | ||
95 | PAL_STM32_OSPEED_HIGHEST | PAL_STM32_OTYPE_OPENDRAIN); | ||
96 | palSetLineMode(LINE_ARD_D14, PAL_MODE_ALTERNATE(4) | | ||
97 | PAL_STM32_OSPEED_HIGHEST | PAL_STM32_OTYPE_OPENDRAIN); | ||
98 | |||
99 | /* Activates the serial driver 1 using the driver default configuration.*/ | ||
100 | sdStart(&SD2, NULL); | ||
101 | |||
102 | /* Creates the blinker thread.*/ | ||
103 | chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); | ||
104 | |||
105 | /* HTS221 Object Initialization.*/ | ||
106 | hts221ObjectInit(&HTS221D1); | ||
107 | |||
108 | /* Activates the HTS221 driver.*/ | ||
109 | hts221Start(&HTS221D1, &hts221cfg); | ||
110 | |||
111 | /* Normal main() thread activity, printing MEMS data on the SD2. */ | ||
112 | while (true) { | ||
113 | hts221HygrometerReadRaw(&HTS221D1, &hygroraw); | ||
114 | chprintf(chp, "HTS221D1 Hygrometer raw data...\r\n"); | ||
115 | chprintf(chp, "Hum: %d\r\n", hygroraw); | ||
116 | |||
117 | hts221ThermometerReadRaw(&HTS221D1, &thermoraw); | ||
118 | chprintf(chp, "HTS221D1 Thermometer raw data...\r\n"); | ||
119 | chprintf(chp, "Temp: %d\r\n", &thermoraw); | ||
120 | |||
121 | hts221HygrometerReadCooked(&HTS221D1, &hygrocooked); | ||
122 | chprintf(chp, "HTS221D1 Hygrometer cooked data...\r\n"); | ||
123 | chprintf(chp, "Hum: %.2f\r\n", hygrocooked); | ||
124 | |||
125 | hts221ThermometerReadCooked(&HTS221D1, &thermocooked); | ||
126 | chprintf(chp, "HTS221D1 Thermometer cooked data...\r\n"); | ||
127 | chprintf(chp, "Temp: %.2f\r\n", thermocooked); | ||
128 | |||
129 | chThdSleepMilliseconds(100); | ||
130 | cls(chp); | ||
131 | } | ||
132 | hts221Stop(&HTS221D1); | ||
133 | } | ||
diff --git a/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/readme.txt b/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/readme.txt new file mode 100644 index 000000000..203556682 --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F4xx/I2C-HTS221/readme.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | ***************************************************************************** | ||
2 | ** ChibiOS/HAL + ChibiOS/EX - I2C + HTS221 demo for STM32F4xx. ** | ||
3 | ***************************************************************************** | ||
4 | |||
5 | ** TARGET ** | ||
6 | |||
7 | The demo runs on an STM32 Nucleo64-F401RE board. It has been tested with both | ||
8 | X-NUCLEO-IKS01A1 and X-NUCLEO-IKS01A2 shield. | ||
9 | |||
10 | ** The Demo ** | ||
11 | |||
12 | The application demonstrates the use of the STM32F4xx I2C driver in order | ||
13 | to acquire data from HTS221 using ChibiOS/EX. | ||
14 | |||
15 | ** Board Setup ** | ||
16 | |||
17 | None required. | ||
18 | |||
19 | ** Build Procedure ** | ||
20 | |||
21 | The demo has been tested using the free Codesourcery GCC-based toolchain | ||
22 | and YAGARTO. | ||
23 | Just modify the TRGT line in the makefile in order to use different GCC ports. | ||
24 | |||
25 | ** Notes ** | ||
26 | |||
27 | Some files used by the demo are not part of ChibiOS/RT but are copyright of | ||
28 | ST Microelectronics and are licensed under a different license. | ||
29 | Also note that not all the files present in the ST library are distributed | ||
30 | with ChibiOS/RT, you can find the whole library on the ST web site: | ||
31 | |||
32 | http://www.st.com \ No newline at end of file | ||
diff --git a/lib/chibios/testex/STM32/STM32F4xx/I2C-IKS01A2/Makefile b/lib/chibios/testex/STM32/STM32F4xx/I2C-IKS01A2/Makefile new file mode 100644 index 000000000..9ebe7d5e7 --- /dev/null +++ b/lib/chibios/testex/STM32/STM32F4xx/I2C-IKS01A2/Makefile | |||
@@ -0,0 +1,192 @@ | |||
1 | ############################################################################## | ||
2 | # Build global options | ||
3 | # NOTE: Can be overridden externally. | ||
4 | # | ||
5 | |||
6 | # Compiler options here. | ||
7 | ifeq ($(USE_OPT),) | ||
8 | USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 | ||
9 | endif | ||
10 | |||
11 | # C specific options here (added to USE_OPT). | ||
12 | ifeq ($(USE_COPT),) | ||
13 | USE_COPT = | ||
14 | endif | ||
15 | |||
16 | # C++ specific options here (added to USE_OPT). | ||
17 | ifeq ($(USE_CPPOPT),) | ||
18 | USE_CPPOPT = -fno-rtti | ||
19 | endif | ||
20 | |||
21 | # Enable this if you want the linker to remove unused code and data. | ||
22 | ifeq ($(USE_LINK_GC),) | ||
23 | USE_LINK_GC = yes | ||
24 | endif | ||
25 | |||
26 | # Linker extra options here. | ||
27 | ifeq ($(USE_LDOPT),) | ||
28 | USE_LDOPT = | ||
29 | endif | ||
30 | |||
31 | # Enable this if you want link time optimizations (LTO). | ||
32 | ifeq ($(USE_LTO),) | ||
33 | USE_LTO = yes | ||
34 | endif | ||
35 | |||
36 | # Enable this if you want to see the full log while compiling. | ||
37 | ifeq ($(USE_VERBOSE_COMPILE),) | ||
38 | USE_VERBOSE_COMPILE = no | ||
39 | endif | ||
40 | |||
41 | # If enabled, this option makes the build process faster by not compiling | ||
42 | # modules not used in the current configuration. | ||
43 | ifeq ($(USE_SMART_BUILD),) | ||
44 | USE_SMART_BUILD = yes | ||
45 | endif | ||
46 | |||
47 | # | ||
48 | # Build global options | ||
49 | ############################################################################## | ||
50 | |||
51 | ############################################################################## | ||
52 | # Architecture or project specific options | ||
53 | # | ||
54 | |||
55 | # Stack size to be allocated to the Cortex-M process stack. This stack is | ||
56 | # the stack used by the main() thread. | ||
57 | ifeq ($(USE_PROCESS_STACKSIZE),) | ||
58 | USE_PROCESS_STACKSIZE = 0x400 | ||
59 | endif | ||
60 | |||
61 | # Stack size to the allocated to the Cortex-M main/exceptions stack. This | ||
62 | # stack is used for processing interrupts and exceptions. | ||
63 | ifeq ($(USE_EXCEPTIONS_STACKSIZE),) | ||
64 | USE_EXCEPTIONS_STACKSIZE = 0x400 | ||
65 | endif | ||
66 | |||
67 | # Enables the use of FPU (no, softfp, hard). | ||
68 | ifeq ($(USE_FPU),) | ||
69 | USE_FPU = hard | ||
70 | endif | ||
71 | |||
72 | # FPU-related options. | ||
73 | ifeq ($(USE_FPU_OPT),) | ||
74 | USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 | ||
75 | endif | ||
76 | |||
77 | # | ||
78 | # Architecture or project specific options | ||
79 | ############################################################################## | ||
80 | |||
81 | ############################################################################## | ||
82 | # Project, target, sources and paths | ||
83 | # | ||
84 | |||
85 | # Define project name here | ||
86 | PROJECT = ch | ||
87 | |||
88 | # Target settings. | ||
89 | MCU = cortex-m4 | ||
90 | |||
91 | # Imported source files and paths. | ||
92 | CHIBIOS := ../../../.. | ||
93 | CONFDIR := ./cfg | ||
94 | BUILDDIR := ./build | ||
95 | DEPDIR := ./.dep | ||
96 | |||
97 | # Licensing files. | ||
98 | include $(CHIBIOS)/os/license/license.mk | ||
99 | # Startup files. | ||
100 | include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk | ||
101 | # HAL-OSAL files (optional). | ||
102 | include $(CHIBIOS)/os/hal/hal.mk | ||
103 | include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk | ||
104 | include $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F401RE/board.mk | ||
105 | include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk | ||
106 | # RTOS files (optional). | ||
107 | include $(CHIBIOS)/os/rt/rt.mk | ||
108 | include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk | ||
109 | # EX files (optional). | ||
110 | include $(CHIBIOS)/os/ex/devices/ST/hts221.mk | ||
111 | include $(CHIBIOS)/os/ex/devices/ST/lps22hb.mk | ||
112 | include $(CHIBIOS)/os/ex/devices/ST/lsm303agr.mk | ||
113 | include $(CHIBIOS)/os/ex/devices/ST/lsm6dsl.mk | ||
114 | # Auto-build files in ./source recursively. | ||
115 | include $(CHIBIOS)/tools/mk/autobuild.mk | ||
116 | # Other files (optional). | ||
117 | include $(CHIBIOS)/os/hal/lib/streams/streams.mk | ||
118 | |||
119 | # Define linker script file here. | ||
120 | LDSCRIPT= $(STARTUPLD)/STM32F401xE.ld | ||
121 | |||
122 | # C sources that can be compiled in ARM or THUMB mode depending on the global | ||
123 | # setting. | ||
124 | CSRC = $(ALLCSRC) \ | ||
125 | $(TESTSRC) \ | ||
126 | main.c | ||
127 | |||
128 | # C++ sources that can be compiled in ARM or THUMB mode depending on the global | ||
129 | # setting. | ||
130 | CPPSRC = $(ALLCPPSRC) | ||
131 | |||
132 | # List ASM source files here. | ||
133 | ASMSRC = $(ALLASMSRC) | ||
134 | |||
135 | # List ASM with preprocessor source files here. | ||
136 | ASMXSRC = $(ALLXASMSRC) | ||
137 | |||
138 | # Inclusion directories. | ||
139 | INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) | ||
140 | |||
141 | # Define C warning options here. | ||
142 | CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes | ||
143 | |||
144 | # Define C++ warning options here. | ||
145 | CPPWARN = -Wall -Wextra -Wundef | ||
146 | |||
147 | # | ||
148 | # Project, target, sources and paths | ||
149 | ############################################################################## | ||
150 | |||
151 | ############################################################################## | ||
152 | # Start of user section | ||
153 | # | ||
154 | |||
155 | # List all user C define here, like -D_DEBUG=1 | ||
156 | UDEFS = -DCHPRINTF_USE_FLOAT=1 | ||
157 | |||
158 | # Define ASM defines here | ||
159 | UADEFS = | ||
160 | |||
161 | # List all user directories here | ||
162 | UINCDIR = | ||
163 | |||
164 | # List the user directory to look for the libraries here | ||
165 | ULIBDIR = | ||
166 | |||
167 | # List all user libraries here | ||
168 | ULIBS = | ||
169 | |||
170 | # | ||
171 | # End of user section | ||
172 | ############################################################################## | ||
173 | |||
1 |