amiro-os / modules / NUCLEO-L476RG / aosconf.h @ 10fd7ac9
History | View | Annotate | Download (10.294 KB)
1 | 27d0378b | Simon Welzel | /*
|
---|---|---|---|
2 | AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
|
||
3 | 8543d0d9 | Thomas Schöpping | Copyright (C) 2016..2019 Thomas Schöpping et al.
|
4 | 27d0378b | Simon Welzel | |
5 | This program is free software: you can redistribute it and/or modify
|
||
6 | it under the terms of the GNU General Public License as published by
|
||
7 | the Free Software Foundation, either version 3 of the License, or
|
||
8 | (at your option) any later version.
|
||
9 | |||
10 | This program is distributed in the hope that it will be useful,
|
||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | GNU General Public License for more details.
|
||
14 | |||
15 | You should have received a copy of the GNU General Public License
|
||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
17 | */
|
||
18 | |||
19 | /**
|
||
20 | 8543d0d9 | Thomas Schöpping | * @file
|
21 | 126ace3c | Thomas Schöpping | * @brief AMiRo-OS Configuration file for the NUCLEO-L476RG module.
|
22 | 27d0378b | Simon Welzel | * @details Contains the application specific AMiRo-OS settings.
|
23 | *
|
||
24 | 126ace3c | Thomas Schöpping | * @addtogroup NUCLEO-L476RG_aos_config
|
25 | 27d0378b | Simon Welzel | * @{
|
26 | */
|
||
27 | |||
28 | 6ff06bbf | Thomas Schöpping | #ifndef AOSCONF_H
|
29 | #define AOSCONF_H
|
||
30 | 27d0378b | Simon Welzel | |
31 | /*
|
||
32 | * compatibility guards
|
||
33 | */
|
||
34 | #define _AMIRO_OS_CFG_
|
||
35 | 7da800ab | Thomas Schöpping | #define AMIRO_OS_CFG_VERSION_MAJOR 2 |
36 | cda14729 | Thomas Schöpping | #define AMIRO_OS_CFG_VERSION_MINOR 1 |
37 | 27d0378b | Simon Welzel | |
38 | #include <stdbool.h> |
||
39 | |||
40 | /*
|
||
41 | * Include an external configuration file to override the following default settings only if required.
|
||
42 | */
|
||
43 | #if defined(AMIRO_APPS) && (AMIRO_APPS == true) |
||
44 | #include <osconf.h> |
||
45 | 7de0cc90 | Thomas Schöpping | #endif /* defined(AMIRO_APPS) && (AMIRO_APPS == true) */ |
46 | 27d0378b | Simon Welzel | |
47 | /*===========================================================================*/
|
||
48 | /**
|
||
49 | * @name Kernel parameters and options
|
||
50 | * @{
|
||
51 | */
|
||
52 | /*===========================================================================*/
|
||
53 | |||
54 | /**
|
||
55 | * @brief Flag to enable/disable debug API and logic.
|
||
56 | */
|
||
57 | #if !defined(OS_CFG_DBG)
|
||
58 | #define AMIROOS_CFG_DBG true |
||
59 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_DBG) */ |
60 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_DBG OS_CFG_DBG
|
61 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_DBG) */ |
62 | 27d0378b | Simon Welzel | |
63 | /**
|
||
64 | * @brief Flag to enable/disable unit tests.
|
||
65 | 8543d0d9 | Thomas Schöpping | * @note Setting this flag will implicitely enable the shell.
|
66 | 27d0378b | Simon Welzel | */
|
67 | #if !defined(OS_CFG_TESTS_ENABLE)
|
||
68 | a0301104 | Thomas Schöpping | #define AMIROOS_CFG_TESTS_ENABLE true |
69 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_TESTS_ENABLE) */ |
70 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_TESTS_ENABLE OS_CFG_TESTS_ENABLE
|
71 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_TESTS_ENABLE) */ |
72 | 27d0378b | Simon Welzel | |
73 | /**
|
||
74 | * @brief Flag to enable/disable profiling API and logic.
|
||
75 | */
|
||
76 | #if !defined(OS_CFG_PROFILE)
|
||
77 | #define AMIROOS_CFG_PROFILE true |
||
78 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_PROFILE) */ |
79 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_PROFILE OS_CFG_PROFILE
|
80 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_PROFILE) */ |
81 | 27d0378b | Simon Welzel | |
82 | /**
|
||
83 | cda14729 | Thomas Schöpping | * @brief Mask for the control thread to listen to certain GPIO events.
|
84 | 8543d0d9 | Thomas Schöpping | * @note Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
|
85 | */
|
||
86 | cda14729 | Thomas Schöpping | #if !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK)
|
87 | #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK MODULE_OS_GPIOEVENTFLAG_USERBUTTON
|
||
88 | #else /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */ |
||
89 | #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK
|
||
90 | #endif /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */ |
||
91 | 8543d0d9 | Thomas Schöpping | |
92 | /**
|
||
93 | 27d0378b | Simon Welzel | * @brief Timeout value when waiting for events in the main loop in microseconds.
|
94 | * @details A value of 0 deactivates the timeout.
|
||
95 | */
|
||
96 | #if !defined(OS_CFG_MAIN_LOOP_TIMEOUT)
|
||
97 | #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT 0 |
||
98 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */ |
99 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT OS_CFG_MAIN_LOOP_TIMEOUT
|
100 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */ |
101 | 27d0378b | Simon Welzel | |
102 | /** @} */
|
||
103 | |||
104 | /*===========================================================================*/
|
||
105 | /**
|
||
106 | cda14729 | Thomas Schöpping | * @name Bootloader configuration
|
107 | * @{
|
||
108 | */
|
||
109 | /*===========================================================================*/
|
||
110 | |||
111 | /**
|
||
112 | * @brief Identifier of the instaled bootloader (if any).
|
||
113 | * @note See aos_bootloader.h file for a list of available settings.
|
||
114 | */
|
||
115 | 510b93cc | Thomas Schöpping | #if !defined(OS_CFG_BOOTLOADER)
|
116 | #define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_NONE
|
||
117 | #else /* !defined(OS_CFG_BOOTLOADER) */ |
||
118 | #define AMIROOS_CFG_BOOTLOADER OS_CFG_BOOTLOADER
|
||
119 | #endif /* !defined(OS_CFG_BOOTLOADER) */ |
||
120 | |||
121 | /** @} */
|
||
122 | cda14729 | Thomas Schöpping | |
123 | /*===========================================================================*/
|
||
124 | /**
|
||
125 | 27d0378b | Simon Welzel | * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
|
126 | * @{
|
||
127 | */
|
||
128 | /*===========================================================================*/
|
||
129 | |||
130 | /**
|
||
131 | * @brief Flag to enable SSSP.
|
||
132 | */
|
||
133 | #if !defined(OS_CFG_SSSP_ENABLE)
|
||
134 | 960338cc | Simon Welzel | #define AMIROOS_CFG_SSSP_ENABLE false |
135 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_SSSP_ENABLE) */ |
136 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_SSSP_ENABLE OS_CFG_SSSP_ENABLE
|
137 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_SSSP_ENABLE) */ |
138 | 27d0378b | Simon Welzel | |
139 | /**
|
||
140 | cda14729 | Thomas Schöpping | * @brief Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
|
141 | * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
|
||
142 | */
|
||
143 | #if !defined(OS_CFG_SSSP_STARTUP)
|
||
144 | #define AMIROOS_CFG_SSSP_STARTUP false |
||
145 | #else
|
||
146 | #define AMIROOS_CFG_SSSP_STARTUP OS_CFG_SSSP_STARTUP
|
||
147 | #endif
|
||
148 | |||
149 | /**
|
||
150 | * @brief Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
|
||
151 | * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
|
||
152 | */
|
||
153 | #if !defined(OS_CFG_SSSP_SHUTDOWN)
|
||
154 | #define AMIROOS_CFG_SSSP_SHUTDOWN false |
||
155 | #else
|
||
156 | #define AMIROOS_CFG_SSSP_SHUTDOWN OS_CFG_SSSP_SHUTDOWN
|
||
157 | #endif
|
||
158 | |||
159 | /**
|
||
160 | * @brief Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
|
||
161 | * @brief In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
|
||
162 | */
|
||
163 | #if !defined(OS_CFG_SSSP_MSI)
|
||
164 | #define AMIROOS_CFG_SSSP_MSI false |
||
165 | #else
|
||
166 | #define AMIROOS_CFG_SSSP_MSI OS_CFG_SSSP_MSI
|
||
167 | #endif
|
||
168 | |||
169 | /**
|
||
170 | * @brief Width of the @p aos_sssp_moduleid_t type.
|
||
171 | c53ef0b1 | Thomas Schöpping | * @details Possible settings are 8, 16, 32 and 64.
|
172 | cda14729 | Thomas Schöpping | */
|
173 | #if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
|
||
174 | #define AMIROOS_CFG_SSSP_MODULEIDWIDTH 16 |
||
175 | #else
|
||
176 | #define AMIROOS_CFG_SSSP_MODULEIDWIDTH OS_CFG_SSSP_MODULEIDWIDTH
|
||
177 | #endif
|
||
178 | |||
179 | /**
|
||
180 | 27d0378b | Simon Welzel | * @brief Flag to set the module as SSSP master.
|
181 | * @details There must be only one module with this flag set to true in a system.
|
||
182 | */
|
||
183 | #if !defined(OS_CFG_SSSP_MASTER)
|
||
184 | 8543d0d9 | Thomas Schöpping | #define AMIROOS_CFG_SSSP_MASTER false |
185 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_SSSP_MASTER) */ |
186 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_SSSP_MASTER OS_CFG_SSSP_MASTER
|
187 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_SSSP_MASTER) */ |
188 | 27d0378b | Simon Welzel | |
189 | /**
|
||
190 | * @brief Flag to set the module to be the first in the stack.
|
||
191 | * @details There must be only one module with this flag set to true in a system.
|
||
192 | */
|
||
193 | #if !defined(OS_CFG_SSSP_STACK_START)
|
||
194 | 8543d0d9 | Thomas Schöpping | #define AMIROOS_CFG_SSSP_STACK_START false |
195 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_SSSP_STACK_START) */ |
196 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_SSSP_STACK_START OS_CFG_SSSP_STACK_START
|
197 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_SSSP_STACK_START) */ |
198 | 27d0378b | Simon Welzel | |
199 | /**
|
||
200 | * @brief Flag to set the module to be the last in the stack.
|
||
201 | * @details There must be only one module with this flag set to true in a system.
|
||
202 | */
|
||
203 | #if !defined(OS_CFG_SSSP_STACK_END)
|
||
204 | 8543d0d9 | Thomas Schöpping | #define AMIROOS_CFG_SSSP_STACK_END false |
205 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_SSSP_STACK_END) */ |
206 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_SSSP_STACK_END OS_CFG_SSSP_STACK_END
|
207 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_SSSP_STACK_END) */ |
208 | 27d0378b | Simon Welzel | |
209 | /**
|
||
210 | * @brief Delay time (in microseconds) how long a SSSP signal must be active.
|
||
211 | */
|
||
212 | #if !defined(OS_CFG_SSSP_SIGNALDELAY)
|
||
213 | #define AMIROOS_CFG_SSSP_SIGNALDELAY 1000 |
||
214 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_SSSP_SIGNALDELAY) */ |
215 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_SSSP_SIGNALDELAY OS_CFG_SSSP_SIGNALDELAY
|
216 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_SSSP_SIGNALDELAY) */ |
217 | 27d0378b | Simon Welzel | |
218 | /**
|
||
219 | * @brief Time boundary for robot wide clock synchronization in microseconds.
|
||
220 | * @details Whenever the SSSP S (snychronization) signal gets logically deactivated,
|
||
221 | * All modules need to align their local uptime to the nearest multiple of this value.
|
||
222 | */
|
||
223 | #if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
|
||
224 | #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD 1000000 |
||
225 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */ |
226 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD OS_CFG_SSSP_SYSSYNCPERIOD
|
227 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */ |
228 | 27d0378b | Simon Welzel | |
229 | /** @} */
|
||
230 | |||
231 | /*===========================================================================*/
|
||
232 | /**
|
||
233 | * @name System shell options
|
||
234 | * @{
|
||
235 | */
|
||
236 | /*===========================================================================*/
|
||
237 | |||
238 | /**
|
||
239 | * @brief Shell enable flag.
|
||
240 | */
|
||
241 | 8543d0d9 | Thomas Schöpping | #if !defined(OS_CFG_SHELL_ENABLE)
|
242 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_SHELL_ENABLE true |
243 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_SHELL_ENABLE) */ |
244 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_SHELL_ENABLE OS_CFG_SHELL_ENABLE
|
245 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_SHELL_ENABLE) */ |
246 | 27d0378b | Simon Welzel | |
247 | /**
|
||
248 | * @brief Shell thread stack size.
|
||
249 | */
|
||
250 | #if !defined(OS_CFG_SHELL_STACKSIZE)
|
||
251 | #define AMIROOS_CFG_SHELL_STACKSIZE 1024 |
||
252 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_SHELL_STACKSIZE) */ |
253 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_SHELL_STACKSIZE OS_CFG_SHELL_STACKSIZE
|
254 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_SHELL_STACKSIZE) */ |
255 | 27d0378b | Simon Welzel | |
256 | /**
|
||
257 | * @brief Shell thread priority.
|
||
258 | * @details Thread priorities are specified as an integer value.
|
||
259 | * Predefined ranges are:
|
||
260 | * lowest ┌ THD_LOWPRIO_MIN
|
||
261 | * │ ...
|
||
262 | * └ THD_LOWPRIO_MAX
|
||
263 | * ┌ THD_NORMALPRIO_MIN
|
||
264 | * │ ...
|
||
265 | * └ THD_NORMALPRIO_MAX
|
||
266 | * ┌ THD_HIGHPRIO_MIN
|
||
267 | * │ ...
|
||
268 | * └ THD_HIGHPRIO_MAX
|
||
269 | * ┌ THD_RTPRIO_MIN
|
||
270 | * │ ...
|
||
271 | * highest └ THD_RTPRIO_MAX
|
||
272 | */
|
||
273 | #if !defined(OS_CFG_SHELL_THREADPRIO)
|
||
274 | #define AMIROOS_CFG_SHELL_THREADPRIO AOS_THD_NORMALPRIO_MIN
|
||
275 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_SHELL_THREADPRIO) */ |
276 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_SHELL_THREADPRIO OS_CFG_SHELL_THREADPRIO
|
277 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_SHELL_THREADPRIO) */ |
278 | 27d0378b | Simon Welzel | |
279 | /**
|
||
280 | * @brief Shell maximum input line length.
|
||
281 | */
|
||
282 | #if !defined(OS_CFG_SHELL_LINEWIDTH)
|
||
283 | cc33217b | Thomas Schöpping | #define AMIROOS_CFG_SHELL_LINEWIDTH 80 |
284 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_SHELL_LINEWIDTH) */ |
285 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_SHELL_LINEWIDTH OS_CFG_SHELL_LINEWIDTH
|
286 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_SHELL_LINEWIDTH) */ |
287 | 27d0378b | Simon Welzel | |
288 | /**
|
||
289 | * @brief Shell maximum number of arguments.
|
||
290 | */
|
||
291 | #if !defined(OS_CFG_SHELL_MAXARGS)
|
||
292 | cc33217b | Thomas Schöpping | #define AMIROOS_CFG_SHELL_MAXARGS 8 |
293 | 7de0cc90 | Thomas Schöpping | #else /* !defined(OS_CFG_SHELL_MAXARGS) */ |
294 | 27d0378b | Simon Welzel | #define AMIROOS_CFG_SHELL_MAXARGS OS_CFG_SHELL_MAXARGS
|
295 | 7de0cc90 | Thomas Schöpping | #endif /* !defined(OS_CFG_SHELL_MAXARGS) */ |
296 | 27d0378b | Simon Welzel | |
297 | /** @} */
|
||
298 | |||
299 | 6ff06bbf | Thomas Schöpping | #endif /* AOSCONF_H */ |
300 | 27d0378b | Simon Welzel | |
301 | /** @} */ |