Revision 0128be0f
| kernel/ChibiOS | ||
|---|---|---|
| 1 |
Subproject commit 6494e27fd86fc8b674547e0740dbba1a3b1d5f35 |
|
| 1 |
Subproject commit d9a22f36378a8898ce95c3ad807aff622a2fb2a1 |
|
| modules/DiWheelDrive_1-1/Makefile | ||
|---|---|---|
| 132 | 132 |
include $(CHIBIOS)/os/rt/rt.mk |
| 133 | 133 |
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk |
| 134 | 134 |
# Other files (optional). |
| 135 |
include $(CHIBIOS)/test/rt/test.mk |
|
| 135 |
include $(CHIBIOS)/test/lib/test.mk |
|
| 136 |
include $(CHIBIOS)/test/rt/rt_test.mk |
|
| 136 | 137 |
# AMiRo-BLT files |
| 137 | 138 |
include ../../bootloader/bootloader.mk |
| 138 | 139 |
# AMiRo-LLD files |
| modules/DiWheelDrive_1-1/chconf.h | ||
|---|---|---|
| 1 |
/* |
|
| 2 |
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform. |
|
| 3 |
Copyright (C) 2016..2018 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 os/modules/DiWheelDrive/chconf.h |
|
| 21 |
* @brief ChibiOS Configuration file for the DiWheelDrive v1.1 module. |
|
| 22 |
* @details Contains the application specific kernel settings. |
|
| 23 |
* |
|
| 24 |
* @addtogroup config |
|
| 25 |
* @details Kernel related settings and hooks. |
|
| 26 |
* @{
|
|
| 27 |
*/ |
|
| 28 |
|
|
| 29 |
#ifndef _CHCONF_H_ |
|
| 30 |
#define _CHCONF_H_ |
|
| 31 |
|
|
| 32 |
#include <aosconf.h> |
|
| 33 |
|
|
| 34 |
/*===========================================================================*/ |
|
| 35 |
/** |
|
| 36 |
* @name System timers settings |
|
| 37 |
* @{
|
|
| 38 |
*/ |
|
| 39 |
/*===========================================================================*/ |
|
| 40 |
|
|
| 41 |
/** |
|
| 42 |
* @brief System time counter resolution. |
|
| 43 |
* @note Allowed values are 16 or 32 bits. |
|
| 44 |
*/ |
|
| 45 |
#define CH_CFG_ST_RESOLUTION 16 |
|
| 46 |
|
|
| 47 |
/** |
|
| 48 |
* @brief System tick frequency. |
|
| 49 |
* @details Frequency of the system timer that drives the system ticks. This |
|
| 50 |
* setting also defines the system tick time unit. |
|
| 51 |
*/ |
|
| 52 |
#if (AMIROOS_CFG_TESTS_ENABLE != true) || defined(__DOXYGEN__) |
|
| 53 |
#define CH_CFG_ST_FREQUENCY 1000000UL |
|
| 54 |
#else |
|
| 55 |
#define CH_CFG_ST_FREQUENCY 100000UL |
|
| 56 |
#endif |
|
| 57 |
|
|
| 58 |
/** |
|
| 59 |
* @brief Time delta constant for the tick-less mode. |
|
| 60 |
* @note If this value is zero then the system uses the classic |
|
| 61 |
* periodic tick. This value represents the minimum number |
|
| 62 |
* of ticks that is safe to specify in a timeout directive. |
|
| 63 |
* The value one is not valid, timeouts are rounded up to |
|
| 64 |
* this value. |
|
| 65 |
*/ |
|
| 66 |
#if (AMIROOS_CFG_TESTS_ENABLE != true) || defined(__DOXYGEN__) |
|
| 67 |
#define CH_CFG_ST_TIMEDELTA 20 |
|
| 68 |
#else |
|
| 69 |
#define CH_CFG_ST_TIMEDELTA 2 |
|
| 70 |
#endif |
|
| 71 |
|
|
| 72 |
/** @} */ |
|
| 73 |
|
|
| 74 |
/*===========================================================================*/ |
|
| 75 |
/** |
|
| 76 |
* @name Port specific settings |
|
| 77 |
* @{
|
|
| 78 |
*/ |
|
| 79 |
/*===========================================================================*/ |
|
| 80 |
|
|
| 81 |
/** |
|
| 82 |
* @brief NVIC VTOR initialization offset. |
|
| 83 |
* @details On initialization, the code at this address in the flash memory will be executed. |
|
| 84 |
*/ |
|
| 85 |
#define CORTEX_VTOR_INIT 0x00006000U |
|
| 86 |
|
|
| 87 |
/** @} */ |
|
| 88 |
|
|
| 89 |
#include <aos_chconf.h> |
|
| 90 |
|
|
| 91 |
#endif /* _CHCONF_H_ */ |
|
| 92 |
|
|
| 93 |
/** @} */ |
|
| 1 |
/* |
|
| 2 |
* AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform. |
|
| 3 |
* Copyright (C) 2016..2018 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 os/modules/DiWheelDrive/chconf.h |
|
| 21 |
* @brief ChibiOS Configuration file for the DiWheelDrive v1.1 module. |
|
| 22 |
* @details Contains the application specific kernel settings. |
|
| 23 |
* |
|
| 24 |
* @addtogroup config |
|
| 25 |
* @details Kernel related settings and hooks. |
|
| 26 |
* @{
|
|
| 27 |
*/ |
|
| 28 |
|
|
| 29 |
#ifndef CHCONF_H |
|
| 30 |
#define CHCONF_H |
|
| 31 |
|
|
| 32 |
#define _CHIBIOS_RT_CONF_ |
|
| 33 |
#define _CHIBIOS_RT_CONF_VER_5_1_ |
|
| 34 |
|
|
| 35 |
/*===========================================================================*/ |
|
| 36 |
/** |
|
| 37 |
* @name System timers settings |
|
| 38 |
* @{
|
|
| 39 |
*/ |
|
| 40 |
/*===========================================================================*/ |
|
| 41 |
|
|
| 42 |
/** |
|
| 43 |
* @brief System time counter resolution. |
|
| 44 |
* @note Allowed values are 16 or 32 bits. |
|
| 45 |
*/ |
|
| 46 |
#if !defined(CH_CFG_ST_RESOLUTION) |
|
| 47 |
#define CH_CFG_ST_RESOLUTION 16 |
|
| 48 |
#endif |
|
| 49 |
|
|
| 50 |
/** |
|
| 51 |
* @brief System tick frequency. |
|
| 52 |
* @details Frequency of the system timer that drives the system ticks. This |
|
| 53 |
* setting also defines the system tick time unit. |
|
| 54 |
*/ |
|
| 55 |
#if !defined(CH_CFG_ST_FREQUENCY) |
|
| 56 |
#define CH_CFG_ST_FREQUENCY 1000000UL |
|
| 57 |
#endif |
|
| 58 |
|
|
| 59 |
/** |
|
| 60 |
* @brief Time intervals data size. |
|
| 61 |
* @note Allowed values are 16, 32 or 64 bits. |
|
| 62 |
*/ |
|
| 63 |
#if !defined(CH_CFG_INTERVALS_SIZE) |
|
| 64 |
#define CH_CFG_INTERVALS_SIZE 64 |
|
| 65 |
#endif |
|
| 66 |
|
|
| 67 |
/** |
|
| 68 |
* @brief Time types data size. |
|
| 69 |
* @note Allowed values are 16 or 32 bits. |
|
| 70 |
*/ |
|
| 71 |
#if !defined(CH_CFG_TIME_TYPES_SIZE) |
|
| 72 |
#define CH_CFG_TIME_TYPES_SIZE 32 |
|
| 73 |
#endif |
|
| 74 |
|
|
| 75 |
/** |
|
| 76 |
* @brief Time delta constant for the tick-less mode. |
|
| 77 |
* @note If this value is zero then the system uses the classic |
|
| 78 |
* periodic tick. This value represents the minimum number |
|
| 79 |
* of ticks that is safe to specify in a timeout directive. |
|
| 80 |
* The value one is not valid, timeouts are rounded up to |
|
| 81 |
* this value. |
|
| 82 |
*/ |
|
| 83 |
#if !defined(CH_CFG_ST_TIMEDELTA) |
|
| 84 |
#define CH_CFG_ST_TIMEDELTA 10 |
|
| 85 |
#endif |
|
| 86 |
|
|
| 87 |
/** @} */ |
|
| 88 |
|
|
| 89 |
/*===========================================================================*/ |
|
| 90 |
/** |
|
| 91 |
* @name Kernel parameters and options |
|
| 92 |
* @{
|
|
| 93 |
*/ |
|
| 94 |
/*===========================================================================*/ |
|
| 95 |
|
|
| 96 |
/** |
|
| 97 |
* @brief Round robin interval. |
|
| 98 |
* @details This constant is the number of system ticks allowed for the |
|
| 99 |
* threads before preemption occurs. Setting this value to zero |
|
| 100 |
* disables the preemption for threads with equal priority and the |
|
| 101 |
* round robin becomes cooperative. Note that higher priority |
|
| 102 |
* threads can still preempt, the kernel is always preemptive. |
|
| 103 |
* @note Disabling the round robin preemption makes the kernel more compact |
|
| 104 |
* and generally faster. |
|
| 105 |
* @note The round robin preemption is not supported in tickless mode and |
|
| 106 |
* must be set to zero in that case. |
|
| 107 |
*/ |
|
| 108 |
#if !defined(CH_CFG_TIME_QUANTUM) |
|
| 109 |
#define CH_CFG_TIME_QUANTUM 0 |
|
| 110 |
#endif |
|
| 111 |
|
|
| 112 |
/** |
|
| 113 |
* @brief Managed RAM size. |
|
| 114 |
* @details Size of the RAM area to be managed by the OS. If set to zero |
|
| 115 |
* then the whole available RAM is used. The core memory is made |
|
| 116 |
* available to the heap allocator and/or can be used directly through |
|
| 117 |
* the simplified core memory allocator. |
|
| 118 |
* |
|
| 119 |
* @note In order to let the OS manage the whole RAM the linker script must |
|
| 120 |
* provide the @p __heap_base__ and @p __heap_end__ symbols. |
|
| 121 |
* @note Requires @p CH_CFG_USE_MEMCORE. |
|
| 122 |
*/ |
|
| 123 |
#if !defined(CH_CFG_MEMCORE_SIZE) |
|
| 124 |
#define CH_CFG_MEMCORE_SIZE 0 |
|
| 125 |
#endif |
|
| 126 |
|
|
| 127 |
/** |
|
| 128 |
* @brief Idle thread automatic spawn suppression. |
|
| 129 |
* @details When this option is activated the function @p chSysInit() |
|
| 130 |
* does not spawn the idle thread. The application @p main() |
|
| 131 |
* function becomes the idle thread and must implement an |
|
| 132 |
* infinite loop. |
|
| 133 |
*/ |
|
| 134 |
#if !defined(CH_CFG_NO_IDLE_THREAD) |
|
| 135 |
#define CH_CFG_NO_IDLE_THREAD FALSE |
|
| 136 |
#endif |
|
| 137 |
|
|
| 138 |
/** @} */ |
|
| 139 |
|
|
| 140 |
/*===========================================================================*/ |
|
| 141 |
/** |
|
| 142 |
* @name Performance options |
|
| 143 |
* @{
|
|
| 144 |
*/ |
|
| 145 |
/*===========================================================================*/ |
|
| 146 |
|
|
| 147 |
/** |
|
| 148 |
* @brief OS optimization. |
|
| 149 |
* @details If enabled then time efficient rather than space efficient code |
|
| 150 |
* is used when two possible implementations exist. |
|
| 151 |
* |
|
| 152 |
* @note This is not related to the compiler optimization options. |
|
| 153 |
* @note The default is @p TRUE. |
|
| 154 |
*/ |
|
| 155 |
#if !defined(CH_CFG_OPTIMIZE_SPEED) |
|
| 156 |
#define CH_CFG_OPTIMIZE_SPEED TRUE |
|
| 157 |
#endif |
|
| 158 |
|
|
| 159 |
/** @} */ |
|
| 160 |
|
|
| 161 |
/*===========================================================================*/ |
|
| 162 |
/** |
|
| 163 |
* @name Subsystem options |
|
| 164 |
* @{
|
|
| 165 |
*/ |
|
| 166 |
/*===========================================================================*/ |
|
| 167 |
|
|
| 168 |
/** |
|
| 169 |
* @brief Time Measurement APIs. |
|
| 170 |
* @details If enabled then the time measurement APIs are included in |
|
| 171 |
* the kernel. |
|
| 172 |
* |
|
| 173 |
* @note The default is @p TRUE. |
|
| 174 |
*/ |
|
| 175 |
#if !defined(CH_CFG_USE_TM) |
|
| 176 |
#define CH_CFG_USE_TM FALSE |
|
| 177 |
#endif |
|
| 178 |
|
|
| 179 |
/** |
|
| 180 |
* @brief Threads registry APIs. |
|
| 181 |
* @details If enabled then the registry APIs are included in the kernel. |
|
| 182 |
* |
|
| 183 |
* @note The default is @p TRUE. |
|
| 184 |
*/ |
|
| 185 |
#if !defined(CH_CFG_USE_REGISTRY) |
|
| 186 |
#define CH_CFG_USE_REGISTRY FALSE |
|
| 187 |
#endif |
|
| 188 |
|
|
| 189 |
/** |
|
| 190 |
* @brief Threads synchronization APIs. |
|
| 191 |
* @details If enabled then the @p chThdWait() function is included in |
|
| 192 |
* the kernel. |
|
| 193 |
* |
|
| 194 |
* @note The default is @p TRUE. |
|
| 195 |
*/ |
|
| 196 |
#if !defined(CH_CFG_USE_WAITEXIT) |
|
| 197 |
#define CH_CFG_USE_WAITEXIT TRUE |
|
| 198 |
#endif |
|
| 199 |
|
|
| 200 |
/** |
|
| 201 |
* @brief Semaphores APIs. |
|
| 202 |
* @details If enabled then the Semaphores APIs are included in the kernel. |
|
| 203 |
* |
|
| 204 |
* @note The default is @p TRUE. |
|
| 205 |
*/ |
|
| 206 |
#if !defined(CH_CFG_USE_SEMAPHORES) |
|
| 207 |
#define CH_CFG_USE_SEMAPHORES FALSE |
|
| 208 |
#endif |
|
| 209 |
|
|
| 210 |
/** |
|
| 211 |
* @brief Semaphores queuing mode. |
|
| 212 |
* @details If enabled then the threads are enqueued on semaphores by |
|
| 213 |
* priority rather than in FIFO order. |
|
| 214 |
* |
|
| 215 |
* @note The default is @p FALSE. Enable this if you have special |
|
| 216 |
* requirements. |
|
| 217 |
* @note Requires @p CH_CFG_USE_SEMAPHORES. |
|
| 218 |
*/ |
|
| 219 |
#if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY) |
|
| 220 |
#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE |
|
| 221 |
#endif |
|
| 222 |
|
|
| 223 |
/** |
|
| 224 |
* @brief Mutexes APIs. |
|
| 225 |
* @details If enabled then the mutexes APIs are included in the kernel. |
|
| 226 |
* |
|
| 227 |
* @note The default is @p TRUE. |
|
| 228 |
*/ |
|
| 229 |
#if !defined(CH_CFG_USE_MUTEXES) |
|
| 230 |
#define CH_CFG_USE_MUTEXES TRUE |
|
| 231 |
#endif |
|
| 232 |
|
|
| 233 |
/** |
|
| 234 |
* @brief Enables recursive behavior on mutexes. |
|
| 235 |
* @note Recursive mutexes are heavier and have an increased |
|
| 236 |
* memory footprint. |
|
| 237 |
* |
|
| 238 |
* @note The default is @p FALSE. |
|
| 239 |
* @note Requires @p CH_CFG_USE_MUTEXES. |
|
| 240 |
*/ |
|
| 241 |
#if !defined(CH_CFG_USE_MUTEXES_RECURSIVE) |
|
| 242 |
#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE |
|
| 243 |
#endif |
|
| 244 |
|
|
| 245 |
/** |
|
| 246 |
* @brief Conditional Variables APIs. |
|
| 247 |
* @details If enabled then the conditional variables APIs are included |
|
| 248 |
* in the kernel. |
|
| 249 |
* |
|
| 250 |
* @note The default is @p TRUE. |
|
| 251 |
* @note Requires @p CH_CFG_USE_MUTEXES. |
|
| 252 |
*/ |
|
| 253 |
#if !defined(CH_CFG_USE_CONDVARS) |
|
| 254 |
#define CH_CFG_USE_CONDVARS FALSE |
|
| 255 |
#endif |
|
| 256 |
|
|
| 257 |
/** |
|
| 258 |
* @brief Conditional Variables APIs with timeout. |
|
| 259 |
* @details If enabled then the conditional variables APIs with timeout |
|
| 260 |
* specification are included in the kernel. |
|
| 261 |
* |
|
| 262 |
* @note The default is @p TRUE. |
|
| 263 |
* @note Requires @p CH_CFG_USE_CONDVARS. |
|
| 264 |
*/ |
|
| 265 |
#if !defined(CH_CFG_USE_CONDVARS_TIMEOUT) |
|
| 266 |
#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE |
|
| 267 |
#endif |
|
| 268 |
|
|
| 269 |
/** |
|
| 270 |
* @brief Events Flags APIs. |
|
| 271 |
* @details If enabled then the event flags APIs are included in the kernel. |
|
| 272 |
* |
|
| 273 |
* @note The default is @p TRUE. |
|
| 274 |
*/ |
|
| 275 |
#if !defined(CH_CFG_USE_EVENTS) |
|
| 276 |
#define CH_CFG_USE_EVENTS TRUE |
|
| 277 |
#endif |
|
| 278 |
|
|
| 279 |
/** |
|
| 280 |
* @brief Events Flags APIs with timeout. |
|
| 281 |
* @details If enabled then the events APIs with timeout specification |
|
| 282 |
* are included in the kernel. |
|
| 283 |
* |
|
| 284 |
* @note The default is @p TRUE. |
|
| 285 |
* @note Requires @p CH_CFG_USE_EVENTS. |
|
| 286 |
*/ |
|
| 287 |
#if !defined(CH_CFG_USE_EVENTS_TIMEOUT) |
|
| 288 |
#define CH_CFG_USE_EVENTS_TIMEOUT TRUE |
|
| 289 |
#endif |
|
| 290 |
|
|
| 291 |
/** |
|
| 292 |
* @brief Synchronous Messages APIs. |
|
| 293 |
* @details If enabled then the synchronous messages APIs are included |
|
| 294 |
* in the kernel. |
|
| 295 |
* |
|
| 296 |
* @note The default is @p TRUE. |
|
| 297 |
*/ |
|
| 298 |
#if !defined(CH_CFG_USE_MESSAGES) |
|
| 299 |
#define CH_CFG_USE_MESSAGES FALSE |
|
| 300 |
#endif |
|
| 301 |
|
|
| 302 |
/** |
|
| 303 |
* @brief Synchronous Messages queuing mode. |
|
| 304 |
* @details If enabled then messages are served by priority rather than in |
|
| 305 |
* FIFO order. |
|
| 306 |
* |
|
| 307 |
* @note The default is @p FALSE. Enable this if you have special |
|
| 308 |
* requirements. |
|
| 309 |
* @note Requires @p CH_CFG_USE_MESSAGES. |
|
| 310 |
*/ |
|
| 311 |
#if !defined(CH_CFG_USE_MESSAGES_PRIORITY) |
|
| 312 |
#define CH_CFG_USE_MESSAGES_PRIORITY FALSE |
|
| 313 |
#endif |
|
| 314 |
|
|
| 315 |
/** |
|
| 316 |
* @brief Mailboxes APIs. |
|
| 317 |
* @details If enabled then the asynchronous messages (mailboxes) APIs are |
|
| 318 |
* included in the kernel. |
|
| 319 |
* |
|
| 320 |
* @note The default is @p TRUE. |
|
| 321 |
* @note Requires @p CH_CFG_USE_SEMAPHORES. |
|
| 322 |
*/ |
|
| 323 |
#if !defined(CH_CFG_USE_MAILBOXES) |
|
| 324 |
#define CH_CFG_USE_MAILBOXES FALSE |
|
| 325 |
#endif |
|
| 326 |
|
|
| 327 |
/** |
|
| 328 |
* @brief Core Memory Manager APIs. |
|
| 329 |
* @details If enabled then the core memory manager APIs are included |
|
| 330 |
* in the kernel. |
|
| 331 |
* |
|
| 332 |
* @note The default is @p TRUE. |
|
| 333 |
*/ |
|
| 334 |
#if !defined(CH_CFG_USE_MEMCORE) |
|
| 335 |
#define CH_CFG_USE_MEMCORE FALSE |
|
| 336 |
#endif |
|
| 337 |
|
|
| 338 |
/** |
|
| 339 |
* @brief Heap Allocator APIs. |
|
| 340 |
* @details If enabled then the memory heap allocator APIs are included |
|
| 341 |
* in the kernel. |
|
| 342 |
* |
|
| 343 |
* @note The default is @p TRUE. |
|
| 344 |
* @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or |
|
| 345 |
* @p CH_CFG_USE_SEMAPHORES. |
|
| 346 |
* @note Mutexes are recommended. |
|
| 347 |
*/ |
|
| 348 |
#if !defined(CH_CFG_USE_HEAP) |
|
| 349 |
#define CH_CFG_USE_HEAP FALSE |
|
| 350 |
#endif |
|
| 351 |
|
|
| 352 |
/** |
|
| 353 |
* @brief Memory Pools Allocator APIs. |
|
| 354 |
* @details If enabled then the memory pools allocator APIs are included |
|
| 355 |
* in the kernel. |
|
| 356 |
* |
|
| 357 |
* @note The default is @p TRUE. |
|
| 358 |
*/ |
|
| 359 |
#if !defined(CH_CFG_USE_MEMPOOLS) |
|
| 360 |
#define CH_CFG_USE_MEMPOOLS FALSE |
|
| 361 |
#endif |
|
| 362 |
|
|
| 363 |
/** |
|
| 364 |
* @brief Objects FIFOs APIs. |
|
| 365 |
* @details If enabled then the objects FIFOs APIs are included |
|
| 366 |
* in the kernel. |
|
| 367 |
* |
|
| 368 |
* @note The default is @p TRUE. |
|
| 369 |
*/ |
|
| 370 |
#if !defined(CH_CFG_USE_OBJ_FIFOS) |
|
| 371 |
#define CH_CFG_USE_OBJ_FIFOS FALSE |
|
| 372 |
#endif |
|
| 373 |
|
|
| 374 |
/** |
|
| 375 |
* @brief Dynamic Threads APIs. |
|
| 376 |
* @details If enabled then the dynamic threads creation APIs are included |
|
| 377 |
* in the kernel. |
|
| 378 |
* |
|
| 379 |
* @note The default is @p TRUE. |
|
| 380 |
* @note Requires @p CH_CFG_USE_WAITEXIT. |
|
| 381 |
* @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. |
|
| 382 |
*/ |
|
| 383 |
#if !defined(CH_CFG_USE_DYNAMIC) |
|
| 384 |
#define CH_CFG_USE_DYNAMIC FALSE |
|
| 385 |
#endif |
|
| 386 |
|
|
| 387 |
/** @} */ |
|
| 388 |
|
|
| 389 |
/*===========================================================================*/ |
|
| 390 |
/** |
|
| 391 |
* @name Objects factory options |
|
| 392 |
* @{
|
|
| 393 |
*/ |
|
| 394 |
/*===========================================================================*/ |
|
| 395 |
|
|
| 396 |
/** |
|
| 397 |
* @brief Objects Factory APIs. |
|
| 398 |
* @details If enabled then the objects factory APIs are included in the |
|
| 399 |
* kernel. |
|
| 400 |
* |
|
| 401 |
* @note The default is @p FALSE. |
|
| 402 |
*/ |
|
| 403 |
#if !defined(CH_CFG_USE_FACTORY) |
|
| 404 |
#define CH_CFG_USE_FACTORY FALSE |
|
| 405 |
#endif |
|
| 406 |
|
|
| 407 |
/** |
|
| 408 |
* @brief Maximum length for object names. |
|
| 409 |
* @details If the specified length is zero then the name is stored by |
|
| 410 |
* pointer but this could have unintended side effects. |
|
| 411 |
*/ |
|
| 412 |
#if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH) |
|
| 413 |
#define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8 |
|
| 414 |
#endif |
|
| 415 |
|
|
| 416 |
/** |
|
| 417 |
* @brief Enables the registry of generic objects. |
|
| 418 |
*/ |
|
| 419 |
#if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY) |
|
| 420 |
#define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE |
|
| 421 |
#endif |
|
| 422 |
|
|
| 423 |
/** |
|
| 424 |
* @brief Enables factory for generic buffers. |
|
| 425 |
*/ |
|
| 426 |
#if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS) |
|
| 427 |
#define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE |
|
| 428 |
#endif |
|
| 429 |
|
|
| 430 |
/** |
|
| 431 |
* @brief Enables factory for semaphores. |
|
| 432 |
*/ |
|
| 433 |
#if !defined(CH_CFG_FACTORY_SEMAPHORES) |
|
| 434 |
#define CH_CFG_FACTORY_SEMAPHORES TRUE |
|
| 435 |
#endif |
|
| 436 |
|
|
| 437 |
/** |
|
| 438 |
* @brief Enables factory for mailboxes. |
|
| 439 |
*/ |
|
| 440 |
#if !defined(CH_CFG_FACTORY_MAILBOXES) |
|
| 441 |
#define CH_CFG_FACTORY_MAILBOXES TRUE |
|
| 442 |
#endif |
|
| 443 |
|
|
| 444 |
/** |
|
| 445 |
* @brief Enables factory for objects FIFOs. |
|
| 446 |
*/ |
|
| 447 |
#if !defined(CH_CFG_FACTORY_OBJ_FIFOS) |
|
| 448 |
#define CH_CFG_FACTORY_OBJ_FIFOS TRUE |
|
| 449 |
#endif |
|
| 450 |
|
|
| 451 |
/** @} */ |
|
| 452 |
|
|
| 453 |
/*===========================================================================*/ |
|
| 454 |
/** |
|
| 455 |
* @name Debug options |
|
| 456 |
* @{
|
|
| 457 |
*/ |
|
| 458 |
/*===========================================================================*/ |
|
| 459 |
|
|
| 460 |
/** |
|
| 461 |
* @brief Debug option, kernel statistics. |
|
| 462 |
* |
|
| 463 |
* @note The default is @p FALSE. |
|
| 464 |
*/ |
|
| 465 |
#if !defined(CH_DBG_STATISTICS) |
|
| 466 |
#define CH_DBG_STATISTICS FALSE |
|
| 467 |
#endif |
|
| 468 |
|
|
| 469 |
/** |
|
| 470 |
* @brief Debug option, system state check. |
|
| 471 |
* @details If enabled the correct call protocol for system APIs is checked |
|
| 472 |
* at runtime. |
|
| 473 |
* |
|
| 474 |
* @note The default is @p FALSE. |
|
| 475 |
*/ |
|
| 476 |
#if !defined(CH_DBG_SYSTEM_STATE_CHECK) |
|
| 477 |
#define CH_DBG_SYSTEM_STATE_CHECK FALSE |
|
| 478 |
#endif |
|
| 479 |
|
|
| 480 |
/** |
|
| 481 |
* @brief Debug option, parameters checks. |
|
| 482 |
* @details If enabled then the checks on the API functions input |
|
| 483 |
* parameters are activated. |
|
| 484 |
* |
|
| 485 |
* @note The default is @p FALSE. |
|
| 486 |
*/ |
|
| 487 |
#if !defined(CH_DBG_ENABLE_CHECKS) |
|
| 488 |
#define CH_DBG_ENABLE_CHECKS FALSE |
|
| 489 |
#endif |
|
| 490 |
|
|
| 491 |
/** |
|
| 492 |
* @brief Debug option, consistency checks. |
|
| 493 |
* @details If enabled then all the assertions in the kernel code are |
|
| 494 |
* activated. This includes consistency checks inside the kernel, |
|
| 495 |
* runtime anomalies and port-defined checks. |
|
| 496 |
* |
|
| 497 |
* @note The default is @p FALSE. |
|
| 498 |
*/ |
|
| 499 |
#if !defined(CH_DBG_ENABLE_ASSERTS) |
|
| 500 |
#define CH_DBG_ENABLE_ASSERTS TRUE |
|
| 501 |
#endif |
|
| 502 |
|
|
| 503 |
/** |
|
| 504 |
* @brief Debug option, trace buffer. |
|
| 505 |
* @details If enabled then the trace buffer is activated. |
|
| 506 |
* |
|
| 507 |
* @note The default is @p CH_DBG_TRACE_MASK_DISABLED. |
|
| 508 |
*/ |
|
| 509 |
#if !defined(CH_DBG_TRACE_MASK) |
|
| 510 |
#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED |
|
| 511 |
#endif |
|
| 512 |
|
|
| 513 |
/** |
|
| 514 |
* @brief Trace buffer entries. |
|
| 515 |
* @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is |
|
| 516 |
* different from @p CH_DBG_TRACE_MASK_DISABLED. |
|
| 517 |
*/ |
|
| 518 |
#if !defined(CH_DBG_TRACE_BUFFER_SIZE) |
|
| 519 |
#define CH_DBG_TRACE_BUFFER_SIZE 128 |
|
| 520 |
#endif |
|
| 521 |
|
|
| 522 |
/** |
|
| 523 |
* @brief Debug option, stack checks. |
|
| 524 |
* @details If enabled then a runtime stack check is performed. |
|
| 525 |
* |
|
| 526 |
* @note The default is @p FALSE. |
|
| 527 |
* @note The stack check is performed in a architecture/port dependent way. |
|
| 528 |
* It may not be implemented or some ports. |
|
| 529 |
* @note The default failure mode is to halt the system with the global |
|
| 530 |
* @p panic_msg variable set to @p NULL. |
|
| 531 |
*/ |
|
| 532 |
#if !defined(CH_DBG_ENABLE_STACK_CHECK) |
|
| 533 |
#define CH_DBG_ENABLE_STACK_CHECK TRUE |
|
| 534 |
#endif |
|
| 535 |
|
|
| 536 |
/** |
|
| 537 |
* @brief Debug option, stacks initialization. |
|
| 538 |
* @details If enabled then the threads working area is filled with a byte |
|
| 539 |
* value when a thread is created. This can be useful for the |
|
| 540 |
* runtime measurement of the used stack. |
|
| 541 |
* |
|
| 542 |
* @note The default is @p FALSE. |
|
| 543 |
*/ |
|
| 544 |
#if !defined(CH_DBG_FILL_THREADS) |
|
| 545 |
#define CH_DBG_FILL_THREADS TRUE |
|
| 546 |
#endif |
|
| 547 |
|
|
| 548 |
/** |
|
| 549 |
* @brief Debug option, threads profiling. |
|
| 550 |
* @details If enabled then a field is added to the @p thread_t structure that |
|
| 551 |
* counts the system ticks occurred while executing the thread. |
|
| 552 |
* |
|
| 553 |
* @note The default is @p FALSE. |
|
| 554 |
* @note This debug option is not currently compatible with the |
|
| 555 |
* tickless mode. |
|
| 556 |
*/ |
|
| 557 |
#if !defined(CH_DBG_THREADS_PROFILING) |
|
| 558 |
#define CH_DBG_THREADS_PROFILING FALSE |
|
| 559 |
#endif |
|
| 560 |
|
|
| 561 |
/** @} */ |
|
| 562 |
|
|
| 563 |
/*===========================================================================*/ |
|
| 564 |
/** |
|
| 565 |
* @name Kernel hooks |
|
| 566 |
* @{
|
|
| 567 |
*/ |
|
| 568 |
/*===========================================================================*/ |
|
| 569 |
|
|
| 570 |
/** |
|
| 571 |
* @brief System structure extension. |
|
| 572 |
* @details User fields added to the end of the @p ch_system_t structure. |
|
| 573 |
*/ |
|
| 574 |
#define CH_CFG_SYSTEM_EXTRA_FIELDS \ |
|
| 575 |
/* Add threads custom fields here.*/ |
|
| 576 |
|
|
| 577 |
/** |
|
| 578 |
* @brief System initialization hook. |
|
| 579 |
* @details User initialization code added to the @p chSysInit() function |
|
| 580 |
* just before interrupts are enabled globally. |
|
| 581 |
*/ |
|
| 582 |
#define CH_CFG_SYSTEM_INIT_HOOK(tp) { \
|
|
| 583 |
/* Add threads initialization code here.*/ \ |
|
| 584 |
} |
|
| 585 |
|
|
| 586 |
/** |
|
| 587 |
* @brief Threads descriptor structure extension. |
|
| 588 |
* @details User fields added to the end of the @p thread_t structure. |
|
| 589 |
*/ |
|
| 590 |
#define CH_CFG_THREAD_EXTRA_FIELDS \ |
|
| 591 |
/* Add threads custom fields here.*/ |
|
| 592 |
|
|
| 593 |
/** |
|
| 594 |
* @brief Threads initialization hook. |
|
| 595 |
* @details User initialization code added to the @p _thread_init() function. |
|
| 596 |
* |
|
| 597 |
* @note It is invoked from within @p _thread_init() and implicitly from all |
|
| 598 |
* the threads creation APIs. |
|
| 599 |
*/ |
|
| 600 |
#define CH_CFG_THREAD_INIT_HOOK(tp) { \
|
|
| 601 |
/* Add threads initialization code here.*/ \ |
|
| 602 |
} |
|
| 603 |
|
|
| 604 |
/** |
|
| 605 |
* @brief Threads finalization hook. |
|
| 606 |
* @details User finalization code added to the @p chThdExit() API. |
|
| 607 |
*/ |
|
| 608 |
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
|
|
| 609 |
/* Add threads finalization code here.*/ \ |
|
| 610 |
} |
|
| 611 |
|
|
| 612 |
/** |
|
| 613 |
* @brief Context switch hook. |
|
| 614 |
* @details This hook is invoked just before switching between threads. |
|
| 615 |
*/ |
|
| 616 |
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
|
|
| 617 |
/* Context switch code here.*/ \ |
|
| 618 |
} |
|
| 619 |
|
|
| 620 |
/** |
|
| 621 |
* @brief ISR enter hook. |
|
| 622 |
*/ |
|
| 623 |
#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
|
|
| 624 |
/* IRQ prologue code here.*/ \ |
|
| 625 |
} |
|
| 626 |
|
|
| 627 |
/** |
|
| 628 |
* @brief ISR exit hook. |
|
| 629 |
*/ |
|
| 630 |
#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
|
|
| 631 |
/* IRQ epilogue code here.*/ \ |
|
| 632 |
} |
|
| 633 |
|
|
| 634 |
/** |
|
| 635 |
* @brief Idle thread enter hook. |
|
| 636 |
* @note This hook is invoked within a critical zone, no OS functions |
|
| 637 |
* should be invoked from here. |
|
| 638 |
* @note This macro can be used to activate a power saving mode. |
|
| 639 |
*/ |
|
| 640 |
#define CH_CFG_IDLE_ENTER_HOOK() { \
|
|
| 641 |
/* Idle-enter code here.*/ \ |
|
| 642 |
} |
|
| 643 |
|
|
| 644 |
/** |
|
| 645 |
* @brief Idle thread leave hook. |
|
| 646 |
* @note This hook is invoked within a critical zone, no OS functions |
|
| 647 |
* should be invoked from here. |
|
| 648 |
* @note This macro can be used to deactivate a power saving mode. |
|
| 649 |
*/ |
|
| 650 |
#define CH_CFG_IDLE_LEAVE_HOOK() { \
|
|
| 651 |
/* Idle-leave code here.*/ \ |
|
| 652 |
} |
|
| 653 |
|
|
| 654 |
/** |
|
| 655 |
* @brief Idle Loop hook. |
|
| 656 |
* @details This hook is continuously invoked by the idle thread loop. |
|
| 657 |
*/ |
|
| 658 |
#define CH_CFG_IDLE_LOOP_HOOK() { \
|
|
| 659 |
/* Idle loop code here.*/ \ |
|
| 660 |
} |
|
| 661 |
|
|
| 662 |
/** |
|
| 663 |
* @brief System tick event hook. |
|
| 664 |
* @details This hook is invoked in the system tick handler immediately |
|
| 665 |
* after processing the virtual timers queue. |
|
| 666 |
*/ |
|
| 667 |
#define CH_CFG_SYSTEM_TICK_HOOK() { \
|
|
| 668 |
/* System tick event code here.*/ \ |
|
| 669 |
} |
|
| 670 |
|
|
| 671 |
/** |
|
| 672 |
* @brief System halt hook. |
|
| 673 |
* @details This hook is invoked in case to a system halting error before |
|
| 674 |
* the system is halted. |
|
| 675 |
*/ |
|
| 676 |
#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
|
|
| 677 |
/* System halt code here.*/ \ |
|
| 678 |
} |
|
| 679 |
|
|
| 680 |
/** |
|
| 681 |
* @brief Trace hook. |
|
| 682 |
* @details This hook is invoked each time a new record is written in the |
|
| 683 |
* trace buffer. |
|
| 684 |
*/ |
|
| 685 |
#define CH_CFG_TRACE_HOOK(tep) { \
|
|
| 686 |
/* Trace code here.*/ \ |
|
| 687 |
} |
|
| 688 |
|
|
| 689 |
/** @} */ |
|
| 690 |
|
|
| 691 |
/*===========================================================================*/ |
|
| 692 |
/* Port-specific settings (override port settings defaulted in chcore.h). */ |
|
| 693 |
/*===========================================================================*/ |
|
| 694 |
|
|
| 695 |
#endif /* CHCONF_H */ |
|
| 696 |
|
|
| 697 |
/** @} */ |
|
| modules/DiWheelDrive_1-1/halconf.h | ||
|---|---|---|
| 1 | 1 |
/* |
| 2 |
* AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform. |
|
| 3 |
* Copyright (C) 2016..2018 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 os/modules/DiWheelDrive/chconf.h |
|
| 21 |
* @brief ChibiOS Configuration file for the DiWheelDrive v1.1 module. |
|
| 22 |
* @details Contains the application specific kernel settings. |
|
| 23 |
* |
|
| 24 |
* @addtogroup config |
|
| 25 |
* @details Kernel related settings and hooks. |
|
| 26 |
* @{
|
|
| 27 |
*/ |
|
| 28 |
/* |
|
| 2 | 29 |
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform. |
| 3 | 30 |
Copyright (C) 2016..2018 Thomas Schöpping et al. |
| 4 | 31 |
|
| ... | ... | |
| 62 | 89 |
* @brief Enables the EXT subsystem. |
| 63 | 90 |
*/ |
| 64 | 91 |
#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) |
| 65 |
#define HAL_USE_EXT TRUE
|
|
| 92 |
#define HAL_USE_EXT FALSE
|
|
| 66 | 93 |
#endif |
| 67 | 94 |
|
| 68 | 95 |
/** |
| modules/DiWheelDrive_1-1/module.c | ||
|---|---|---|
| 29 | 29 |
/** |
| 30 | 30 |
* @brief Interrupt service routine callback for I/O interrupt signals. |
| 31 | 31 |
* |
| 32 |
* @param extp EXT driver to handle the ISR. |
|
| 33 |
* @param channel Channel on which the interrupt was encountered. |
|
| 32 |
* @param args Channel on which the interrupt was encountered. |
|
| 34 | 33 |
*/ |
| 35 |
static void _moduleIsrCallback(EXTDriver* extp, expchannel_t channel) {
|
|
| 36 |
(void)extp; |
|
| 37 |
|
|
| 34 |
static void _modulePalIsrCallback(void *args) {
|
|
| 38 | 35 |
chSysLockFromISR(); |
| 39 |
chEvtBroadcastFlagsI(&aos.events.io, (1 << channel));
|
|
| 36 |
chEvtBroadcastFlagsI(&aos.events.io, (1 << (*(uint16_t*)args)));
|
|
| 40 | 37 |
chSysUnlockFromISR(); |
| 41 | 38 |
|
| 42 | 39 |
return; |
| ... | ... | |
| 56 | 53 |
/* btr */ CAN_BTR_SJW(1) | CAN_BTR_TS2(2) | CAN_BTR_TS1(13) | CAN_BTR_BRP(1), |
| 57 | 54 |
}; |
| 58 | 55 |
|
| 59 |
EXTConfig moduleHalExtConfig = {
|
|
| 60 |
/* channel configrations */ {
|
|
| 61 |
/* channel 0 */ {
|
|
| 62 |
/* mode */ EXT_CH_MODE_DISABLED, |
|
| 63 |
/* callback */ NULL, |
|
| 64 |
}, |
|
| 56 |
aos_interrupt_cfg_t moduleIntConfig[10] = {
|
|
| 65 | 57 |
/* channel 1 */ { // SYS_INT_N/SYS_SYNC_N: automatic interrupt on event
|
| 66 |
/* mode */ EXT_MODE_GPIOC | EXT_CH_MODE_BOTH_EDGES | EXT_CH_MODE_AUTOSTART, |
|
| 67 |
/* callback */ _moduleIsrCallback, |
|
| 58 |
/* port */ GPIOC, |
|
| 59 |
/* pad */ GPIOC_SYS_INT_N, |
|
| 60 |
/* flags */ AOS_INTERRUPT_AUTOSTART, |
|
| 61 |
/* mode */ PAL_EVENT_MODE_BOTH_EDGES, |
|
| 62 |
/* callback */ _modulePalIsrCallback, |
|
| 63 |
/* cb arg */ 1, |
|
| 68 | 64 |
}, |
| 69 | 65 |
/* channel 2 */ { // SYS_WARMRST_N: automatic interrupt when activated
|
| 70 |
/* mode */ EXT_MODE_GPIOD | EXT_CH_MODE_FALLING_EDGE | EXT_CH_MODE_AUTOSTART, |
|
| 71 |
/* callback */ _moduleIsrCallback, |
|
| 66 |
/* port */ GPIOD, |
|
| 67 |
/* pad */ GPIOD_SYS_WARMRST_N, |
|
| 68 |
/* flags */ AOS_INTERRUPT_AUTOSTART, |
|
| 69 |
/* mode */ PAL_EVENT_MODE_FALLING_EDGE, |
|
| 70 |
/* callback */ _modulePalIsrCallback, |
|
| 71 |
/* cb arg */ 2, |
|
| 72 | 72 |
}, |
| 73 | 73 |
/* channel 3 */ { // PATH_DCSTAT: must be enabled explicitely when charging is in progress to detect unexpected voltage drop
|
| 74 |
/* mode */ EXT_MODE_GPIOC | EXT_CH_MODE_FALLING_EDGE,
|
|
| 75 |
/* callback */ _moduleIsrCallback,
|
|
| 76 |
},
|
|
| 77 |
/* channel 4 */ {
|
|
| 78 |
/* mode */ EXT_CH_MODE_DISABLED,
|
|
| 79 |
/* callback */ NULL,
|
|
| 74 |
/* port */ GPIOC,
|
|
| 75 |
/* pad */ GPIOC_PATH_DCSTAT,
|
|
| 76 |
/* flags */ 0,
|
|
| 77 |
/* mode */ PAL_EVENT_MODE_FALLING_EDGE,
|
|
| 78 |
/* callback */ _modulePalIsrCallback,
|
|
| 79 |
/* cb arg */ 3,
|
|
| 80 | 80 |
}, |
| 81 | 81 |
/* channel 5 */ { // COMPASS_DRDY: must be enabled explicitely
|
| 82 |
/* mode */ EXT_MODE_GPIOB | APAL2CH_EDGE(HMC5883L_LLD_INT_EDGE), |
|
| 83 |
/* callback */ _moduleIsrCallback, |
|
| 84 |
}, |
|
| 85 |
/* channel 6 */ {
|
|
| 86 |
/* mode */ EXT_CH_MODE_DISABLED, |
|
| 87 |
/* callback */ NULL, |
|
| 88 |
}, |
|
| 89 |
/* channel 7 */ {
|
|
| 90 |
/* mode */ EXT_CH_MODE_DISABLED, |
|
| 91 |
/* callback */ NULL, |
|
| 82 |
/* port */ GPIOB, |
|
| 83 |
/* pad */ GPIOB_COMPASS_DRDY, |
|
| 84 |
/* flags */ 0, |
|
| 85 |
/* mode */ APAL2CH_EDGE(HMC5883L_LLD_INT_EDGE), |
|
| 86 |
/* callback */ _modulePalIsrCallback, |
|
| 87 |
/* cb arg */ 4, |
|
| 92 | 88 |
}, |
| 93 | 89 |
/* channel 8 */ { // SYS_PD_N: automatic interrupt when activated
|
| 94 |
/* mode */ EXT_MODE_GPIOC | EXT_CH_MODE_FALLING_EDGE | EXT_CH_MODE_AUTOSTART, |
|
| 95 |
/* callback */ _moduleIsrCallback, |
|
| 90 |
/* port */ GPIOC, |
|
| 91 |
/* pad */ GPIOC_SYS_PD_N, |
|
| 92 |
/* flags */ AOS_INTERRUPT_AUTOSTART, |
|
| 93 |
/* mode */ PAL_EVENT_MODE_FALLING_EDGE, |
|
| 94 |
/* callback */ _modulePalIsrCallback, |
|
| 95 |
/* cb arg */ 5, |
|
| 96 | 96 |
}, |
| 97 | 97 |
/* channel 9 */ { // SYS_REG_EN: automatic interrupt when activated
|
| 98 |
/* mode */ EXT_MODE_GPIOC | EXT_CH_MODE_FALLING_EDGE | EXT_CH_MODE_AUTOSTART, |
|
| 99 |
/* callback */ _moduleIsrCallback, |
|
| 100 |
}, |
|
| 101 |
/* channel 10 */ {
|
|
| 102 |
/* mode */ EXT_CH_MODE_DISABLED, |
|
| 103 |
/* callback */ NULL, |
|
| 104 |
}, |
|
| 105 |
/* channel 11 */ {
|
|
| 106 |
/* mode */ EXT_CH_MODE_DISABLED, |
|
| 107 |
/* callback */ NULL, |
|
| 98 |
/* port */ GPIOC, |
|
| 99 |
/* pad */ GPIOC_SYS_REG_EN, |
|
| 100 |
/* flags */ AOS_INTERRUPT_AUTOSTART, |
|
| 101 |
/* mode */ PAL_EVENT_MODE_FALLING_EDGE, |
|
| 102 |
/* callback */ _modulePalIsrCallback, |
|
| 103 |
/* cb arg */ 6, |
|
| 108 | 104 |
}, |
| 109 | 105 |
/* channel 12 */ { // IR_INT: must be enabled explicitely
|
| 110 |
/* mode */ EXT_MODE_GPIOB | APAL2CH_EDGE(VCNL4020_LLD_INT_EDGE), |
|
| 111 |
/* callback */ _moduleIsrCallback, |
|
| 106 |
/* port */ GPIOB, |
|
| 107 |
/* pad */ GPIOB_IR_INT, |
|
| 108 |
/* flags */ 0, |
|
| 109 |
/* mode */ APAL2CH_EDGE(VCNL4020_LLD_INT_EDGE), |
|
| 110 |
/* callback */ _modulePalIsrCallback, |
|
| 111 |
/* cb arg */ 7, |
|
| 112 | 112 |
}, |
| 113 | 113 |
/* channel 13 */ { // GYRO_DRDY: must be enabled explicitely
|
| 114 |
/* mode */ EXT_MODE_GPIOB | APAL2CH_EDGE(L3G4200D_LLD_INT_EDGE), |
|
| 115 |
/* callback */ _moduleIsrCallback, |
|
| 114 |
/* port */ GPIOB, |
|
| 115 |
/* pad */ GPIOB_GYRO_DRDY, |
|
| 116 |
/* flags */ 0, |
|
| 117 |
/* mode */ APAL2CH_EDGE(L3G4200D_LLD_INT_EDGE), |
|
| 118 |
/* callback */ _modulePalIsrCallback, |
|
| 119 |
/* cb arg */ 8, |
|
| 116 | 120 |
}, |
| 117 | 121 |
/* channel 14 */ { // SYS_UART_UP: automatic interrupt on event
|
| 118 |
/* mode */ EXT_MODE_GPIOB | EXT_CH_MODE_BOTH_EDGES | EXT_CH_MODE_AUTOSTART, |
|
| 119 |
/* callback */ _moduleIsrCallback, |
|
| 122 |
/* port */ GPIOB, |
|
| 123 |
/* pad */ GPIOB_SYS_UART_UP, |
|
| 124 |
/* flags */ AOS_INTERRUPT_AUTOSTART, |
|
| 125 |
/* mode */ PAL_EVENT_MODE_BOTH_EDGES, |
|
| 126 |
/* callback */ _modulePalIsrCallback, |
|
| 127 |
/* cb arg */ 9, |
|
| 120 | 128 |
}, |
| 121 | 129 |
/* channel 15 */ { // ACCEL_INT_N: must be enabled explicitely
|
| 122 |
/* mode */ EXT_MODE_GPIOB | APAL2CH_EDGE(LIS331DLH_LLD_INT_EDGE), |
|
| 123 |
/* callback */ _moduleIsrCallback, |
|
| 130 |
/* port */ GPIOB, |
|
| 131 |
/* pad */ GPIOB_ACCEL_INT_N, |
|
| 132 |
/* flags */ 0, |
|
| 133 |
/* mode */ APAL2CH_EDGE(LIS331DLH_LLD_INT_EDGE), |
|
| 134 |
/* callback */ _modulePalIsrCallback, |
|
| 135 |
/* cb arg */ 10, |
|
| 124 | 136 |
}, |
| 125 |
/* channel 16 */ {
|
|
| 126 |
/* mode */ EXT_CH_MODE_DISABLED, |
|
| 127 |
/* callback */ NULL, |
|
| 128 |
}, |
|
| 129 |
/* channel 17 */ {
|
|
| 130 |
/* mode */ EXT_CH_MODE_DISABLED, |
|
| 131 |
/* callback */ NULL, |
|
| 132 |
}, |
|
| 133 |
/* channel 18 */ {
|
|
| 134 |
/* mode */ EXT_CH_MODE_DISABLED, |
|
| 135 |
/* callback */ NULL, |
|
| 136 |
}, |
|
| 137 |
}, |
|
| 137 |
}; |
|
| 138 |
|
|
| 139 |
aos_interrupt_driver_t moduleIntDriver = {
|
|
| 140 |
/* config */ NULL, |
|
| 141 |
/* interrupts */ 10, |
|
| 138 | 142 |
}; |
| 139 | 143 |
|
| 140 | 144 |
I2CConfig moduleHalI2cCompassConfig = {
|
| ... | ... | |
| 199 | 203 |
}; |
| 200 | 204 |
|
| 201 | 205 |
SPIConfig moduleHalSpiAccelerometerConfig = {
|
| 206 |
/* circular buffer mode */ false, |
|
| 202 | 207 |
/* callback function pointer */ NULL, |
| 203 | 208 |
/* chip select line port */ GPIOC, |
| 204 | 209 |
/* chip select line pad number */ GPIOC_ACCEL_SS_N, |
| ... | ... | |
| 207 | 212 |
}; |
| 208 | 213 |
|
| 209 | 214 |
SPIConfig moduleHalSpiGyroscopeConfig = {
|
| 215 |
/* circular buffer mode */ false, |
|
| 210 | 216 |
/* callback function pointer */ NULL, |
| 211 | 217 |
/* chip select line port */ GPIOC, |
| 212 | 218 |
/* chip select line pad number */ GPIOC_GYRO_SS_N, |
| ... | ... | |
| 511 | 517 |
{
|
| 512 | 518 |
(void)argc; |
| 513 | 519 |
(void)argv; |
| 514 |
extChannelEnable(&MODULE_HAL_EXT, MODULE_GPIO_EXTCHANNEL_COMPASSDRDY);
|
|
| 520 |
aosIntEnable(&moduleIntDriver, MODULE_GPIO_INT_COMPASSDRDY);
|
|
| 515 | 521 |
aosUtRun(stream, &moduleUtAlldHmc5883l, NULL); |
| 522 |
aosIntDisable(&moduleIntDriver, MODULE_GPIO_INT_COMPASSDRDY); |
|
| 516 | 523 |
return AOS_OK; |
| 517 | 524 |
} |
| 518 | 525 |
static ut_hmc5883ldata_t _utHmc5883lData = {
|
| 519 | 526 |
/* HMC driver */ &moduleLldCompass, |
| 520 | 527 |
/* event source */ &aos.events.io, |
| 521 |
/* event flags */ (1 << MODULE_GPIO_EXTCHANNEL_COMPASSDRDY),
|
|
| 528 |
/* event flags */ (1 << MODULE_GPIO_INT_COMPASSDRDY),
|
|
| 522 | 529 |
/* timeout */ MICROSECONDS_PER_SECOND, |
| 523 | 530 |
}; |
| 524 | 531 |
aos_unittest_t moduleUtAlldHmc5883l = {
|
| ... | ... | |
| 564 | 571 |
{
|
| 565 | 572 |
(void)argc; |
| 566 | 573 |
(void)argv; |
| 567 |
extChannelEnable(&MODULE_HAL_EXT, MODULE_GPIO_EXTCHANNEL_GYRODRDY);
|
|
| 574 |
aosIntEnable(&moduleIntDriver, MODULE_GPIO_INT_GYRODRDY);
|
|
| 568 | 575 |
spiStart(((ut_l3g4200ddata_t*)moduleUtAlldL3g4200d.data)->l3gd->spid, ((ut_l3g4200ddata_t*)moduleUtAlldL3g4200d.data)->spiconf); |
| 569 | 576 |
aosUtRun(stream, &moduleUtAlldL3g4200d, NULL); |
| 570 | 577 |
spiStop(((ut_l3g4200ddata_t*)moduleUtAlldL3g4200d.data)->l3gd->spid); |
| 578 |
aosIntDisable(&moduleIntDriver, MODULE_GPIO_INT_GYRODRDY); |
|
| 571 | 579 |
return AOS_OK; |
| 572 | 580 |
} |
| 573 | 581 |
static ut_l3g4200ddata_t _utL3g4200dData = {
|
| 574 | 582 |
/* driver */ &moduleLldGyroscope, |
| 575 | 583 |
/* SPI configuration */ &moduleHalSpiGyroscopeConfig, |
| 576 | 584 |
/* event source */ &aos.events.io, |
| 577 |
/* event flags */ (1 << MODULE_GPIO_EXTCHANNEL_GYRODRDY),
|
|
| 585 |
/* event flags */ (1 << MODULE_GPIO_INT_GYRODRDY),
|
|
| 578 | 586 |
}; |
| 579 | 587 |
aos_unittest_t moduleUtAlldL3g4200d = {
|
| 580 | 588 |
/* name */ "L3G4200D", |
| ... | ... | |
| 613 | 621 |
{
|
| 614 | 622 |
(void)argc; |
| 615 | 623 |
(void)argv; |
| 616 |
extChannelEnable(&MODULE_HAL_EXT, MODULE_GPIO_EXTCHANNEL_ACCELINT);
|
|
| 624 |
aosIntEnable(&moduleIntDriver, MODULE_GPIO_INT_ACCELINT);
|
|
| 617 | 625 |
spiStart(((ut_lis331dlhdata_t*)moduleUtAlldLis331dlh.data)->lisd->spid, ((ut_lis331dlhdata_t*)moduleUtAlldLis331dlh.data)->spiconf); |
| 618 | 626 |
aosUtRun(stream, &moduleUtAlldLis331dlh, NULL); |
| 619 | 627 |
spiStop(((ut_lis331dlhdata_t*)moduleUtAlldLis331dlh.data)->lisd->spid); |
| 628 |
aosIntDisable(&moduleIntDriver, MODULE_GPIO_INT_ACCELINT); |
|
| 620 | 629 |
return AOS_OK; |
| 621 | 630 |
} |
| 622 | 631 |
static ut_lis331dlhdata_t _utLis331dlhData = {
|
| 623 | 632 |
/* driver */ &moduleLldAccelerometer, |
| 624 | 633 |
/* SPI configuration */ &moduleHalSpiAccelerometerConfig, |
| 625 | 634 |
/* event source */ &aos.events.io, |
| 626 |
/* event flags */ (1 << MODULE_GPIO_EXTCHANNEL_ACCELINT),
|
|
| 635 |
/* event flags */ (1 << MODULE_GPIO_INT_ACCELINT),
|
|
| 627 | 636 |
}; |
| 628 | 637 |
aos_unittest_t moduleUtAlldLis331dlh = {
|
| 629 | 638 |
/* name */ "LIS331DLH", |
| ... | ... | |
| 739 | 748 |
_utAlldVcnl4020_disableInterrupt(((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->vcnld); |
| 740 | 749 |
pca9544a_lld_setchannel(&moduleLldI2cMultiplexer, PCA9544A_LLD_CH3, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout); |
| 741 | 750 |
_utAlldVcnl4020_disableInterrupt(((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->vcnld); |
| 742 |
extChannelEnable(&MODULE_HAL_EXT, MODULE_GPIO_EXTCHANNEL_IRINT);
|
|
| 751 |
aosIntEnable(&moduleIntDriver, MODULE_GPIO_INT_IRINT);
|
|
| 743 | 752 |
switch (sensor) {
|
| 744 | 753 |
case FL: |
| 745 | 754 |
pca9544a_lld_setchannel(&moduleLldI2cMultiplexer, PCA9544A_LLD_CH3, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout); |
| ... | ... | |
| 760 | 769 |
default: |
| 761 | 770 |
break; |
| 762 | 771 |
} |
| 772 |
aosIntDisable(&moduleIntDriver, MODULE_GPIO_INT_IRINT); |
|
| 763 | 773 |
return AOS_OK; |
| 764 | 774 |
} |
| 765 | 775 |
// print help |
| ... | ... | |
| 779 | 789 |
/* driver */ &moduleLldProximity, |
| 780 | 790 |
/* timeout */ MICROSECONDS_PER_SECOND, |
| 781 | 791 |
/* event source */ &aos.events.io, |
| 782 |
/* event flags */ (1 << MODULE_GPIO_EXTCHANNEL_IRINT),
|
|
| 792 |
/* event flags */ (1 << MODULE_GPIO_INT_IRINT),
|
|
| 783 | 793 |
}; |
| 784 | 794 |
aos_unittest_t moduleUtAlldVcnl4020 = {
|
| 785 | 795 |
/* name */ "VCNL4020", |
| modules/DiWheelDrive_1-1/module.h | ||
|---|---|---|
| 36 | 36 |
/*===========================================================================*/ |
| 37 | 37 |
#include <hal.h> |
| 38 | 38 |
#include <hal_qei.h> |
| 39 |
#include <aos_interrupts.h> |
|
| 39 | 40 |
|
| 40 | 41 |
/** |
| 41 | 42 |
* @brief CAN driver to use. |
| ... | ... | |
| 48 | 49 |
extern CANConfig moduleHalCanConfig; |
| 49 | 50 |
|
| 50 | 51 |
/** |
| 51 |
* @brief Interrupt driver to use.
|
|
| 52 |
* @brief Interrupt driver (PAL).
|
|
| 52 | 53 |
*/ |
| 53 |
#define MODULE_HAL_EXT EXTD1 |
|
| 54 |
|
|
| 55 |
extern aos_interrupt_driver_t moduleIntDriver; |
|
| 54 | 56 |
|
| 55 | 57 |
/** |
| 56 |
* @brief Interrupt driver configuration.
|
|
| 58 |
* @brief Interrupt driver config. |
|
| 57 | 59 |
*/ |
| 58 |
extern EXTConfig moduleHalExtConfig;
|
|
| 60 |
extern aos_interrupt_cfg_t moduleIntConfig[10];
|
|
| 59 | 61 |
|
| 60 | 62 |
/** |
| 61 | 63 |
* @brief I2C driver to access the compass. |
| ... | ... | |
| 171 | 173 |
/** |
| 172 | 174 |
* @brief Interrupt channel for the SYS_SYNC signal. |
| 173 | 175 |
*/ |
| 174 |
#define MODULE_GPIO_EXTCHANNEL_SYSSYNC ((expchannel_t)1)
|
|
| 176 |
#define MODULE_GPIO_INT_SYSSYNC ((uint8_t)1)
|
|
| 175 | 177 |
|
| 176 | 178 |
/** |
| 177 | 179 |
* @brief Interrupt channel for the SYS_WARMRST signal. |
| 178 | 180 |
*/ |
| 179 |
#define MODULE_GPIO_EXTCHANNEL_SYSWARMRST ((expchannel_t)2)
|
|
| 181 |
#define MODULE_GPIO_INT_SYSWARMRST ((uint8_t)2)
|
|
| 180 | 182 |
|
| 181 | 183 |
/** |
| 182 | 184 |
* @brief Interrupt channel for the PATH_DCSTAT signal. |
| 183 | 185 |
*/ |
| 184 |
#define MODULE_GPIO_EXTCHANNEL_PATHDCSTAT ((expchannel_t)3)
|
|
| 186 |
#define MODULE_GPIO_INT_PATHDCSTAT ((uint8_t)3)
|
|
| 185 | 187 |
|
| 186 | 188 |
/** |
| 187 | 189 |
* @brief Interrupt channel for the COMPASS_DRDY signal. |
| 188 | 190 |
*/ |
| 189 |
#define MODULE_GPIO_EXTCHANNEL_COMPASSDRDY ((expchannel_t)5)
|
|
| 191 |
#define MODULE_GPIO_INT_COMPASSDRDY ((uint8_t)4)
|
|
| 190 | 192 |
|
| 191 | 193 |
/** |
| 192 | 194 |
* @brief Interrupt channel for the SYS_PD signal. |
| 193 | 195 |
*/ |
| 194 |
#define MODULE_GPIO_EXTCHANNEL_SYSPD ((expchannel_t)8)
|
|
| 196 |
#define MODULE_GPIO_INT_SYSPD ((uint8_t)5)
|
|
| 195 | 197 |
|
| 196 | 198 |
/** |
| 197 | 199 |
* @brief Interrupt channel for the SYS_REG_EN signal. |
| 198 | 200 |
*/ |
| 199 |
#define MODULE_GPIO_EXTCHANNEL_SYSREGEN ((expchannel_t)9)
|
|
| 201 |
#define MODULE_GPIO_INT_SYSREGEN ((uint8_t)6)
|
|
| 200 | 202 |
|
| 201 | 203 |
/** |
| 202 | 204 |
* @brief Interrupt channel for the IR_INT signal. |
| 203 | 205 |
*/ |
| 204 |
#define MODULE_GPIO_EXTCHANNEL_IRINT ((expchannel_t)12)
|
|
| 206 |
#define MODULE_GPIO_INT_IRINT ((uint8_t)7)
|
|
| 205 | 207 |
|
| 206 | 208 |
/** |
| 207 | 209 |
* @brief Interrupt channel for the GYRO_DRDY signal. |
| 208 | 210 |
*/ |
| 209 |
#define MODULE_GPIO_EXTCHANNEL_GYRODRDY ((expchannel_t)13)
|
|
| 211 |
#define MODULE_GPIO_INT_GYRODRDY ((uint8_t)8)
|
|
| 210 | 212 |
|
| 211 | 213 |
/** |
| 212 | 214 |
* @brief Interrupt channel for the SYS_UART_UP signal. |
| 213 | 215 |
*/ |
| 214 |
#define MODULE_GPIO_EXTCHANNEL_SYSUARTUP ((expchannel_t)14)
|
|
| 216 |
#define MODULE_GPIO_INT_SYSUARTUP ((uint8_t)9)
|
|
| 215 | 217 |
|
| 216 | 218 |
/** |
| 217 | 219 |
* @brief Interrupt channel for the ACCEL_INT signal. |
| 218 | 220 |
*/ |
| 219 |
#define MODULE_GPIO_EXTCHANNEL_ACCELINT ((expchannel_t)15)
|
|
| 221 |
#define MODULE_GPIO_INT_ACCELINT ((uint8_t)10)
|
|
| 220 | 222 |
|
| 221 | 223 |
/** |
| 222 | 224 |
* @brief LED output signal GPIO. |
| ... | ... | |
| 295 | 297 |
/** |
| 296 | 298 |
* @brief Event flag to be set on a SYS_SYNC interrupt. |
| 297 | 299 |
*/ |
| 298 |
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC ((eventflags_t)(1 << MODULE_GPIO_EXTCHANNEL_SYSSYNC))
|
|
| 300 |
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC ((eventflags_t)(1 << MODULE_GPIO_INT_SYSSYNC))
|
|
| 299 | 301 |
|
| 300 | 302 |
/** |
| 301 | 303 |
* @brief Event flag to be set on a SYS_WARMRST interrupt. |
| 302 | 304 |
*/ |
| 303 |
#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST ((eventflags_t)(1 << MODULE_GPIO_EXTCHANNEL_SYSWARMRST))
|
|
| 305 |
#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST ((eventflags_t)(1 << MODULE_GPIO_INT_SYSWARMRST))
|
|
| 304 | 306 |
|
| 305 | 307 |
/** |
| 306 | 308 |
* @brief Event flag to be set on a PATH_DCSTAT interrupt. |
| 307 | 309 |
*/ |
| 308 |
#define MODULE_OS_IOEVENTFLAGS_PATHDCSTAT ((eventflags_t)(1 << MODULE_GPIO_EXTCHANNEL_PATHDCSTAT))
|
|
| 310 |
#define MODULE_OS_IOEVENTFLAGS_PATHDCSTAT ((eventflags_t)(1 << MODULE_GPIO_INT_PATHDCSTAT))
|
|
| 309 | 311 |
|
| 310 | 312 |
/** |
| 311 | 313 |
* @brief Event flag to be set on a COMPASS_DRDY interrupt. |
| 312 | 314 |
*/ |
| 313 |
#define MODULE_OS_IOEVENTFLAGS_COMPASSDRDY ((eventflags_t)(1 << MODULE_GPIO_EXTCHANNEL_COMPASSDRDY))
|
|
| 315 |
#define MODULE_OS_IOEVENTFLAGS_COMPASSDRDY ((eventflags_t)(1 << MODULE_GPIO_INT_COMPASSDRDY))
|
|
| 314 | 316 |
|
| 315 | 317 |
/** |
| 316 | 318 |
* @brief Event flag to be set on a SYS_PD interrupt. |
| 317 | 319 |
*/ |
| 318 |
#define MODULE_OS_IOEVENTFLAGS_SYSPD ((eventflags_t)(1 << MODULE_GPIO_EXTCHANNEL_SYSPD))
|
|
| 320 |
#define MODULE_OS_IOEVENTFLAGS_SYSPD ((eventflags_t)(1 << MODULE_GPIO_INT_SYSPD))
|
|
| 319 | 321 |
|
| 320 | 322 |
/** |
| 321 | 323 |
* @brief Event flag to be set on a SYS_REG_EN interrupt. |
| 322 | 324 |
*/ |
| 323 |
#define MODULE_OS_IOEVENTFLAGS_SYSREGEN ((eventflags_t)(1 << MODULE_GPIO_EXTCHANNEL_SYSREGEN))
|
|
| 325 |
#define MODULE_OS_IOEVENTFLAGS_SYSREGEN ((eventflags_t)(1 << MODULE_GPIO_INT_SYSREGEN))
|
|
| 324 | 326 |
|
| 325 | 327 |
/** |
| 326 | 328 |
* @brief Event flag to be set on a IR_INT interrupt. |
| 327 | 329 |
*/ |
| 328 |
#define MODULE_OS_IOEVENTFLAGS_IRINT ((eventflags_t)(1 << MODULE_GPIO_EXTCHANNEL_IRINT))
|
|
| 330 |
#define MODULE_OS_IOEVENTFLAGS_IRINT ((eventflags_t)(1 << MODULE_GPIO_INT_IRINT))
|
|
| 329 | 331 |
|
| 330 | 332 |
/** |
| 331 | 333 |
* @brief Event flag to be set on a GYRO_DRDY interrupt. |
| 332 | 334 |
*/ |
| 333 |
#define MODULE_OS_IOEVENTFLAGS_GYRODRDY ((eventflags_t)(1 << MODULE_GPIO_EXTCHANNEL_GYRODRDY))
|
|
| 335 |
#define MODULE_OS_IOEVENTFLAGS_GYRODRDY ((eventflags_t)(1 << MODULE_GPIO_INT_GYRODRDY))
|
|
| 334 | 336 |
|
| 335 | 337 |
/** |
| 336 | 338 |
* @brief Event flag to be set on a SYS_UART_UP interrupt. |
| 337 | 339 |
*/ |
| 338 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP ((eventflags_t)(1 << MODULE_GPIO_EXTCHANNEL_SYSUARTUP))
|
|
| 340 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP ((eventflags_t)(1 << MODULE_GPIO_INT_SYSUARTUP))
|
|
| 339 | 341 |
|
| 340 | 342 |
/** |
| 341 | 343 |
* @brief Event flag to be set on a ACCEL_INT interrupt. |
| 342 | 344 |
*/ |
| 343 |
#define MODULE_OS_IOEVENTFLAGS_ACCELINT ((eventflags_t)(1 << MODULE_GPIO_EXTCHANNEL_ACCELINT))
|
|
| 345 |
#define MODULE_OS_IOEVENTFLAGS_ACCELINT ((eventflags_t)(1 << MODULE_GPIO_INT_ACCELINT))
|
|
| 344 | 346 |
|
| 345 | 347 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__) |
| 346 | 348 |
/** |
| modules/LightRing_1-0/Makefile | ||
|---|---|---|
| 132 | 132 |
include $(CHIBIOS)/os/rt/rt.mk |
| 133 | 133 |
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk |
| 134 | 134 |
# Other files (optional). |
| 135 |
include $(CHIBIOS)/test/rt/test.mk |
|
| 135 |
include $(CHIBIOS)/test/lib/test.mk |
|
| 136 |
include $(CHIBIOS)/test/rt/rt_test.mk |
|
| 136 | 137 |
# AMiRo-BLT files |
| 137 | 138 |
include ../../bootloader/bootloader.mk |
| 138 | 139 |
# AMiRo-LLD files |
| modules/LightRing_1-0/chconf.h | ||
|---|---|---|
| 1 |
/* |
|
| 2 |
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform. |
|
| 3 |
Copyright (C) 2016..2018 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 os/modules/LightRing/chconf.h |
|
| 21 |
* @brief ChibiOS Configuration file for the LightRing v1.0 module. |
|
| 22 |
* @details Contains the application specific kernel settings. |
|
| 23 |
* |
|
| 24 |
* @addtogroup config |
|
| 25 |
* @details Kernel related settings and hooks. |
|
| 26 |
* @{
|
|
| 27 |
*/ |
|
| 28 |
|
|
| 29 |
#ifndef _CHCONF_H_ |
|
| 30 |
#define _CHCONF_H_ |
|
| 31 |
|
|
| 32 |
#include <aosconf.h> |
|
| 33 |
|
|
| 34 |
/*===========================================================================*/ |
|
| 35 |
/** |
|
| 36 |
* @name System timers settings |
|
| 37 |
* @{
|
|
| 38 |
*/ |
|
| 39 |
/*===========================================================================*/ |
|
| 40 |
|
|
| 41 |
/** |
|
| 42 |
* @brief System time counter resolution. |
|
| 43 |
* @note Allowed values are 16 or 32 bits. |
|
| 44 |
*/ |
|
| 45 |
#define CH_CFG_ST_RESOLUTION 16 |
|
| 46 |
|
|
| 47 |
/** |
|
| 48 |
* @brief System tick frequency. |
|
| 49 |
* @details Frequency of the system timer that drives the system ticks. This |
|
| 50 |
* setting also defines the system tick time unit. |
|
| 51 |
*/ |
|
| 52 |
#if (AMIROOS_CFG_TESTS_ENABLE != true) || defined(__DOXYGEN__) |
|
| 53 |
#define CH_CFG_ST_FREQUENCY 1000000UL |
|
| 54 |
#else |
|
| 55 |
#define CH_CFG_ST_FREQUENCY 100000UL |
|
| 56 |
#endif |
|
| 57 |
|
|
| 58 |
/** |
|
| 59 |
* @brief Time delta constant for the tick-less mode. |
|
| 60 |
* @note If this value is zero then the system uses the classic |
|
| 61 |
* periodic tick. This value represents the minimum number |
|
| 62 |
* of ticks that is safe to specify in a timeout directive. |
|
| 63 |
* The value one is not valid, timeouts are rounded up to |
|
| 64 |
* this value. |
|
| 65 |
*/ |
|
| 66 |
#if (AMIROOS_CFG_TESTS_ENABLE != true) || defined(__DOXYGEN__) |
|
| 67 |
#define CH_CFG_ST_TIMEDELTA 20 |
|
| 68 |
#else |
|
| 69 |
#define CH_CFG_ST_TIMEDELTA 2 |
|
| 70 |
#endif |
|
| 71 |
|
|
| 72 |
/** @} */ |
|
| 73 |
|
|
| 74 |
/*===========================================================================*/ |
|
| 75 |
/** |
|
| 76 |
* @name Port specific settings |
|
| 77 |
* @{
|
|
| 78 |
*/ |
|
| 79 |
/*===========================================================================*/ |
|
| 80 |
|
|
| 81 |
/** |
|
| 82 |
* @brief NVIC VTOR initialization offset. |
|
| 83 |
* @details On initialization, the code at this address in the flash memory will be executed. |
|
| 84 |
*/ |
|
| 85 |
#define CORTEX_VTOR_INIT 0x00006000U |
|
| 86 |
|
|
| 87 |
/** @} */ |
|
| 88 |
|
|
| 89 |
#include <aos_chconf.h> |
|
| 90 |
|
|
| 91 |
#endif /* _CHCONF_H_ */ |
|
| 92 |
|
|
| 93 |
/** @} */ |
|
| 1 |
/* |
|
| 2 |
* AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform. |
|
| 3 |
* Copyright (C) 2016..2018 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 os/modules/DiWheelDrive/chconf.h |
|
| 21 |
* @brief ChibiOS Configuration file for the DiWheelDrive v1.1 module. |
|
| 22 |
* @details Contains the application specific kernel settings. |
|
| 23 |
* |
|
| 24 |
* @addtogroup config |
|
| 25 |
* @details Kernel related settings and hooks. |
|
| 26 |
* @{
|
|
| 27 |
*/ |
|
| 28 |
|
|
| 29 |
#ifndef CHCONF_H |
|
| 30 |
#define CHCONF_H |
|
| 31 |
|
|
| 32 |
#define _CHIBIOS_RT_CONF_ |
|
| 33 |
#define _CHIBIOS_RT_CONF_VER_5_1_ |
|
| 34 |
|
|
| 35 |
/*===========================================================================*/ |
|
| 36 |
/** |
|
| 37 |
* @name System timers settings |
|
| 38 |
* @{
|
|
| 39 |
*/ |
|
| 40 |
/*===========================================================================*/ |
|
| 41 |
|
|
| 42 |
/** |
|
| 43 |
* @brief System time counter resolution. |
|
| 44 |
* @note Allowed values are 16 or 32 bits. |
|
| 45 |
*/ |
|
| 46 |
#if !defined(CH_CFG_ST_RESOLUTION) |
|
| 47 |
#define CH_CFG_ST_RESOLUTION 16 |
|
| 48 |
#endif |
|
| 49 |
|
|
| 50 |
/** |
|
| 51 |
* @brief System tick frequency. |
|
| 52 |
* @details Frequency of the system timer that drives the system ticks. This |
|
| 53 |
* setting also defines the system tick time unit. |
|
| 54 |
*/ |
|
| 55 |
#if !defined(CH_CFG_ST_FREQUENCY) |
|
| 56 |
#define CH_CFG_ST_FREQUENCY 1000000UL |
|
| 57 |
#endif |
|
| 58 |
|
|
| 59 |
/** |
|
| 60 |
* @brief Time intervals data size. |
|
| 61 |
* @note Allowed values are 16, 32 or 64 bits. |
|
| 62 |
*/ |
|
| 63 |
#if !defined(CH_CFG_INTERVALS_SIZE) |
|
| 64 |
#define CH_CFG_INTERVALS_SIZE 64 |
|
| 65 |
#endif |
|
| 66 |
|
|
| 67 |
/** |
|
| 68 |
* @brief Time types data size. |
|
| 69 |
* @note Allowed values are 16 or 32 bits. |
|
| 70 |
*/ |
|
| 71 |
#if !defined(CH_CFG_TIME_TYPES_SIZE) |
|
| 72 |
#define CH_CFG_TIME_TYPES_SIZE 32 |
|
| 73 |
#endif |
|
| 74 |
|
|
| 75 |
/** |
|
| 76 |
* @brief Time delta constant for the tick-less mode. |
|
| 77 |
* @note If this value is zero then the system uses the classic |
|
| 78 |
* periodic tick. This value represents the minimum number |
|
| 79 |
* of ticks that is safe to specify in a timeout directive. |
|
| 80 |
* The value one is not valid, timeouts are rounded up to |
|
| 81 |
* this value. |
|
| 82 |
*/ |
|
| 83 |
#if !defined(CH_CFG_ST_TIMEDELTA) |
|
| 84 |
#define CH_CFG_ST_TIMEDELTA 10 |
|
| 85 |
#endif |
|
Also available in: Unified diff