aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/testhal/MSP430X
diff options
context:
space:
mode:
authorAkshay <[email protected]>2022-04-10 12:13:40 +0100
committerAkshay <[email protected]>2022-04-10 12:13:40 +0100
commitdc90387ce7d8ba7b607d9c48540bf6d8b560f14d (patch)
tree4ccb8fa5886b66fa9d480edef74236c27f035e16 /lib/chibios-contrib/testhal/MSP430X
Diffstat (limited to 'lib/chibios-contrib/testhal/MSP430X')
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/Makefile199
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/chconf.h479
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/halconf.h531
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/main.c270
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/mcuconf.h68
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/msp_vectors.c286
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/Makefile199
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/chconf.h479
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/halconf.h531
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/main.c351
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/mcuconf.h55
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/msp_vectors.c294
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/Makefile199
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/chconf.h479
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/halconf.h531
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/main.c415
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/mcuconf.h62
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/msp_vectors.c292
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR6989/ADC/Makefile199
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR6989/ADC/chconf.h479
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR6989/ADC/halconf.h531
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR6989/ADC/main.c254
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR6989/ADC/mcuconf.h68
-rw-r--r--lib/chibios-contrib/testhal/MSP430X/EXP430FR6989/ADC/msp_vectors.c286
24 files changed, 7537 insertions, 0 deletions
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/Makefile b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/Makefile
new file mode 100644
index 000000000..3af7ed7c4
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/Makefile
@@ -0,0 +1,199 @@
1##############################################################################
2# Build global options
3# NOTE: Can be overridden externally.
4#
5
6# Optimization level, can be [0, 1, 2, 3, s].
7# 0 = turn off optimization. s = optimize for size.
8# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
9OPTIMIZE = 0
10
11# Debugging format.
12DEBUG =
13#DEBUG = stabs
14
15# Memory/data model
16MODEL = small
17
18# Object files directory
19# To put object files in current directory, use a dot (.), do NOT make
20# this an empty or blank macro!
21OBJDIR = .
22
23# Compiler flag to set the C Standard level.
24# c89 = "ANSI" C
25# gnu89 = c89 plus GCC extensions
26# c99 = ISO C99 standard (not yet fully implemented)
27# gnu99 = c99 plus GCC extensions
28CSTANDARD = -std=gnu11
29
30# Compiler options here.
31ifeq ($(USE_OPT),)
32 USE_OPT = -O$(OPTIMIZE) -g$(DEBUG)
33 USE_OPT += -funsigned-char -fshort-enums
34endif
35
36# C specific options here (added to USE_OPT).
37ifeq ($(USE_COPT),)
38 USE_COPT =
39endif
40
41# C++ specific options here (added to USE_OPT).
42ifeq ($(USE_CPPOPT),)
43 USE_CPPOPT = -fno-rtti
44endif
45
46# Enable this if you want the linker to remove unused code and data
47ifeq ($(USE_LINK_GC),)
48 USE_LINK_GC = yes
49endif
50
51# Linker extra options here.
52ifeq ($(USE_LDOPT),)
53 USE_LDOPT =
54endif
55
56# Enable this if you want link time optimizations (LTO)
57ifeq ($(USE_LTO),)
58 USE_LTO = no
59endif
60
61# Enable the selected hardware multiplier
62ifeq ($(USE_HWMULT),)
63 USE_HWMULT = f5series
64endif
65
66# Enable this if you want to see the full log while compiling.
67ifeq ($(USE_VERBOSE_COMPILE),)
68 USE_VERBOSE_COMPILE = yes
69endif
70
71# If enabled, this option makes the build process faster by not compiling
72# modules not used in the current configuration.
73ifeq ($(USE_SMART_BUILD),)
74 USE_SMART_BUILD = yes
75endif
76
77#
78# Build global options
79##############################################################################
80
81##############################################################################
82# Architecture or project specific options
83#
84
85# Stack size to be allocated to the idle thread stack. This stack is
86# the stack used by the main() thread.
87ifeq ($(USE_IDLE_STACKSIZE),)
88 USE_IDLE_STACKSIZE = 0xC00
89endif
90
91#
92# Architecture or project specific options
93##############################################################################
94
95##############################################################################
96# Project, sources and paths
97#
98
99# Define project name here
100PROJECT = nil
101
102# Imported source files and paths
103CHIBIOS = ../../../../../ChibiOS
104CHIBIOS_CONTRIB = ../../../..
105# Licensing files.
106include $(CHIBIOS)/os/license/license.mk
107# Startup files.
108include $(CHIBIOS_CONTRIB)/os/common/startup/MSP430X/compilers/GCC/mk/startup_msp430fr5xxx.mk
109# HAL-OSAL files (optional).
110include $(CHIBIOS)/os/hal/hal.mk
111include $(CHIBIOS_CONTRIB)/os/hal/boards/EXP430FR5969/board.mk
112include $(CHIBIOS_CONTRIB)/os/hal/ports/MSP430X/platform.mk
113include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk
114# RTOS files (optional).
115include $(CHIBIOS)/os/nil/nil.mk
116include $(CHIBIOS_CONTRIB)/os/common/ports/MSP430X/compilers/GCC/mk/port.mk
117# Other files (optional).
118
119# Define linker script file here
120LDSCRIPT = $(STARTUPLD)/msp430fr5969.ld
121
122# C sources
123CSRC = $(ALLCSRC) \
124 $(TESTSRC) \
125 msp_vectors.c \
126 main.c
127
128# C++ sources
129CPPSRC = $(ALLCPPSRC)
130
131# List ASM source files here
132ASMSRC = $(ALLASMSRC)
133
134INCDIR = $(ALLINC) $(TESTINC)
135
136#
137# Project, sources and paths
138##############################################################################
139
140##############################################################################
141# Compiler settings
142#
143
144MCU = msp430fr5969
145
146TRGT = msp430-elf-
147CC = $(TRGT)gcc
148CPPC = $(TRGT)g++
149# Enable loading with g++ only if you need C++ runtime support.
150# NOTE: You can use C++ even without C++ support if you are careful. C++
151# runtime support makes code size explode.
152LD = $(TRGT)gcc
153#LD = $(TRGT)g++
154CP = $(TRGT)objcopy
155AS = $(TRGT)gcc -x assembler-with-cpp
156AR = $(TRGT)ar
157OD = $(TRGT)objdump
158SZ = $(TRGT)size
159HEX = $(CP) -O ihex
160BIN = $(CP) -O binary
161
162# MSP430-specific options here
163MOPT = -m$(MODEL)
164
165# Define C warning options here
166CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
167
168# Define C++ warning options here
169CPPWARN = -Wall -Wextra -Wundef
170
171#
172# Compiler settings
173##############################################################################
174
175##############################################################################
176# Start of user section
177#
178
179# List all user C define here, like -D_DEBUG=1
180UDEFS =
181
182# Define ASM defines here
183UADEFS =
184
185# List all user directories here
186UINCDIR =
187
188# List the user directory to look for the libraries here
189ULIBDIR =
190
191# List all user libraries here
192ULIBS =
193
194#
195# End of user defines
196##############################################################################
197
198RULESPATH = $(CHIBIOS_CONTRIB)/os/common/startup/MSP430X/compilers/GCC
199include $(RULESPATH)/rules.mk
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/chconf.h b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/chconf.h
new file mode 100644
index 000000000..929cb29fd
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/chconf.h
@@ -0,0 +1,479 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file nil/templates/chconf.h
19 * @brief Configuration file template.
20 * @details A copy of this file must be placed in each project directory, it
21 * contains the application specific kernel settings.
22 *
23 * @addtogroup NIL_CONFIG
24 * @details Kernel related settings and hooks.
25 * @{
26 */
27
28#ifndef CHCONF_H
29#define CHCONF_H
30
31#define _CHIBIOS_NIL_CONF_
32#define _CHIBIOS_NIL_CONF_VER_4_0_
33
34/*===========================================================================*/
35/**
36 * @name Kernel parameters and options
37 * @{
38 */
39/*===========================================================================*/
40
41/**
42 * @brief Maximum number of user threads in the application.
43 * @note This number is not inclusive of the idle thread which is
44 * implicitly handled.
45 * @note Set this value to be exactly equal to the number of threads you
46 * will use or you would be wasting RAM and cycles.
47 * @note This values also defines the number of available priorities
48 * (0..CH_CFG_MAX_THREADS-1).
49 */
50#if !defined(CH_CFG_MAX_THREADS)
51#define CH_CFG_MAX_THREADS 8
52#endif
53
54/**
55 * @brief Auto starts threads when @p chSysInit() is invoked.
56 */
57#if !defined(CH_CFG_AUTOSTART_THREADS)
58#define CH_CFG_AUTOSTART_THREADS TRUE
59#endif
60
61/** @} */
62
63/*===========================================================================*/
64/**
65 * @name System timer settings
66 * @{
67 */
68/*===========================================================================*/
69
70/**
71 * @brief System time counter resolution.
72 * @note Allowed values are 16 or 32 bits.
73 */
74#if !defined(CH_CFG_ST_RESOLUTION)
75#define CH_CFG_ST_RESOLUTION 16
76#endif
77
78/**
79 * @brief System tick frequency.
80 * @note This value together with the @p CH_CFG_ST_RESOLUTION
81 * option defines the maximum amount of time allowed for
82 * timeouts.
83 */
84#if !defined(CH_CFG_ST_FREQUENCY)
85#define CH_CFG_ST_FREQUENCY 1000
86#endif
87
88/**
89 * @brief Time delta constant for the tick-less mode.
90 * @note If this value is zero then the system uses the classic
91 * periodic tick. This value represents the minimum number
92 * of ticks that is safe to specify in a timeout directive.
93 * The value one is not valid, timeouts are rounded up to
94 * this value.
95 */
96#if !defined(CH_CFG_ST_TIMEDELTA)
97#define CH_CFG_ST_TIMEDELTA 0
98#endif
99
100/** @} */
101
102/*===========================================================================*/
103/**
104 * @name Subsystem options
105 * @{
106 */
107/*===========================================================================*/
108
109/**
110 * @brief Threads synchronization APIs.
111 * @details If enabled then the @p chThdWait() function is included in
112 * the kernel.
113 *
114 * @note The default is @p TRUE.
115 */
116#if !defined(CH_CFG_USE_WAITEXIT)
117#define CH_CFG_USE_WAITEXIT TRUE
118#endif
119
120/**
121 * @brief Semaphores APIs.
122 * @details If enabled then the Semaphores APIs are included in the kernel.
123 *
124 * @note The default is @p TRUE.
125 */
126#if !defined(CH_CFG_USE_SEMAPHORES)
127#define CH_CFG_USE_SEMAPHORES TRUE
128#endif
129
130/**
131 * @brief Mutexes APIs.
132 * @details If enabled then the mutexes APIs are included in the kernel.
133 *
134 * @note Feature not currently implemented.
135 * @note The default is @p FALSE.
136 */
137#if !defined(CH_CFG_USE_MUTEXES)
138#define CH_CFG_USE_MUTEXES FALSE
139#endif
140
141/**
142 * @brief Events Flags APIs.
143 * @details If enabled then the event flags APIs are included in the kernel.
144 *
145 * @note The default is @p TRUE.
146 */
147#if !defined(CH_CFG_USE_EVENTS)
148#define CH_CFG_USE_EVENTS TRUE
149#endif
150
151/**
152 * @brief Synchronous Messages APIs.
153 * @details If enabled then the synchronous messages APIs are included
154 * in the kernel.
155 *
156 * @note The default is @p TRUE.
157 */
158#if !defined(CH_CFG_USE_MESSAGES)
159#define CH_CFG_USE_MESSAGES TRUE
160#endif
161
162/** @} */
163
164/*===========================================================================*/
165/**
166 * @name OSLIB options
167 * @{
168 */
169/*===========================================================================*/
170
171/**
172 * @brief Mailboxes APIs.
173 * @details If enabled then the asynchronous messages (mailboxes) APIs are
174 * included in the kernel.
175 *
176 * @note The default is @p TRUE.
177 * @note Requires @p CH_CFG_USE_SEMAPHORES.
178 */
179#if !defined(CH_CFG_USE_MAILBOXES)
180#define CH_CFG_USE_MAILBOXES TRUE
181#endif
182
183/**
184 * @brief Core Memory Manager APIs.
185 * @details If enabled then the core memory manager APIs are included
186 * in the kernel.
187 *
188 * @note The default is @p TRUE.
189 */
190#if !defined(CH_CFG_USE_MEMCORE)
191#define CH_CFG_USE_MEMCORE TRUE
192#endif
193
194/**
195 * @brief Managed RAM size.
196 * @details Size of the RAM area to be managed by the OS. If set to zero
197 * then the whole available RAM is used. The core memory is made
198 * available to the heap allocator and/or can be used directly through
199 * the simplified core memory allocator.
200 *
201 * @note In order to let the OS manage the whole RAM the linker script must
202 * provide the @p __heap_base__ and @p __heap_end__ symbols.
203 * @note Requires @p CH_CFG_USE_MEMCORE.
204 */
205#if !defined(CH_CFG_MEMCORE_SIZE)
206#define CH_CFG_MEMCORE_SIZE 0
207#endif
208
209/**
210 * @brief Heap Allocator APIs.
211 * @details If enabled then the memory heap allocator APIs are included
212 * in the kernel.
213 *
214 * @note The default is @p TRUE.
215 */
216#if !defined(CH_CFG_USE_HEAP)
217#define CH_CFG_USE_HEAP TRUE
218#endif
219
220/**
221 * @brief Memory Pools Allocator APIs.
222 * @details If enabled then the memory pools allocator APIs are included
223 * in the kernel.
224 *
225 * @note The default is @p TRUE.
226 */
227#if !defined(CH_CFG_USE_MEMPOOLS)
228#define CH_CFG_USE_MEMPOOLS TRUE
229#endif
230
231/**
232 * @brief Objects FIFOs APIs.
233 * @details If enabled then the objects FIFOs APIs are included
234 * in the kernel.
235 *
236 * @note The default is @p TRUE.
237 */
238#if !defined(CH_CFG_USE_OBJ_FIFOS)
239#define CH_CFG_USE_OBJ_FIFOS TRUE
240#endif
241
242/**
243 * @brief Pipes APIs.
244 * @details If enabled then the pipes APIs are included
245 * in the kernel.
246 *
247 * @note The default is @p TRUE.
248 */
249#if !defined(CH_CFG_USE_PIPES)
250#define CH_CFG_USE_PIPES TRUE
251#endif
252
253/**
254 * @brief Objects Caches APIs.
255 * @details If enabled then the objects caches APIs are included
256 * in the kernel.
257 *
258 * @note The default is @p TRUE.
259 */
260#if !defined(CH_CFG_USE_OBJ_CACHES)
261#define CH_CFG_USE_OBJ_CACHES TRUE
262#endif
263
264/**
265 * @brief Delegate threads APIs.
266 * @details If enabled then the delegate threads APIs are included
267 * in the kernel.
268 *
269 * @note The default is @p TRUE.
270 */
271#if !defined(CH_CFG_USE_DELEGATES)
272#define CH_CFG_USE_DELEGATES TRUE
273#endif
274
275/**
276 * @brief Jobs Queues APIs.
277 * @details If enabled then the jobs queues APIs are included
278 * in the kernel.
279 *
280 * @note The default is @p TRUE.
281 */
282#if !defined(CH_CFG_USE_JOBS)
283#define CH_CFG_USE_JOBS TRUE
284#endif
285
286/** @} */
287
288/*===========================================================================*/
289/**
290 * @name Objects factory options
291 * @{
292 */
293/*===========================================================================*/
294
295/**
296 * @brief Objects Factory APIs.
297 * @details If enabled then the objects factory APIs are included in the
298 * kernel.
299 *
300 * @note The default is @p FALSE.
301 */
302#if !defined(CH_CFG_USE_FACTORY)
303#define CH_CFG_USE_FACTORY TRUE
304#endif
305
306/**
307 * @brief Maximum length for object names.
308 * @details If the specified length is zero then the name is stored by
309 * pointer but this could have unintended side effects.
310 */
311#if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
312#define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8
313#endif
314
315/**
316 * @brief Enables the registry of generic objects.
317 */
318#if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
319#define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
320#endif
321
322/**
323 * @brief Enables factory for generic buffers.
324 */
325#if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
326#define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
327#endif
328
329/**
330 * @brief Enables factory for semaphores.
331 */
332#if !defined(CH_CFG_FACTORY_SEMAPHORES)
333#define CH_CFG_FACTORY_SEMAPHORES TRUE
334#endif
335
336/**
337 * @brief Enables factory for mailboxes.
338 */
339#if !defined(CH_CFG_FACTORY_MAILBOXES)
340#define CH_CFG_FACTORY_MAILBOXES TRUE
341#endif
342
343/**
344 * @brief Enables factory for objects FIFOs.
345 */
346#if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
347#define CH_CFG_FACTORY_OBJ_FIFOS TRUE
348#endif
349
350/**
351 * @brief Enables factory for Pipes.
352 */
353#if !defined(CH_CFG_FACTORY_PIPES)
354#define CH_CFG_FACTORY_PIPES TRUE
355#endif
356
357/** @} */
358
359/*===========================================================================*/
360/**
361 * @name Debug options
362 * @{
363 */
364/*===========================================================================*/
365
366/**
367 * @brief Debug option, kernel statistics.
368 *
369 * @note Feature not currently implemented.
370 * @note The default is @p FALSE.
371 */
372#if !defined(CH_DBG_STATISTICS)
373#define CH_DBG_STATISTICS FALSE
374#endif
375
376/**
377 * @brief Debug option, system state check.
378 *
379 * @note The default is @p FALSE.
380 */
381#if !defined(CH_DBG_SYSTEM_STATE_CHECK)
382#define CH_DBG_SYSTEM_STATE_CHECK TRUE
383#endif
384
385/**
386 * @brief Debug option, parameters checks.
387 *
388 * @note The default is @p FALSE.
389 */
390#if !defined(CH_DBG_ENABLE_CHECKS)
391#define CH_DBG_ENABLE_CHECKS TRUE
392#endif
393
394/**
395 * @brief System assertions.
396 *
397 * @note The default is @p FALSE.
398 */
399#if !defined(CH_DBG_ENABLE_ASSERTS)
400#define CH_DBG_ENABLE_ASSERTS TRUE
401#endif
402
403/**
404 * @brief Stack check.
405 *
406 * @note The default is @p FALSE.
407 */
408#if !defined(CH_DBG_ENABLE_STACK_CHECK)
409#define CH_DBG_ENABLE_STACK_CHECK TRUE
410#endif
411
412/** @} */
413
414/*===========================================================================*/
415/**
416 * @name Kernel hooks
417 * @{
418 */
419/*===========================================================================*/
420
421/**
422 * @brief System initialization hook.
423 */
424#define CH_CFG_SYSTEM_INIT_HOOK() { \
425}
426
427/**
428 * @brief Threads descriptor structure extension.
429 * @details User fields added to the end of the @p thread_t structure.
430 */
431#define CH_CFG_THREAD_EXT_FIELDS \
432 /* Add threads custom fields here.*/
433
434/**
435 * @brief Threads initialization hook.
436 */
437#define CH_CFG_THREAD_EXT_INIT_HOOK(tr) { \
438 /* Add custom threads initialization code here.*/ \
439}
440
441/**
442 * @brief Threads finalization hook.
443 * @details User finalization code added to the @p chThdExit() API.
444 */
445#define CH_CFG_THREAD_EXIT_HOOK(tp) {}
446
447/**
448 * @brief Idle thread enter hook.
449 * @note This hook is invoked within a critical zone, no OS functions
450 * should be invoked from here.
451 * @note This macro can be used to activate a power saving mode.
452 */
453#define CH_CFG_IDLE_ENTER_HOOK() { \
454}
455
456/**
457 * @brief Idle thread leave hook.
458 * @note This hook is invoked within a critical zone, no OS functions
459 * should be invoked from here.
460 * @note This macro can be used to deactivate a power saving mode.
461 */
462#define CH_CFG_IDLE_LEAVE_HOOK() { \
463}
464
465/**
466 * @brief System halt hook.
467 */
468#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
469}
470
471/** @} */
472
473/*===========================================================================*/
474/* Port-specific settings (override port settings defaulted in nilcore.h). */
475/*===========================================================================*/
476
477#endif /* CHCONF_H */
478
479/** @} */
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/halconf.h b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/halconf.h
new file mode 100644
index 000000000..5f4a53dd4
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/halconf.h
@@ -0,0 +1,531 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/halconf.h
19 * @brief HAL configuration header.
20 * @details HAL configuration file, this file allows to enable or disable the
21 * various device drivers from your application. You may also use
22 * this file in order to override the device drivers default settings.
23 *
24 * @addtogroup HAL_CONF
25 * @{
26 */
27
28#ifndef HALCONF_H
29#define HALCONF_H
30
31#define _CHIBIOS_HAL_CONF_
32#define _CHIBIOS_HAL_CONF_VER_7_1_
33
34#include "mcuconf.h"
35
36/**
37 * @brief Enables the PAL subsystem.
38 */
39#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
40#define HAL_USE_PAL TRUE
41#endif
42
43/**
44 * @brief Enables the ADC subsystem.
45 */
46#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
47#define HAL_USE_ADC TRUE
48#endif
49
50/**
51 * @brief Enables the CAN subsystem.
52 */
53#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
54#define HAL_USE_CAN FALSE
55#endif
56
57/**
58 * @brief Enables the cryptographic subsystem.
59 */
60#if !defined(HAL_USE_CRY) || defined(__DOXYGEN__)
61#define HAL_USE_CRY FALSE
62#endif
63
64/**
65 * @brief Enables the DAC subsystem.
66 */
67#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
68#define HAL_USE_DAC FALSE
69#endif
70
71/**
72 * @brief Enables the EFlash subsystem.
73 */
74#if !defined(HAL_USE_EFL) || defined(__DOXYGEN__)
75#define HAL_USE_EFL FALSE
76#endif
77
78/**
79 * @brief Enables the GPT subsystem.
80 */
81#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
82#define HAL_USE_GPT FALSE
83#endif
84
85/**
86 * @brief Enables the I2C subsystem.
87 */
88#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
89#define HAL_USE_I2C FALSE
90#endif
91
92/**
93 * @brief Enables the I2S subsystem.
94 */
95#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
96#define HAL_USE_I2S FALSE
97#endif
98
99/**
100 * @brief Enables the ICU subsystem.
101 */
102#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
103#define HAL_USE_ICU FALSE
104#endif
105
106/**
107 * @brief Enables the MAC subsystem.
108 */
109#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
110#define HAL_USE_MAC FALSE
111#endif
112
113/**
114 * @brief Enables the MMC_SPI subsystem.
115 */
116#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
117#define HAL_USE_MMC_SPI FALSE
118#endif
119
120/**
121 * @brief Enables the PWM subsystem.
122 */
123#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
124#define HAL_USE_PWM FALSE
125#endif
126
127/**
128 * @brief Enables the RTC subsystem.
129 */
130#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
131#define HAL_USE_RTC FALSE
132#endif
133
134/**
135 * @brief Enables the SDC subsystem.
136 */
137#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
138#define HAL_USE_SDC FALSE
139#endif
140
141/**
142 * @brief Enables the SERIAL subsystem.
143 */
144#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
145#define HAL_USE_SERIAL TRUE
146#endif
147
148/**
149 * @brief Enables the SERIAL over USB subsystem.
150 */
151#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
152#define HAL_USE_SERIAL_USB FALSE
153#endif
154
155/**
156 * @brief Enables the SIO subsystem.
157 */
158#if !defined(HAL_USE_SIO) || defined(__DOXYGEN__)
159#define HAL_USE_SIO FALSE
160#endif
161
162/**
163 * @brief Enables the SPI subsystem.
164 */
165#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
166#define HAL_USE_SPI 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 FALSE
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 FALSE
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 FALSE
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 FALSE
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 FALSE
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 FALSE
467#endif
468
469/**
470 * @brief Handling method for SPI CS line.
471 * @note Disabling this option saves both code and data space.
472 */
473#if !defined(SPI_SELECT_MODE) || defined(__DOXYGEN__)
474#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
475#endif
476
477/*===========================================================================*/
478/* UART driver related settings. */
479/*===========================================================================*/
480
481/**
482 * @brief Enables synchronous APIs.
483 * @note Disabling this option saves both code and data space.
484 */
485#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
486#define UART_USE_WAIT FALSE
487#endif
488
489/**
490 * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs.
491 * @note Disabling this option saves both code and data space.
492 */
493#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
494#define UART_USE_MUTUAL_EXCLUSION FALSE
495#endif
496
497/*===========================================================================*/
498/* USB driver related settings. */
499/*===========================================================================*/
500
501/**
502 * @brief Enables synchronous APIs.
503 * @note Disabling this option saves both code and data space.
504 */
505#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
506#define USB_USE_WAIT FALSE
507#endif
508
509/*===========================================================================*/
510/* WSPI driver related settings. */
511/*===========================================================================*/
512
513/**
514 * @brief Enables synchronous APIs.
515 * @note Disabling this option saves both code and data space.
516 */
517#if !defined(WSPI_USE_WAIT) || defined(__DOXYGEN__)
518#define WSPI_USE_WAIT TRUE
519#endif
520
521/**
522 * @brief Enables the @p wspiAcquireBus() and @p wspiReleaseBus() APIs.
523 * @note Disabling this option saves both code and data space.
524 */
525#if !defined(WSPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
526#define WSPI_USE_MUTUAL_EXCLUSION TRUE
527#endif
528
529#endif /* HALCONF_H */
530
531/** @} */
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/main.c b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/main.c
new file mode 100644
index 000000000..4115cfa02
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/main.c
@@ -0,0 +1,270 @@
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#include "string.h"
20#include "stdio.h" /* eesh */
21
22/* Disable watchdog because of lousy startup code in newlib */
23static void __attribute__((naked, section(".crt_0042disable_watchdog"), used))
24disable_watchdog(void) {
25 WDTCTL = WDTPW | WDTHOLD;
26}
27
28const char * start_msg = "\r\n\r\nExecuting ADC test suite...\r\n";
29const char * test_1_msg = "\r\nTEST 1: 1 channel, depth 1, no circular\r\n";
30const char * test_2_msg = "\r\nTEST 2: 1 channel, depth 8, no circular\r\n";
31const char * test_3_msg = "\r\nTEST 3: 4 channels, depth 1, no circular\r\n";
32const char * test_4_msg = "\r\nTEST 4: 4 channels, depth 8, no circular\r\n";
33const char * test_5_msg = "\r\nTEST 5: 1 channel, depth 1, circular\r\n";
34const char * test_6_msg = "\r\nTEST 6: 1 channel, depth 8, circular\r\n";
35const char * test_7_msg = "\r\nTEST 7: 4 channel, depth 1, circular\r\n";
36const char * test_8_msg = "\r\nTEST 8: 4 channel, depth 8, circular\r\n";
37const char * test_9_msg = "\r\nTEST 9: 1 channel, depth 1, synchronous\r\n";
38const char * test_10_msg = "\r\nTEST 9: 1 channel, depth 1, exclusive\r\n";
39
40const char * success_string = "\r\nSUCCESS\r\n";
41const char * fail_string = "\r\nFAILURE\r\n";
42
43char out_string[128];
44const char * raw_fmt_string = "Raw Value: %d\r\n";
45const char * cooked_fmt_string = "Cooked Value: %d\r\n";
46const char * chn_fmt_string = "\r\nCHANNEL %d\r\n";
47
48uint16_t buffer_margin[72];
49uint16_t * buffer = buffer_margin + 4;
50uint8_t depth;
51uint8_t cb_arg = 0;
52uint16_t cb_expect;
53
54static const int test = 0;
55
56ADCConfig config = {
57 255 /* dma_index */
58};
59
60ADCConversionGroup group = {
61 false, /* circular */
62 1, /* num_channels */
63 NULL, /* end_cb */
64 NULL, /* error_cb */
65 {
66 30, 31, 30, 31, 0, 0, 0, 0,
67 0, 0, 0, 0, 0, 0, 0, 0,
68 0, 0, 0, 0, 0, 0, 0, 0,
69 0, 0, 0, 0, 0, 0, 0, 0
70 }, /* channels */
71 MSP430X_ADC_RES_12BIT, /* res */
72 MSP430X_ADC_SHT_32, /* rate */
73 MSP430X_ADC_VSS_VREF_BUF, /* ref */
74 MSP430X_REF_2V5 /* vref_src */
75};
76
77void print(const char * msg) {
78
79 if (!test) {
80 chnWrite(&SD0, (const uint8_t *)msg, strlen(msg));
81 }
82}
83
84void adc_callback(ADCDriver * adcp, adcsample_t *buffer, size_t n) {
85 (void)adcp;
86 (void)buffer;
87 (void)n;
88
89 cb_arg++;
90
91 if (adcp->grpp->circular && cb_arg == cb_expect) {
92 osalSysLockFromISR();
93 adcStopConversionI(adcp);
94 osalSysUnlockFromISR();
95 }
96}
97
98void run_test(const char * test_msg, uint8_t num_channels, uint8_t depth,
99 bool circular) {
100 print(test_msg);
101
102 cb_arg = 0;
103
104 group.num_channels = num_channels;
105 group.circular = circular;
106 group.end_cb = adc_callback;
107
108 if (depth > 1) cb_expect = 2;
109 else cb_expect = 1;
110 if (circular) cb_expect *= 3;
111
112 adcStartConversion(&ADCD1, &group, buffer, depth);
113
114 while (ADCD1.state == ADC_ACTIVE) ;
115
116
117 int index = 0;
118 for (int j = 0; j < depth; j++) {
119 for (int i = 0; i < group.num_channels; i++) {
120 index = i + (j * group.num_channels);
121 sniprintf(out_string, 128, chn_fmt_string, group.channels[i]);
122 print(out_string);
123
124 sniprintf(out_string, 128, raw_fmt_string, buffer[index]);
125 print(out_string);
126
127 if (group.channels[i] == 30) { /* internal temp sensor */
128 buffer[index] = adcMSP430XAdjustTemp(&group, buffer[index]);
129 }
130 else {
131 buffer[index] = adcMSP430XAdjustResult(&group, buffer[index]);
132 }
133
134 sniprintf(out_string, 128, cooked_fmt_string, buffer[index]);
135 print(out_string);
136 }
137 }
138
139 if (cb_arg == cb_expect) {
140 print(success_string);
141 }
142 else {
143 print(fail_string);
144 }
145}
146
147/*
148 * Thread 2.
149 */
150THD_WORKING_AREA(waThread1, 4096);
151THD_FUNCTION(Thread1, arg) {
152
153 (void)arg;
154
155 /*
156 * Activate the serial driver 0 using the driver default configuration.
157 */
158 sdStart(&SD0, NULL);
159
160
161 while (chnGetTimeout(&SD0, TIME_INFINITE)) {
162 print(start_msg);
163 chThdSleepMilliseconds(2000);
164
165 /* Activate the ADC driver 1 using its config */
166 adcStart(&ADCD1, &config);
167
168 /* Test 1 - 1ch1d, no circular */
169 run_test(test_1_msg, 1, 1, false);
170
171 /* Test 2 - 1ch8d, no circular */
172 run_test(test_2_msg, 1, 8, false);
173
174 /* Test 3 - 4chd1, no circular */
175 run_test(test_3_msg, 4, 1, false);
176
177 /* Test 4 - 4ch8d, no circular */
178 run_test(test_4_msg, 4, 8, false);
179
180 /* Test 5 - 1ch1d, circular */
181 run_test(test_5_msg, 1, 1, true);
182
183 /* Test 6 - 1ch8d, circular */
184 run_test(test_6_msg, 1, 8, true);
185
186 /* Test 7 - 4ch1d, circular */
187 run_test(test_7_msg, 4, 1, true);
188
189 /* Test 8 - 4ch8d, circular */
190 run_test(test_8_msg, 4, 8, true);
191
192 /* Test 9 - 1ch1d, synchronous */
193 print(test_9_msg);
194 cb_arg = 0;
195
196 group.num_channels = 1;
197 group.circular = false;
198 group.end_cb = adc_callback;
199
200 cb_expect = 1;
201
202 adcConvert(&ADCD1, &group, buffer, 1);
203
204 while (ADCD1.state == ADC_ACTIVE) ;
205
206 sniprintf(out_string, 128, chn_fmt_string, group.channels[0]);
207 print(out_string);
208
209 sniprintf(out_string, 128, raw_fmt_string, buffer[0]);
210 print(out_string);
211
212 buffer[0] = adcMSP430XAdjustTemp(&group, buffer[0]);
213
214 sniprintf(out_string, 128, cooked_fmt_string, buffer[0]);
215 print(out_string);
216
217 if (cb_arg == cb_expect) {
218 print(success_string);
219 }
220 else {
221 print(fail_string);
222 }
223
224 /* Test 10 - 1ch1d, exclusive */
225 adcStop(&ADCD1);
226
227 config.dma_index = 0;
228
229 adcStart(&ADCD1, &config);
230
231 run_test(test_10_msg, 1, 1, false);
232
233 adcStop(&ADCD1);
234
235 config.dma_index = 255;
236 }
237}
238
239/*
240 * Threads static table, one entry per thread. The number of entries must
241 * match NIL_CFG_NUM_THREADS.
242 */
243THD_TABLE_BEGIN
244 THD_TABLE_ENTRY(waThread1, "adc_test", Thread1, NULL)
245THD_TABLE_END
246
247/*
248 * Application entry point.
249 */
250int main(void) {
251
252 /*
253 * System initializations.
254 * - HAL initialization, this also initializes the configured device drivers
255 * and performs the board-specific initializations.
256 * - Kernel initialization, the main() function becomes a thread and the
257 * RTOS is active.
258 */
259 WDTCTL = WDTPW | WDTHOLD;
260
261 halInit();
262 chSysInit();
263
264 /* This is now the idle thread loop, you may perform here a low priority
265 task but you must never try to sleep or wait in this loop. Note that
266 this tasks runs at the lowest priority level so any instruction added
267 here will be executed after all other tasks have been started.*/
268 while (true) {
269 }
270}
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/mcuconf.h b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/mcuconf.h
new file mode 100644
index 000000000..fcc140754
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/mcuconf.h
@@ -0,0 +1,68 @@
1/*
2 ChibiOS - Copyright (C) 2016 Andrew Wygle aka awygle
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#ifndef MCUCONF_H
18#define MCUCONF_H
19
20/*
21 * MSP430X drivers configuration.
22 * The following settings override the default settings present in
23 * the various device driver implementation headers.
24 * Note that the settings for each driver only have effect if the driver
25 * is enabled in halconf.h.
26 *
27 */
28
29#define MSP430X_MCUCONF
30
31/* HAL driver system settings */
32#define MSP430X_ACLK_SRC MSP430X_VLOCLK
33#define MSP430X_LFXTCLK_FREQ 0
34#define MSP430X_HFXTCLK_FREQ 0
35#define MSP430X_DCOCLK_FREQ 8000000
36#define MSP430X_MCLK_DIV 1
37#define MSP430X_SMCLK_DIV 32
38
39/*
40 * SERIAL driver system settings.
41 */
42#define MSP430X_SERIAL_USE_USART0 TRUE
43#define MSP430X_USART0_CLK_SRC MSP430X_SMCLK_SRC
44#define MSP430X_SERIAL_USE_USART1 FALSE
45#define MSP430X_SERIAL_USE_USART2 FALSE
46#define MSP430X_SERIAL_USE_USART3 FALSE
47
48/*
49 * ST driver system settings.
50 */
51#define MSP430X_ST_CLK_SRC MSP430X_SMCLK_SRC
52#define MSP430X_ST_TIMER_TYPE B
53#define MSP430X_ST_TIMER_INDEX 0
54
55/*
56 * SPI driver system settings.
57 */
58#define MSP430X_SPI_USE_SPIA1 FALSE
59#define MSP430X_SPI_USE_SPIB0 FALSE
60#define MSP430X_SPI_EXCLUSIVE_DMA TRUE
61
62/*
63 * ADC driver system settings
64 */
65#define MSP430X_ADC_EXCLUSIVE_DMA TRUE
66#define MSP430X_ADC1_FREQ 5000000 / 256
67
68#endif /* _MCUCONF_H_ */
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/msp_vectors.c b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/msp_vectors.c
new file mode 100644
index 000000000..244b21917
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/ADC/msp_vectors.c
@@ -0,0 +1,286 @@
1#include <msp430.h>
2
3__attribute__((interrupt(1)))
4void Vector1(void) {
5
6 while (1) {
7 }
8}
9__attribute__((interrupt(2)))
10void Vector2(void) {
11
12 while (1) {
13 }
14}
15__attribute__((interrupt(3)))
16void Vector3(void) {
17
18 while (1) {
19 }
20}
21__attribute__((interrupt(4)))
22void Vector4(void) {
23
24 while (1) {
25 }
26}
27__attribute__((interrupt(5)))
28void Vector5(void) {
29
30 while (1) {
31 }
32}
33__attribute__((interrupt(6)))
34void Vector6(void) {
35
36 while (1) {
37 }
38}
39__attribute__((interrupt(7)))
40void Vector7(void) {
41
42 while (1) {
43 }
44}
45__attribute__((interrupt(8)))
46void Vector8(void) {
47
48 while (1) {
49 }
50}
51__attribute__((interrupt(9)))
52void Vector9(void) {
53
54 while (1) {
55 }
56}
57__attribute__((interrupt(10)))
58void Vector10(void) {
59
60 while (1) {
61 }
62}
63__attribute__((interrupt(11)))
64void Vector11(void) {
65
66 while (1) {
67 }
68}
69__attribute__((interrupt(12)))
70void Vector12(void) {
71
72 while (1) {
73 }
74}
75__attribute__((interrupt(13)))
76void Vector13(void) {
77
78 while (1) {
79 }
80}
81__attribute__((interrupt(14)))
82void Vector14(void) {
83
84 while (1) {
85 }
86}
87__attribute__((interrupt(15)))
88void Vector15(void) {
89
90 while (1) {
91 }
92}
93__attribute__((interrupt(16)))
94void Vector16(void) {
95
96 while (1) {
97 }
98}
99__attribute__((interrupt(17)))
100void Vector17(void) {
101
102 while (1) {
103 }
104}
105__attribute__((interrupt(18)))
106void Vector18(void) {
107
108 while (1) {
109 }
110}
111__attribute__((interrupt(19)))
112void Vector19(void) {
113
114 while (1) {
115 }
116}
117__attribute__((interrupt(20)))
118void Vector20(void) {
119
120 while (1) {
121 }
122}
123__attribute__((interrupt(21)))
124void Vector21(void) {
125
126 while (1) {
127 }
128}
129__attribute__((interrupt(22)))
130void Vector22(void) {
131
132 while (1) {
133 }
134}
135__attribute__((interrupt(23)))
136void Vector23(void) {
137
138 while (1) {
139 }
140}
141__attribute__((interrupt(24)))
142void Vector24(void) {
143
144 while (1) {
145 }
146}
147__attribute__((interrupt(25)))
148void Vector25(void) {
149
150 while (1) {
151 }
152}
153__attribute__((interrupt(26)))
154void Vector26(void) {
155
156 while (1) {
157 }
158}
159__attribute__((interrupt(27)))
160void Vector27(void) {
161
162 while (1) {
163 }
164}
165__attribute__((interrupt(28)))
166void Vector28(void) {
167
168 while (1) {
169 }
170}
171__attribute__((interrupt(29)))
172void Vector29(void) {
173
174 while (1) {
175 }
176}
177__attribute__((interrupt(30)))
178void Vector30(void) {
179
180 while (1) {
181 }
182}
183__attribute__((interrupt(31)))
184void Vector31(void) {
185
186 while (1) {
187 }
188}
189__attribute__((interrupt(32)))
190void Vector32(void) {
191
192 while (1) {
193 }
194}
195__attribute__((interrupt(35)))
196void Vector35(void) {
197
198 while (1) {
199 }
200}
201__attribute__((interrupt(36)))
202void Vector36(void) {
203
204 while (1) {
205 }
206}
207__attribute__((interrupt(38)))
208void Vector38(void) {
209
210 while (1) {
211 }
212}
213__attribute__((interrupt(39)))
214void Vector39(void) {
215
216 while (1) {
217 }
218}
219__attribute__((interrupt(41)))
220void Vector41(void) {
221
222 while (1) {
223 }
224}
225__attribute__((interrupt(42)))
226void Vector42(void) {
227
228 while (1) {
229 }
230}
231__attribute__((interrupt(44)))
232void Vector44(void) {
233
234 while (1) {
235 }
236}
237__attribute__((interrupt(45)))
238void Vector45(void) {
239
240 while (1) {
241 }
242}
243__attribute__((interrupt(46)))
244void Vector46(void) {
245
246 while (1) {
247 }
248}
249__attribute__((interrupt(48)))
250void Vector48(void) {
251
252 while (1) {
253 }
254}
255__attribute__((interrupt(50)))
256void Vector50(void) {
257
258 while (1) {
259 }
260}
261__attribute__((interrupt(51)))
262void Vector51(void) {
263
264 while (1) {
265 }
266}
267__attribute__((interrupt(53)))
268void Vector53(void) {
269
270 while (1) {
271 }
272}
273__attribute__((interrupt(54)))
274void Vector54(void) {
275
276 while (1) {
277 }
278}
279__attribute__((interrupt(55)))
280void Vector55(void) {
281
282 while (1) {
283 }
284}
285
286
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/Makefile b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/Makefile
new file mode 100644
index 000000000..3af7ed7c4
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/Makefile
@@ -0,0 +1,199 @@
1##############################################################################
2# Build global options
3# NOTE: Can be overridden externally.
4#
5
6# Optimization level, can be [0, 1, 2, 3, s].
7# 0 = turn off optimization. s = optimize for size.
8# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
9OPTIMIZE = 0
10
11# Debugging format.
12DEBUG =
13#DEBUG = stabs
14
15# Memory/data model
16MODEL = small
17
18# Object files directory
19# To put object files in current directory, use a dot (.), do NOT make
20# this an empty or blank macro!
21OBJDIR = .
22
23# Compiler flag to set the C Standard level.
24# c89 = "ANSI" C
25# gnu89 = c89 plus GCC extensions
26# c99 = ISO C99 standard (not yet fully implemented)
27# gnu99 = c99 plus GCC extensions
28CSTANDARD = -std=gnu11
29
30# Compiler options here.
31ifeq ($(USE_OPT),)
32 USE_OPT = -O$(OPTIMIZE) -g$(DEBUG)
33 USE_OPT += -funsigned-char -fshort-enums
34endif
35
36# C specific options here (added to USE_OPT).
37ifeq ($(USE_COPT),)
38 USE_COPT =
39endif
40
41# C++ specific options here (added to USE_OPT).
42ifeq ($(USE_CPPOPT),)
43 USE_CPPOPT = -fno-rtti
44endif
45
46# Enable this if you want the linker to remove unused code and data
47ifeq ($(USE_LINK_GC),)
48 USE_LINK_GC = yes
49endif
50
51# Linker extra options here.
52ifeq ($(USE_LDOPT),)
53 USE_LDOPT =
54endif
55
56# Enable this if you want link time optimizations (LTO)
57ifeq ($(USE_LTO),)
58 USE_LTO = no
59endif
60
61# Enable the selected hardware multiplier
62ifeq ($(USE_HWMULT),)
63 USE_HWMULT = f5series
64endif
65
66# Enable this if you want to see the full log while compiling.
67ifeq ($(USE_VERBOSE_COMPILE),)
68 USE_VERBOSE_COMPILE = yes
69endif
70
71# If enabled, this option makes the build process faster by not compiling
72# modules not used in the current configuration.
73ifeq ($(USE_SMART_BUILD),)
74 USE_SMART_BUILD = yes
75endif
76
77#
78# Build global options
79##############################################################################
80
81##############################################################################
82# Architecture or project specific options
83#
84
85# Stack size to be allocated to the idle thread stack. This stack is
86# the stack used by the main() thread.
87ifeq ($(USE_IDLE_STACKSIZE),)
88 USE_IDLE_STACKSIZE = 0xC00
89endif
90
91#
92# Architecture or project specific options
93##############################################################################
94
95##############################################################################
96# Project, sources and paths
97#
98
99# Define project name here
100PROJECT = nil
101
102# Imported source files and paths
103CHIBIOS = ../../../../../ChibiOS
104CHIBIOS_CONTRIB = ../../../..
105# Licensing files.
106include $(CHIBIOS)/os/license/license.mk
107# Startup files.
108include $(CHIBIOS_CONTRIB)/os/common/startup/MSP430X/compilers/GCC/mk/startup_msp430fr5xxx.mk
109# HAL-OSAL files (optional).
110include $(CHIBIOS)/os/hal/hal.mk
111include $(CHIBIOS_CONTRIB)/os/hal/boards/EXP430FR5969/board.mk
112include $(CHIBIOS_CONTRIB)/os/hal/ports/MSP430X/platform.mk
113include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk
114# RTOS files (optional).
115include $(CHIBIOS)/os/nil/nil.mk
116include $(CHIBIOS_CONTRIB)/os/common/ports/MSP430X/compilers/GCC/mk/port.mk
117# Other files (optional).
118
119# Define linker script file here
120LDSCRIPT = $(STARTUPLD)/msp430fr5969.ld
121
122# C sources
123CSRC = $(ALLCSRC) \
124 $(TESTSRC) \
125 msp_vectors.c \
126 main.c
127
128# C++ sources
129CPPSRC = $(ALLCPPSRC)
130
131# List ASM source files here
132ASMSRC = $(ALLASMSRC)
133
134INCDIR = $(ALLINC) $(TESTINC)
135
136#
137# Project, sources and paths
138##############################################################################
139
140##############################################################################
141# Compiler settings
142#
143
144MCU = msp430fr5969
145
146TRGT = msp430-elf-
147CC = $(TRGT)gcc
148CPPC = $(TRGT)g++
149# Enable loading with g++ only if you need C++ runtime support.
150# NOTE: You can use C++ even without C++ support if you are careful. C++
151# runtime support makes code size explode.
152LD = $(TRGT)gcc
153#LD = $(TRGT)g++
154CP = $(TRGT)objcopy
155AS = $(TRGT)gcc -x assembler-with-cpp
156AR = $(TRGT)ar
157OD = $(TRGT)objdump
158SZ = $(TRGT)size
159HEX = $(CP) -O ihex
160BIN = $(CP) -O binary
161
162# MSP430-specific options here
163MOPT = -m$(MODEL)
164
165# Define C warning options here
166CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
167
168# Define C++ warning options here
169CPPWARN = -Wall -Wextra -Wundef
170
171#
172# Compiler settings
173##############################################################################
174
175##############################################################################
176# Start of user section
177#
178
179# List all user C define here, like -D_DEBUG=1
180UDEFS =
181
182# Define ASM defines here
183UADEFS =
184
185# List all user directories here
186UINCDIR =
187
188# List the user directory to look for the libraries here
189ULIBDIR =
190
191# List all user libraries here
192ULIBS =
193
194#
195# End of user defines
196##############################################################################
197
198RULESPATH = $(CHIBIOS_CONTRIB)/os/common/startup/MSP430X/compilers/GCC
199include $(RULESPATH)/rules.mk
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/chconf.h b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/chconf.h
new file mode 100644
index 000000000..38b94f8a2
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/chconf.h
@@ -0,0 +1,479 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file nil/templates/chconf.h
19 * @brief Configuration file template.
20 * @details A copy of this file must be placed in each project directory, it
21 * contains the application specific kernel settings.
22 *
23 * @addtogroup NIL_CONFIG
24 * @details Kernel related settings and hooks.
25 * @{
26 */
27
28#ifndef CHCONF_H
29#define CHCONF_H
30
31#define _CHIBIOS_NIL_CONF_
32#define _CHIBIOS_NIL_CONF_VER_4_0_
33
34/*===========================================================================*/
35/**
36 * @name Kernel parameters and options
37 * @{
38 */
39/*===========================================================================*/
40
41/**
42 * @brief Maximum number of user threads in the application.
43 * @note This number is not inclusive of the idle thread which is
44 * implicitly handled.
45 * @note Set this value to be exactly equal to the number of threads you
46 * will use or you would be wasting RAM and cycles.
47 * @note This values also defines the number of available priorities
48 * (0..CH_CFG_MAX_THREADS-1).
49 */
50#if !defined(CH_CFG_MAX_THREADS)
51#define CH_CFG_MAX_THREADS 8
52#endif
53
54/**
55 * @brief Auto starts threads when @p chSysInit() is invoked.
56 */
57#if !defined(CH_CFG_AUTOSTART_THREADS)
58#define CH_CFG_AUTOSTART_THREADS TRUE
59#endif
60
61/** @} */
62
63/*===========================================================================*/
64/**
65 * @name System timer settings
66 * @{
67 */
68/*===========================================================================*/
69
70/**
71 * @brief System time counter resolution.
72 * @note Allowed values are 16 or 32 bits.
73 */
74#if !defined(CH_CFG_ST_RESOLUTION)
75#define CH_CFG_ST_RESOLUTION 16
76#endif
77
78/**
79 * @brief System tick frequency.
80 * @note This value together with the @p CH_CFG_ST_RESOLUTION
81 * option defines the maximum amount of time allowed for
82 * timeouts.
83 */
84#if !defined(CH_CFG_ST_FREQUENCY)
85#define CH_CFG_ST_FREQUENCY 1000
86#endif
87
88/**
89 * @brief Time delta constant for the tick-less mode.
90 * @note If this value is zero then the system uses the classic
91 * periodic tick. This value represents the minimum number
92 * of ticks that is safe to specify in a timeout directive.
93 * The value one is not valid, timeouts are rounded up to
94 * this value.
95 */
96#if !defined(CH_CFG_ST_TIMEDELTA)
97#define CH_CFG_ST_TIMEDELTA 0
98#endif
99
100/** @} */
101
102/*===========================================================================*/
103/**
104 * @name Subsystem options
105 * @{
106 */
107/*===========================================================================*/
108
109/**
110 * @brief Threads synchronization APIs.
111 * @details If enabled then the @p chThdWait() function is included in
112 * the kernel.
113 *
114 * @note The default is @p TRUE.
115 */
116#if !defined(CH_CFG_USE_WAITEXIT)
117#define CH_CFG_USE_WAITEXIT TRUE
118#endif
119
120/**
121 * @brief Semaphores APIs.
122 * @details If enabled then the Semaphores APIs are included in the kernel.
123 *
124 * @note The default is @p TRUE.
125 */
126#if !defined(CH_CFG_USE_SEMAPHORES)
127#define CH_CFG_USE_SEMAPHORES TRUE
128#endif
129
130/**
131 * @brief Mutexes APIs.
132 * @details If enabled then the mutexes APIs are included in the kernel.
133 *
134 * @note Feature not currently implemented.
135 * @note The default is @p FALSE.
136 */
137#if !defined(CH_CFG_USE_MUTEXES)
138#define CH_CFG_USE_MUTEXES FALSE
139#endif
140
141/**
142 * @brief Events Flags APIs.
143 * @details If enabled then the event flags APIs are included in the kernel.
144 *
145 * @note The default is @p TRUE.
146 */
147#if !defined(CH_CFG_USE_EVENTS)
148#define CH_CFG_USE_EVENTS TRUE
149#endif
150
151/**
152 * @brief Synchronous Messages APIs.
153 * @details If enabled then the synchronous messages APIs are included
154 * in the kernel.
155 *
156 * @note The default is @p TRUE.
157 */
158#if !defined(CH_CFG_USE_MESSAGES)
159#define CH_CFG_USE_MESSAGES TRUE
160#endif
161
162/** @} */
163
164/*===========================================================================*/
165/**
166 * @name OSLIB options
167 * @{
168 */
169/*===========================================================================*/
170
171/**
172 * @brief Mailboxes APIs.
173 * @details If enabled then the asynchronous messages (mailboxes) APIs are
174 * included in the kernel.
175 *
176 * @note The default is @p TRUE.
177 * @note Requires @p CH_CFG_USE_SEMAPHORES.
178 */
179#if !defined(CH_CFG_USE_MAILBOXES)
180#define CH_CFG_USE_MAILBOXES TRUE
181#endif
182
183/**
184 * @brief Core Memory Manager APIs.
185 * @details If enabled then the core memory manager APIs are included
186 * in the kernel.
187 *
188 * @note The default is @p TRUE.
189 */
190#if !defined(CH_CFG_USE_MEMCORE)
191#define CH_CFG_USE_MEMCORE TRUE
192#endif
193
194/**
195 * @brief Managed RAM size.
196 * @details Size of the RAM area to be managed by the OS. If set to zero
197 * then the whole available RAM is used. The core memory is made
198 * available to the heap allocator and/or can be used directly through
199 * the simplified core memory allocator.
200 *
201 * @note In order to let the OS manage the whole RAM the linker script must
202 * provide the @p __heap_base__ and @p __heap_end__ symbols.
203 * @note Requires @p CH_CFG_USE_MEMCORE.
204 */
205#if !defined(CH_CFG_MEMCORE_SIZE)
206#define CH_CFG_MEMCORE_SIZE 0
207#endif
208
209/**
210 * @brief Heap Allocator APIs.
211 * @details If enabled then the memory heap allocator APIs are included
212 * in the kernel.
213 *
214 * @note The default is @p TRUE.
215 */
216#if !defined(CH_CFG_USE_HEAP)
217#define CH_CFG_USE_HEAP TRUE
218#endif
219
220/**
221 * @brief Memory Pools Allocator APIs.
222 * @details If enabled then the memory pools allocator APIs are included
223 * in the kernel.
224 *
225 * @note The default is @p TRUE.
226 */
227#if !defined(CH_CFG_USE_MEMPOOLS)
228#define CH_CFG_USE_MEMPOOLS TRUE
229#endif
230
231/**
232 * @brief Objects FIFOs APIs.
233 * @details If enabled then the objects FIFOs APIs are included
234 * in the kernel.
235 *
236 * @note The default is @p TRUE.
237 */
238#if !defined(CH_CFG_USE_OBJ_FIFOS)
239#define CH_CFG_USE_OBJ_FIFOS TRUE
240#endif
241
242/**
243 * @brief Pipes APIs.
244 * @details If enabled then the pipes APIs are included
245 * in the kernel.
246 *
247 * @note The default is @p TRUE.
248 */
249#if !defined(CH_CFG_USE_PIPES)
250#define CH_CFG_USE_PIPES TRUE
251#endif
252
253/**
254 * @brief Objects Caches APIs.
255 * @details If enabled then the objects caches APIs are included
256 * in the kernel.
257 *
258 * @note The default is @p TRUE.
259 */
260#if !defined(CH_CFG_USE_OBJ_CACHES)
261#define CH_CFG_USE_OBJ_CACHES TRUE
262#endif
263
264/**
265 * @brief Delegate threads APIs.
266 * @details If enabled then the delegate threads APIs are included
267 * in the kernel.
268 *
269 * @note The default is @p TRUE.
270 */
271#if !defined(CH_CFG_USE_DELEGATES)
272#define CH_CFG_USE_DELEGATES TRUE
273#endif
274
275/**
276 * @brief Jobs Queues APIs.
277 * @details If enabled then the jobs queues APIs are included
278 * in the kernel.
279 *
280 * @note The default is @p TRUE.
281 */
282#if !defined(CH_CFG_USE_JOBS)
283#define CH_CFG_USE_JOBS TRUE
284#endif
285
286/** @} */
287
288/*===========================================================================*/
289/**
290 * @name Objects factory options
291 * @{
292 */
293/*===========================================================================*/
294
295/**
296 * @brief Objects Factory APIs.
297 * @details If enabled then the objects factory APIs are included in the
298 * kernel.
299 *
300 * @note The default is @p FALSE.
301 */
302#if !defined(CH_CFG_USE_FACTORY)
303#define CH_CFG_USE_FACTORY TRUE
304#endif
305
306/**
307 * @brief Maximum length for object names.
308 * @details If the specified length is zero then the name is stored by
309 * pointer but this could have unintended side effects.
310 */
311#if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
312#define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8
313#endif
314
315/**
316 * @brief Enables the registry of generic objects.
317 */
318#if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
319#define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
320#endif
321
322/**
323 * @brief Enables factory for generic buffers.
324 */
325#if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
326#define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
327#endif
328
329/**
330 * @brief Enables factory for semaphores.
331 */
332#if !defined(CH_CFG_FACTORY_SEMAPHORES)
333#define CH_CFG_FACTORY_SEMAPHORES TRUE
334#endif
335
336/**
337 * @brief Enables factory for mailboxes.
338 */
339#if !defined(CH_CFG_FACTORY_MAILBOXES)
340#define CH_CFG_FACTORY_MAILBOXES TRUE
341#endif
342
343/**
344 * @brief Enables factory for objects FIFOs.
345 */
346#if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
347#define CH_CFG_FACTORY_OBJ_FIFOS TRUE
348#endif
349
350/**
351 * @brief Enables factory for Pipes.
352 */
353#if !defined(CH_CFG_FACTORY_PIPES)
354#define CH_CFG_FACTORY_PIPES TRUE
355#endif
356
357/** @} */
358
359/*===========================================================================*/
360/**
361 * @name Debug options
362 * @{
363 */
364/*===========================================================================*/
365
366/**
367 * @brief Debug option, kernel statistics.
368 *
369 * @note Feature not currently implemented.
370 * @note The default is @p FALSE.
371 */
372#if !defined(CH_DBG_STATISTICS)
373#define CH_DBG_STATISTICS FALSE
374#endif
375
376/**
377 * @brief Debug option, system state check.
378 *
379 * @note The default is @p FALSE.
380 */
381#if !defined(CH_DBG_SYSTEM_STATE_CHECK)
382#define CH_DBG_SYSTEM_STATE_CHECK FALSE
383#endif
384
385/**
386 * @brief Debug option, parameters checks.
387 *
388 * @note The default is @p FALSE.
389 */
390#if !defined(CH_DBG_ENABLE_CHECKS)
391#define CH_DBG_ENABLE_CHECKS FALSE
392#endif
393
394/**
395 * @brief System assertions.
396 *
397 * @note The default is @p FALSE.
398 */
399#if !defined(CH_DBG_ENABLE_ASSERTS)
400#define CH_DBG_ENABLE_ASSERTS FALSE
401#endif
402
403/**
404 * @brief Stack check.
405 *
406 * @note The default is @p FALSE.
407 */
408#if !defined(CH_DBG_ENABLE_STACK_CHECK)
409#define CH_DBG_ENABLE_STACK_CHECK TRUE
410#endif
411
412/** @} */
413
414/*===========================================================================*/
415/**
416 * @name Kernel hooks
417 * @{
418 */
419/*===========================================================================*/
420
421/**
422 * @brief System initialization hook.
423 */
424#define CH_CFG_SYSTEM_INIT_HOOK() { \
425}
426
427/**
428 * @brief Threads descriptor structure extension.
429 * @details User fields added to the end of the @p thread_t structure.
430 */
431#define CH_CFG_THREAD_EXT_FIELDS \
432 /* Add threads custom fields here.*/
433
434/**
435 * @brief Threads initialization hook.
436 */
437#define CH_CFG_THREAD_EXT_INIT_HOOK(tr) { \
438 /* Add custom threads initialization code here.*/ \
439}
440
441/**
442 * @brief Threads finalization hook.
443 * @details User finalization code added to the @p chThdExit() API.
444 */
445#define CH_CFG_THREAD_EXIT_HOOK(tp) {}
446
447/**
448 * @brief Idle thread enter hook.
449 * @note This hook is invoked within a critical zone, no OS functions
450 * should be invoked from here.
451 * @note This macro can be used to activate a power saving mode.
452 */
453#define CH_CFG_IDLE_ENTER_HOOK() { \
454}
455
456/**
457 * @brief Idle thread leave hook.
458 * @note This hook is invoked within a critical zone, no OS functions
459 * should be invoked from here.
460 * @note This macro can be used to deactivate a power saving mode.
461 */
462#define CH_CFG_IDLE_LEAVE_HOOK() { \
463}
464
465/**
466 * @brief System halt hook.
467 */
468#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
469}
470
471/** @} */
472
473/*===========================================================================*/
474/* Port-specific settings (override port settings defaulted in nilcore.h). */
475/*===========================================================================*/
476
477#endif /* CHCONF_H */
478
479/** @} */
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/halconf.h b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/halconf.h
new file mode 100644
index 000000000..2c21c25dc
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/halconf.h
@@ -0,0 +1,531 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/halconf.h
19 * @brief HAL configuration header.
20 * @details HAL configuration file, this file allows to enable or disable the
21 * various device drivers from your application. You may also use
22 * this file in order to override the device drivers default settings.
23 *
24 * @addtogroup HAL_CONF
25 * @{
26 */
27
28#ifndef HALCONF_H
29#define HALCONF_H
30
31#define _CHIBIOS_HAL_CONF_
32#define _CHIBIOS_HAL_CONF_VER_7_1_
33
34#include "mcuconf.h"
35
36/**
37 * @brief Enables the PAL subsystem.
38 */
39#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
40#define HAL_USE_PAL TRUE
41#endif
42
43/**
44 * @brief Enables the ADC subsystem.
45 */
46#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
47#define HAL_USE_ADC FALSE
48#endif
49
50/**
51 * @brief Enables the CAN subsystem.
52 */
53#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
54#define HAL_USE_CAN FALSE
55#endif
56
57/**
58 * @brief Enables the cryptographic subsystem.
59 */
60#if !defined(HAL_USE_CRY) || defined(__DOXYGEN__)
61#define HAL_USE_CRY FALSE
62#endif
63
64/**
65 * @brief Enables the DAC subsystem.
66 */
67#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
68#define HAL_USE_DAC FALSE
69#endif
70
71/**
72 * @brief Enables the EFlash subsystem.
73 */
74#if !defined(HAL_USE_EFL) || defined(__DOXYGEN__)
75#define HAL_USE_EFL FALSE
76#endif
77
78/**
79 * @brief Enables the GPT subsystem.
80 */
81#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
82#define HAL_USE_GPT FALSE
83#endif
84
85/**
86 * @brief Enables the I2C subsystem.
87 */
88#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
89#define HAL_USE_I2C FALSE
90#endif
91
92/**
93 * @brief Enables the I2S subsystem.
94 */
95#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
96#define HAL_USE_I2S FALSE
97#endif
98
99/**
100 * @brief Enables the ICU subsystem.
101 */
102#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
103#define HAL_USE_ICU FALSE
104#endif
105
106/**
107 * @brief Enables the MAC subsystem.
108 */
109#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
110#define HAL_USE_MAC FALSE
111#endif
112
113/**
114 * @brief Enables the MMC_SPI subsystem.
115 */
116#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
117#define HAL_USE_MMC_SPI FALSE
118#endif
119
120/**
121 * @brief Enables the PWM subsystem.
122 */
123#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
124#define HAL_USE_PWM FALSE
125#endif
126
127/**
128 * @brief Enables the RTC subsystem.
129 */
130#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
131#define HAL_USE_RTC FALSE
132#endif
133
134/**
135 * @brief Enables the SDC subsystem.
136 */
137#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
138#define HAL_USE_SDC FALSE
139#endif
140
141/**
142 * @brief Enables the SERIAL subsystem.
143 */
144#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
145#define HAL_USE_SERIAL TRUE
146#endif
147
148/**
149 * @brief Enables the SERIAL over USB subsystem.
150 */
151#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
152#define HAL_USE_SERIAL_USB FALSE
153#endif
154
155/**
156 * @brief Enables the SIO subsystem.
157 */
158#if !defined(HAL_USE_SIO) || defined(__DOXYGEN__)
159#define HAL_USE_SIO FALSE
160#endif
161
162/**
163 * @brief Enables the SPI subsystem.
164 */
165#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
166#define HAL_USE_SPI 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 FALSE
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 FALSE
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 FALSE
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 FALSE
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 FALSE
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 FALSE
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 FALSE
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 FALSE
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 FALSE
467#endif
468
469/**
470 * @brief Handling method for SPI CS line.
471 * @note Disabling this option saves both code and data space.
472 */
473#if !defined(SPI_SELECT_MODE) || defined(__DOXYGEN__)
474#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
475#endif
476
477/*===========================================================================*/
478/* UART driver related settings. */
479/*===========================================================================*/
480
481/**
482 * @brief Enables synchronous APIs.
483 * @note Disabling this option saves both code and data space.
484 */
485#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
486#define UART_USE_WAIT FALSE
487#endif
488
489/**
490 * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs.
491 * @note Disabling this option saves both code and data space.
492 */
493#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
494#define UART_USE_MUTUAL_EXCLUSION FALSE
495#endif
496
497/*===========================================================================*/
498/* USB driver related settings. */
499/*===========================================================================*/
500
501/**
502 * @brief Enables synchronous APIs.
503 * @note Disabling this option saves both code and data space.
504 */
505#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
506#define USB_USE_WAIT FALSE
507#endif
508
509/*===========================================================================*/
510/* WSPI driver related settings. */
511/*===========================================================================*/
512
513/**
514 * @brief Enables synchronous APIs.
515 * @note Disabling this option saves both code and data space.
516 */
517#if !defined(WSPI_USE_WAIT) || defined(__DOXYGEN__)
518#define WSPI_USE_WAIT TRUE
519#endif
520
521/**
522 * @brief Enables the @p wspiAcquireBus() and @p wspiReleaseBus() APIs.
523 * @note Disabling this option saves both code and data space.
524 */
525#if !defined(WSPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
526#define WSPI_USE_MUTUAL_EXCLUSION TRUE
527#endif
528
529#endif /* HALCONF_H */
530
531/** @} */
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/main.c b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/main.c
new file mode 100644
index 000000000..f65d55019
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/main.c
@@ -0,0 +1,351 @@
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#include "hal_dma_lld.h"
20#include "string.h"
21
22const char * start_msg = "\r\n\r\nExecuting DMA test suite...\r\n";
23const char * test_1_msg =
24 "TEST 1: Word-to-word memcpy with DMA engine, no callbacks\r\n";
25const char * test_2_msg =
26 "TEST 2: Byte-to-byte memcpy with DMA engine, no callbacks\r\n";
27const char * test_3_msg =
28 "TEST 3: Byte-to-byte memset with DMA engine, no callbacks\r\n";
29const char * test_4_msg =
30 "TEST 4: Word-to-word memcpy with DMA engine, with callback\r\n";
31const char * test_5_msg =
32 "TEST 5: Claim DMA channel 0, perform a Word-to-word memcpy\r\n";
33const char * test_6_msg = "TEST 6: Attempt to claim already claimed DMA "
34 "channel, fail. Release it, try to claim it again, "
35 "and succeed.\r\n";
36const char * test_7_msg = "TEST 7: Claim DMA channel 1, perform a Word-to-word "
37 "memcpy, and release it\r\n";
38const char * test_8_msg = "TEST 8: Claim all three DMA channels, try to issue dmaRequest, "
39 "fail\r\n";
40
41const char * succeed_string = "SUCCESS\r\n\r\n";
42const char * fail_string = "FAILURE\r\n\r\n";
43
44char instring[256];
45char outstring[256];
46msp430x_dma_req_t * request;
47uint8_t cb_arg = 1;
48bool result;
49int result_i;
50
51void dma_callback_test(void * args) {
52
53 *((uint8_t *)args) = 0;
54}
55
56msp430x_dma_req_t test_1_req = {
57 instring, /* source address */
58 outstring, /* destination address */
59 9, /* number of words */
60 MSP430X_DMA_SRCINCR | MSP430X_DMA_DSTINCR, /* address mode - dual increment */
61 MSP430X_DMA_SRCWORD | MSP430X_DMA_DSTWORD, /* word transfer */
62 MSP430X_DMA_BLOCK, /* block (and blocking) transfer */
63 DMA_TRIGGER_MNEM(DMAREQ), /* software-requested trigger */
64 {
65 NULL, /* no callback */
66 NULL /* no arguments */
67 }
68};
69
70msp430x_dma_req_t test_2_req = {
71 instring, /* source address */
72 outstring, /* destination address */
73 18, /* number of bytes */
74 MSP430X_DMA_SRCINCR | MSP430X_DMA_DSTINCR, /* address mode - dual increment */
75 MSP430X_DMA_SRCBYTE | MSP430X_DMA_DSTBYTE, /* byte transfer */
76 MSP430X_DMA_BLOCK, /* block (and blocking) transfer */
77 DMA_TRIGGER_MNEM(DMAREQ), /* software-requested trigger */
78 {
79 NULL, /* no callback */
80 NULL /* no arguments */
81 }
82};
83
84msp430x_dma_req_t test_3_req = {
85 instring, /* source address */
86 outstring, /* destination address */
87 16, /* number of words */
88 MSP430X_DMA_DSTINCR, /* address mode - dest increment only */
89 MSP430X_DMA_SRCBYTE | MSP430X_DMA_DSTBYTE, /* word transfer */
90 MSP430X_DMA_BLOCK, /* block (and blocking) transfer */
91 DMA_TRIGGER_MNEM(DMAREQ), /* software-requested trigger */
92 {
93 NULL, /* no callback */
94 NULL /* no arguments */
95 }
96};
97
98msp430x_dma_req_t test_4_req = {
99 instring, /* source address */
100 outstring, /* destination address */
101 9, /* number of words */
102 MSP430X_DMA_SRCINCR | MSP430X_DMA_DSTINCR, /* address mode - dual increment */
103 MSP430X_DMA_SRCWORD | MSP430X_DMA_DSTWORD, /* word transfer */
104 MSP430X_DMA_BLOCK, /* block (and blocking) transfer */
105 DMA_TRIGGER_MNEM(DMAREQ), /* software-requested trigger */
106 {
107 &dma_callback_test, /* test callback */
108 &cb_arg /* test arguments */
109 }
110};
111
112msp430x_dma_req_t test_5_req = {
113 instring, /* source address */
114 outstring, /* destination address */
115 9, /* number of words */
116 MSP430X_DMA_SRCINCR | MSP430X_DMA_DSTINCR, /* address mode - dual increment */
117 MSP430X_DMA_SRCWORD | MSP430X_DMA_DSTWORD, /* word transfer */
118 MSP430X_DMA_BLOCK, /* block (and blocking) transfer */
119 DMA_TRIGGER_MNEM(DMAREQ), /* software-requested trigger */
120 {
121 NULL, /* no callback */
122 NULL /* no arguments */
123 }
124};
125
126msp430x_dma_ch_t ch = { NULL, 0, NULL };
127msp430x_dma_ch_t ch1 = { NULL, 0, NULL };
128msp430x_dma_ch_t ch2 = { NULL, 0, NULL };
129
130/*
131 * Thread 2.
132 */
133THD_WORKING_AREA(waThread1, 2048);
134THD_FUNCTION(Thread1, arg) {
135
136 (void)arg;
137
138 /*
139 * Activate the serial driver 0 using the driver default configuration.
140 */
141 sdStart(&SD0, NULL);
142
143 while (chnGetTimeout(&SD0, TIME_INFINITE)) {
144 chnWrite(&SD0, (const uint8_t *)start_msg, strlen(start_msg));
145 chThdSleepMilliseconds(2000);
146
147 /* Test 1 - use DMA engine to execute a word-wise memory-to-memory copy. */
148 chnWrite(&SD0, (const uint8_t *)test_1_msg, strlen(test_1_msg));
149 strcpy(instring, "After DMA test \r\n");
150 strcpy(outstring, "Before DMA test \r\n");
151 if (strcmp("Before DMA test \r\n", outstring)) {
152 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
153 }
154 request = &test_1_req;
155 chSysLock();
156 dmaRequestS(request, TIME_INFINITE);
157 chSysUnlock();
158 if (strcmp("After DMA test \r\n", outstring)) {
159 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
160 }
161 else {
162 chnWrite(&SD0, (const uint8_t *)succeed_string, strlen(succeed_string));
163 }
164
165 /* Test 2 - use DMA engine to execute a byte-wise memory-to-memory copy. */
166 chnWrite(&SD0, (const uint8_t *)test_2_msg, strlen(test_2_msg));
167 strcpy(instring, "After DMA test \r\n");
168 strcpy(outstring, "Before DMA test \r\n");
169 if (strcmp("Before DMA test \r\n", outstring)) {
170 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
171 }
172 request = &test_2_req;
173 chSysLock();
174 dmaRequestS(request, TIME_INFINITE);
175 chSysUnlock();
176 if (strcmp("After DMA test \r\n", outstring)) {
177 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
178 }
179 else {
180 chnWrite(&SD0, (const uint8_t *)succeed_string, strlen(succeed_string));
181 }
182
183 /* Test 3 - use DMA engine to execute a word-wise memory-to-memory set. */
184 chnWrite(&SD0, (const uint8_t *)test_3_msg, strlen(test_3_msg));
185 strcpy(instring, "After DMA test \r\n");
186 strcpy(outstring, "Before DMA test \r\n");
187 if (strcmp("Before DMA test \r\n", outstring)) {
188 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
189 }
190 request = &test_3_req;
191 chSysLock();
192 dmaRequestS(request, TIME_INFINITE);
193 chSysUnlock();
194 if (strcmp("AAAAAAAAAAAAAAAA\r\n", outstring)) {
195 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
196 }
197 else {
198 chnWrite(&SD0, (const uint8_t *)succeed_string, strlen(succeed_string));
199 }
200
201 /* Test 4 - use DMA engine to execute a word-wise memory-to-memory copy,
202 * then call a callback. */
203 chnWrite(&SD0, (const uint8_t *)test_4_msg, strlen(test_4_msg));
204 strcpy(instring, "After DMA test \r\n");
205 strcpy(outstring, "Before DMA test \r\n");
206 cb_arg = 1;
207 if (strcmp("Before DMA test \r\n", outstring) || (cb_arg != 1)) {
208 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
209 }
210 request = &test_4_req;
211 chSysLock();
212 dmaRequestS(request, TIME_INFINITE);
213 chSysUnlock();
214 if (strcmp("After DMA test \r\n", outstring) || cb_arg) {
215 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
216 }
217 else {
218 chnWrite(&SD0, (const uint8_t *)succeed_string, strlen(succeed_string));
219 }
220
221 /* Test 5 - use exclusive DMA channel 0 to execute a word-wise
222 * memory-to-memory copy. */
223 chnWrite(&SD0, (const uint8_t *)test_5_msg, strlen(test_5_msg));
224 strcpy(instring, "After DMA test \r\n");
225 strcpy(outstring, "Before DMA test \r\n");
226 if (strcmp("Before DMA test \r\n", outstring)) {
227 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
228 }
229 request = &test_5_req;
230 chSysLock();
231 dmaAcquireI(&ch, 0);
232 chSysUnlock();
233 dmaTransfer(&ch, request);
234 if (strcmp("After DMA test \r\n", outstring)) {
235 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
236 }
237 else {
238 chnWrite(&SD0, (const uint8_t *)succeed_string, strlen(succeed_string));
239 }
240
241 /* Test 6 - Attempt to claim DMA channel 0, fail, release it, attempt to
242 * claim it again */
243 chnWrite(&SD0, (const uint8_t *)test_6_msg, strlen(test_6_msg));
244 chSysLock();
245 result = dmaAcquireI(&ch, 0);
246 chSysUnlock();
247 if (!result) {
248 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
249 }
250 dmaRelease(&ch);
251 chSysLock();
252 result = dmaAcquireI(&ch, 0);
253 chSysUnlock();
254 if (result) {
255 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
256 }
257 else {
258 chnWrite(&SD0, (const uint8_t *)succeed_string, strlen(succeed_string));
259 }
260 dmaRelease(&ch);
261
262 /* Test 7 - use exclusive DMA channel 1 to execute a word-wise
263 * memory-to-memory copy. */
264 chnWrite(&SD0, (const uint8_t *)test_7_msg, strlen(test_7_msg));
265 strcpy(instring, "After DMA test \r\n");
266 strcpy(outstring, "Before DMA test \r\n");
267 if (strcmp("Before DMA test \r\n", outstring)) {
268 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
269 }
270 request = &test_5_req;
271 chSysLock();
272 dmaAcquireI(&ch, 1);
273 chSysUnlock();
274 dmaTransfer(&ch, request);
275 if (strcmp("After DMA test \r\n", outstring)) {
276 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
277 }
278 else {
279 chnWrite(&SD0, (const uint8_t *)succeed_string, strlen(succeed_string));
280 }
281 dmaRelease(&ch);
282
283 /* Test 8 - Claim all 3 DMA channels, attempt dmaRequest, fail */
284 chnWrite(&SD0, (const uint8_t *)test_8_msg, strlen(test_8_msg));
285 chSysLock();
286 result = dmaAcquireI(&ch, 0);
287 chSysUnlock();
288 if (result) {
289 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
290 }
291 chSysLock();
292 result = dmaAcquireI(&ch1, 1);
293 chSysUnlock();
294 if (result) {
295 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
296 }
297 chSysLock();
298 result = dmaAcquireI(&ch2, 2);
299 chSysUnlock();
300 if (result) {
301 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
302 }
303 chSysLock();
304 result_i = dmaRequestS(request, TIME_IMMEDIATE);
305 chSysUnlock();
306 if (result_i > 0) {
307 chnWrite(&SD0, (const uint8_t *)fail_string, strlen(fail_string));
308 }
309 else {
310 chnWrite(&SD0, (const uint8_t *)succeed_string, strlen(succeed_string));
311 }
312 dmaRelease(&ch);
313 dmaRelease(&ch1);
314 dmaRelease(&ch2);
315
316 }
317}
318
319/*
320 * Threads static table, one entry per thread. The number of entries must
321 * match NIL_CFG_NUM_THREADS.
322 */
323THD_TABLE_BEGIN
324 THD_TABLE_ENTRY(waThread1, "dma_test", Thread1, NULL)
325THD_TABLE_END
326
327/*
328 * Application entry point.
329 */
330int main(void) {
331
332 /*
333 * System initializations.
334 * - HAL initialization, this also initializes the configured device drivers
335 * and performs the board-specific initializations.
336 * - Kernel initialization, the main() function becomes a thread and the
337 * RTOS is active.
338 */
339 WDTCTL = WDTPW | WDTHOLD;
340
341 halInit();
342 chSysInit();
343 dmaInit();
344
345 /* This is now the idle thread loop, you may perform here a low priority
346 task but you must never try to sleep or wait in this loop. Note that
347 this tasks runs at the lowest priority level so any instruction added
348 here will be executed after all other tasks have been started.*/
349 while (true) {
350 }
351}
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/mcuconf.h b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/mcuconf.h
new file mode 100644
index 000000000..50e1ec8c5
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/mcuconf.h
@@ -0,0 +1,55 @@
1/*
2 ChibiOS - Copyright (C) 2016 Andrew Wygle aka awygle
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#ifndef MCUCONF_H
18#define MCUCONF_H
19
20/*
21 * MSP430X drivers configuration.
22 * The following settings override the default settings present in
23 * the various device driver implementation headers.
24 * Note that the settings for each driver only have effect if the driver
25 * is enabled in halconf.h.
26 *
27 */
28
29#define MSP430X_MCUCONF
30
31/* HAL driver system settings */
32#define MSP430X_ACLK_SRC MSP430X_VLOCLK
33#define MSP430X_LFXTCLK_FREQ 0
34#define MSP430X_HFXTCLK_FREQ 0
35#define MSP430X_DCOCLK_FREQ 8000000
36#define MSP430X_MCLK_DIV 1
37#define MSP430X_SMCLK_DIV 32
38
39/*
40 * SERIAL driver system settings.
41 */
42#define MSP430X_SERIAL_USE_USART0 TRUE
43#define MSP430X_USART0_CLK_SRC MSP430X_SMCLK_SRC
44#define MSP430X_SERIAL_USE_USART1 FALSE
45#define MSP430X_SERIAL_USE_USART2 FALSE
46#define MSP430X_SERIAL_USE_USART3 FALSE
47
48/*
49 * ST driver system settings.
50 */
51#define MSP430X_ST_CLK_SRC MSP430X_SMCLK_SRC
52#define MSP430X_ST_TIMER_TYPE B
53#define MSP430X_ST_TIMER_INDEX 0
54
55#endif /* _MCUCONF_H_ */
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/msp_vectors.c b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/msp_vectors.c
new file mode 100644
index 000000000..8d16e5a6c
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/DMA/msp_vectors.c
@@ -0,0 +1,294 @@
1#include <msp430.h>
2
3__attribute__((interrupt(1)))
4void Vector1(void) {
5
6 while (1) {
7 }
8}
9__attribute__((interrupt(2)))
10void Vector2(void) {
11
12 while (1) {
13 }
14}
15__attribute__((interrupt(3)))
16void Vector3(void) {
17
18 while (1) {
19 }
20}
21__attribute__((interrupt(4)))
22void Vector4(void) {
23
24 while (1) {
25 }
26}
27__attribute__((interrupt(5)))
28void Vector5(void) {
29
30 while (1) {
31 }
32}
33__attribute__((interrupt(6)))
34void Vector6(void) {
35
36 while (1) {
37 }
38}
39__attribute__((interrupt(7)))
40void Vector7(void) {
41
42 while (1) {
43 }
44}
45__attribute__((interrupt(8)))
46void Vector8(void) {
47
48 while (1) {
49 }
50}
51__attribute__((interrupt(9)))
52void Vector9(void) {
53
54 while (1) {
55 }
56}
57__attribute__((interrupt(10)))
58void Vector10(void) {
59
60 while (1) {
61 }
62}
63__attribute__((interrupt(11)))
64void Vector11(void) {
65
66 while (1) {
67 }
68}
69__attribute__((interrupt(12)))
70void Vector12(void) {
71
72 while (1) {
73 }
74}
75__attribute__((interrupt(13)))
76void Vector13(void) {
77
78 while (1) {
79 }
80}
81__attribute__((interrupt(14)))
82void Vector14(void) {
83
84 while (1) {
85 }
86}
87__attribute__((interrupt(15)))
88void Vector15(void) {
89
90 while (1) {
91 }
92}
93__attribute__((interrupt(16)))
94void Vector16(void) {
95
96 while (1) {
97 }
98}
99__attribute__((interrupt(17)))
100void Vector17(void) {
101
102 while (1) {
103 }
104}
105__attribute__((interrupt(18)))
106void Vector18(void) {
107
108 while (1) {
109 }
110}
111__attribute__((interrupt(19)))
112void Vector19(void) {
113
114 while (1) {
115 }
116}
117__attribute__((interrupt(20)))
118void Vector20(void) {
119
120 while (1) {
121 }
122}
123__attribute__((interrupt(21)))
124void Vector21(void) {
125
126 while (1) {
127 }
128}
129__attribute__((interrupt(22)))
130void Vector22(void) {
131
132 while (1) {
133 }
134}
135__attribute__((interrupt(23)))
136void Vector23(void) {
137
138 while (1) {
139 }
140}
141__attribute__((interrupt(24)))
142void Vector24(void) {
143
144 while (1) {
145 }
146}
147__attribute__((interrupt(25)))
148void Vector25(void) {
149
150 while (1) {
151 }
152}
153__attribute__((interrupt(26)))
154void Vector26(void) {
155
156 while (1) {
157 }
158}
159__attribute__((interrupt(27)))
160void Vector27(void) {
161
162 while (1) {
163 }
164}
165__attribute__((interrupt(28)))
166void Vector28(void) {
167
168 while (1) {
169 }
170}
171__attribute__((interrupt(29)))
172void Vector29(void) {
173
174 while (1) {
175 }
176}
177__attribute__((interrupt(30)))
178void Vector30(void) {
179
180 while (1) {
181 }
182}
183__attribute__((interrupt(31)))
184void Vector31(void) {
185
186 while (1) {
187 }
188}
189__attribute__((interrupt(32)))
190void Vector32(void) {
191
192 while (1) {
193 }
194}
195__attribute__((interrupt(35)))
196void Vector35(void) {
197
198 while (1) {
199 }
200}
201__attribute__((interrupt(36)))
202void Vector36(void) {
203
204 while (1) {
205 }
206}
207
208__attribute__((interrupt(38)))
209void Vector38(void) {
210
211 while (1) {
212 }
213}
214__attribute__((interrupt(39)))
215void Vector39(void) {
216
217 while (1) {
218 }
219}
220
221__attribute__((interrupt(41)))
222void Vector41(void) {
223
224 while (1) {
225 }
226}
227__attribute__((interrupt(42)))
228void Vector42(void) {
229
230 while (1) {
231 }
232}
233__attribute__((interrupt(44)))
234void Vector44(void) {
235
236 while (1) {
237 }
238}
239__attribute__((interrupt(45)))
240void Vector45(void) {
241
242 while (1) {
243 }
244}
245__attribute__((interrupt(46)))
246void Vector46(void) {
247
248 while (1) {
249 }
250}
251__attribute__((interrupt(47)))
252void Vector47(void) {
253
254 while (1) {
255 }
256}
257__attribute__((interrupt(48)))
258void Vector48(void) {
259
260 while (1) {
261 }
262}
263__attribute__((interrupt(50)))
264void Vector50(void) {
265
266 while (1) {
267 }
268}
269__attribute__((interrupt(51)))
270void Vector51(void) {
271
272 while (1) {
273 }
274}
275__attribute__((interrupt(53)))
276void Vector53(void) {
277
278 while (1) {
279 }
280}
281__attribute__((interrupt(54)))
282void Vector54(void) {
283
284 while (1) {
285 }
286}
287__attribute__((interrupt(55)))
288void Vector55(void) {
289
290 while (1) {
291 }
292}
293
294
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/Makefile b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/Makefile
new file mode 100644
index 000000000..3af7ed7c4
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/Makefile
@@ -0,0 +1,199 @@
1##############################################################################
2# Build global options
3# NOTE: Can be overridden externally.
4#
5
6# Optimization level, can be [0, 1, 2, 3, s].
7# 0 = turn off optimization. s = optimize for size.
8# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
9OPTIMIZE = 0
10
11# Debugging format.
12DEBUG =
13#DEBUG = stabs
14
15# Memory/data model
16MODEL = small
17
18# Object files directory
19# To put object files in current directory, use a dot (.), do NOT make
20# this an empty or blank macro!
21OBJDIR = .
22
23# Compiler flag to set the C Standard level.
24# c89 = "ANSI" C
25# gnu89 = c89 plus GCC extensions
26# c99 = ISO C99 standard (not yet fully implemented)
27# gnu99 = c99 plus GCC extensions
28CSTANDARD = -std=gnu11
29
30# Compiler options here.
31ifeq ($(USE_OPT),)
32 USE_OPT = -O$(OPTIMIZE) -g$(DEBUG)
33 USE_OPT += -funsigned-char -fshort-enums
34endif
35
36# C specific options here (added to USE_OPT).
37ifeq ($(USE_COPT),)
38 USE_COPT =
39endif
40
41# C++ specific options here (added to USE_OPT).
42ifeq ($(USE_CPPOPT),)
43 USE_CPPOPT = -fno-rtti
44endif
45
46# Enable this if you want the linker to remove unused code and data
47ifeq ($(USE_LINK_GC),)
48 USE_LINK_GC = yes
49endif
50
51# Linker extra options here.
52ifeq ($(USE_LDOPT),)
53 USE_LDOPT =
54endif
55
56# Enable this if you want link time optimizations (LTO)
57ifeq ($(USE_LTO),)
58 USE_LTO = no
59endif
60
61# Enable the selected hardware multiplier
62ifeq ($(USE_HWMULT),)
63 USE_HWMULT = f5series
64endif
65
66# Enable this if you want to see the full log while compiling.
67ifeq ($(USE_VERBOSE_COMPILE),)
68 USE_VERBOSE_COMPILE = yes
69endif
70
71# If enabled, this option makes the build process faster by not compiling
72# modules not used in the current configuration.
73ifeq ($(USE_SMART_BUILD),)
74 USE_SMART_BUILD = yes
75endif
76
77#
78# Build global options
79##############################################################################
80
81##############################################################################
82# Architecture or project specific options
83#
84
85# Stack size to be allocated to the idle thread stack. This stack is
86# the stack used by the main() thread.
87ifeq ($(USE_IDLE_STACKSIZE),)
88 USE_IDLE_STACKSIZE = 0xC00
89endif
90
91#
92# Architecture or project specific options
93##############################################################################
94
95##############################################################################
96# Project, sources and paths
97#
98
99# Define project name here
100PROJECT = nil
101
102# Imported source files and paths
103CHIBIOS = ../../../../../ChibiOS
104CHIBIOS_CONTRIB = ../../../..
105# Licensing files.
106include $(CHIBIOS)/os/license/license.mk
107# Startup files.
108include $(CHIBIOS_CONTRIB)/os/common/startup/MSP430X/compilers/GCC/mk/startup_msp430fr5xxx.mk
109# HAL-OSAL files (optional).
110include $(CHIBIOS)/os/hal/hal.mk
111include $(CHIBIOS_CONTRIB)/os/hal/boards/EXP430FR5969/board.mk
112include $(CHIBIOS_CONTRIB)/os/hal/ports/MSP430X/platform.mk
113include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk
114# RTOS files (optional).
115include $(CHIBIOS)/os/nil/nil.mk
116include $(CHIBIOS_CONTRIB)/os/common/ports/MSP430X/compilers/GCC/mk/port.mk
117# Other files (optional).
118
119# Define linker script file here
120LDSCRIPT = $(STARTUPLD)/msp430fr5969.ld
121
122# C sources
123CSRC = $(ALLCSRC) \
124 $(TESTSRC) \
125 msp_vectors.c \
126 main.c
127
128# C++ sources
129CPPSRC = $(ALLCPPSRC)
130
131# List ASM source files here
132ASMSRC = $(ALLASMSRC)
133
134INCDIR = $(ALLINC) $(TESTINC)
135
136#
137# Project, sources and paths
138##############################################################################
139
140##############################################################################
141# Compiler settings
142#
143
144MCU = msp430fr5969
145
146TRGT = msp430-elf-
147CC = $(TRGT)gcc
148CPPC = $(TRGT)g++
149# Enable loading with g++ only if you need C++ runtime support.
150# NOTE: You can use C++ even without C++ support if you are careful. C++
151# runtime support makes code size explode.
152LD = $(TRGT)gcc
153#LD = $(TRGT)g++
154CP = $(TRGT)objcopy
155AS = $(TRGT)gcc -x assembler-with-cpp
156AR = $(TRGT)ar
157OD = $(TRGT)objdump
158SZ = $(TRGT)size
159HEX = $(CP) -O ihex
160BIN = $(CP) -O binary
161
162# MSP430-specific options here
163MOPT = -m$(MODEL)
164
165# Define C warning options here
166CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
167
168# Define C++ warning options here
169CPPWARN = -Wall -Wextra -Wundef
170
171#
172# Compiler settings
173##############################################################################
174
175##############################################################################
176# Start of user section
177#
178
179# List all user C define here, like -D_DEBUG=1
180UDEFS =
181
182# Define ASM defines here
183UADEFS =
184
185# List all user directories here
186UINCDIR =
187
188# List the user directory to look for the libraries here
189ULIBDIR =
190
191# List all user libraries here
192ULIBS =
193
194#
195# End of user defines
196##############################################################################
197
198RULESPATH = $(CHIBIOS_CONTRIB)/os/common/startup/MSP430X/compilers/GCC
199include $(RULESPATH)/rules.mk
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/chconf.h b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/chconf.h
new file mode 100644
index 000000000..38b94f8a2
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/chconf.h
@@ -0,0 +1,479 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file nil/templates/chconf.h
19 * @brief Configuration file template.
20 * @details A copy of this file must be placed in each project directory, it
21 * contains the application specific kernel settings.
22 *
23 * @addtogroup NIL_CONFIG
24 * @details Kernel related settings and hooks.
25 * @{
26 */
27
28#ifndef CHCONF_H
29#define CHCONF_H
30
31#define _CHIBIOS_NIL_CONF_
32#define _CHIBIOS_NIL_CONF_VER_4_0_
33
34/*===========================================================================*/
35/**
36 * @name Kernel parameters and options
37 * @{
38 */
39/*===========================================================================*/
40
41/**
42 * @brief Maximum number of user threads in the application.
43 * @note This number is not inclusive of the idle thread which is
44 * implicitly handled.
45 * @note Set this value to be exactly equal to the number of threads you
46 * will use or you would be wasting RAM and cycles.
47 * @note This values also defines the number of available priorities
48 * (0..CH_CFG_MAX_THREADS-1).
49 */
50#if !defined(CH_CFG_MAX_THREADS)
51#define CH_CFG_MAX_THREADS 8
52#endif
53
54/**
55 * @brief Auto starts threads when @p chSysInit() is invoked.
56 */
57#if !defined(CH_CFG_AUTOSTART_THREADS)
58#define CH_CFG_AUTOSTART_THREADS TRUE
59#endif
60
61/** @} */
62
63/*===========================================================================*/
64/**
65 * @name System timer settings
66 * @{
67 */
68/*===========================================================================*/
69
70/**
71 * @brief System time counter resolution.
72 * @note Allowed values are 16 or 32 bits.
73 */
74#if !defined(CH_CFG_ST_RESOLUTION)
75#define CH_CFG_ST_RESOLUTION 16
76#endif
77
78/**
79 * @brief System tick frequency.
80 * @note This value together with the @p CH_CFG_ST_RESOLUTION
81 * option defines the maximum amount of time allowed for
82 * timeouts.
83 */
84#if !defined(CH_CFG_ST_FREQUENCY)
85#define CH_CFG_ST_FREQUENCY 1000
86#endif
87
88/**
89 * @brief Time delta constant for the tick-less mode.
90 * @note If this value is zero then the system uses the classic
91 * periodic tick. This value represents the minimum number
92 * of ticks that is safe to specify in a timeout directive.
93 * The value one is not valid, timeouts are rounded up to
94 * this value.
95 */
96#if !defined(CH_CFG_ST_TIMEDELTA)
97#define CH_CFG_ST_TIMEDELTA 0
98#endif
99
100/** @} */
101
102/*===========================================================================*/
103/**
104 * @name Subsystem options
105 * @{
106 */
107/*===========================================================================*/
108
109/**
110 * @brief Threads synchronization APIs.
111 * @details If enabled then the @p chThdWait() function is included in
112 * the kernel.
113 *
114 * @note The default is @p TRUE.
115 */
116#if !defined(CH_CFG_USE_WAITEXIT)
117#define CH_CFG_USE_WAITEXIT TRUE
118#endif
119
120/**
121 * @brief Semaphores APIs.
122 * @details If enabled then the Semaphores APIs are included in the kernel.
123 *
124 * @note The default is @p TRUE.
125 */
126#if !defined(CH_CFG_USE_SEMAPHORES)
127#define CH_CFG_USE_SEMAPHORES TRUE
128#endif
129
130/**
131 * @brief Mutexes APIs.
132 * @details If enabled then the mutexes APIs are included in the kernel.
133 *
134 * @note Feature not currently implemented.
135 * @note The default is @p FALSE.
136 */
137#if !defined(CH_CFG_USE_MUTEXES)
138#define CH_CFG_USE_MUTEXES FALSE
139#endif
140
141/**
142 * @brief Events Flags APIs.
143 * @details If enabled then the event flags APIs are included in the kernel.
144 *
145 * @note The default is @p TRUE.
146 */
147#if !defined(CH_CFG_USE_EVENTS)
148#define CH_CFG_USE_EVENTS TRUE
149#endif
150
151/**
152 * @brief Synchronous Messages APIs.
153 * @details If enabled then the synchronous messages APIs are included
154 * in the kernel.
155 *
156 * @note The default is @p TRUE.
157 */
158#if !defined(CH_CFG_USE_MESSAGES)
159#define CH_CFG_USE_MESSAGES TRUE
160#endif
161
162/** @} */
163
164/*===========================================================================*/
165/**
166 * @name OSLIB options
167 * @{
168 */
169/*===========================================================================*/
170
171/**
172 * @brief Mailboxes APIs.
173 * @details If enabled then the asynchronous messages (mailboxes) APIs are
174 * included in the kernel.
175 *
176 * @note The default is @p TRUE.
177 * @note Requires @p CH_CFG_USE_SEMAPHORES.
178 */
179#if !defined(CH_CFG_USE_MAILBOXES)
180#define CH_CFG_USE_MAILBOXES TRUE
181#endif
182
183/**
184 * @brief Core Memory Manager APIs.
185 * @details If enabled then the core memory manager APIs are included
186 * in the kernel.
187 *
188 * @note The default is @p TRUE.
189 */
190#if !defined(CH_CFG_USE_MEMCORE)
191#define CH_CFG_USE_MEMCORE TRUE
192#endif
193
194/**
195 * @brief Managed RAM size.
196 * @details Size of the RAM area to be managed by the OS. If set to zero
197 * then the whole available RAM is used. The core memory is made
198 * available to the heap allocator and/or can be used directly through
199 * the simplified core memory allocator.
200 *
201 * @note In order to let the OS manage the whole RAM the linker script must
202 * provide the @p __heap_base__ and @p __heap_end__ symbols.
203 * @note Requires @p CH_CFG_USE_MEMCORE.
204 */
205#if !defined(CH_CFG_MEMCORE_SIZE)
206#define CH_CFG_MEMCORE_SIZE 0
207#endif
208
209/**
210 * @brief Heap Allocator APIs.
211 * @details If enabled then the memory heap allocator APIs are included
212 * in the kernel.
213 *
214 * @note The default is @p TRUE.
215 */
216#if !defined(CH_CFG_USE_HEAP)
217#define CH_CFG_USE_HEAP TRUE
218#endif
219
220/**
221 * @brief Memory Pools Allocator APIs.
222 * @details If enabled then the memory pools allocator APIs are included
223 * in the kernel.
224 *
225 * @note The default is @p TRUE.
226 */
227#if !defined(CH_CFG_USE_MEMPOOLS)
228#define CH_CFG_USE_MEMPOOLS TRUE
229#endif
230
231/**
232 * @brief Objects FIFOs APIs.
233 * @details If enabled then the objects FIFOs APIs are included
234 * in the kernel.
235 *
236 * @note The default is @p TRUE.
237 */
238#if !defined(CH_CFG_USE_OBJ_FIFOS)
239#define CH_CFG_USE_OBJ_FIFOS TRUE
240#endif
241
242/**
243 * @brief Pipes APIs.
244 * @details If enabled then the pipes APIs are included
245 * in the kernel.
246 *
247 * @note The default is @p TRUE.
248 */
249#if !defined(CH_CFG_USE_PIPES)
250#define CH_CFG_USE_PIPES TRUE
251#endif
252
253/**
254 * @brief Objects Caches APIs.
255 * @details If enabled then the objects caches APIs are included
256 * in the kernel.
257 *
258 * @note The default is @p TRUE.
259 */
260#if !defined(CH_CFG_USE_OBJ_CACHES)
261#define CH_CFG_USE_OBJ_CACHES TRUE
262#endif
263
264/**
265 * @brief Delegate threads APIs.
266 * @details If enabled then the delegate threads APIs are included
267 * in the kernel.
268 *
269 * @note The default is @p TRUE.
270 */
271#if !defined(CH_CFG_USE_DELEGATES)
272#define CH_CFG_USE_DELEGATES TRUE
273#endif
274
275/**
276 * @brief Jobs Queues APIs.
277 * @details If enabled then the jobs queues APIs are included
278 * in the kernel.
279 *
280 * @note The default is @p TRUE.
281 */
282#if !defined(CH_CFG_USE_JOBS)
283#define CH_CFG_USE_JOBS TRUE
284#endif
285
286/** @} */
287
288/*===========================================================================*/
289/**
290 * @name Objects factory options
291 * @{
292 */
293/*===========================================================================*/
294
295/**
296 * @brief Objects Factory APIs.
297 * @details If enabled then the objects factory APIs are included in the
298 * kernel.
299 *
300 * @note The default is @p FALSE.
301 */
302#if !defined(CH_CFG_USE_FACTORY)
303#define CH_CFG_USE_FACTORY TRUE
304#endif
305
306/**
307 * @brief Maximum length for object names.
308 * @details If the specified length is zero then the name is stored by
309 * pointer but this could have unintended side effects.
310 */
311#if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
312#define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8
313#endif
314
315/**
316 * @brief Enables the registry of generic objects.
317 */
318#if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
319#define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
320#endif
321
322/**
323 * @brief Enables factory for generic buffers.
324 */
325#if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
326#define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
327#endif
328
329/**
330 * @brief Enables factory for semaphores.
331 */
332#if !defined(CH_CFG_FACTORY_SEMAPHORES)
333#define CH_CFG_FACTORY_SEMAPHORES TRUE
334#endif
335
336/**
337 * @brief Enables factory for mailboxes.
338 */
339#if !defined(CH_CFG_FACTORY_MAILBOXES)
340#define CH_CFG_FACTORY_MAILBOXES TRUE
341#endif
342
343/**
344 * @brief Enables factory for objects FIFOs.
345 */
346#if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
347#define CH_CFG_FACTORY_OBJ_FIFOS TRUE
348#endif
349
350/**
351 * @brief Enables factory for Pipes.
352 */
353#if !defined(CH_CFG_FACTORY_PIPES)
354#define CH_CFG_FACTORY_PIPES TRUE
355#endif
356
357/** @} */
358
359/*===========================================================================*/
360/**
361 * @name Debug options
362 * @{
363 */
364/*===========================================================================*/
365
366/**
367 * @brief Debug option, kernel statistics.
368 *
369 * @note Feature not currently implemented.
370 * @note The default is @p FALSE.
371 */
372#if !defined(CH_DBG_STATISTICS)
373#define CH_DBG_STATISTICS FALSE
374#endif
375
376/**
377 * @brief Debug option, system state check.
378 *
379 * @note The default is @p FALSE.
380 */
381#if !defined(CH_DBG_SYSTEM_STATE_CHECK)
382#define CH_DBG_SYSTEM_STATE_CHECK FALSE
383#endif
384
385/**
386 * @brief Debug option, parameters checks.
387 *
388 * @note The default is @p FALSE.
389 */
390#if !defined(CH_DBG_ENABLE_CHECKS)
391#define CH_DBG_ENABLE_CHECKS FALSE
392#endif
393
394/**
395 * @brief System assertions.
396 *
397 * @note The default is @p FALSE.
398 */
399#if !defined(CH_DBG_ENABLE_ASSERTS)
400#define CH_DBG_ENABLE_ASSERTS FALSE
401#endif
402
403/**
404 * @brief Stack check.
405 *
406 * @note The default is @p FALSE.
407 */
408#if !defined(CH_DBG_ENABLE_STACK_CHECK)
409#define CH_DBG_ENABLE_STACK_CHECK TRUE
410#endif
411
412/** @} */
413
414/*===========================================================================*/
415/**
416 * @name Kernel hooks
417 * @{
418 */
419/*===========================================================================*/
420
421/**
422 * @brief System initialization hook.
423 */
424#define CH_CFG_SYSTEM_INIT_HOOK() { \
425}
426
427/**
428 * @brief Threads descriptor structure extension.
429 * @details User fields added to the end of the @p thread_t structure.
430 */
431#define CH_CFG_THREAD_EXT_FIELDS \
432 /* Add threads custom fields here.*/
433
434/**
435 * @brief Threads initialization hook.
436 */
437#define CH_CFG_THREAD_EXT_INIT_HOOK(tr) { \
438 /* Add custom threads initialization code here.*/ \
439}
440
441/**
442 * @brief Threads finalization hook.
443 * @details User finalization code added to the @p chThdExit() API.
444 */
445#define CH_CFG_THREAD_EXIT_HOOK(tp) {}
446
447/**
448 * @brief Idle thread enter hook.
449 * @note This hook is invoked within a critical zone, no OS functions
450 * should be invoked from here.
451 * @note This macro can be used to activate a power saving mode.
452 */
453#define CH_CFG_IDLE_ENTER_HOOK() { \
454}
455
456/**
457 * @brief Idle thread leave hook.
458 * @note This hook is invoked within a critical zone, no OS functions
459 * should be invoked from here.
460 * @note This macro can be used to deactivate a power saving mode.
461 */
462#define CH_CFG_IDLE_LEAVE_HOOK() { \
463}
464
465/**
466 * @brief System halt hook.
467 */
468#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
469}
470
471/** @} */
472
473/*===========================================================================*/
474/* Port-specific settings (override port settings defaulted in nilcore.h). */
475/*===========================================================================*/
476
477#endif /* CHCONF_H */
478
479/** @} */
diff --git a/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/halconf.h b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/halconf.h
new file mode 100644
index 000000000..a56843212
--- /dev/null
+++ b/lib/chibios-contrib/testhal/MSP430X/EXP430FR5969/SPI/halconf.h
@@ -0,0 +1,531 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/halconf.h
19 * @brief HAL configuration header.
20 * @details HAL configuration file, this file allows to enable or disable the
21 * various device drivers from your application. You may also use
22 * this file in order to override the device drivers default settings.
23 *
24 * @addtogroup HAL_CONF
25 * @{
26 */
27
28#ifndef HALCONF_H
29#define HALCONF_H
30
31#define _CHIBIOS_HAL_CONF_
32#define _CHIBIOS_HAL_CONF_VER_7_1_
33
34#include "mcuconf.h"
35
36/**
37 * @brief Enables the PAL subsystem.
38 */
39#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
40#define HAL_USE_PAL TRUE
41#endif
42
43/**
44 * @brief Enables the ADC subsystem.
45 */
46#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
47#define HAL_USE_ADC FALSE
48#endif
49
50/**
51 * @brief Enables the CAN subsystem.
52 */
53#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
54#define HAL_USE_CAN FALSE
55#endif
56
57/**
58 * @brief Enables the cryptographic subsystem.
59 */
60#if !defined(HAL_USE_CRY) || defined(__DOXYGEN__)
61#define HAL_USE_CRY FALSE
62#endif
63
64/**
65 * @brief Enables the DAC subsystem.
66 */
67#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
68#define HAL_USE_DAC FALSE
69#endif
70
71/**
72 * @brief Enables the EFlash subsystem.
73 */
74#if !defined(HAL_USE_EFL) || defined(__DOXYGEN__)
75#define HAL_USE_EFL FALSE
76#endif
77
78/**
79 * @brief Enables the GPT subsystem.
80 */
81#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
82#define HAL_USE_GPT FALSE
83#endif
84
85/**
86 * @brief Enables the I2C subsystem.
87 */
88#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
89#define HAL_USE_I2C FALSE
90#endif
91
92/**
93 * @brief Enables the I2S subsystem.
94 */
95#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
96#define HAL_USE_I2S FALSE
97#endif
98
99/**
100 * @brief Enables the ICU subsystem.
101 */
102#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
103#define HAL_USE_ICU FALSE
104#endif
105
106/**
107 * @brief Enables the MAC subsystem.
108 */
109#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
110#define HAL_USE_MAC FALSE
111#endif
112
113/**
114 * @brief Enables the MMC_SPI subsystem.
115 */
116#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
117#define HAL_USE_MMC_SPI FALSE
118#endif
119
120/**
121 * @brief Enables the PWM subsystem.
122 */
123#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
124#define HAL_USE_PWM FALSE
125#endif
126
127/**
128 * @brief Enables the RTC subsystem.
129 */
130#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
131#define HAL_USE_RTC FALSE
132#endif
133
134/**
135 * @brief Enables the SDC subsystem.
136 */
137#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
138#define HAL_USE_SDC FALSE
139#endif
140
141/**
142 * @brief Enables the SERIAL subsystem.
143 */
144#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
145#define HAL_USE_SERIAL TRUE
146#endif
147
148/**
149 * @brief Enables the SERIAL over USB subsystem.
150 */
151#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
152#define HAL_USE_SERIAL_USB FALSE
153#endif
154
155/**
156 * @brief Enables the SIO subsystem.
157 */
158#if !defined(HAL_USE_SIO) || defined(__DOXYGEN__)
159#define HAL_USE_SIO FALSE
160#endif
161
162/**
163 * @brief Enables the SPI subsystem.
164 */
165#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
166#define HAL_USE_SPI TRUE
167#endif
168
169/**
170 * @brief Enables the TRNG subsystem.
171 */
172#if !defined(HAL_USE_TRNG) || defined(__DOXYGEN__)
173#define HAL_USE_TRNG FALSE
174#endif
175
176/**
177 * @brief Enables the UART subsystem.
178 */
179#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
180#define HAL_USE_UART FALSE
181#endif
182
183/**
184 * @brief Enables the USB subsystem.
185 */
186#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
187#define HAL_USE_USB FALSE
188#endif
189
190/**
191 * @brief Enables the WDG subsystem.
192 */
193#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
194#define HAL_USE_WDG FALSE
195#endif
196
197/**
198 * @brief Enables the WSPI subsystem.
199 */
200#if !defined(HAL_USE_WSPI) || defined(__DOXYGEN__)
201#define HAL_USE_WSPI FALSE
202#endif
203
204/*===========================================================================*/
205/* PAL driver related settings. */