amiro-os / modules / DiWheelDrive_1-1 / module.h @ e2d7143f
History | View | Annotate | Download (19.2 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 Structures and constant for the DiWheelDrive module.
|
22 |
*
|
23 |
* @addtogroup diwheeldrive_module
|
24 |
* @{
|
25 |
*/
|
26 |
|
27 |
#ifndef _AMIROOS_MODULE_H_
|
28 |
#define _AMIROOS_MODULE_H_
|
29 |
|
30 |
#include <amiroos.h> |
31 |
|
32 |
/*===========================================================================*/
|
33 |
/**
|
34 |
* @name Module specific functions
|
35 |
* @{
|
36 |
*/
|
37 |
/*===========================================================================*/
|
38 |
|
39 |
/** @} */
|
40 |
|
41 |
/*===========================================================================*/
|
42 |
/**
|
43 |
* @name ChibiOS/HAL configuration
|
44 |
* @{
|
45 |
*/
|
46 |
/*===========================================================================*/
|
47 |
|
48 |
/**
|
49 |
* @brief CAN driver to use.
|
50 |
*/
|
51 |
#define MODULE_HAL_CAN CAND1
|
52 |
|
53 |
/**
|
54 |
* @brief Configuration for the CAN driver.
|
55 |
*/
|
56 |
extern CANConfig moduleHalCanConfig;
|
57 |
|
58 |
/**
|
59 |
* @brief I2C driver to access the compass.
|
60 |
*/
|
61 |
#define MODULE_HAL_I2C_COMPASS I2CD1
|
62 |
|
63 |
/**
|
64 |
* @brief Configuration for the compass I2C driver.
|
65 |
*/
|
66 |
extern I2CConfig moduleHalI2cCompassConfig;
|
67 |
|
68 |
/**
|
69 |
* @brief I2C driver to access multiplexer, proximity sensors, EEPROM and power monitor.
|
70 |
*/
|
71 |
#define MODULE_HAL_I2C_PROX_EEPROM_PWRMTR I2CD2
|
72 |
|
73 |
/**
|
74 |
* @brief Configuration for the multiplexer, proximity, EEPROM and power monitor I2C driver.
|
75 |
*/
|
76 |
extern I2CConfig moduleHalI2cProxEepromPwrmtrConfig;
|
77 |
|
78 |
/**
|
79 |
* @brief PWM driver to use.
|
80 |
*/
|
81 |
#define MODULE_HAL_PWM_DRIVE PWMD2
|
82 |
|
83 |
/**
|
84 |
* @brief Configuration for the PWM driver.
|
85 |
*/
|
86 |
extern PWMConfig moduleHalPwmDriveConfig;
|
87 |
|
88 |
/**
|
89 |
* @brief Drive PWM channel for the left wheel forward direction.
|
90 |
*/
|
91 |
#define MODULE_HAL_PWM_DRIVE_CHANNEL_LEFT_FORWARD ((apalPWMchannel_t)0) |
92 |
|
93 |
/**
|
94 |
* @brief Drive PWM channel for the left wheel backward direction.
|
95 |
*/
|
96 |
#define MODULE_HAL_PWM_DRIVE_CHANNEL_LEFT_BACKWARD ((apalPWMchannel_t)1) |
97 |
|
98 |
/**
|
99 |
* @brief Drive PWM channel for the right wheel forward direction.
|
100 |
*/
|
101 |
#define MODULE_HAL_PWM_DRIVE_CHANNEL_RIGHT_FORWARD ((apalPWMchannel_t)2) |
102 |
|
103 |
/**
|
104 |
* @brief Drive PWM channel for the right wheel backward direction.
|
105 |
*/
|
106 |
#define MODULE_HAL_PWM_DRIVE_CHANNEL_RIGHT_BACKWARD ((apalPWMchannel_t)3) |
107 |
|
108 |
/**
|
109 |
* @brief Quadrature encooder for the left wheel.
|
110 |
*/
|
111 |
#define MODULE_HAL_QEI_LEFT_WHEEL QEID3
|
112 |
|
113 |
/**
|
114 |
* @brief Quadrature encooder for the right wheel.
|
115 |
*/
|
116 |
#define MODULE_HAL_QEI_RIGHT_WHEEL QEID4
|
117 |
|
118 |
/**
|
119 |
* @brief Configuration for both quadrature encoders.
|
120 |
*/
|
121 |
extern QEIConfig moduleHalQeiConfig;
|
122 |
|
123 |
/**
|
124 |
* @brief QEI increments per wheel revolution.
|
125 |
* @details 2 signal edges per pulse * 2 signals * 16 pulses per motor revolution * 22:1 gearbox
|
126 |
*/
|
127 |
#define MODULE_HAL_QEI_INCREMENTS_PER_REVOLUTION (apalQEICount_t)(2 * 2 * 16 * 22) |
128 |
|
129 |
/**
|
130 |
* @brief Serial driver of the programmer interface.
|
131 |
*/
|
132 |
#define MODULE_HAL_PROGIF SD1
|
133 |
|
134 |
/**
|
135 |
* @brief Configuration for the programmer serial interface driver.
|
136 |
*/
|
137 |
extern SerialConfig moduleHalProgIfConfig;
|
138 |
|
139 |
/**
|
140 |
* @brief SPI interface driver for the motion sensors (gyroscope and accelerometer).
|
141 |
*/
|
142 |
#define MODULE_HAL_SPI_MOTION SPID1
|
143 |
|
144 |
/**
|
145 |
* @brief Configuration for the motion sensor SPI interface driver to communicate with the accelerometer.
|
146 |
*/
|
147 |
extern SPIConfig moduleHalSpiAccelerometerConfig;
|
148 |
|
149 |
/**
|
150 |
* @brief Configuration for the motion sensor SPI interface driver to communicate with the gyroscope.
|
151 |
*/
|
152 |
extern SPIConfig moduleHalSpiGyroscopeConfig;
|
153 |
|
154 |
/**
|
155 |
* @brief Real-Time Clock driver.
|
156 |
*/
|
157 |
#define MODULE_HAL_RTC RTCD1
|
158 |
|
159 |
/** @} */
|
160 |
|
161 |
/*===========================================================================*/
|
162 |
/**
|
163 |
* @name GPIO definitions
|
164 |
* @{
|
165 |
*/
|
166 |
/*===========================================================================*/
|
167 |
|
168 |
/**
|
169 |
* @brief LED output signal GPIO.
|
170 |
*/
|
171 |
extern ROMCONST apalControlGpio_t moduleGpioLed;
|
172 |
|
173 |
/**
|
174 |
* @brief POWER_EN output signal GPIO.
|
175 |
*/
|
176 |
extern ROMCONST apalControlGpio_t moduleGpioPowerEn;
|
177 |
|
178 |
/**
|
179 |
* @brief COMPASS_DRDY input signal GPIO.
|
180 |
*/
|
181 |
extern ROMCONST apalControlGpio_t moduleGpioCompassDrdy;
|
182 |
|
183 |
/**
|
184 |
* @brief IR_INT input signal GPIO.
|
185 |
*/
|
186 |
extern ROMCONST apalControlGpio_t moduleGpioIrInt;
|
187 |
|
188 |
/**
|
189 |
* @brief GYRO_DRDY input signal GPIO.
|
190 |
*/
|
191 |
extern ROMCONST apalControlGpio_t moduleGpioGyroDrdy;
|
192 |
|
193 |
/**
|
194 |
* @brief SYS_UART_UP bidirectional signal GPIO.
|
195 |
*/
|
196 |
extern ROMCONST apalControlGpio_t moduleGpioSysUartUp;
|
197 |
|
198 |
/**
|
199 |
* @brief ACCEL_INT input signal GPIO.
|
200 |
*/
|
201 |
extern ROMCONST apalControlGpio_t moduleGpioAccelInt;
|
202 |
|
203 |
/**
|
204 |
* @brief SYS_SNYC bidirectional signal GPIO.
|
205 |
*/
|
206 |
extern ROMCONST apalControlGpio_t moduleGpioSysSync;
|
207 |
|
208 |
/**
|
209 |
* @brief PATH_DCSTAT input signal GPIO.
|
210 |
*/
|
211 |
extern ROMCONST apalControlGpio_t moduleGpioPathDcStat;
|
212 |
|
213 |
/**
|
214 |
* @brief PATH_DCEN output signal GPIO.
|
215 |
*/
|
216 |
extern ROMCONST apalControlGpio_t moduleGpioPathDcEn;
|
217 |
|
218 |
/**
|
219 |
* @brief SYS_PD bidirectional signal GPIO.
|
220 |
*/
|
221 |
extern ROMCONST apalControlGpio_t moduleGpioSysPd;
|
222 |
|
223 |
/**
|
224 |
* @brief SYS_REG_EN input signal GPIO.
|
225 |
*/
|
226 |
extern ROMCONST apalControlGpio_t moduleGpioSysRegEn;
|
227 |
|
228 |
/**
|
229 |
* @brief SYS_WARMRST bidirectional signal GPIO.
|
230 |
*/
|
231 |
extern ROMCONST apalControlGpio_t moduleGpioSysWarmrst;
|
232 |
|
233 |
/** @} */
|
234 |
|
235 |
/*===========================================================================*/
|
236 |
/**
|
237 |
* @name AMiRo-OS core configurations
|
238 |
* @{
|
239 |
*/
|
240 |
/*===========================================================================*/
|
241 |
|
242 |
/**
|
243 |
* @brief Event flag to be set on a SYS_SYNC interrupt.
|
244 |
*/
|
245 |
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC AOS_IOEVENT_FLAG(GPIOC_SYS_INT_N)
|
246 |
|
247 |
/**
|
248 |
* @brief Event flag to be set on a SYS_WARMRST interrupt.
|
249 |
*/
|
250 |
#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST AOS_IOEVENT_FLAG(GPIOD_SYS_WARMRST_N)
|
251 |
|
252 |
/**
|
253 |
* @brief Event flag to be set on a PATH_DCSTAT interrupt.
|
254 |
*/
|
255 |
#define MODULE_OS_IOEVENTFLAGS_PATHDCSTAT AOS_IOEVENT_FLAG(GPIOC_PATH_DCEN)
|
256 |
|
257 |
/**
|
258 |
* @brief Event flag to be set on a COMPASS_DRDY interrupt.
|
259 |
*/
|
260 |
#define MODULE_OS_IOEVENTFLAGS_COMPASSDRDY AOS_IOEVENT_FLAG(GPIOB_COMPASS_DRDY)
|
261 |
|
262 |
/**
|
263 |
* @brief Event flag to be set on a SYS_PD interrupt.
|
264 |
*/
|
265 |
#define MODULE_OS_IOEVENTFLAGS_SYSPD AOS_IOEVENT_FLAG(GPIOC_SYS_PD_N)
|
266 |
|
267 |
/**
|
268 |
* @brief Event flag to be set on a SYS_REG_EN interrupt.
|
269 |
*/
|
270 |
#define MODULE_OS_IOEVENTFLAGS_SYSREGEN AOS_IOEVENT_FLAG(GPIOC_SYS_REG_EN)
|
271 |
|
272 |
/**
|
273 |
* @brief Event flag to be set on a IR_INT interrupt.
|
274 |
*/
|
275 |
#define MODULE_OS_IOEVENTFLAGS_IRINT AOS_IOEVENT_FLAG(GPIOB_IR_INT)
|
276 |
|
277 |
/**
|
278 |
* @brief Event flag to be set on a GYRO_DRDY interrupt.
|
279 |
*/
|
280 |
#define MODULE_OS_IOEVENTFLAGS_GYRODRDY AOS_IOEVENT_FLAG(GPIOB_GYRO_DRDY)
|
281 |
|
282 |
/**
|
283 |
* @brief Event flag to be set on a SYS_UART_UP interrupt.
|
284 |
*/
|
285 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP AOS_IOEVENT_FLAG(GPIOB_SYS_UART_UP)
|
286 |
|
287 |
/**
|
288 |
* @brief Event flag to be set on a ACCEL_INT interrupt.
|
289 |
*/
|
290 |
#define MODULE_OS_IOEVENTFLAGS_ACCELINT AOS_IOEVENT_FLAG(GPIOB_ACCEL_INT_N)
|
291 |
|
292 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
293 |
/**
|
294 |
* @brief Shell prompt text.
|
295 |
*/
|
296 |
extern ROMCONST char* moduleShellPrompt; |
297 |
#endif
|
298 |
|
299 |
/**
|
300 |
* @brief Additional HAL initialization hook.
|
301 |
*/
|
302 |
#define MODULE_INIT_HAL_EXTRA() { \
|
303 |
qeiInit(); \ |
304 |
} |
305 |
|
306 |
/**
|
307 |
* @brief Interrupt initialization macro.
|
308 |
* @note SSSP related interrupt signals are already initialized in 'aos_system.c'.
|
309 |
*/
|
310 |
#define MODULE_INIT_INTERRUPTS() { \
|
311 |
/* COMPASS_DRDY */ \
|
312 |
palSetPadCallback(moduleGpioCompassDrdy.gpio->port, moduleGpioCompassDrdy.gpio->pad, _intCallback, &moduleGpioCompassDrdy.gpio->pad); \ |
313 |
palEnablePadEvent(moduleGpioCompassDrdy.gpio->port, moduleGpioCompassDrdy.gpio->pad, APAL2CH_EDGE(moduleGpioCompassDrdy.meta.edge)); \ |
314 |
/* IR_INT */ \
|
315 |
palSetPadCallback(moduleGpioIrInt.gpio->port, moduleGpioIrInt.gpio->pad, _intCallback, &moduleGpioIrInt.gpio->pad); \ |
316 |
palEnablePadEvent(moduleGpioIrInt.gpio->port, moduleGpioIrInt.gpio->pad, APAL2CH_EDGE(moduleGpioIrInt.meta.edge)); \ |
317 |
/* GYRO_DRDY */ \
|
318 |
palSetPadCallback(moduleGpioGyroDrdy.gpio->port, moduleGpioGyroDrdy.gpio->pad, _intCallback, &moduleGpioGyroDrdy.gpio->pad); \ |
319 |
palEnablePadEvent(moduleGpioGyroDrdy.gpio->port, moduleGpioGyroDrdy.gpio->pad, APAL2CH_EDGE(moduleGpioGyroDrdy.meta.edge)); \ |
320 |
/* ACCEL_INT */ \
|
321 |
palSetPadCallback(moduleGpioAccelInt.gpio->port, moduleGpioAccelInt.gpio->pad, _intCallback, &moduleGpioAccelInt.gpio->pad); \ |
322 |
palEnablePadEvent(moduleGpioAccelInt.gpio->port, moduleGpioAccelInt.gpio->pad, APAL2CH_EDGE(moduleGpioAccelInt.meta.edge)); \ |
323 |
/* PATH_DCSTAT */ \
|
324 |
palSetPadCallback(moduleGpioPathDcStat.gpio->port, moduleGpioPathDcStat.gpio->pad, _intCallback, &moduleGpioPathDcStat.gpio->pad); \ |
325 |
palEnablePadEvent(moduleGpioPathDcStat.gpio->port, moduleGpioPathDcStat.gpio->pad, APAL2CH_EDGE(moduleGpioPathDcStat.meta.edge)); \ |
326 |
/* SYS_REG_EN */ \
|
327 |
palSetPadCallback(moduleGpioSysRegEn.gpio->port, moduleGpioSysRegEn.gpio->pad, _intCallback, &moduleGpioSysRegEn.gpio->pad); \ |
328 |
palEnablePadEvent(moduleGpioSysRegEn.gpio->port, moduleGpioSysRegEn.gpio->pad, APAL2CH_EDGE(moduleGpioSysRegEn.meta.edge)); \ |
329 |
/* SYS_WARMRST */ \
|
330 |
palSetPadCallback(moduleGpioSysWarmrst.gpio->port, moduleGpioSysWarmrst.gpio->pad, _intCallback, &moduleGpioSysWarmrst.gpio->pad); \ |
331 |
palEnablePadEvent(moduleGpioSysWarmrst.gpio->port, moduleGpioSysWarmrst.gpio->pad, APAL2CH_EDGE(moduleGpioSysWarmrst.meta.edge)); \ |
332 |
} |
333 |
|
334 |
/**
|
335 |
* @brief Unit test initialization hook.
|
336 |
*/
|
337 |
#define MODULE_INIT_TESTS() { \
|
338 |
/* add unit-test shell commands */ \
|
339 |
aosShellAddCommand(&aos.shell, &moduleUtAlldA3906.shellcmd); \ |
340 |
aosShellAddCommand(&aos.shell, &moduleUtAlldAt24c01bn.shellcmd); \ |
341 |
aosShellAddCommand(&aos.shell, &moduleUtAlldHmc5883l.shellcmd); \ |
342 |
aosShellAddCommand(&aos.shell, &moduleUtAlldIna219.shellcmd); \ |
343 |
aosShellAddCommand(&aos.shell, &moduleUtAlldL3g4200d.shellcmd); \ |
344 |
aosShellAddCommand(&aos.shell, &moduleUtAlldLed.shellcmd); \ |
345 |
aosShellAddCommand(&aos.shell, &moduleUtAlldLis331dlh.shellcmd); \ |
346 |
aosShellAddCommand(&aos.shell, &moduleUtAlldLtc4412.shellcmd); \ |
347 |
aosShellAddCommand(&aos.shell, &moduleUtAlldPca9544a.shellcmd); \ |
348 |
aosShellAddCommand(&aos.shell, &moduleUtAlldTps62113.shellcmd); \ |
349 |
aosShellAddCommand(&aos.shell, &moduleUtAlldVcnl4020.shellcmd); \ |
350 |
} |
351 |
|
352 |
/**
|
353 |
* @brief Periphery communication interfaces initialization hook.
|
354 |
*/
|
355 |
#define MODULE_INIT_PERIPHERY_COMM() { \
|
356 |
/* serial driver */ \
|
357 |
sdStart(&MODULE_HAL_PROGIF, &moduleHalProgIfConfig); \ |
358 |
/* I2C */ \
|
359 |
moduleHalI2cCompassConfig.clock_speed = (HMC5883L_LLD_I2C_MAXFREQUENCY < moduleHalI2cCompassConfig.clock_speed) ? HMC5883L_LLD_I2C_MAXFREQUENCY : moduleHalI2cCompassConfig.clock_speed; \ |
360 |
moduleHalI2cCompassConfig.duty_cycle = (moduleHalI2cCompassConfig.clock_speed <= 100000) ? STD_DUTY_CYCLE : FAST_DUTY_CYCLE_2; \
|
361 |
i2cStart(&MODULE_HAL_I2C_COMPASS, &moduleHalI2cCompassConfig); \ |
362 |
moduleHalI2cProxEepromPwrmtrConfig.clock_speed = (PCA9544A_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxEepromPwrmtrConfig.clock_speed) ? PCA9544A_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxEepromPwrmtrConfig.clock_speed; \ |
363 |
moduleHalI2cProxEepromPwrmtrConfig.clock_speed = (VCNL4020_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxEepromPwrmtrConfig.clock_speed) ? VCNL4020_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxEepromPwrmtrConfig.clock_speed; \ |
364 |
moduleHalI2cProxEepromPwrmtrConfig.clock_speed = (AT24C01BN_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxEepromPwrmtrConfig.clock_speed) ? AT24C01BN_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxEepromPwrmtrConfig.clock_speed; \ |
365 |
moduleHalI2cProxEepromPwrmtrConfig.clock_speed = (INA219_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxEepromPwrmtrConfig.clock_speed) ? INA219_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxEepromPwrmtrConfig.clock_speed; \ |
366 |
moduleHalI2cProxEepromPwrmtrConfig.duty_cycle = (moduleHalI2cProxEepromPwrmtrConfig.clock_speed <= 100000) ? STD_DUTY_CYCLE : FAST_DUTY_CYCLE_2; \
|
367 |
i2cStart(&MODULE_HAL_I2C_PROX_EEPROM_PWRMTR, &moduleHalI2cProxEepromPwrmtrConfig); \ |
368 |
/* SPI is shared between accelerometer and gyroscope and needs to be restarted for each transmission */ \
|
369 |
/* PWM */ \
|
370 |
pwmStart(&MODULE_HAL_PWM_DRIVE, &moduleHalPwmDriveConfig); \ |
371 |
/* QEI */ \
|
372 |
qeiStart(&MODULE_HAL_QEI_LEFT_WHEEL, &moduleHalQeiConfig); \ |
373 |
qeiStart(&MODULE_HAL_QEI_RIGHT_WHEEL, &moduleHalQeiConfig); \ |
374 |
qeiEnable(&MODULE_HAL_QEI_LEFT_WHEEL); \ |
375 |
qeiEnable(&MODULE_HAL_QEI_RIGHT_WHEEL); \ |
376 |
} |
377 |
|
378 |
/**
|
379 |
* @brief Periphery communication interface deinitialization hook.
|
380 |
*/
|
381 |
#define MODULE_SHUTDOWN_PERIPHERY_COMM() { \
|
382 |
/* PWM */ \
|
383 |
pwmStop(&MODULE_HAL_PWM_DRIVE); \ |
384 |
/* QEI */ \
|
385 |
qeiDisable(&MODULE_HAL_QEI_LEFT_WHEEL); \ |
386 |
qeiDisable(&MODULE_HAL_QEI_RIGHT_WHEEL); \ |
387 |
qeiStop(&MODULE_HAL_QEI_LEFT_WHEEL); \ |
388 |
qeiStop(&MODULE_HAL_QEI_RIGHT_WHEEL); \ |
389 |
/* I2C */ \
|
390 |
i2cStop(&MODULE_HAL_I2C_COMPASS); \ |
391 |
i2cStop(&MODULE_HAL_I2C_PROX_EEPROM_PWRMTR); \ |
392 |
/* don't stop the serial driver so messages can still be printed */ \
|
393 |
} |
394 |
|
395 |
/** @} */
|
396 |
|
397 |
/*===========================================================================*/
|
398 |
/**
|
399 |
* @name Startup Shutdown Synchronization Protocol (SSSP)
|
400 |
* @{
|
401 |
*/
|
402 |
/*===========================================================================*/
|
403 |
|
404 |
/**
|
405 |
* @brief PD signal GPIO.
|
406 |
*/
|
407 |
#define moduleSsspGpioPd moduleGpioSysPd
|
408 |
|
409 |
/**
|
410 |
* @brief SYNC signal GPIO.
|
411 |
*/
|
412 |
#define moduleSsspGpioSync moduleGpioSysSync
|
413 |
|
414 |
/**
|
415 |
* @brief UP signal GPIO.
|
416 |
*/
|
417 |
#define moduleSsspGpioUp moduleGpioSysUartUp
|
418 |
|
419 |
/**
|
420 |
* @brief Event flags for PD signal events.
|
421 |
*/
|
422 |
#define MODULE_SSSP_EVENTFLAGS_PD MODULE_OS_IOEVENTFLAGS_SYSPD
|
423 |
|
424 |
/**
|
425 |
* @brief Event flags for SYNC signal events.
|
426 |
*/
|
427 |
#define MODULE_SSSP_EVENTFLAGS_SYNC MODULE_OS_IOEVENTFLAGS_SYSSYNC
|
428 |
|
429 |
/**
|
430 |
* @brief Event flags for UP signal events.
|
431 |
*/
|
432 |
#define MODULE_SSSP_EVENTFLAGS_UP MODULE_OS_IOEVENTFLAGS_SYSUARTUP
|
433 |
|
434 |
/** @} */
|
435 |
|
436 |
/*===========================================================================*/
|
437 |
/**
|
438 |
* @name Low-level drivers
|
439 |
* @{
|
440 |
*/
|
441 |
/*===========================================================================*/
|
442 |
#include <alld_a3906.h> |
443 |
#include <alld_at24c01bn-sh-b.h> |
444 |
#include <alld_hmc5883l.h> |
445 |
#include <alld_ina219.h> |
446 |
#include <alld_l3g4200d.h> |
447 |
#include <alld_led.h> |
448 |
#include <alld_lis331dlh.h> |
449 |
#include <alld_ltc4412.h> |
450 |
#include <alld_pca9544a.h> |
451 |
#include <alld_tps62113.h> |
452 |
#include <alld_vcnl4020.h> |
453 |
|
454 |
/**
|
455 |
* @brief Motor driver.
|
456 |
*/
|
457 |
extern A3906Driver moduleLldMotors;
|
458 |
|
459 |
/**
|
460 |
* @brief EEPROM driver.
|
461 |
*/
|
462 |
extern AT24C01BNDriver moduleLldEeprom;
|
463 |
|
464 |
/**
|
465 |
* @brief Compass driver.
|
466 |
*/
|
467 |
extern HMC5883LDriver moduleLldCompass;
|
468 |
|
469 |
/**
|
470 |
* @brief Power monitor (VDD) driver.
|
471 |
*/
|
472 |
extern INA219Driver moduleLldPowerMonitorVdd;
|
473 |
|
474 |
/**
|
475 |
* @brief Gyroscope driver.
|
476 |
*/
|
477 |
extern L3G4200DDriver moduleLldGyroscope;
|
478 |
|
479 |
/**
|
480 |
* @brief Status LED driver.
|
481 |
*/
|
482 |
extern LEDDriver moduleLldStatusLed;
|
483 |
|
484 |
/**
|
485 |
* @brief Accelerometer driver.
|
486 |
*/
|
487 |
extern LIS331DLHDriver moduleLldAccelerometer;
|
488 |
|
489 |
/**
|
490 |
* @brief Power path controler (charging pins) driver.
|
491 |
*/
|
492 |
extern LTC4412Driver moduleLldPowerPathController;
|
493 |
|
494 |
/**
|
495 |
* @brief I2C multiplexer driver.
|
496 |
*/
|
497 |
extern PCA9544ADriver moduleLldI2cMultiplexer;
|
498 |
|
499 |
/**
|
500 |
* @brief Step down converter (VDRIVE) driver.
|
501 |
*/
|
502 |
extern TPS62113Driver moduleLldStepDownConverterVdrive;
|
503 |
|
504 |
/**
|
505 |
* @brief Proximity sensor driver.
|
506 |
*/
|
507 |
extern VCNL4020Driver moduleLldProximity;
|
508 |
|
509 |
/** @} */
|
510 |
|
511 |
/*===========================================================================*/
|
512 |
/**
|
513 |
* @name Unit tests (UT)
|
514 |
* @{
|
515 |
*/
|
516 |
/*===========================================================================*/
|
517 |
#if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
518 |
#include <ut_alld_a3906.h> |
519 |
#include <ut_alld_at24c01bn-sh-b.h> |
520 |
#include <ut_alld_hmc5883l.h> |
521 |
#include <ut_alld_ina219.h> |
522 |
#include <ut_alld_l3g4200d.h> |
523 |
#include <ut_alld_led.h> |
524 |
#include <ut_alld_lis331dlh.h> |
525 |
#include <ut_alld_ltc4412.h> |
526 |
#include <ut_alld_pca9544a.h> |
527 |
#include <ut_alld_tps62113.h> |
528 |
#include <ut_alld_vcnl4020.h> |
529 |
|
530 |
/**
|
531 |
* @brief A3906 (motor driver) unit test object.
|
532 |
*/
|
533 |
extern aos_unittest_t moduleUtAlldA3906;
|
534 |
|
535 |
/**
|
536 |
* @brief AT24C01BN-SH-B (EEPROM) unit test object.
|
537 |
*/
|
538 |
extern aos_unittest_t moduleUtAlldAt24c01bn;
|
539 |
|
540 |
/**
|
541 |
* @brief HMC5883L (compass) unit test object.
|
542 |
*/
|
543 |
extern aos_unittest_t moduleUtAlldHmc5883l;
|
544 |
|
545 |
/**
|
546 |
* @brief INA219 (power monitor) unit test object.
|
547 |
*/
|
548 |
extern aos_unittest_t moduleUtAlldIna219;
|
549 |
|
550 |
/**
|
551 |
* @brief L3G4200D (gyroscope) unit test object.
|
552 |
*/
|
553 |
extern aos_unittest_t moduleUtAlldL3g4200d;
|
554 |
|
555 |
/**
|
556 |
* @brief Status LED unit test object.
|
557 |
*/
|
558 |
extern aos_unittest_t moduleUtAlldLed;
|
559 |
|
560 |
/**
|
561 |
* @brief LIS331DLH (accelerometer) unit test object.
|
562 |
*/
|
563 |
extern aos_unittest_t moduleUtAlldLis331dlh;
|
564 |
|
565 |
/**
|
566 |
* @brief LTC4412 (power path controller) unit test object.
|
567 |
*/
|
568 |
extern aos_unittest_t moduleUtAlldLtc4412;
|
569 |
|
570 |
/**
|
571 |
* @brief PCA9544A (I2C multiplexer) unit test object.
|
572 |
*/
|
573 |
extern aos_unittest_t moduleUtAlldPca9544a;
|
574 |
|
575 |
/**
|
576 |
* @brief TPS62113 (step-down converter) unit test object.
|
577 |
*/
|
578 |
extern aos_unittest_t moduleUtAlldTps62113;
|
579 |
|
580 |
/**
|
581 |
* @brief VCNL4020 (proximity sensor) unit test object.
|
582 |
*/
|
583 |
extern aos_unittest_t moduleUtAlldVcnl4020;
|
584 |
|
585 |
#endif /* AMIROOS_CFG_TESTS_ENABLE == true */ |
586 |
|
587 |
/** @} */
|
588 |
|
589 |
#endif /* _AMIROOS_MODULE_H_ */ |
590 |
|
591 |
/** @} */
|