Statistics
| Branch: | Tag: | Revision:

amiro-os / modules / NUCLEO-F401RE / aosconf.h @ cda14729

History | View | Annotate | Download (10.104 KB)

1
/*
2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2019  Thomas Schöpping et al.
4

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
 * @file
21
 * @brief   AMiRo-OS Configuration file for the NUCLEO-F401RE module.
22
 * @details Contains the application specific AMiRo-OS settings.
23
 *
24
 * @addtogroup NUCLEO-F401RE_aos_config
25
 * @{
26
 */
27

    
28
#ifndef AOSCONF_H
29
#define AOSCONF_H
30

    
31
/*
32
 * compatibility guards
33
 */
34
#define _AMIRO_OS_CFG_
35
#define AMIRO_OS_CFG_VERSION_MAJOR              2
36
#define AMIRO_OS_CFG_VERSION_MINOR              1
37

    
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
#endif /* defined(AMIRO_APPS) && (AMIRO_APPS == true) */
46

    
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
#else /* !defined(OS_CFG_DBG) */
60
  #define AMIROOS_CFG_DBG                       OS_CFG_DBG
61
#endif /* !defined(OS_CFG_DBG) */
62

    
63
/**
64
 * @brief   Flag to enable/disable unit tests.
65
 * @note    Setting this flag will implicitely enable the shell.
66
 */
67
#if !defined(OS_CFG_TESTS_ENABLE)
68
  #define AMIROOS_CFG_TESTS_ENABLE              true
69
#else /* !defined(OS_CFG_TESTS_ENABLE) */
70
  #define AMIROOS_CFG_TESTS_ENABLE              OS_CFG_TESTS_ENABLE
71
#endif /* !defined(OS_CFG_TESTS_ENABLE) */
72

    
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
#else /* !defined(OS_CFG_PROFILE) */
79
  #define AMIROOS_CFG_PROFILE                   OS_CFG_PROFILE
80
#endif /* !defined(OS_CFG_PROFILE) */
81

    
82
/**
83
 * @brief   Mask for the control thread to listen to certain GPIO events.
84
 * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
85
 */
86
#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

    
92
/**
93
 * @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
#else /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
99
  #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         OS_CFG_MAIN_LOOP_TIMEOUT
100
#endif /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
101

    
102
/** @} */
103

    
104
/*===========================================================================*/
105
/**
106
 * @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
#define AMIROOS_CFG_BOOTLOADER                  AOS_BOOTLOADER_NONE
116

    
117
/*===========================================================================*/
118
/**
119
 * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
120
 * @{
121
 */
122
/*===========================================================================*/
123

    
124
/**
125
 * @brief   Flag to enable SSSP.
126
 */
127
#if !defined(OS_CFG_SSSP_ENABLE)
128
  #define AMIROOS_CFG_SSSP_ENABLE               false
129
#else /* !defined(OS_CFG_SSSP_ENABLE) */
130
  #define AMIROOS_CFG_SSSP_ENABLE               OS_CFG_SSSP_ENABLE
131
#endif /* !defined(OS_CFG_SSSP_ENABLE) */
132

    
133
/**
134
 * @brief   Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
135
 * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
136
 */
137
#if !defined(OS_CFG_SSSP_STARTUP)
138
  #define AMIROOS_CFG_SSSP_STARTUP              false
139
#else
140
  #define AMIROOS_CFG_SSSP_STARTUP              OS_CFG_SSSP_STARTUP
141
#endif
142

    
143
/**
144
 * @brief   Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
145
 * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
146
 */
147
#if !defined(OS_CFG_SSSP_SHUTDOWN)
148
  #define AMIROOS_CFG_SSSP_SHUTDOWN             false
149
#else
150
  #define AMIROOS_CFG_SSSP_SHUTDOWN             OS_CFG_SSSP_SHUTDOWN
151
#endif
152

    
153
/**
154
 * @brief   Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
155
 * @brief   In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
156
 */
157
#if !defined(OS_CFG_SSSP_MSI)
158
  #define AMIROOS_CFG_SSSP_MSI                  false
159
#else
160
  #define AMIROOS_CFG_SSSP_MSI                  OS_CFG_SSSP_MSI
161
#endif
162

    
163
/**
164
 * @brief   Width of the @p aos_sssp_moduleid_t type.
165
 * @details Possible settings are 8, 16 and 32.
166
 */
167
#if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
168
  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        16
169
#else
170
  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        OS_CFG_SSSP_MODULEIDWIDTH
171
#endif
172

    
173
/**
174
 * @brief   Flag to set the module as SSSP master.
175
 * @details There must be only one module with this flag set to true in a system.
176
 */
177
#if !defined(OS_CFG_SSSP_MASTER)
178
  #define AMIROOS_CFG_SSSP_MASTER               false
179
#else /* !defined(OS_CFG_SSSP_MASTER) */
180
  #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
181
#endif /* !defined(OS_CFG_SSSP_MASTER) */
182

    
183
/**
184
 * @brief   Flag to set the module to be the first in the stack.
185
 * @details There must be only one module with this flag set to true in a system.
186
 */
187
#if !defined(OS_CFG_SSSP_STACK_START)
188
  #define AMIROOS_CFG_SSSP_STACK_START          false
189
#else /* !defined(OS_CFG_SSSP_STACK_START) */
190
  #define AMIROOS_CFG_SSSP_STACK_START          OS_CFG_SSSP_STACK_START
191
#endif /* !defined(OS_CFG_SSSP_STACK_START) */
192

    
193
/**
194
 * @brief   Flag to set the module to be the last in the stack.
195
 * @details There must be only one module with this flag set to true in a system.
196
 */
197
#if !defined(OS_CFG_SSSP_STACK_END)
198
  #define AMIROOS_CFG_SSSP_STACK_END            false
199
#else /* !defined(OS_CFG_SSSP_STACK_END) */
200
  #define AMIROOS_CFG_SSSP_STACK_END            OS_CFG_SSSP_STACK_END
201
#endif /* !defined(OS_CFG_SSSP_STACK_END) */
202

    
203
/**
204
 * @brief   Delay time (in microseconds) how long a SSSP signal must be active.
205
 */
206
#if !defined(OS_CFG_SSSP_SIGNALDELAY)
207
  #define AMIROOS_CFG_SSSP_SIGNALDELAY          1000
208
#else /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
209
  #define AMIROOS_CFG_SSSP_SIGNALDELAY          OS_CFG_SSSP_SIGNALDELAY
210
#endif /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
211

    
212
/**
213
 * @brief   Time boundary for robot wide clock synchronization in microseconds.
214
 * @details Whenever the SSSP S (snychronization) signal gets logically deactivated,
215
 *          All modules need to align their local uptime to the nearest multiple of this value.
216
 */
217
#if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
218
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
219
#else /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
220
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
221
#endif /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
222

    
223
/** @} */
224

    
225
/*===========================================================================*/
226
/**
227
 * @name System shell options
228
 * @{
229
 */
230
/*===========================================================================*/
231

    
232
/**
233
 * @brief   Shell enable flag.
234
 */
235
#if !defined(OS_CFG_SHELL_ENABLE)
236
  #define AMIROOS_CFG_SHELL_ENABLE              true
237
#else /* !defined(OS_CFG_SHELL_ENABLE) */
238
  #define AMIROOS_CFG_SHELL_ENABLE              OS_CFG_SHELL_ENABLE
239
#endif /* !defined(OS_CFG_SHELL_ENABLE) */
240

    
241
/**
242
 * @brief   Shell thread stack size.
243
 */
244
#if !defined(OS_CFG_SHELL_STACKSIZE)
245
  #define AMIROOS_CFG_SHELL_STACKSIZE           1024
246
#else /* !defined(OS_CFG_SHELL_STACKSIZE) */
247
  #define AMIROOS_CFG_SHELL_STACKSIZE           OS_CFG_SHELL_STACKSIZE
248
#endif /* !defined(OS_CFG_SHELL_STACKSIZE) */
249

    
250
/**
251
 * @brief   Shell thread priority.
252
 * @details Thread priorities are specified as an integer value.
253
 *          Predefined ranges are:
254
 *            lowest  ┌ THD_LOWPRIO_MIN
255
 *                    │ ...
256
 *                    └ THD_LOWPRIO_MAX
257
 *                    ┌ THD_NORMALPRIO_MIN
258
 *                    │ ...
259
 *                    └ THD_NORMALPRIO_MAX
260
 *                    ┌ THD_HIGHPRIO_MIN
261
 *                    │ ...
262
 *                    └ THD_HIGHPRIO_MAX
263
 *                    ┌ THD_RTPRIO_MIN
264
 *                    │ ...
265
 *            highest └ THD_RTPRIO_MAX
266
 */
267
#if !defined(OS_CFG_SHELL_THREADPRIO)
268
  #define AMIROOS_CFG_SHELL_THREADPRIO          AOS_THD_NORMALPRIO_MIN
269
#else /* !defined(OS_CFG_SHELL_THREADPRIO) */
270
  #define AMIROOS_CFG_SHELL_THREADPRIO          OS_CFG_SHELL_THREADPRIO
271
#endif /* !defined(OS_CFG_SHELL_THREADPRIO) */
272

    
273
/**
274
 * @brief   Shell maximum input line length.
275
 */
276
#if !defined(OS_CFG_SHELL_LINEWIDTH)
277
  #define AMIROOS_CFG_SHELL_LINEWIDTH           80
278
#else /* !defined(OS_CFG_SHELL_LINEWIDTH) */
279
  #define AMIROOS_CFG_SHELL_LINEWIDTH           OS_CFG_SHELL_LINEWIDTH
280
#endif /* !defined(OS_CFG_SHELL_LINEWIDTH) */
281

    
282
/**
283
 * @brief   Shell maximum number of arguments.
284
 */
285
#if !defined(OS_CFG_SHELL_MAXARGS)
286
  #define AMIROOS_CFG_SHELL_MAXARGS             8
287
#else /* !defined(OS_CFG_SHELL_MAXARGS) */
288
  #define AMIROOS_CFG_SHELL_MAXARGS             OS_CFG_SHELL_MAXARGS
289
#endif /* !defined(OS_CFG_SHELL_MAXARGS) */
290

    
291
/** @} */
292

    
293
#endif /* AOSCONF_H */
294

    
295
/** @} */