diff options
Diffstat (limited to 'lib/chibios-contrib/testhal')
605 files changed, 172798 insertions, 0 deletions
diff --git a/lib/chibios-contrib/testhal/.keep b/lib/chibios-contrib/testhal/.keep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/lib/chibios-contrib/testhal/.keep | |||
diff --git a/lib/chibios-contrib/testhal/HT32/.keep b/lib/chibios-contrib/testhal/HT32/.keep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/lib/chibios-contrib/testhal/HT32/.keep | |||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/Makefile b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/Makefile new file mode 100644 index 000000000..0e2572a92 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/Makefile | |||
@@ -0,0 +1,213 @@ | |||
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 -DCRT0_INIT_STACKS=0 | ||
9 | # USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 | ||
10 | endif | ||
11 | |||
12 | # C specific options here (added to USE_OPT). | ||
13 | ifeq ($(USE_COPT),) | ||
14 | USE_COPT = | ||
15 | endif | ||
16 | |||
17 | # C++ specific options here (added to USE_OPT). | ||
18 | ifeq ($(USE_CPPOPT),) | ||
19 | USE_CPPOPT = -fno-rtti | ||
20 | endif | ||
21 | |||
22 | # Enable this if you want the linker to remove unused code and data | ||
23 | ifeq ($(USE_LINK_GC),) | ||
24 | USE_LINK_GC = yes | ||
25 | endif | ||
26 | |||
27 | # Linker extra options here. | ||
28 | ifeq ($(USE_LDOPT),) | ||
29 | USE_LDOPT = | ||
30 | endif | ||
31 | |||
32 | # Enable this if you want link time optimizations (LTO) | ||
33 | ifeq ($(USE_LTO),) | ||
34 | USE_LTO = no | ||
35 | endif | ||
36 | |||
37 | # If enabled, this option allows to compile the application in THUMB mode. | ||
38 | ifeq ($(USE_THUMB),) | ||
39 | USE_THUMB = yes | ||
40 | endif | ||
41 | |||
42 | # Enable this if you want to see the full log while compiling. | ||
43 | ifeq ($(USE_VERBOSE_COMPILE),) | ||
44 | USE_VERBOSE_COMPILE = no | ||
45 | endif | ||
46 | |||
47 | # If enabled, this option makes the build process faster by not compiling | ||
48 | # modules not used in the current configuration. | ||
49 | ifeq ($(USE_SMART_BUILD),) | ||
50 | USE_SMART_BUILD = yes | ||
51 | endif | ||
52 | |||
53 | # | ||
54 | # Build global options | ||
55 | ############################################################################## | ||
56 | |||
57 | ############################################################################## | ||
58 | # Architecture or project specific options | ||
59 | # | ||
60 | |||
61 | # Stack size to be allocated to the Cortex-M process stack. This stack is | ||
62 | # the stack used by the main() thread. | ||
63 | ifeq ($(USE_PROCESS_STACKSIZE),) | ||
64 | USE_PROCESS_STACKSIZE = 0x200 | ||
65 | endif | ||
66 | |||
67 | # Stack size to the allocated to the Cortex-M main/exceptions stack. This | ||
68 | # stack is used for processing interrupts and exceptions. | ||
69 | ifeq ($(USE_EXCEPTIONS_STACKSIZE),) | ||
70 | USE_EXCEPTIONS_STACKSIZE = 0x400 | ||
71 | endif | ||
72 | |||
73 | # Enables the use of FPU on Cortex-M4 (no, softfp, hard). | ||
74 | ifeq ($(USE_FPU),) | ||
75 | USE_FPU = no | ||
76 | endif | ||
77 | |||
78 | # | ||
79 | # Architecture or project specific options | ||
80 | ############################################################################## | ||
81 | |||
82 | ############################################################################## | ||
83 | # Project, sources and paths | ||
84 | # | ||
85 | |||
86 | # Define project name here | ||
87 | PROJECT = ch | ||
88 | |||
89 | # Imported source files and paths | ||
90 | CHIBIOS = ../../../../../ChibiOS | ||
91 | CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib | ||
92 | # Licensing files. | ||
93 | include $(CHIBIOS)/os/license/license.mk | ||
94 | # Startup files. | ||
95 | include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_k20x5.mk | ||
96 | # HAL-OSAL files (optional). | ||
97 | include $(CHIBIOS_CONTRIB)/os/hal/hal.mk | ||
98 | include $(CHIBIOS_CONTRIB)/os/hal/ports/KINETIS/K20x/platform.mk | ||
99 | include $(CHIBIOS_CONTRIB)/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.mk | ||
100 | include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk | ||
101 | # RTOS files (optional). | ||
102 | include $(CHIBIOS)/os/rt/rt.mk | ||
103 | include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk | ||
104 | # Other files (optional). | ||
105 | |||
106 | # Define linker script file here | ||
107 | LDSCRIPT= $(STARTUPLD_CONTRIB)/MK20DX128.ld | ||
108 | |||
109 | # C sources that can be compiled in ARM or THUMB mode depending on the global | ||
110 | # setting. | ||
111 | CSRC = $(ALLCSRC) \ | ||
112 | $(TESTSRC) \ | ||
113 | main.c | ||
114 | |||
115 | # C++ sources that can be compiled in ARM or THUMB mode depending on the global | ||
116 | # setting. | ||
117 | CPPSRC = $(ALLCPPSRC) | ||
118 | |||
119 | # C sources to be compiled in ARM mode regardless of the global setting. | ||
120 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler | ||
121 | # option that results in lower performance and larger code size. | ||
122 | ACSRC = | ||
123 | |||
124 | # C++ sources to be compiled in ARM mode regardless of the global setting. | ||
125 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler | ||
126 | # option that results in lower performance and larger code size. | ||
127 | ACPPSRC = | ||
128 | |||
129 | # C sources to be compiled in THUMB mode regardless of the global setting. | ||
130 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler | ||
131 | # option that results in lower performance and larger code size. | ||
132 | TCSRC = | ||
133 | |||
134 | # C sources to be compiled in THUMB mode regardless of the global setting. | ||
135 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler | ||
136 | # option that results in lower performance and larger code size. | ||
137 | TCPPSRC = | ||
138 | |||
139 | # List ASM source files here | ||
140 | ASMSRC = $(ALLASMSRC) | ||
141 | ASMXSRC = $(ALLXASMSRC) | ||
142 | |||
143 | INCDIR = $(ALLINC) $(TESTINC) \ | ||
144 | $(TESTHAL) | ||
145 | |||
146 | # | ||
147 | # Project, sources and paths | ||
148 | ############################################################################## | ||
149 | |||
150 | ############################################################################## | ||
151 | # Compiler settings | ||
152 | # | ||
153 | |||
154 | MCU = cortex-m4 | ||
155 | |||
156 | #TRGT = arm-elf- | ||
157 | TRGT = arm-none-eabi- | ||
158 | CC = $(TRGT)gcc | ||
159 | CPPC = $(TRGT)g++ | ||
160 | # Enable loading with g++ only if you need C++ runtime support. | ||
161 | # NOTE: You can use C++ even without C++ support if you are careful. C++ | ||
162 | # runtime support makes code size explode. | ||
163 | LD = $(TRGT)gcc | ||
164 | #LD = $(TRGT)g++ | ||
165 | CP = $(TRGT)objcopy | ||
166 | AS = $(TRGT)gcc -x assembler-with-cpp | ||
167 | OD = $(TRGT)objdump | ||
168 | SZ = $(TRGT)size | ||
169 | HEX = $(CP) -O ihex | ||
170 | BIN = $(CP) -O binary | ||
171 | SREC = $(CP) -O srec | ||
172 | |||
173 | # ARM-specific options here | ||
174 | AOPT = | ||
175 | |||
176 | # THUMB-specific options here | ||
177 | TOPT = -mthumb -DTHUMB | ||
178 | |||
179 | # Define C warning options here | ||
180 | CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes | ||
181 | |||
182 | # Define C++ warning options here | ||
183 | CPPWARN = -Wall -Wextra -Wundef | ||
184 | |||
185 | # | ||
186 | # Compiler settings | ||
187 | ############################################################################## | ||
188 | |||
189 | ############################################################################## | ||
190 | # Start of user section | ||
191 | # | ||
192 | |||
193 | # List all user C define here, like -D_DEBUG=1 | ||
194 | UDEFS = | ||
195 | |||
196 | # Define ASM defines here | ||
197 | UADEFS = | ||
198 | |||
199 | # List all user directories here | ||
200 | UINCDIR = | ||
201 | |||
202 | # List the user directory to look for the libraries here | ||
203 | ULIBDIR = | ||
204 | |||
205 | # List all user libraries here | ||
206 | ULIBS = | ||
207 | |||
208 | # | ||
209 | # End of user defines | ||
210 | ############################################################################## | ||
211 | |||
212 | RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk | ||
213 | include $(RULESPATH)/rules.mk | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/chconf.h b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/chconf.h new file mode 100644 index 000000000..b6753aba6 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/chconf.h | |||
@@ -0,0 +1,757 @@ | |||
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 or 32 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 | /*===========================================================================*/ | ||
752 | /* Port-specific settings (override port settings defaulted in chcore.h). */ | ||
753 | /*===========================================================================*/ | ||
754 | |||
755 | #endif /* CHCONF_H */ | ||
756 | |||
757 | /** @} */ | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/halconf.h b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/halconf.h new file mode 100644 index 000000000..57edb4927 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/halconf.h | |||
@@ -0,0 +1,533 @@ | |||
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 FALSE | ||
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 | #include "halconf_community.h" | ||
530 | |||
531 | #endif /* HALCONF_H */ | ||
532 | |||
533 | /** @} */ | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/halconf_community.h b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/halconf_community.h new file mode 100644 index 000000000..43fdbf869 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/halconf_community.h | |||
@@ -0,0 +1,173 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2014 Uladzimir Pylinsky aka barthess | ||
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 HALCONF_COMMUNITY_H | ||
18 | #define HALCONF_COMMUNITY_H | ||
19 | |||
20 | /** | ||
21 | * @brief Enables the community overlay. | ||
22 | */ | ||
23 | #if !defined(HAL_USE_COMMUNITY) || defined(__DOXYGEN__) | ||
24 | #define HAL_USE_COMMUNITY TRUE | ||
25 | #endif | ||
26 | |||
27 | /** | ||
28 | * @brief Enables the FSMC subsystem. | ||
29 | */ | ||
30 | #if !defined(HAL_USE_FSMC) || defined(__DOXYGEN__) | ||
31 | #define HAL_USE_FSMC FALSE | ||
32 | #endif | ||
33 | |||
34 | /** | ||
35 | * @brief Enables the NAND subsystem. | ||
36 | */ | ||
37 | #if !defined(HAL_USE_NAND) || defined(__DOXYGEN__) | ||
38 | #define HAL_USE_NAND FALSE | ||
39 | #endif | ||
40 | |||
41 | /** | ||
42 | * @brief Enables the 1-wire subsystem. | ||
43 | */ | ||
44 | #if !defined(HAL_USE_ONEWIRE) || defined(__DOXYGEN__) | ||
45 | #define HAL_USE_ONEWIRE FALSE | ||
46 | #endif | ||
47 | |||
48 | /** | ||
49 | * @brief Enables the EICU subsystem. | ||
50 | */ | ||
51 | #if !defined(HAL_USE_EICU) || defined(__DOXYGEN__) | ||
52 | #define HAL_USE_EICU FALSE | ||
53 | #endif | ||
54 | |||
55 | /** | ||
56 | * @brief Enables the CRC subsystem. | ||
57 | */ | ||
58 | #if !defined(HAL_USE_CRC) || defined(__DOXYGEN__) | ||
59 | #define HAL_USE_CRC FALSE | ||
60 | #endif | ||
61 | |||
62 | /** | ||
63 | * @brief Enables the RNG subsystem. | ||
64 | */ | ||
65 | #if !defined(HAL_USE_RNG) || defined(__DOXYGEN__) | ||
66 | #define HAL_USE_RNG FALSE | ||
67 | #endif | ||
68 | |||
69 | /** | ||
70 | * @brief Enables the EEPROM subsystem. | ||
71 | */ | ||
72 | #if !defined(HAL_USE_EEPROM) || defined(__DOXYGEN__) | ||
73 | #define HAL_USE_EEPROM FALSE | ||
74 | #endif | ||
75 | |||
76 | /** | ||
77 | * @brief Enables the TIMCAP subsystem. | ||
78 | */ | ||
79 | #if !defined(HAL_USE_TIMCAP) || defined(__DOXYGEN__) | ||
80 | #define HAL_USE_TIMCAP FALSE | ||
81 | #endif | ||
82 | |||
83 | /** | ||
84 | * @brief Enables the TIMCAP subsystem. | ||
85 | */ | ||
86 | #if !defined(HAL_USE_COMP) || defined(__DOXYGEN__) | ||
87 | #define HAL_USE_COMP FALSE | ||
88 | #endif | ||
89 | |||
90 | /** | ||
91 | * @brief Enables the QEI subsystem. | ||
92 | */ | ||
93 | #if !defined(HAL_USE_QEI) || defined(__DOXYGEN__) | ||
94 | #define HAL_USE_QEI FALSE | ||
95 | #endif | ||
96 | |||
97 | /** | ||
98 | * @brief Enables the USBH subsystem. | ||
99 | */ | ||
100 | #if !defined(HAL_USE_USBH) || defined(__DOXYGEN__) | ||
101 | #define HAL_USE_USBH FALSE | ||
102 | #endif | ||
103 | |||
104 | /** | ||
105 | * @brief Enables the USB_MSD subsystem. | ||
106 | */ | ||
107 | #if !defined(HAL_USE_USB_MSD) || defined(__DOXYGEN__) | ||
108 | #define HAL_USE_USB_MSD FALSE | ||
109 | #endif | ||
110 | |||
111 | /*===========================================================================*/ | ||
112 | /* FSMCNAND driver related settings. */ | ||
113 | /*===========================================================================*/ | ||
114 | |||
115 | /** | ||
116 | * @brief Enables the @p nandAcquireBus() and @p nanReleaseBus() APIs. | ||
117 | * @note Disabling this option saves both code and data space. | ||
118 | */ | ||
119 | #if !defined(NAND_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
120 | #define NAND_USE_MUTUAL_EXCLUSION TRUE | ||
121 | #endif | ||
122 | |||
123 | /*===========================================================================*/ | ||
124 | /* 1-wire driver related settings. */ | ||
125 | /*===========================================================================*/ | ||
126 | /** | ||
127 | * @brief Enables strong pull up feature. | ||
128 | * @note Disabling this option saves both code and data space. | ||
129 | */ | ||
130 | #define ONEWIRE_USE_STRONG_PULLUP FALSE | ||
131 | |||
132 | /** | ||
133 | * @brief Enables search ROM feature. | ||
134 | * @note Disabling this option saves both code and data space. | ||
135 | */ | ||
136 | #define ONEWIRE_USE_SEARCH_ROM TRUE | ||
137 | |||
138 | /*===========================================================================*/ | ||
139 | /* QEI driver related settings. */ | ||
140 | /*===========================================================================*/ | ||
141 | |||
142 | /** | ||
143 | * @brief Enables discard of overlow | ||
144 | */ | ||
145 | #if !defined(QEI_USE_OVERFLOW_DISCARD) || defined(__DOXYGEN__) | ||
146 | #define QEI_USE_OVERFLOW_DISCARD FALSE | ||
147 | #endif | ||
148 | |||
149 | /** | ||
150 | * @brief Enables min max of overlow | ||
151 | */ | ||
152 | #if !defined(QEI_USE_OVERFLOW_MINMAX) || defined(__DOXYGEN__) | ||
153 | #define QEI_USE_OVERFLOW_MINMAX FALSE | ||
154 | #endif | ||
155 | |||
156 | /*===========================================================================*/ | ||
157 | /* EEProm driver related settings. */ | ||
158 | /*===========================================================================*/ | ||
159 | |||
160 | /** | ||
161 | * @brief Enables 24xx series I2C eeprom device driver. | ||
162 | * @note Disabling this option saves both code and data space. | ||
163 | */ | ||
164 | #define EEPROM_USE_EE24XX FALSE | ||
165 | /** | ||
166 | * @brief Enables 25xx series SPI eeprom device driver. | ||
167 | * @note Disabling this option saves both code and data space. | ||
168 | */ | ||
169 | #define EEPROM_USE_EE25XX FALSE | ||
170 | |||
171 | #endif /* HALCONF_COMMUNITY_H */ | ||
172 | |||
173 | /** @} */ | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/main.c b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/main.c new file mode 100644 index 000000000..c6c3e135c --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/main.c | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2015 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 | #define MMA8451_ADDR 0x1D | ||
21 | #define WHO_AM_I 0x0D | ||
22 | |||
23 | static bool i2cOk = false; | ||
24 | |||
25 | static THD_WORKING_AREA(waThread1, 64); | ||
26 | static THD_FUNCTION(Thread1, arg) { | ||
27 | |||
28 | (void)arg; | ||
29 | chRegSetThreadName("Blinker"); | ||
30 | while (TRUE) { | ||
31 | if (i2cOk) { | ||
32 | palSetPad(IOPORT3, 3); | ||
33 | palTogglePad(IOPORT4, 4); | ||
34 | } else { | ||
35 | palSetPad(IOPORT4, 4); | ||
36 | palTogglePad(IOPORT3, 3); | ||
37 | } | ||
38 | chThdSleepMilliseconds(500); | ||
39 | } | ||
40 | } | ||
41 | |||
42 | /* | ||
43 | * Application entry point. | ||
44 | */ | ||
45 | int main(void) { | ||
46 | |||
47 | uint8_t tx[1], rx[1]; | ||
48 | |||
49 | /* | ||
50 | * System initializations. | ||
51 | * - HAL initialization, this also initializes the configured device drivers | ||
52 | * and performs the board-specific initializations. | ||
53 | * - Kernel initialization, the main() function becomes a thread and the | ||
54 | * RTOS is active. | ||
55 | */ | ||
56 | halInit(); | ||
57 | chSysInit(); | ||
58 | |||
59 | palSetPad(IOPORT3, 3); | ||
60 | palSetPad(IOPORT4, 4); | ||
61 | palSetPad(IOPORT1, 2); | ||
62 | |||
63 | i2cStart(&I2CD1, NULL); | ||
64 | |||
65 | chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); | ||
66 | |||
67 | while (1) { | ||
68 | tx[0] = WHO_AM_I; | ||
69 | i2cMasterTransmitTimeout(&I2CD1, MMA8451_ADDR, tx, 1, rx, 1, TIME_INFINITE); | ||
70 | i2cOk = (rx[0] == 0x1A) ? true : false; | ||
71 | chThdSleepMilliseconds(2000); | ||
72 | } | ||
73 | } | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/mcuconf.h b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/mcuconf.h new file mode 100644 index 000000000..5a9d3c35a --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/mcuconf.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2015 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 | #define K20x_MCUCONF | ||
21 | |||
22 | /* | ||
23 | * HAL driver system settings. | ||
24 | */ | ||
25 | |||
26 | /* Select the MCU clocking mode below by enabling the appropriate block. */ | ||
27 | |||
28 | /* Enable clock initialization by HAL */ | ||
29 | #define KINETIS_NO_INIT FALSE | ||
30 | |||
31 | /* PEE mode - external (8 MHz) crystal with PLL for 48 MHz core/system clock. */ | ||
32 | #if 1 | ||
33 | #define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE | ||
34 | #define KINETIS_PLLCLK_FREQUENCY 96000000UL | ||
35 | #define KINETIS_SYSCLK_FREQUENCY 48000000UL | ||
36 | #endif | ||
37 | |||
38 | /* FEI mode - 48 MHz with internal 32.768 kHz oscillator */ | ||
39 | #if 0 | ||
40 | #define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI | ||
41 | #define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */ | ||
42 | #define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */ | ||
43 | #define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */ | ||
44 | #define KINETIS_CLKDIV1_OUTDIV1 1 /* Divide MCGCLKOUT (~48MHz) by 1 to SYSCLK */ | ||
45 | #define KINETIS_CLKDIV1_OUTDIV2 1 /* Divide by 1 for (~48MHz) peripheral clock */ | ||
46 | #define KINETIS_CLKDIV1_OUTDIV4 2 /* Divide by 2 for (~24MHz) flash clock */ | ||
47 | #define KINETIS_BUSCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY | ||
48 | #define KINETIS_FLASHCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY/2 | ||
49 | #endif /* 0 */ | ||
50 | |||
51 | /* FEE mode - 24 MHz with external 32.768 kHz crystal */ | ||
52 | /* not implemented */ | ||
53 | #if 0 | ||
54 | #define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEE | ||
55 | #define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */ | ||
56 | #define KINETIS_MCG_FLL_DRS 0 /* 732x FLL factor */ | ||
57 | #define KINETIS_CLKDIV1_OUTDIV1 1 /* Divide 48 MHz FLL by 1 => 24 MHz */ | ||
58 | #define KINETIS_CLKDIV1_OUTDIV4 2 /* Divide OUTDIV1 output by 2 => 12 MHz */ | ||
59 | #define KINETIS_SYSCLK_FREQUENCY 23986176UL /* 32.768 kHz*732 (~24 MHz) */ | ||
60 | #define KINETIS_UART0_CLOCK_FREQ (32768 * 732) /* FLL output */ | ||
61 | #define KINETIS_UART0_CLOCK_SRC 1 /* Select FLL clock */ | ||
62 | #define KINETIS_BUSCLK_FREQUENCY (KINETIS_SYSCLK_FREQUENCY / KINETIS_CLKDIV1_OUTDIV4) | ||
63 | #endif /* 0 */ | ||
64 | |||
65 | /* FEE mode - 48 MHz */ | ||
66 | /* not implemented */ | ||
67 | #if 0 | ||
68 | #define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEE | ||
69 | #define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */ | ||
70 | #define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */ | ||
71 | #define KINETIS_CLKDIV1_OUTDIV1 1 /* Divide 48 MHz FLL by 1 => 48 MHz */ | ||
72 | #define KINETIS_CLKDIV1_OUTDIV4 2 /* Divide OUTDIV1 output by 2 => 24 MHz */ | ||
73 | #define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */ | ||
74 | #endif /* 0 */ | ||
75 | |||
76 | /* | ||
77 | * SERIAL driver system settings. | ||
78 | */ | ||
79 | #define KINETIS_SERIAL_USE_UART0 FALSE | ||
80 | #define KINETIS_I2C_USE_I2C0 TRUE | ||
81 | #define KINETIS_I2C_I2C0_PRIORITY 8 | ||
82 | |||
83 | #endif /* _MCUCONF_H_ */ | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/readme.txt b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/readme.txt new file mode 100644 index 000000000..d4a0cd8a8 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/readme.txt | |||
@@ -0,0 +1,20 @@ | |||
1 | ********************************************************************* | ||
2 | ** ChibiOS/RT I2C test demo for Freedom Board K20D50M. ** | ||
3 | ********************************************************************* | ||
4 | |||
5 | ** TARGET ** | ||
6 | |||
7 | The test runs on an Freescale Freedom K20D50M board. | ||
8 | |||
9 | ** The Demo ** | ||
10 | |||
11 | This test tries to access the onboard MMA8451 chip using the I2C bus. | ||
12 | It sends the command WHO_AM_I which has a standard answer that can be | ||
13 | verified. If the correct answer is received the GREEN led will blink. | ||
14 | If no answer or invalid answer is received the RED led will blink. | ||
15 | |||
16 | ** Build Procedure ** | ||
17 | |||
18 | This test was built using the ARM GCC toolchain available at: | ||
19 | |||
20 | https://launchpad.net/gcc-arm-embedded | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/Makefile b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/Makefile new file mode 100644 index 000000000..3c0acb96a --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/Makefile | |||
@@ -0,0 +1,219 @@ | |||
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 | # If enabled, this option allows to compile the application in THUMB mode. | ||
37 | ifeq ($(USE_THUMB),) | ||
38 | USE_THUMB = yes | ||
39 | endif | ||
40 | |||
41 | # Enable this if you want to see the full log while compiling. | ||
42 | ifeq ($(USE_VERBOSE_COMPILE),) | ||
43 | USE_VERBOSE_COMPILE = no | ||
44 | endif | ||
45 | |||
46 | # If enabled, this option makes the build process faster by not compiling | ||
47 | # modules not used in the current configuration. | ||
48 | ifeq ($(USE_SMART_BUILD),) | ||
49 | USE_SMART_BUILD = yes | ||
50 | endif | ||
51 | |||
52 | # | ||
53 | # Build global options | ||
54 | ############################################################################## | ||
55 | |||
56 | ############################################################################## | ||
57 | # Architecture or project specific options | ||
58 | # | ||
59 | |||
60 | # Stack size to be allocated to the Cortex-M process stack. This stack is | ||
61 | # the stack used by the main() thread. | ||
62 | ifeq ($(USE_PROCESS_STACKSIZE),) | ||
63 | USE_PROCESS_STACKSIZE = 0x200 | ||
64 | endif | ||
65 | |||
66 | # Stack size to the allocated to the Cortex-M main/exceptions stack. This | ||
67 | # stack is used for processing interrupts and exceptions. | ||
68 | ifeq ($(USE_EXCEPTIONS_STACKSIZE),) | ||
69 | USE_EXCEPTIONS_STACKSIZE = 0x400 | ||
70 | endif | ||
71 | |||
72 | # Enables the use of FPU on Cortex-M4 (no, softfp, hard). | ||
73 | ifeq ($(USE_FPU),) | ||
74 | USE_FPU = no | ||
75 | endif | ||
76 | |||
77 | # | ||
78 | # Architecture or project specific options | ||
79 | ############################################################################## | ||
80 | |||
81 | ############################################################################## | ||
82 | # Project, sources and paths | ||
83 | # | ||
84 | |||
85 | # Define project name here | ||
86 | PROJECT = ch | ||
87 | |||
88 | # Imported source files and paths | ||
89 | CHIBIOS = ../../../../../ChibiOS | ||
90 | CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib | ||
91 | # Licensing files. | ||
92 | include $(CHIBIOS)/os/license/license.mk | ||
93 | # Startup files. | ||
94 | include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_k20x5.mk | ||
95 | # HAL-OSAL files (optional). | ||
96 | include $(CHIBIOS_CONTRIB)/os/hal/hal.mk | ||
97 | include $(CHIBIOS_CONTRIB)/os/hal/ports/KINETIS/K20x/platform.mk | ||
98 | include $(CHIBIOS_CONTRIB)/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.mk | ||
99 | include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk | ||
100 | # RTOS files (optional). | ||
101 | include $(CHIBIOS)/os/rt/rt.mk | ||
102 | include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk | ||
103 | # Other files (optional). | ||
104 | include $(CHIBIOS)/test/lib/test.mk | ||
105 | include $(CHIBIOS)/test/rt/rt_test.mk | ||
106 | include $(CHIBIOS)/test/oslib/oslib_test.mk | ||
107 | include $(CHIBIOS)/os/hal/lib/streams/streams.mk | ||
108 | include $(CHIBIOS)/os/various/shell/shell.mk | ||
109 | |||
110 | # Define linker script file here | ||
111 | LDSCRIPT= $(STARTUPLD_CONTRIB)/MK20DX128.ld | ||
112 | |||
113 | # C sources that can be compiled in ARM or THUMB mode depending on the global | ||
114 | # setting. | ||
115 | CSRC = $(ALLCSRC) \ | ||
116 | $(TESTSRC) \ | ||
117 | usbcfg.c \ | ||
118 | main.c | ||
119 | |||
120 | # C++ sources that can be compiled in ARM or THUMB mode depending on the global | ||
121 | # setting. | ||
122 | CPPSRC = $(ALLCPPSRC) | ||
123 | |||
124 | # C sources to be compiled in ARM mode regardless of the global setting. | ||
125 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler | ||
126 | # option that results in lower performance and larger code size. | ||
127 | ACSRC = | ||
128 | |||
129 | # C++ sources to be compiled in ARM mode regardless of the global setting. | ||
130 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler | ||
131 | # option that results in lower performance and larger code size. | ||
132 | ACPPSRC = | ||
133 | |||
134 | # C sources to be compiled in THUMB mode regardless of the global setting. | ||
135 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler | ||
136 | # option that results in lower performance and larger code size. | ||
137 | TCSRC = | ||
138 | |||
139 | # C sources to be compiled in THUMB mode regardless of the global setting. | ||
140 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler | ||
141 | # option that results in lower performance and larger code size. | ||
142 | TCPPSRC = | ||
143 | |||
144 | # List ASM source files here | ||
145 | ASMSRC = $(ALLASMSRC) | ||
146 | ASMXSRC = $(ALLXASMSRC) | ||
147 | |||
148 | INCDIR = $(ALLINC) $(TESTINC) \ | ||
149 | $(TESTHAL) | ||
150 | |||
151 | # | ||
152 | # Project, sources and paths | ||
153 | ############################################################################## | ||
154 | |||
155 | ############################################################################## | ||
156 | # Compiler settings | ||
157 | # | ||
158 | |||
159 | MCU = cortex-m4 | ||
160 | |||
161 | #TRGT = arm-elf- | ||
162 | TRGT = arm-none-eabi- | ||
163 | CC = $(TRGT)gcc | ||
164 | CPPC = $(TRGT)g++ | ||
165 | # Enable loading with g++ only if you need C++ runtime support. | ||
166 | # NOTE: You can use C++ even without C++ support if you are careful. C++ | ||
167 | # runtime support makes code size explode. | ||
168 | LD = $(TRGT)gcc | ||
169 | #LD = $(TRGT)g++ | ||
170 | CP = $(TRGT)objcopy | ||
171 | AS = $(TRGT)gcc -x assembler-with-cpp | ||
172 | AR = $(TRGT)ar | ||
173 | OD = $(TRGT)objdump | ||
174 | SZ = $(TRGT)size | ||
175 | HEX = $(CP) -O ihex | ||
176 | BIN = $(CP) -O binary | ||
177 | SREC = $(CP) -O srec | ||
178 | |||
179 | # ARM-specific options here | ||
180 | AOPT = | ||
181 | |||
182 | # THUMB-specific options here | ||
183 | TOPT = -mthumb -DTHUMB | ||
184 | |||
185 | # Define C warning options here | ||
186 | CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes | ||
187 | |||
188 | # Define C++ warning options here | ||
189 | CPPWARN = -Wall -Wextra -Wundef | ||
190 | |||
191 | # | ||
192 | # Compiler settings | ||
193 | ############################################################################## | ||
194 | |||
195 | ############################################################################## | ||
196 | # Start of user section | ||
197 | # | ||
198 | |||
199 | # List all user C define here, like -D_DEBUG=1 | ||
200 | UDEFS = | ||
201 | |||
202 | # Define ASM defines here | ||
203 | UADEFS = | ||
204 | |||
205 | # List all user directories here | ||
206 | UINCDIR = | ||
207 | |||
208 | # List the user directory to look for the libraries here | ||
209 | ULIBDIR = | ||
210 | |||
211 | # List all user libraries here | ||
212 | ULIBS = | ||
213 | |||
214 | # | ||
215 | # End of user defines | ||
216 | ############################################################################## | ||
217 | |||
218 | RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk | ||
219 | include $(RULESPATH)/rules.mk | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/chconf.h b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/chconf.h new file mode 100644 index 000000000..b6753aba6 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/chconf.h | |||
@@ -0,0 +1,757 @@ | |||
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 or 32 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 | /*===========================================================================*/ | ||
752 | /* Port-specific settings (override port settings defaulted in chcore.h). */ | ||
753 | /*===========================================================================*/ | ||
754 | |||
755 | #endif /* CHCONF_H */ | ||
756 | |||
757 | /** @} */ | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/chtsy.inf b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/chtsy.inf new file mode 100644 index 000000000..519b30010 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/chtsy.inf | |||
@@ -0,0 +1,106 @@ | |||
1 | ;************************************************************ | ||
2 | ; Windows USB CDC ACM Setup File | ||
3 | ; Copyright (c) 2000 Microsoft Corporation | ||
4 | |||
5 | |||
6 | [Version] | ||
7 | Signature="$Windows NT$" | ||
8 | Class=Ports | ||
9 | ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} | ||
10 | Provider=%MFGNAME% | ||
11 | LayoutFile=layout.inf | ||
12 | CatalogFile=%MFGFILENAME%.cat | ||
13 | DriverVer=11/15/2007,5.1.2600.0 | ||
14 | |||
15 | [Manufacturer] | ||
16 | %MFGNAME%=DeviceList, NTamd64 | ||
17 | |||
18 | [DestinationDirs] | ||
19 | DefaultDestDir=12 | ||
20 | |||
21 | |||
22 | ;------------------------------------------------------------------------------ | ||
23 | ; Windows 2000/XP/Vista-32bit Sections | ||
24 | ;------------------------------------------------------------------------------ | ||
25 | |||
26 | [DriverInstall.nt] | ||
27 | include=mdmcpq.inf | ||
28 | CopyFiles=DriverCopyFiles.nt | ||
29 | AddReg=DriverInstall.nt.AddReg | ||
30 | |||
31 | [DriverCopyFiles.nt] | ||
32 | usbser.sys,,,0x20 | ||
33 | |||
34 | [DriverInstall.nt.AddReg] | ||
35 | HKR,,DevLoader,,*ntkern | ||
36 | HKR,,NTMPDriver,,%DRIVERFILENAME%.sys | ||
37 | HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" | ||
38 | |||
39 | [DriverInstall.nt.Services] | ||
40 | AddService=usbser, 0x00000002, DriverService.nt | ||
41 | |||
42 | [DriverService.nt] | ||
43 | DisplayName=%SERVICE% | ||
44 | ServiceType=1 | ||
45 | StartType=3 | ||
46 | ErrorControl=1 | ||
47 | ServiceBinary=%12%\%DRIVERFILENAME%.sys | ||
48 | |||
49 | ;------------------------------------------------------------------------------ | ||
50 | ; Vista-64bit Sections | ||
51 | ;------------------------------------------------------------------------------ | ||
52 | |||
53 | [DriverInstall.NTamd64] | ||
54 | include=mdmcpq.inf | ||
55 | CopyFiles=DriverCopyFiles.NTamd64 | ||
56 | AddReg=DriverInstall.NTamd64.AddReg | ||
57 | |||
58 | [DriverCopyFiles.NTamd64] | ||
59 | %DRIVERFILENAME%.sys,,,0x20 | ||
60 | |||
61 | [DriverInstall.NTamd64.AddReg] | ||
62 | HKR,,DevLoader,,*ntkern | ||
63 | HKR,,NTMPDriver,,%DRIVERFILENAME%.sys | ||
64 | HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" | ||
65 | |||
66 | [DriverInstall.NTamd64.Services] | ||
67 | AddService=usbser, 0x00000002, DriverService.NTamd64 | ||
68 | |||
69 | [DriverService.NTamd64] | ||
70 | DisplayName=%SERVICE% | ||
71 | ServiceType=1 | ||
72 | StartType=3 | ||
73 | ErrorControl=1 | ||
74 | ServiceBinary=%12%\%DRIVERFILENAME%.sys | ||
75 | |||
76 | |||
77 | ;------------------------------------------------------------------------------ | ||
78 | ; Vendor and Product ID Definitions | ||
79 | ;------------------------------------------------------------------------------ | ||
80 | ; When developing your USB device, the VID and PID used in the PC side | ||
81 | ; application program and the firmware on the microcontroller must match. | ||
82 | ; Modify the below line to use your VID and PID. Use the format as shown below. | ||
83 | ; Note: One INF file can be used for multiple devices with different VID and PIDs. | ||
84 | ; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line. | ||
85 | ;------------------------------------------------------------------------------ | ||
86 | [SourceDisksFiles] | ||
87 | [SourceDisksNames] | ||
88 | [DeviceList] | ||
89 | %DESCRIPTION%=DriverInstall, USB\VID_0179&PID_0001 | ||
90 | |||
91 | [DeviceList.NTamd64] | ||
92 | %DESCRIPTION%=DriverInstall, USB\VID_0179&PID_0001 | ||
93 | |||
94 | |||
95 | ;------------------------------------------------------------------------------ | ||
96 | ; String Definitions | ||
97 | ;------------------------------------------------------------------------------ | ||
98 | ;Modify these strings to customize your device | ||
99 | ;------------------------------------------------------------------------------ | ||
100 | [Strings] | ||
101 | MFGFILENAME="ChTsy" | ||
102 | DRIVERFILENAME ="usbser" | ||
103 | MFGNAME="NopeLab" | ||
104 | INSTDISK="ChTsy CDC driver" | ||
105 | DESCRIPTION="ChTsy CDC driver" | ||
106 | SERVICE="USB RS-232 Emulation Driver" \ No newline at end of file | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/halconf.h b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/halconf.h new file mode 100644 index 000000000..33fddbaa4 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/halconf.h | |||
@@ -0,0 +1,533 @@ | |||
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 FALSE | ||
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 TRUE | ||
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 TRUE | ||
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 | #include "halconf_community.h" | ||
530 | |||
531 | #endif /* HALCONF_H */ | ||
532 | |||
533 | /** @} */ | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/halconf_community.h b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/halconf_community.h new file mode 100644 index 000000000..43fdbf869 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/halconf_community.h | |||
@@ -0,0 +1,173 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2014 Uladzimir Pylinsky aka barthess | ||
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 HALCONF_COMMUNITY_H | ||
18 | #define HALCONF_COMMUNITY_H | ||
19 | |||
20 | /** | ||
21 | * @brief Enables the community overlay. | ||
22 | */ | ||
23 | #if !defined(HAL_USE_COMMUNITY) || defined(__DOXYGEN__) | ||
24 | #define HAL_USE_COMMUNITY TRUE | ||
25 | #endif | ||
26 | |||
27 | /** | ||
28 | * @brief Enables the FSMC subsystem. | ||
29 | */ | ||
30 | #if !defined(HAL_USE_FSMC) || defined(__DOXYGEN__) | ||
31 | #define HAL_USE_FSMC FALSE | ||
32 | #endif | ||
33 | |||
34 | /** | ||
35 | * @brief Enables the NAND subsystem. | ||
36 | */ | ||
37 | #if !defined(HAL_USE_NAND) || defined(__DOXYGEN__) | ||
38 | #define HAL_USE_NAND FALSE | ||
39 | #endif | ||
40 | |||
41 | /** | ||
42 | * @brief Enables the 1-wire subsystem. | ||
43 | */ | ||
44 | #if !defined(HAL_USE_ONEWIRE) || defined(__DOXYGEN__) | ||
45 | #define HAL_USE_ONEWIRE FALSE | ||
46 | #endif | ||
47 | |||
48 | /** | ||
49 | * @brief Enables the EICU subsystem. | ||
50 | */ | ||
51 | #if !defined(HAL_USE_EICU) || defined(__DOXYGEN__) | ||
52 | #define HAL_USE_EICU FALSE | ||
53 | #endif | ||
54 | |||
55 | /** | ||
56 | * @brief Enables the CRC subsystem. | ||
57 | */ | ||
58 | #if !defined(HAL_USE_CRC) || defined(__DOXYGEN__) | ||
59 | #define HAL_USE_CRC FALSE | ||
60 | #endif | ||
61 | |||
62 | /** | ||
63 | * @brief Enables the RNG subsystem. | ||
64 | */ | ||
65 | #if !defined(HAL_USE_RNG) || defined(__DOXYGEN__) | ||
66 | #define HAL_USE_RNG FALSE | ||
67 | #endif | ||
68 | |||
69 | /** | ||
70 | * @brief Enables the EEPROM subsystem. | ||
71 | */ | ||
72 | #if !defined(HAL_USE_EEPROM) || defined(__DOXYGEN__) | ||
73 | #define HAL_USE_EEPROM FALSE | ||
74 | #endif | ||
75 | |||
76 | /** | ||
77 | * @brief Enables the TIMCAP subsystem. | ||
78 | */ | ||
79 | #if !defined(HAL_USE_TIMCAP) || defined(__DOXYGEN__) | ||
80 | #define HAL_USE_TIMCAP FALSE | ||
81 | #endif | ||
82 | |||
83 | /** | ||
84 | * @brief Enables the TIMCAP subsystem. | ||
85 | */ | ||
86 | #if !defined(HAL_USE_COMP) || defined(__DOXYGEN__) | ||
87 | #define HAL_USE_COMP FALSE | ||
88 | #endif | ||
89 | |||
90 | /** | ||
91 | * @brief Enables the QEI subsystem. | ||
92 | */ | ||
93 | #if !defined(HAL_USE_QEI) || defined(__DOXYGEN__) | ||
94 | #define HAL_USE_QEI FALSE | ||
95 | #endif | ||
96 | |||
97 | /** | ||
98 | * @brief Enables the USBH subsystem. | ||
99 | */ | ||
100 | #if !defined(HAL_USE_USBH) || defined(__DOXYGEN__) | ||
101 | #define HAL_USE_USBH FALSE | ||
102 | #endif | ||
103 | |||
104 | /** | ||
105 | * @brief Enables the USB_MSD subsystem. | ||
106 | */ | ||
107 | #if !defined(HAL_USE_USB_MSD) || defined(__DOXYGEN__) | ||
108 | #define HAL_USE_USB_MSD FALSE | ||
109 | #endif | ||
110 | |||
111 | /*===========================================================================*/ | ||
112 | /* FSMCNAND driver related settings. */ | ||
113 | /*===========================================================================*/ | ||
114 | |||
115 | /** | ||
116 | * @brief Enables the @p nandAcquireBus() and @p nanReleaseBus() APIs. | ||
117 | * @note Disabling this option saves both code and data space. | ||
118 | */ | ||
119 | #if !defined(NAND_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) | ||
120 | #define NAND_USE_MUTUAL_EXCLUSION TRUE | ||
121 | #endif | ||
122 | |||
123 | /*===========================================================================*/ | ||
124 | /* 1-wire driver related settings. */ | ||
125 | /*===========================================================================*/ | ||
126 | /** | ||
127 | * @brief Enables strong pull up feature. | ||
128 | * @note Disabling this option saves both code and data space. | ||
129 | */ | ||
130 | #define ONEWIRE_USE_STRONG_PULLUP FALSE | ||
131 | |||
132 | /** | ||
133 | * @brief Enables search ROM feature. | ||
134 | * @note Disabling this option saves both code and data space. | ||
135 | */ | ||
136 | #define ONEWIRE_USE_SEARCH_ROM TRUE | ||
137 | |||
138 | /*===========================================================================*/ | ||
139 | /* QEI driver related settings. */ | ||
140 | /*===========================================================================*/ | ||
141 | |||
142 | /** | ||
143 | * @brief Enables discard of overlow | ||
144 | */ | ||
145 | #if !defined(QEI_USE_OVERFLOW_DISCARD) || defined(__DOXYGEN__) | ||
146 | #define QEI_USE_OVERFLOW_DISCARD FALSE | ||
147 | #endif | ||
148 | |||
149 | /** | ||
150 | * @brief Enables min max of overlow | ||
151 | */ | ||
152 | #if !defined(QEI_USE_OVERFLOW_MINMAX) || defined(__DOXYGEN__) | ||
153 | #define QEI_USE_OVERFLOW_MINMAX FALSE | ||
154 | #endif | ||
155 | |||
156 | /*===========================================================================*/ | ||
157 | /* EEProm driver related settings. */ | ||
158 | /*===========================================================================*/ | ||
159 | |||
160 | /** | ||
161 | * @brief Enables 24xx series I2C eeprom device driver. | ||
162 | * @note Disabling this option saves both code and data space. | ||
163 | */ | ||
164 | #define EEPROM_USE_EE24XX FALSE | ||
165 | /** | ||
166 | * @brief Enables 25xx series SPI eeprom device driver. | ||
167 | * @note Disabling this option saves both code and data space. | ||
168 | */ | ||
169 | #define EEPROM_USE_EE25XX FALSE | ||
170 | |||
171 | #endif /* HALCONF_COMMUNITY_H */ | ||
172 | |||
173 | /** @} */ | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/main.c b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/main.c new file mode 100644 index 000000000..aab7671c4 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/main.c | |||
@@ -0,0 +1,168 @@ | |||
1 | /* | ||
2 | (C) 2015-2016 Jonathan Struebel | ||
3 | Based on ChibiOS USB_CDC demo - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
4 | |||
5 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | you may not use this file except in compliance with the License. | ||
7 | You may obtain a copy of the License at | ||
8 | |||
9 | http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | |||
11 | Unless required by applicable law or agreed to in writing, software | ||
12 | distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | See the License for the specific language governing permissions and | ||
15 | limitations under the License. | ||
16 | */ | ||
17 | |||
18 | #include <stdio.h> | ||
19 | #include <string.h> | ||
20 | |||
21 | #include "ch.h" | ||
22 | #include "hal.h" | ||
23 | |||
24 | #include "shell.h" | ||
25 | #include "chprintf.h" | ||
26 | |||
27 | #include "usbcfg.h" | ||
28 | |||
29 | /*===========================================================================*/ | ||
30 | /* Command line related. */ | ||
31 | /*===========================================================================*/ | ||
32 | |||
33 | #define SHELL_WA_SIZE THD_WORKING_AREA_SIZE(2048) | ||
34 | |||
35 | /* Can be measured using dd if=/dev/xxxx of=/dev/null bs=512 count=10000.*/ | ||
36 | static void cmd_write(BaseSequentialStream *chp, int argc, char *argv[]) { | ||
37 | static uint8_t buf[] = | ||
38 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
39 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
40 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
41 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
42 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
43 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
44 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
45 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
46 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
47 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
48 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
49 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
50 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
51 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
52 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" | ||
53 | "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"; | ||
54 | |||
55 | (void)argv; | ||
56 | if (argc > 0) { | ||
57 | chprintf(chp, "Usage: write\r\n"); | ||
58 | return; | ||
59 | } | ||
60 | |||
61 | while (chnGetTimeout((BaseChannel *)chp, TIME_IMMEDIATE) == Q_TIMEOUT) { | ||
62 | #if 1 | ||
63 | /* Writing in channel mode.*/ | ||
64 | chnWrite(&SDU1, buf, sizeof buf - 1); | ||
65 | #else | ||
66 | /* Writing in buffer mode.*/ | ||
67 | (void) obqGetEmptyBufferTimeout(&SDU1.obqueue, TIME_INFINITE); | ||
68 | memcpy(SDU1.obqueue.ptr, buf, SERIAL_USB_BUFFERS_SIZE); | ||
69 | obqPostFullBuffer(&SDU1.obqueue, SERIAL_USB_BUFFERS_SIZE); | ||
70 | #endif | ||
71 | } | ||
72 | chprintf(chp, "\r\n\nstopped\r\n"); | ||
73 | } | ||
74 | |||
75 | static const ShellCommand commands[] = { | ||
76 | {"write", cmd_write}, | ||
77 | {NULL, NULL} | ||
78 | }; | ||
79 | |||
80 | static const ShellConfig shell_cfg1 = { | ||
81 | (BaseSequentialStream *)&SDU1, | ||
82 | commands | ||
83 | }; | ||
84 | |||
85 | /*===========================================================================*/ | ||
86 | /* Generic code. */ | ||
87 | /*===========================================================================*/ | ||
88 | |||
89 | /* | ||
90 | * Red LED blinker thread, times are in milliseconds. | ||
91 | */ | ||
92 | static THD_WORKING_AREA(waThread1, 128); | ||
93 | static THD_FUNCTION(Thread1, arg) { | ||
94 | systime_t time; | ||
95 | |||
96 | (void)arg; | ||
97 | |||
98 | chRegSetThreadName("blinker"); | ||
99 | while (true) { | ||
100 | time = serusbcfg.usbp->state == USB_ACTIVE ? 250 : 500; | ||
101 | palClearPad(GPIO_LED_RED, PIN_LED_RED); | ||
102 | chThdSleepMilliseconds(time); | ||
103 | palSetPad(GPIO_LED_RED, PIN_LED_RED); | ||
104 | chThdSleepMilliseconds(time); | ||
105 | } | ||
106 | } | ||
107 | |||
108 | /* | ||
109 | * Application entry point. | ||
110 | */ | ||
111 | int main(void) { | ||
112 | |||
113 | /* | ||
114 | * System initializations. | ||
115 | * - HAL initialization, this also initializes the configured device drivers | ||
116 | * and performs the board-specific initializations. | ||
117 | * - Kernel initialization, the main() function becomes a thread and the | ||
118 | * RTOS is active. | ||
119 | */ | ||
120 | halInit(); | ||
121 | chSysInit(); | ||
122 | |||
123 | /* | ||
124 | * Turn off the RGB LED. | ||
125 | */ | ||
126 | palSetPad(GPIO_LED_RED, PIN_LED_RED); /* red */ | ||
127 | palSetPad(GPIO_LED_GREEN, PIN_LED_GREEN); /* green */ | ||
128 | palSetPad(GPIO_LED_BLUE, PIN_LED_BLUE); /* blue */ | ||
129 | |||
130 | /* | ||
131 | * Initializes a serial-over-USB CDC driver. | ||
132 | */ | ||
133 | sduObjectInit(&SDU1); | ||
134 | sduStart(&SDU1, &serusbcfg); | ||
135 | |||
136 | /* | ||
137 | * Activates the USB driver and then the USB bus pull-up on D+. | ||
138 | * Note, a delay is inserted in order to not have to disconnect the cable | ||
139 | * after a reset. | ||
140 | */ | ||
141 | usbDisconnectBus(serusbcfg.usbp); | ||
142 | chThdSleepMilliseconds(1500); | ||
143 | usbStart(serusbcfg.usbp, &usbcfg); | ||
144 | usbConnectBus(serusbcfg.usbp); | ||
145 | |||
146 | /* | ||
147 | * Shell manager initialization. | ||
148 | */ | ||
149 | shellInit(); | ||
150 | |||
151 | /* | ||
152 | * Creates the blinker thread. | ||
153 | */ | ||
154 | chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); | ||
155 | |||
156 | /* | ||
157 | * Normal main() thread activity, spawning shells. | ||
158 | */ | ||
159 | while (true) { | ||
160 | if (SDU1.config->usbp->state == USB_ACTIVE) { | ||
161 | thread_t *shelltp = chThdCreateFromHeap(NULL, SHELL_WA_SIZE, | ||
162 | "shell", NORMALPRIO + 1, | ||
163 | shellThread, (void *)&shell_cfg1); | ||
164 | chThdWait(shelltp); /* Waiting termination. */ | ||
165 | } | ||
166 | chThdSleepMilliseconds(1000); | ||
167 | } | ||
168 | } | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/mcuconf.h b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/mcuconf.h new file mode 100644 index 000000000..b6b6622bf --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/mcuconf.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | ChibiOS - (C) 2015-2016 Jonathan Struebel | ||
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 | #define K20x_MCUCONF | ||
21 | |||
22 | /* | ||
23 | * HAL driver system settings. | ||
24 | */ | ||
25 | /* PEE mode - 48MHz system clock driven by external crystal. */ | ||
26 | #define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE | ||
27 | #define KINETIS_PLLCLK_FREQUENCY 96000000UL | ||
28 | #define KINETIS_SYSCLK_FREQUENCY 48000000UL | ||
29 | |||
30 | /* | ||
31 | * SERIAL driver system settings. | ||
32 | */ | ||
33 | #define KINETIS_SERIAL_USE_UART0 TRUE | ||
34 | |||
35 | /* | ||
36 | * USB driver settings | ||
37 | */ | ||
38 | #define KINETIS_USB_USE_USB0 TRUE | ||
39 | |||
40 | #endif /* _MCUCONF_H_ */ | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/usbcfg.c b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/usbcfg.c new file mode 100644 index 000000000..c25a561a1 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/usbcfg.c | |||
@@ -0,0 +1,337 @@ | |||
1 | /* | ||
2 | (C) 2015-2016 Jonathan Struebel | ||
3 | Based on ChibiOS USB_CDC demo - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
4 | |||
5 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | you may not use this file except in compliance with the License. | ||
7 | You may obtain a copy of the License at | ||
8 | |||
9 | http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | |||
11 | Unless required by applicable law or agreed to in writing, software | ||
12 | distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | See the License for the specific language governing permissions and | ||
15 | limitations under the License. | ||
16 | */ | ||
17 | |||
18 | #include "hal.h" | ||
19 | |||
20 | /* Virtual serial port over USB.*/ | ||
21 | SerialUSBDriver SDU1; | ||
22 | |||
23 | /* | ||
24 | * Endpoints to be used for USBD1. | ||
25 | */ | ||
26 | #define USBD1_DATA_REQUEST_EP 1 | ||
27 | #define USBD1_DATA_AVAILABLE_EP 1 | ||
28 | #define USBD1_INTERRUPT_REQUEST_EP 2 | ||
29 | |||
30 | /* | ||
31 | * USB Device Descriptor. | ||
32 | */ | ||
33 | static const uint8_t vcom_device_descriptor_data[18] = { | ||
34 | USB_DESC_DEVICE (0x0110, /* bcdUSB (1.1). */ | ||
35 | 0x02, /* bDeviceClass (CDC). */ | ||
36 | 0x00, /* bDeviceSubClass. */ | ||
37 | 0x00, /* bDeviceProtocol. */ | ||
38 | 0x40, /* bMaxPacketSize. */ | ||
39 | 0x0179, /* idVendor. */ | ||
40 | 0x0001, /* idProduct. */ | ||
41 | 0x0200, /* bcdDevice. */ | ||
42 | 1, /* iManufacturer. */ | ||
43 | 2, /* iProduct. */ | ||
44 | 3, /* iSerialNumber. */ | ||
45 | 1) /* bNumConfigurations. */ | ||
46 | }; | ||
47 | |||
48 | /* | ||
49 | * Device Descriptor wrapper. | ||
50 | */ | ||
51 | static const USBDescriptor vcom_device_descriptor = { | ||
52 | sizeof vcom_device_descriptor_data, | ||
53 | vcom_device_descriptor_data | ||
54 | }; | ||
55 | |||
56 | /* Configuration Descriptor tree for a CDC.*/ | ||
57 | static const uint8_t vcom_configuration_descriptor_data[67] = { | ||
58 | /* Configuration Descriptor.*/ | ||
59 | USB_DESC_CONFIGURATION(67, /* wTotalLength. */ | ||
60 | 0x02, /* bNumInterfaces. */ | ||
61 | 0x01, /* bConfigurationValue. */ | ||
62 | 0, /* iConfiguration. */ | ||
63 | 0xC0, /* bmAttributes (self powered). */ | ||
64 | 50), /* bMaxPower (100mA). */ | ||
65 | /* Interface Descriptor.*/ | ||
66 | USB_DESC_INTERFACE (0x00, /* bInterfaceNumber. */ | ||
67 | 0x00, /* bAlternateSetting. */ | ||
68 | 0x01, /* bNumEndpoints. */ | ||
69 | 0x02, /* bInterfaceClass (Communications | ||
70 | Interface Class, CDC section | ||
71 | 4.2). */ | ||
72 | 0x02, /* bInterfaceSubClass (Abstract | ||
73 | Control Model, CDC section 4.3). */ | ||
74 | 0x01, /* bInterfaceProtocol (AT commands, | ||
75 | CDC section 4.4). */ | ||
76 | 0), /* iInterface. */ | ||
77 | /* Header Functional Descriptor (CDC section 5.2.3).*/ | ||
78 | USB_DESC_BYTE (5), /* bLength. */ | ||
79 | USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ | ||
80 | USB_DESC_BYTE (0x00), /* bDescriptorSubtype (Header | ||
81 | Functional Descriptor. */ | ||
82 | USB_DESC_BCD (0x0110), /* bcdCDC. */ | ||
83 | /* Call Management Functional Descriptor. */ | ||
84 | USB_DESC_BYTE (5), /* bFunctionLength. */ | ||
85 | USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ | ||
86 | USB_DESC_BYTE (0x01), /* bDescriptorSubtype (Call Management | ||
87 | Functional Descriptor). */ | ||
88 | USB_DESC_BYTE (0x00), /* bmCapabilities (D0+D1). */ | ||
89 | USB_DESC_BYTE (0x01), /* bDataInterface. */ | ||
90 | /* ACM Functional Descriptor.*/ | ||
91 | USB_DESC_BYTE (4), /* bFunctionLength. */ | ||
92 | USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ | ||
93 | USB_DESC_BYTE (0x02), /* bDescriptorSubtype (Abstract | ||
94 | Control Management Descriptor). */ | ||
95 | USB_DESC_BYTE (0x02), /* bmCapabilities. */ | ||
96 | /* Union Functional Descriptor.*/ | ||
97 | USB_DESC_BYTE (5), /* bFunctionLength. */ | ||
98 | USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ | ||
99 | USB_DESC_BYTE (0x06), /* bDescriptorSubtype (Union | ||
100 | Functional Descriptor). */ | ||
101 | USB_DESC_BYTE (0x00), /* bMasterInterface (Communication | ||
102 | Class Interface). */ | ||
103 | USB_DESC_BYTE (0x01), /* bSlaveInterface0 (Data Class | ||
104 | Interface). */ | ||
105 | /* Endpoint 2 Descriptor.*/ | ||
106 | USB_DESC_ENDPOINT (USBD1_INTERRUPT_REQUEST_EP|0x80, | ||
107 | 0x03, /* bmAttributes (Interrupt). */ | ||
108 | 0x0008, /* wMaxPacketSize. */ | ||
109 | 0xFF), /* bInterval. */ | ||
110 | /* Interface Descriptor.*/ | ||
111 | USB_DESC_INTERFACE (0x01, /* bInterfaceNumber. */ | ||
112 | 0x00, /* bAlternateSetting. */ | ||
113 | 0x02, /* bNumEndpoints. */ | ||
114 | 0x0A, /* bInterfaceClass (Data Class | ||
115 | Interface, CDC section 4.5). */ | ||
116 | 0x00, /* bInterfaceSubClass (CDC section | ||
117 | 4.6). */ | ||
118 | 0x00, /* bInterfaceProtocol (CDC section | ||
119 | 4.7). */ | ||
120 | 0x00), /* iInterface. */ | ||
121 | /* Endpoint 1 Descriptor.*/ | ||
122 | USB_DESC_ENDPOINT (USBD1_DATA_AVAILABLE_EP, /* bEndpointAddress.*/ | ||
123 | 0x02, /* bmAttributes (Bulk). */ | ||
124 | 0x0040, /* wMaxPacketSize. */ | ||
125 | 0x00), /* bInterval. */ | ||
126 | /* Endpoint 1 Descriptor.*/ | ||
127 | USB_DESC_ENDPOINT (USBD1_DATA_REQUEST_EP|0x80, /* bEndpointAddress.*/ | ||
128 | 0x02, /* bmAttributes (Bulk). */ | ||
129 | 0x0040, /* wMaxPacketSize. */ | ||
130 | 0x00) /* bInterval. */ | ||
131 | }; | ||
132 | |||
133 | /* | ||
134 | * Configuration Descriptor wrapper. | ||
135 | */ | ||
136 | static const USBDescriptor vcom_configuration_descriptor = { | ||
137 | sizeof vcom_configuration_descriptor_data, | ||
138 | vcom_configuration_descriptor_data | ||
139 | }; | ||
140 | |||
141 | /* | ||
142 | * U.S. English language identifier. | ||
143 | */ | ||
144 | static const uint8_t vcom_string0[] = { | ||
145 | USB_DESC_BYTE(4), /* bLength. */ | ||
146 | USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ | ||
147 | USB_DESC_WORD(0x0409) /* wLANGID (U.S. English). */ | ||
148 | }; | ||
149 | |||
150 | /* | ||
151 | * Vendor string. | ||
152 | */ | ||
153 | static const uint8_t vcom_string1[] = { | ||
154 | USB_DESC_BYTE(2+2*7), /* bLength. */ | ||
155 | USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ | ||
156 | 'N', 0, 'o', 0, 'p', 0, 'e', 0, 'L', 0, 'a', 0, 'b', 0, | ||
157 | }; | ||
158 | |||
159 | /* | ||
160 | * Device Description string. | ||
161 | */ | ||
162 | static const uint8_t vcom_string2[] = { | ||
163 | USB_DESC_BYTE(2+5*2), /* bLength. */ | ||
164 | USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ | ||
165 | 'C', 0, 'h', 0, 'T', 0, 's', 0, 'y', 0, | ||
166 | }; | ||
167 | |||
168 | /* | ||
169 | * Serial Number string. | ||
170 | */ | ||
171 | static const uint8_t vcom_string3[] = { | ||
172 | USB_DESC_BYTE(8), /* bLength. */ | ||
173 | USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ | ||
174 | '0' + CH_KERNEL_MAJOR, 0, | ||
175 | '0' + CH_KERNEL_MINOR, 0, | ||
176 | '0' + CH_KERNEL_PATCH, 0 | ||
177 | }; | ||
178 | |||
179 | /* | ||
180 | * Strings wrappers array. | ||
181 | */ | ||
182 | static const USBDescriptor vcom_strings[] = { | ||
183 | {sizeof vcom_string0, vcom_string0}, | ||
184 | {sizeof vcom_string1, vcom_string1}, | ||
185 | {sizeof vcom_string2, vcom_string2}, | ||
186 | {sizeof vcom_string3, vcom_string3} | ||
187 | }; | ||
188 | |||
189 | /* | ||
190 | * Handles the GET_DESCRIPTOR callback. All required descriptors must be | ||
191 | * handled here. | ||
192 | */ | ||
193 | static const USBDescriptor *get_descriptor(USBDriver *usbp, | ||
194 | uint8_t dtype, | ||
195 | uint8_t dindex, | ||
196 | uint16_t lang) { | ||
197 | (void)usbp; | ||
198 | (void)lang; | ||
199 | switch (dtype) { | ||
200 | case USB_DESCRIPTOR_DEVICE: | ||
201 | return &vcom_device_descriptor; | ||
202 | case USB_DESCRIPTOR_CONFIGURATION: | ||
203 | return &vcom_configuration_descriptor; | ||
204 | case USB_DESCRIPTOR_STRING: | ||
205 | if (dindex < 4) | ||
206 | return &vcom_strings[dindex]; | ||
207 | } | ||
208 | return NULL; | ||
209 | } | ||
210 | |||
211 | /** | ||
212 | * @brief IN EP1 state. | ||
213 | */ | ||
214 | static USBInEndpointState ep1instate; | ||
215 | |||
216 | /** | ||
217 | * @brief OUT EP1 state. | ||
218 | */ | ||
219 | static USBOutEndpointState ep1outstate; | ||
220 | |||
221 | /** | ||
222 | * @brief EP1 initialization structure (both IN and OUT). | ||
223 | */ | ||
224 | static const USBEndpointConfig ep1config = { | ||
225 | USB_EP_MODE_TYPE_BULK, | ||
226 | NULL, | ||
227 | sduDataTransmitted, | ||
228 | sduDataReceived, | ||
229 | 0x0040, | ||
230 | 0x0040, | ||
231 | &ep1instate, | ||
232 | &ep1outstate, | ||
233 | 2, | ||
234 | NULL | ||
235 | }; | ||
236 | |||
237 | /** | ||
238 | * @brief IN EP2 state. | ||
239 | */ | ||
240 | static USBInEndpointState ep2instate; | ||
241 | |||
242 | /** | ||
243 | * @brief EP2 initialization structure (IN only). | ||
244 | */ | ||
245 | static const USBEndpointConfig ep2config = { | ||
246 | USB_EP_MODE_TYPE_INTR, | ||
247 | NULL, | ||
248 | sduInterruptTransmitted, | ||
249 | NULL, | ||
250 | 0x0010, | ||
251 | 0x0000, | ||
252 | &ep2instate, | ||
253 | NULL, | ||
254 | 1, | ||
255 | NULL | ||
256 | }; | ||
257 | |||
258 | /* | ||
259 | * Handles the USB driver global events. | ||
260 | */ | ||
261 | static void usb_event(USBDriver *usbp, usbevent_t event) { | ||
262 | extern SerialUSBDriver SDU1; | ||
263 | |||
264 | switch (event) { | ||
265 | case USB_EVENT_ADDRESS: | ||
266 | return; | ||
267 | case USB_EVENT_CONFIGURED: | ||
268 | chSysLockFromISR(); | ||
269 | |||
270 | /* Enables the endpoints specified into the configuration. | ||
271 | Note, this callback is invoked from an ISR so I-Class functions | ||
272 | must be used.*/ | ||
273 | usbInitEndpointI(usbp, USBD1_DATA_REQUEST_EP, &ep1config); | ||
274 | usbInitEndpointI(usbp, USBD1_INTERRUPT_REQUEST_EP, &ep2config); | ||
275 | |||
276 | /* Resetting the state of the CDC subsystem.*/ | ||
277 | sduConfigureHookI(&SDU1); | ||
278 | |||
279 | chSysUnlockFromISR(); | ||
280 | return; | ||
281 | case USB_EVENT_RESET: | ||
282 | /* Falls into. */ | ||
283 | case USB_EVENT_UNCONFIGURED: | ||
284 | /* Falls into. */ | ||
285 | case USB_EVENT_SUSPEND: | ||
286 | chSysLockFromISR(); | ||
287 | |||
288 | /* Disconnection event on suspend.*/ | ||
289 | sduSuspendHookI(&SDU1); | ||
290 | |||
291 | chSysUnlockFromISR(); | ||
292 | return; | ||
293 | case USB_EVENT_WAKEUP: | ||
294 | chSysLockFromISR(); | ||
295 | |||
296 | /* Disconnection event on suspend */ | ||
297 | sduWakeupHookI(&SDU1); | ||
298 | |||
299 | chSysUnlockFromISR(); | ||
300 | return; | ||
301 | case USB_EVENT_STALLED: | ||
302 | return; | ||
303 | } | ||
304 | return; | ||
305 | } | ||
306 | |||
307 | /* | ||
308 | * Handles the USB driver global events. | ||
309 | */ | ||
310 | static void sof_handler(USBDriver *usbp) { | ||
311 | |||
312 | (void)usbp; | ||
313 | |||
314 | osalSysLockFromISR(); | ||
315 | sduSOFHookI(&SDU1); | ||
316 | osalSysUnlockFromISR(); | ||
317 | } | ||
318 | |||
319 | /* | ||
320 | * USB driver configuration. | ||
321 | */ | ||
322 | const USBConfig usbcfg = { | ||
323 | usb_event, | ||
324 | get_descriptor, | ||
325 | sduRequestsHook, | ||
326 | sof_handler | ||
327 | }; | ||
328 | |||
329 | /* | ||
330 | * Serial over USB driver configuration. | ||
331 | */ | ||
332 | const SerialUSBConfig serusbcfg = { | ||
333 | &USBD1, | ||
334 | USBD1_DATA_REQUEST_EP, | ||
335 | USBD1_DATA_AVAILABLE_EP, | ||
336 | USBD1_INTERRUPT_REQUEST_EP | ||
337 | }; | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/usbcfg.h b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/usbcfg.h new file mode 100644 index 000000000..718e11411 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/usbcfg.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | (C) 2015-2016 Jonathan Struebel | ||
3 | Based on ChibiOS USB_CDC demo - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
4 | |||
5 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | you may not use this file except in compliance with the License. | ||
7 | You may obtain a copy of the License at | ||
8 | |||
9 | http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | |||
11 | Unless required by applicable law or agreed to in writing, software | ||
12 | distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | See the License for the specific language governing permissions and | ||
15 | limitations under the License. | ||
16 | */ | ||
17 | |||
18 | #ifndef _USBCFG_H_ | ||
19 | #define _USBCFG_H_ | ||
20 | |||
21 | extern const USBConfig usbcfg; | ||
22 | extern SerialUSBConfig serusbcfg; | ||
23 | extern SerialUSBDriver SDU1; | ||
24 | |||
25 | #endif /* _USBCFG_H_ */ | ||
26 | |||
27 | /** @} */ | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-KL25Z/ADC/Makefile b/lib/chibios-contrib/testhal/KINETIS/FRDM-KL25Z/ADC/Makefile new file mode 100644 index 000000000..72a5d7439 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-KL25Z/ADC/Makefile | |||
@@ -0,0 +1,213 @@ | |||
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 | # If enabled, this option allows to compile the application in THUMB mode. | ||
37 | ifeq ($(USE_THUMB),) | ||
38 | USE_THUMB = yes | ||
39 | endif | ||
40 | |||
41 | # Enable this if you want to see the full log while compiling. | ||
42 | ifeq ($(USE_VERBOSE_COMPILE),) | ||
43 | USE_VERBOSE_COMPILE = no | ||
44 | endif | ||
45 | |||
46 | # If enabled, this option makes the build process faster by not compiling | ||
47 | # modules not used in the current configuration. | ||
48 | ifeq ($(USE_SMART_BUILD),) | ||
49 | USE_SMART_BUILD = yes | ||
50 | endif | ||
51 | |||
52 | # | ||
53 | # Build global options | ||
54 | ############################################################################## | ||
55 | |||
56 | ############################################################################## | ||
57 | # Architecture or project specific options | ||
58 | # | ||
59 | |||
60 | # Stack size to be allocated to the Cortex-M process stack. This stack is | ||
61 | # the stack used by the main() thread. | ||
62 | ifeq ($(USE_PROCESS_STACKSIZE),) | ||
63 | USE_PROCESS_STACKSIZE = 0x200 | ||
64 | endif | ||
65 | |||
66 | # Stack size to the allocated to the Cortex-M main/exceptions stack. This | ||
67 | # stack is used for processing interrupts and exceptions. | ||
68 | ifeq ($(USE_EXCEPTIONS_STACKSIZE),) | ||
69 | USE_EXCEPTIONS_STACKSIZE = 0x400 | ||
70 | endif | ||
71 | |||
72 | # Enables the use of FPU on Cortex-M4 (no, softfp, hard). | ||
73 | ifeq ($(USE_FPU),) | ||
74 | USE_FPU = no | ||
75 | endif | ||
76 | |||
77 | # | ||
78 | # Architecture or project specific options | ||
79 | ############################################################################## | ||
80 | |||
81 | ############################################################################## | ||
82 | # Project, sources and paths | ||
83 | # | ||
84 | |||
85 | # Define project name here | ||
86 | PROJECT = ch | ||
87 | |||
88 | # Imported source files and paths | ||
89 | CHIBIOS = ../../../../../ChibiOS | ||
90 | CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib | ||
91 | # Licensing files. | ||
92 | include $(CHIBIOS)/os/license/license.mk | ||
93 | # Startup files. | ||
94 | include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_kl2x.mk | ||
95 | # HAL-OSAL files (optional). | ||
96 | include $(CHIBIOS_CONTRIB)/os/hal/hal.mk | ||
97 | include $(CHIBIOS_CONTRIB)/os/hal/ports/KINETIS/KL2x/platform.mk | ||
98 | include $(CHIBIOS_CONTRIB)/os/hal/boards/FREESCALE_FREEDOM_KL25Z/board.mk | ||
99 | include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk | ||
100 | # RTOS files (optional). | ||
101 | include $(CHIBIOS)/os/rt/rt.mk | ||
102 | include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk | ||
103 | # Other files (optional). | ||
104 | |||
105 | # Define linker script file here | ||
106 | LDSCRIPT= $(STARTUPLD_CONTRIB)/MKL2xZ128.ld | ||
107 | |||
108 | # C sources that can be compiled in ARM or THUMB mode depending on the global | ||
109 | # setting. | ||
110 | CSRC = $(ALLCSRC) \ | ||
111 | $(TESTSRC) \ | ||
112 | main.c | ||
113 | |||
114 | # C++ sources that can be compiled in ARM or THUMB mode depending on the global | ||
115 | # setting. | ||
116 | CPPSRC = $(ALLCPPSRC) | ||
117 | |||
118 | # C sources to be compiled in ARM mode regardless of the global setting. | ||
119 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler | ||
120 | # option that results in lower performance and larger code size. | ||
121 | ACSRC = | ||
122 | |||
123 | # C++ sources to be compiled in ARM mode regardless of the global setting. | ||
124 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler | ||
125 | # option that results in lower performance and larger code size. | ||
126 | ACPPSRC = | ||
127 | |||
128 | # C sources to be compiled in THUMB mode regardless of the global setting. | ||
129 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler | ||
130 | # option that results in lower performance and larger code size. | ||
131 | TCSRC = | ||
132 | |||
133 | # C sources to be compiled in THUMB mode regardless of the global setting. | ||
134 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler | ||
135 | # option that results in lower performance and larger code size. | ||
136 | TCPPSRC = | ||
137 | |||
138 | # List ASM source files here | ||
139 | ASMSRC = $(ALLASMSRC) | ||
140 | ASMXSRC = $(ALLXASMSRC) | ||
141 | |||
142 | INCDIR = $(ALLINC) $(TESTINC) \ | ||
143 | $(TESTHAL) | ||
144 | |||
145 | # | ||
146 | # Project, sources and paths | ||
147 | ############################################################################## | ||
148 | |||
149 | ############################################################################## | ||
150 | # Compiler settings | ||
151 | # | ||
152 | |||
153 | MCU = cortex-m0plus | ||
154 | |||
155 | #TRGT = arm-elf- | ||
156 | TRGT = arm-none-eabi- | ||
157 | CC = $(TRGT)gcc | ||
158 | CPPC = $(TRGT)g++ | ||
159 | # Enable loading with g++ only if you need C++ runtime support. | ||
160 | # NOTE: You can use C++ even without C++ support if you are careful. C++ | ||
161 | # runtime support makes code size explode. | ||
162 | LD = $(TRGT)gcc | ||
163 | #LD = $(TRGT)g++ | ||
164 | CP = $(TRGT)objcopy | ||
165 | AS = $(TRGT)gcc -x assembler-with-cpp | ||
166 | AR = $(TRGT)ar | ||
167 | OD = $(TRGT)objdump | ||
168 | SZ = $(TRGT)size | ||
169 | HEX = $(CP) -O ihex | ||
170 | BIN = $(CP) -O binary | ||
171 | SREC = $(CP) -O srec | ||
172 | |||
173 | # ARM-specific options here | ||
174 | AOPT = | ||
175 | |||
176 | # THUMB-specific options here | ||
177 | TOPT = -mthumb -DTHUMB | ||
178 | |||
179 | # Define C warning options here | ||
180 | CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes | ||
181 | |||
182 | # Define C++ warning options here | ||
183 | CPPWARN = -Wall -Wextra -Wundef | ||
184 | |||
185 | # | ||
186 | # Compiler settings | ||
187 | ############################################################################## | ||
188 | |||
189 | ############################################################################## | ||
190 | # Start of user section | ||
191 | # | ||
192 | |||
193 | # List all user C define here, like -D_DEBUG=1 | ||
194 | UDEFS = | ||
195 | |||
196 | # Define ASM defines here | ||
197 | UADEFS = | ||
198 | |||
199 | # List all user directories here | ||
200 | UINCDIR = | ||
201 | |||
202 | # List the user directory to look for the libraries here | ||
203 | ULIBDIR = | ||
204 | |||
205 | # List all user libraries here | ||
206 | ULIBS = | ||
207 | |||
208 | # | ||
209 | # End of user defines | ||
210 | ############################################################################## | ||
211 | |||
212 | RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk | ||
213 | include $(RULESPATH)/rules.mk | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-KL25Z/ADC/chconf.h b/lib/chibios-contrib/testhal/KINETIS/FRDM-KL25Z/ADC/chconf.h new file mode 100644 index 000000000..c6e3413db --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-KL25Z/ADC/chconf.h | |||
@@ -0,0 +1,757 @@ | |||
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 or 32 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 FALSE | ||
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 | /*===========================================================================*/ | ||
752 | /* Port-specific settings (override port settings defaulted in chcore.h). */ | ||
753 | /*===========================================================================*/ | ||
754 | |||
755 | #endif /* CHCONF_H */ | ||
756 | |||
757 | /** @} */ | ||
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-KL25Z/ADC/debug/RT-FREEDOM-KL25Z-ADC.launch b/lib/chibios-contrib/testhal/KINETIS/FRDM-KL25Z/ADC/debug/RT-FREEDOM-KL25Z-ADC.launch new file mode 100644 index 000000000..67d3e8224 --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-KL25Z/ADC/debug/RT-FREEDOM-KL25Z-ADC.launch | |||
@@ -0,0 +1,31 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | <launchConfiguration type="com.zylin.embeddedcdt.idleNative"> | ||
3 | <stringAttribute key="bad_container_name" value="/RT-MCHCK-K20-DMA/deb"/> | ||
4 | <booleanAttribute key="com.zylin.embeddedcdt.debugger_app_console" value="false"/> | ||
5 | <stringAttribute key="com.zylin.embeddedcdt.debugger_init_commands" value="target extended-remote localhost:3333 monitor reset init load monitor reset halt"/> | ||
6 | <stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="/Users/derek/Documents/Arm/gcc-arm-none-eabi-4_8-2014q2/bin/arm-none-eabi-gdb"/> | ||
7 | <stringAttribute key="org.eclipse.cdt.debug.mi.core.GDB_INIT" value=""/> | ||
8 | <booleanAttribute key="org.eclipse.cdt.debug.mi.core.breakpointsFullPath" value="false"/> | ||
9 | <stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="org.eclipse.cdt.debug.mi.core.standardCommandFactory"/> | ||
10 | <stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/> | ||
11 | <booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/> | ||
12 | <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="com.zylin.embeddedcdt.EmbeddedCDebugger"/> | ||
13 | <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/> | ||
14 | <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/> | ||
15 | <booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="false"/> | ||
16 | <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/> | ||
17 | <booleanAttribute key="org.eclipse.cdt.launch.ENABLE_REGISTER_BOOKKEEPING" value="false"/> | ||
18 | <booleanAttribute key="org.eclipse.cdt.launch.ENABLE_VARIABLE_BOOKKEEPING" value="false"/> | ||
19 | <stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="*buffer-buffer-adc_end_cb-(format)" val="4"/><content id="sensor-adc_end_cb-(format)" val="0"/></contentList>"/> | ||
20 | <stringAttribute key="org.eclipse.cdt.launch.GLOB |