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