Statistics
| Branch: | Tag: | Revision:

amiro-os / modules / PowerManagement_1-1 / aosconf.h @ cda14729

History | View | Annotate | Download (10.094 KB)

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

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 53710ca3 Marc Rothmann
/**
20 2920c6b7 Thomas Schöpping
 * @file
21 53710ca3 Marc Rothmann
 * @brief   AMiRo-OS Configuration file for the PowerManagement v1.1 module.
22
 * @details Contains the application specific AMiRo-OS settings.
23
 *
24
 * @addtogroup powermanagement_aos_config
25
 * @{
26
 */
27
28 6ff06bbf Thomas Schöpping
#ifndef AOSCONF_H
29
#define AOSCONF_H
30 e545e620 Thomas Schöpping
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 e545e620 Thomas Schöpping
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 e545e620 Thomas Schöpping
47 6b53f6bf Thomas Schöpping
/*===========================================================================*/
48 e545e620 Thomas Schöpping
/**
49 6b53f6bf Thomas Schöpping
 * @name Kernel parameters and options
50
 * @{
51 e545e620 Thomas Schöpping
 */
52 6b53f6bf Thomas Schöpping
/*===========================================================================*/
53 e545e620 Thomas Schöpping
54
/**
55 3e1a9c79 Thomas Schöpping
 * @brief   Flag to enable/disable debug API and logic.
56 e545e620 Thomas Schöpping
 */
57
#if !defined(OS_CFG_DBG)
58
  #define AMIROOS_CFG_DBG                       true
59 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_DBG) */
60 e545e620 Thomas Schöpping
  #define AMIROOS_CFG_DBG                       OS_CFG_DBG
61 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_DBG) */
62 e545e620 Thomas Schöpping
63
/**
64
 * @brief   Flag to enable/disable unit tests.
65 2dd2e257 Thomas Schöpping
 * @note    Setting this flag will implicitely enable the shell.
66 e545e620 Thomas Schöpping
 */
67
#if !defined(OS_CFG_TESTS_ENABLE)
68
  #define AMIROOS_CFG_TESTS_ENABLE              true
69 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_TESTS_ENABLE) */
70 e545e620 Thomas Schöpping
  #define AMIROOS_CFG_TESTS_ENABLE              OS_CFG_TESTS_ENABLE
71 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_TESTS_ENABLE) */
72 e545e620 Thomas Schöpping
73
/**
74 3e1a9c79 Thomas Schöpping
 * @brief   Flag to enable/disable profiling API and logic.
75 e545e620 Thomas Schöpping
 */
76
#if !defined(OS_CFG_PROFILE)
77
  #define AMIROOS_CFG_PROFILE                   true
78 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_PROFILE) */
79 e545e620 Thomas Schöpping
  #define AMIROOS_CFG_PROFILE                   OS_CFG_PROFILE
80 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_PROFILE) */
81 e545e620 Thomas Schöpping
82
/**
83 cda14729 Thomas Schöpping
 * @brief   Mask for the control thread to listen to certain GPIO events.
84 2920c6b7 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 0
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 2920c6b7 Thomas Schöpping
92
/**
93 e545e620 Thomas Schöpping
 * @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 e545e620 Thomas Schöpping
  #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         OS_CFG_MAIN_LOOP_TIMEOUT
100 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
101 e545e620 Thomas Schöpping
102
/** @} */
103
104
/*===========================================================================*/
105 6b53f6bf Thomas Schöpping
/**
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
#define AMIROOS_CFG_BOOTLOADER                  AOS_BOOTLOADER_AMiRoBLT
116
117
/** @} */
118
119
/*===========================================================================*/
120
/**
121 6b53f6bf Thomas Schöpping
 * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
122
 * @{
123
 */
124
/*===========================================================================*/
125
126
/**
127 9ebb11a9 Thomas Schöpping
 * @brief   Flag to enable SSSP.
128
 */
129
#if !defined(OS_CFG_SSSP_ENABLE)
130
  #define AMIROOS_CFG_SSSP_ENABLE               true
131 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_SSSP_ENABLE) */
132 9ebb11a9 Thomas Schöpping
  #define AMIROOS_CFG_SSSP_ENABLE               OS_CFG_SSSP_ENABLE
133 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_SSSP_ENABLE) */
134 9ebb11a9 Thomas Schöpping
135
/**
136 cda14729 Thomas Schöpping
 * @brief   Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
137
 * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
138
 */
139
#if !defined(OS_CFG_SSSP_STARTUP)
140
  #define AMIROOS_CFG_SSSP_STARTUP              false
141
#else
142
  #define AMIROOS_CFG_SSSP_STARTUP              OS_CFG_SSSP_STARTUP
143
#endif
144
145
/**
146
 * @brief   Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
147
 * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
148
 */
149
#if !defined(OS_CFG_SSSP_SHUTDOWN)
150
  #define AMIROOS_CFG_SSSP_SHUTDOWN             false
151
#else
152
  #define AMIROOS_CFG_SSSP_SHUTDOWN             OS_CFG_SSSP_SHUTDOWN
153
#endif
154
155
/**
156
 * @brief   Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
157
 * @brief   In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
158
 */
159
#if !defined(OS_CFG_SSSP_MSI)
160
  #define AMIROOS_CFG_SSSP_MSI                  false
161
#else
162
  #define AMIROOS_CFG_SSSP_MSI                  OS_CFG_SSSP_MSI
163
#endif
164
165
/**
166
 * @brief   Width of the @p aos_sssp_moduleid_t type.
167
 * @details Possible settings are 8, 16 and 32.
168
 */
169
#if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
170
  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        16
171
#else
172
  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        OS_CFG_SSSP_MODULEIDWIDTH
173
#endif
174
175
/**
176 6b53f6bf Thomas Schöpping
 * @brief   Flag to set the module as SSSP master.
177
 * @details There must be only one module with this flag set to true in a system.
178
 */
179
#if !defined(OS_CFG_SSSP_MASTER)
180
  #define AMIROOS_CFG_SSSP_MASTER               true
181 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_SSSP_MASTER) */
182 6b53f6bf Thomas Schöpping
  #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
183 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_SSSP_MASTER) */
184 6b53f6bf Thomas Schöpping
185
/**
186 933df08e Thomas Schöpping
 * @brief   Flag to set the module to be the first in the stack.
187
 * @details There must be only one module with this flag set to true in a system.
188
 */
189
#if !defined(OS_CFG_SSSP_STACK_START)
190
  #define AMIROOS_CFG_SSSP_STACK_START          false
191 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_SSSP_STACK_START) */
192 933df08e Thomas Schöpping
  #define AMIROOS_CFG_SSSP_STACK_START          OS_CFG_SSSP_STACK_START
193 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_SSSP_STACK_START) */
194 933df08e Thomas Schöpping
195
/**
196
 * @brief   Flag to set the module to be the last in the stack.
197
 * @details There must be only one module with this flag set to true in a system.
198
 */
199
#if !defined(OS_CFG_SSSP_STACK_END)
200
  #define AMIROOS_CFG_SSSP_STACK_END            false
201 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_SSSP_STACK_END) */
202 933df08e Thomas Schöpping
  #define AMIROOS_CFG_SSSP_STACK_END            OS_CFG_SSSP_STACK_END
203 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_SSSP_STACK_END) */
204 933df08e Thomas Schöpping
205
/**
206
 * @brief   Delay time (in microseconds) how long a SSSP signal must be active.
207
 */
208
#if !defined(OS_CFG_SSSP_SIGNALDELAY)
209
  #define AMIROOS_CFG_SSSP_SIGNALDELAY          1000
210 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
211 933df08e Thomas Schöpping
  #define AMIROOS_CFG_SSSP_SIGNALDELAY          OS_CFG_SSSP_SIGNALDELAY
212 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
213 933df08e Thomas Schöpping
214
/**
215 6b53f6bf Thomas Schöpping
 * @brief   Time boundary for robot wide clock synchronization in microseconds.
216
 * @details Whenever the SSSP S (snychronization) signal gets logically deactivated,
217
 *          All modules need to align their local uptime to the nearest multiple of this value.
218
 */
219
#if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
220
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
221 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
222 6b53f6bf Thomas Schöpping
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
223 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
224 6b53f6bf Thomas Schöpping
225
/** @} */
226
227
/*===========================================================================*/
228 e545e620 Thomas Schöpping
/**
229
 * @name System shell options
230
 * @{
231
 */
232
/*===========================================================================*/
233
234
/**
235
 * @brief   Shell enable flag.
236
 */
237 2dd2e257 Thomas Schöpping
#if !defined(OS_CFG_SHELL_ENABLE)
238 e545e620 Thomas Schöpping
  #define AMIROOS_CFG_SHELL_ENABLE              true
239 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_SHELL_ENABLE) */
240 e545e620 Thomas Schöpping
  #define AMIROOS_CFG_SHELL_ENABLE              OS_CFG_SHELL_ENABLE
241 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_SHELL_ENABLE) */
242 e545e620 Thomas Schöpping
243
/**
244
 * @brief   Shell thread stack size.
245
 */
246
#if !defined(OS_CFG_SHELL_STACKSIZE)
247
  #define AMIROOS_CFG_SHELL_STACKSIZE           1024
248 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_SHELL_STACKSIZE) */
249 e545e620 Thomas Schöpping
  #define AMIROOS_CFG_SHELL_STACKSIZE           OS_CFG_SHELL_STACKSIZE
250 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_SHELL_STACKSIZE) */
251 e545e620 Thomas Schöpping
252
/**
253 20205a98 Thomas Schöpping
 * @brief   Shell thread priority.
254 512abac1 Thomas Schöpping
 * @details Thread priorities are specified as an integer value.
255
 *          Predefined ranges are:
256
 *            lowest  ┌ THD_LOWPRIO_MIN
257
 *                    │ ...
258
 *                    └ THD_LOWPRIO_MAX
259
 *                    ┌ THD_NORMALPRIO_MIN
260
 *                    │ ...
261
 *                    └ THD_NORMALPRIO_MAX
262
 *                    ┌ THD_HIGHPRIO_MIN
263
 *                    │ ...
264
 *                    └ THD_HIGHPRIO_MAX
265
 *                    ┌ THD_RTPRIO_MIN
266
 *                    │ ...
267
 *            highest └ THD_RTPRIO_MAX
268 20205a98 Thomas Schöpping
 */
269
#if !defined(OS_CFG_SHELL_THREADPRIO)
270 512abac1 Thomas Schöpping
  #define AMIROOS_CFG_SHELL_THREADPRIO          AOS_THD_NORMALPRIO_MIN
271 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_SHELL_THREADPRIO) */
272 20205a98 Thomas Schöpping
  #define AMIROOS_CFG_SHELL_THREADPRIO          OS_CFG_SHELL_THREADPRIO
273 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_SHELL_THREADPRIO) */
274 20205a98 Thomas Schöpping
275
/**
276 e545e620 Thomas Schöpping
 * @brief   Shell maximum input line length.
277
 */
278
#if !defined(OS_CFG_SHELL_LINEWIDTH)
279 cc33217b Thomas Schöpping
  #define AMIROOS_CFG_SHELL_LINEWIDTH           80
280 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_SHELL_LINEWIDTH) */
281 e545e620 Thomas Schöpping
  #define AMIROOS_CFG_SHELL_LINEWIDTH           OS_CFG_SHELL_LINEWIDTH
282 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_SHELL_LINEWIDTH) */
283 e545e620 Thomas Schöpping
284
/**
285
 * @brief   Shell maximum number of arguments.
286
 */
287
#if !defined(OS_CFG_SHELL_MAXARGS)
288 cc33217b Thomas Schöpping
  #define AMIROOS_CFG_SHELL_MAXARGS             8
289 7de0cc90 Thomas Schöpping
#else /* !defined(OS_CFG_SHELL_MAXARGS) */
290 e545e620 Thomas Schöpping
  #define AMIROOS_CFG_SHELL_MAXARGS             OS_CFG_SHELL_MAXARGS
291 7de0cc90 Thomas Schöpping
#endif /* !defined(OS_CFG_SHELL_MAXARGS) */
292 e545e620 Thomas Schöpping
293
/** @} */
294
295 6ff06bbf Thomas Schöpping
#endif /* AOSCONF_H */
296 e545e620 Thomas Schöpping
297 53710ca3 Marc Rothmann
/** @} */