Statistics
| Branch: | Tag: | Revision:

amiro-os / modules / DiWheelDrive_1-1 / module.c @ 70dd091e

History | View | Annotate | Download (17.783 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
#include "module.h"
28

    
29
/*===========================================================================*/
30
/**
31
 * @name Module specific functions
32
 * @{
33
 */
34
/*===========================================================================*/
35

    
36
/** @} */
37

    
38
/*===========================================================================*/
39
/**
40
 * @name ChibiOS/HAL configuration
41
 * @{
42
 */
43
/*===========================================================================*/
44

    
45
CANConfig moduleHalCanConfig = {
46
  /* mcr  */ CAN_MCR_ABOM | CAN_MCR_AWUM | CAN_MCR_TXFP,
47
  /* btr  */ CAN_BTR_SJW(1) | CAN_BTR_TS2(2) | CAN_BTR_TS1(13) | CAN_BTR_BRP(1),
48
};
49

    
50
I2CConfig moduleHalI2cCompassConfig = {
51
  /* I²C mode   */ OPMODE_I2C,
52
  /* frequency  */ 400000,
53
  /* duty cycle */ FAST_DUTY_CYCLE_2,
54
};
55

    
56
I2CConfig moduleHalI2cProxEepromPwrmtrConfig = {
57
  /* I²C mode   */ OPMODE_I2C,
58
  /* frequency  */ 400000,
59
  /* duty cycle */ FAST_DUTY_CYCLE_2,
60
};
61

    
62
PWMConfig moduleHalPwmDriveConfig = {
63
  /* frequency              */ 7200000,
64
  /* period                 */ 360,
65
  /* callback               */ NULL,
66
  /* channel configurations */ {
67
    /* channel 0              */ {
68
      /* mode                   */ PWM_OUTPUT_ACTIVE_HIGH,
69
      /* callback               */ NULL
70
    },
71
    /* channel 1              */ {
72
      /* mode                   */ PWM_OUTPUT_ACTIVE_HIGH,
73
      /* callback               */ NULL
74
    },
75
    /* channel 2              */ {
76
      /* mode                   */ PWM_OUTPUT_ACTIVE_HIGH,
77
      /* callback               */ NULL
78
    },
79
    /* channel 3              */ {
80
      /* mode                   */ PWM_OUTPUT_ACTIVE_HIGH,
81
      /* callback               */ NULL
82
    },
83
  },
84
  /* TIM CR2 register       */ 0,
85
#if (STM32_PWM_USE_ADVANCED == TRUE)
86
  /* TIM BDTR register      */ 0,
87
#endif /* (STM32_PWM_USE_ADVANCED == TRUE) */
88
  /* TIM DIER register      */ 0
89
};
90

    
91
QEIConfig moduleHalQeiConfig = {
92
  /* mode           */ QEI_COUNT_BOTH,
93
  /* channel config */ {
94
    /* channel 0 */ {
95
      /* input mode */ QEI_INPUT_NONINVERTED,
96
    },
97
    /* channel 1 */ {
98
      /* input mode */ QEI_INPUT_NONINVERTED,
99
    },
100
  },
101
  /* encoder range  */  0x10000u,
102
};
103

    
104
SerialConfig moduleHalProgIfConfig = {
105
  /* bit rate */ 115200,
106
  /* CR1      */ 0,
107
  /* CR1      */ 0,
108
  /* CR1      */ 0,
109
};
110

    
111
SPIConfig moduleHalSpiAccelerometerConfig = {
112
  /* circular buffer mode         */ false,
113
  /* callback function pointer    */ NULL,
114
  /* chip select line port        */ PAL_PORT(LINE_ACCEL_SS_N),
115
  /* chip select line pad number  */ PAL_PAD(LINE_ACCEL_SS_N),
116
  /* CR1                          */ SPI_CR1_BR_0,
117
  /* CR2                          */ SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN,
118
};
119

    
120
SPIConfig moduleHalSpiGyroscopeConfig = {
121
  /* circular buffer mode         */ false,
122
  /* callback function pointer    */ NULL,
123
  /* chip select line port        */ PAL_PORT(LINE_GYRO_SS_N),
124
  /* chip select line pad number  */ PAL_PAD(LINE_GYRO_SS_N),
125
  /* CR1                          */ SPI_CR1_BR_0,
126
  /* CR2                          */ SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN,
127
};
128

    
129
/** @} */
130

    
131
/*===========================================================================*/
132
/**
133
 * @name GPIO definitions
134
 * @{
135
 */
136
/*===========================================================================*/
137

    
138
/**
139
 * @brief   LED output signal GPIO.
140
 */
141
static apalGpio_t _gpioLed = {
142
  /* line */ LINE_LED,
143
};
144
ROMCONST apalControlGpio_t moduleGpioLed = {
145
  /* GPIO */ &_gpioLed,
146
  /* meta */ {
147
    /* direction      */ APAL_GPIO_DIRECTION_OUTPUT,
148
    /* active state   */ APAL_GPIO_ACTIVE_LOW,
149
    /* interrupt edge */ APAL_GPIO_EDGE_NONE,
150
  },
151
};
152

    
153
/**
154
 * @brief   POWER_EN output signal GPIO.
155
 */
156
static apalGpio_t _gpioPowerEn = {
157
  /* line */ LINE_POWER_EN,
158
};
159
ROMCONST apalControlGpio_t moduleGpioPowerEn = {
160
  /* GPIO */ &_gpioPowerEn,
161
  /* meta */ {
162
    /* direction      */ APAL_GPIO_DIRECTION_OUTPUT,
163
    /* active state   */ APAL_GPIO_ACTIVE_HIGH,
164
    /* interrupt edge */ APAL_GPIO_EDGE_NONE,
165
  },
166
};
167

    
168
/**
169
 * @brief   COMPASS_DRDY output signal GPIO.
170
 */
171
static apalGpio_t _gpioCompassDrdy = {
172
  /* line */ LINE_COMPASS_DRDY,
173
};
174
ROMCONST apalControlGpio_t moduleGpioCompassDrdy = {
175
  /* GPIO */ &_gpioCompassDrdy,
176
  /* meta */ {
177
    /* direction      */ APAL_GPIO_DIRECTION_INPUT,
178
    /* active state   */ (L3G4200D_LLD_INT_EDGE == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_ACTIVE_HIGH : APAL_GPIO_ACTIVE_LOW,
179
    /* interrupt edge */ L3G4200D_LLD_INT_EDGE,
180
  },
181
};
182

    
183
/**
184
 * @brief   IR_INT input signal GPIO.
185
 */
186
static apalGpio_t _gpioIrInt = {
187
  /* line */ LINE_IR_INT,
188
};
189
ROMCONST apalControlGpio_t moduleGpioIrInt = {
190
  /* GPIO */ &_gpioIrInt,
191
  /* meta */ {
192
    /* direction      */ APAL_GPIO_DIRECTION_INPUT,
193
    /* active state   */ (VCNL4020_LLD_INT_EDGE == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_ACTIVE_HIGH : APAL_GPIO_ACTIVE_LOW,
194
    /* interrupt edge */ VCNL4020_LLD_INT_EDGE,
195
  },
196
};
197

    
198
/**
199
 * @brief   GYRO_DRDY input signal GPIO.
200
 */
201
static apalGpio_t _gpioGyroDrdy = {
202
  /* line */ LINE_GYRO_DRDY,
203
};
204
ROMCONST apalControlGpio_t moduleGpioGyroDrdy = {
205
  /* GPIO */ &_gpioGyroDrdy,
206
  /* meta */ {
207
    /* direction      */ APAL_GPIO_DIRECTION_INPUT,
208
    /* active state   */ (L3G4200D_LLD_INT_EDGE == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_ACTIVE_HIGH : APAL_GPIO_ACTIVE_LOW,
209
    /* interrupt edge */ L3G4200D_LLD_INT_EDGE,
210
  },
211
};
212

    
213
/**
214
 * @brief   SYS_UART_UP bidirectional signal GPIO.
215
 */
216
static apalGpio_t _gpioSysUartUp = {
217
  /* line */ LINE_SYS_UART_UP,
218
};
219
ROMCONST apalControlGpio_t moduleGpioSysUartUp = {
220
  /* GPIO */ &_gpioSysUartUp,
221
  /* meta */ {
222
    /* direction      */ APAL_GPIO_DIRECTION_BIDIRECTIONAL,
223
    /* active state   */ APAL_GPIO_ACTIVE_LOW,
224
    /* interrupt edge */ APAL_GPIO_EDGE_BOTH,
225
  },
226
};
227

    
228
/**
229
 * @brief   ACCEL_INT input signal GPIO.
230
 */
231
static apalGpio_t _gpioAccelInt = {
232
  /* line */ LINE_ACCEL_INT_N,
233
};
234
ROMCONST apalControlGpio_t moduleGpioAccelInt = {
235
  /* GPIO */ &_gpioAccelInt,
236
  /* meta */ {
237
    /* direction      */ APAL_GPIO_DIRECTION_INPUT,
238
    /* active state   */ (LIS331DLH_LLD_INT_EDGE == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_ACTIVE_HIGH : APAL_GPIO_ACTIVE_LOW,
239
    /* interrupt edge */ LIS331DLH_LLD_INT_EDGE,
240
  },
241
};
242

    
243
/**
244
 * @brief   SYS_SNYC bidirectional signal GPIO.
245
 */
246
static apalGpio_t _gpioSysSync = {
247
  /* line */ LINE_SYS_INT_N,
248
};
249
ROMCONST apalControlGpio_t  moduleGpioSysSync = {
250
  /* GPIO */ &_gpioSysSync,
251
  /* meta */ {
252
    /* direction      */ APAL_GPIO_DIRECTION_BIDIRECTIONAL,
253
    /* active state   */ APAL_GPIO_ACTIVE_LOW,
254
    /* interrupt edge */ APAL_GPIO_EDGE_BOTH,
255
  },
256
};
257

    
258
/**
259
 * @brief   PATH_DCSTAT input signal GPIO.
260
 */
261
static apalGpio_t _gpioPathDcStat = {
262
  /* line */ LINE_PATH_DCSTAT,
263
};
264
ROMCONST apalControlGpio_t moduleGpioPathDcStat = {
265
  /* GPIO */ &_gpioPathDcStat,
266
  /* meta */ {
267
    /* direction      */ APAL_GPIO_DIRECTION_INPUT,
268
    /* active state   */ LTC4412_LLD_STAT_ACTIVE_STATE,
269
    /* interrupt edge */ APAL_GPIO_EDGE_BOTH,
270
  },
271
};
272

    
273
/**
274
 * @brief   PATH_DCEN output signal GPIO.
275
 */
276
static apalGpio_t _gpioPathDcEn = {
277
  /* line */ LINE_PATH_DCEN,
278
};
279
ROMCONST apalControlGpio_t moduleGpioPathDcEn = {
280
  /* GPIO */ &_gpioPathDcEn,
281
  /* meta */ {
282
    /* direction      */ APAL_GPIO_DIRECTION_OUTPUT,
283
    /* active state   */ LTC4412_LLD_CTRL_ACTIVE_STATE,
284
    /* interrupt edge */ APAL_GPIO_EDGE_NONE,
285
  },
286
};
287

    
288
/**
289
 * @brief   SYS_PD bidirectional signal GPIO.
290
 */
291
static apalGpio_t _gpioSysPd = {
292
  /* line */ LINE_SYS_PD_N,
293
};
294
ROMCONST apalControlGpio_t moduleGpioSysPd = {
295
  /* GPIO */ &_gpioSysPd,
296
  /* meta */ {
297
    /* direction      */ APAL_GPIO_DIRECTION_BIDIRECTIONAL,
298
    /* active state   */ APAL_GPIO_ACTIVE_LOW,
299
    /* interrupt edge */ APAL_GPIO_EDGE_BOTH,
300
  },
301
};
302

    
303
/**
304
 * @brief   SYS_REG_EN input signal GPIO.
305
 */
306
static apalGpio_t _gpioSysRegEn = {
307
  /* line */ LINE_SYS_REG_EN,
308
};
309
ROMCONST apalControlGpio_t moduleGpioSysRegEn = {
310
  /* GPIO */ &_gpioSysRegEn,
311
  /* meta */ {
312
    /* direction      */ APAL_GPIO_DIRECTION_INPUT,
313
    /* active state   */ APAL_GPIO_ACTIVE_HIGH,
314
    /* interrupt edge */ APAL_GPIO_EDGE_BOTH,
315
  },
316
};
317

    
318
/**
319
 * @brief   SYS_WARMRST bidirectional signal GPIO.
320
 */
321
static apalGpio_t _gpioSysWarmrst = {
322
  /* line */ LINE_SYS_WARMRST_N,
323
};
324
ROMCONST apalControlGpio_t moduleGpioSysWarmrst = {
325
  /* GPIO */ &_gpioSysWarmrst,
326
  /* meta */ {
327
    /* direction      */ APAL_GPIO_DIRECTION_BIDIRECTIONAL,
328
    /* active state   */ APAL_GPIO_ACTIVE_LOW,
329
    /* interrupt edge */ APAL_GPIO_EDGE_BOTH,
330
  },
331
};
332

    
333
/** @} */
334

    
335
/*===========================================================================*/
336
/**
337
 * @name AMiRo-OS core configurations
338
 * @{
339
 */
340
/*===========================================================================*/
341

    
342
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
343
ROMCONST char* moduleShellPrompt = "DiWheelDrive";
344
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
345

    
346
/** @} */
347

    
348
/*===========================================================================*/
349
/**
350
 * @name Startup Shutdown Synchronization Protocol (SSSP)
351
 * @{
352
 */
353
/*===========================================================================*/
354

    
355
/** @} */
356

    
357
/*===========================================================================*/
358
/**
359
 * @name Low-level drivers
360
 * @{
361
 */
362
/*===========================================================================*/
363

    
364
A3906Driver moduleLldMotors = {
365
  /* power enable GPIO  */ &moduleGpioPowerEn,
366
};
367

    
368
AT24C01BDriver moduleLldEeprom = {
369
  /* I2C driver   */ &MODULE_HAL_I2C_PROX_EEPROM_PWRMTR,
370
  /* I²C address  */ AT24C01B_LLD_I2C_ADDR_FIXED,
371
};
372

    
373
HMC5883LDriver moduleLldCompass = {
374
  /* I²C Driver */ &MODULE_HAL_I2C_COMPASS,
375
};
376

    
377
INA219Driver moduleLldPowerMonitorVdd = {
378
  /* I2C Driver       */ &MODULE_HAL_I2C_PROX_EEPROM_PWRMTR,
379
  /* I²C address      */ INA219_LLD_I2C_ADDR_FIXED,
380
  /* current LSB (uA) */ 0x00u,
381
  /* configuration    */ NULL,
382
};
383

    
384
L3G4200DDriver moduleLldGyroscope = {
385
  /* SPI Driver */ &MODULE_HAL_SPI_MOTION,
386
};
387

    
388
LEDDriver moduleLldStatusLed = {
389
  /* LED enable Gpio */ &moduleGpioLed,
390
};
391

    
392
LIS331DLHDriver moduleLldAccelerometer = {
393
  /* SPI Driver */ &MODULE_HAL_SPI_MOTION,
394
};
395

    
396
LTC4412Driver moduleLldPowerPathController = {
397
  /* Control GPIO */ &moduleGpioPathDcEn,
398
  /* Status GPIO  */ &moduleGpioPathDcStat,
399
};
400

    
401
PCA9544ADriver moduleLldI2cMultiplexer = {
402
  /* I²C driver   */ &MODULE_HAL_I2C_PROX_EEPROM_PWRMTR,
403
  /* I²C address  */ PCA9544A_LLD_I2C_ADDR_FIXED | PCA9544A_LLD_I2C_ADDR_A0 | PCA9544A_LLD_I2C_ADDR_A1 | PCA9544A_LLD_I2C_ADDR_A2,
404
};
405

    
406
TPS6211xDriver moduleLldStepDownConverterVdrive = {
407
  /* Power enable Gpio */ &moduleGpioPowerEn,
408
};
409

    
410
VCNL4020Driver moduleLldProximity = {
411
  /* I²C Driver */ &MODULE_HAL_I2C_PROX_EEPROM_PWRMTR,
412
};
413

    
414
/** @} */
415

    
416
/*===========================================================================*/
417
/**
418
 * @name Tests
419
 * @{
420
 */
421
/*===========================================================================*/
422
#if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
423

    
424
/*
425
 * A3906 (motor driver)
426
 */
427
#include <module_test_A3906.h>
428
static int _testA3906ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
429
{
430
  return moduleTestA3906ShellCb(stream, argc, argv, NULL);
431
}
432
AOS_SHELL_COMMAND(moduleTestA3906ShellCmd, "test:MotorDriver", _testA3906ShellCmdCb);
433

    
434
/*
435
 * AT24C01BN-SH-B (EEPROM)
436
 */
437
#include <module_test_AT24C01B.h>
438
static int _testAt24co1bShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
439
{
440
  return moduleTestAt24c01bShellCb(stream, argc, argv, NULL);
441
}
442
AOS_SHELL_COMMAND(moduleTestAt24c01bShellCmd, "test:EEPROM", _testAt24co1bShellCmdCb);
443

    
444
/*
445
 * HMC5883L (compass)
446
 */
447
#include <module_test_HMC5883L.h>
448
static int _testHmc5883lShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
449
{
450
  return moduleTestHmc5883lShellCb(stream, argc, argv, NULL);
451
}
452
AOS_SHELL_COMMAND(moduleTestHmc5883lShellCmd, "test:Compass", _testHmc5883lShellCmdCb);
453

    
454
/*
455
 * INA219 (power monitor)
456
 */
457
#include <module_test_INA219.h>
458
static int _testIna219ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
459
{
460
  return moduleTestIna219ShellCb(stream, argc, argv, NULL);
461
}
462
AOS_SHELL_COMMAND(moduleTestIna219ShellCmd, "test:PowerMonitor", _testIna219ShellCmdCb);
463

    
464
/*
465
 * L3G4200D (gyroscope)
466
 */
467
#include <module_test_L3G4200D.h>
468
static int _testL3g4200dShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
469
{
470
  return moduleTestL3g4200dShellCb(stream, argc, argv, NULL);
471
}
472
AOS_SHELL_COMMAND(moduleTestL3g4200dShellCmd, "test:Gyroscope", _testL3g4200dShellCmdCb);
473

    
474
/*
475
 * Status LED
476
 */
477
#include <module_test_LED.h>
478
static int _testLedShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
479
{
480
  return moduleTestLedShellCb(stream, argc, argv, NULL);
481
}
482
AOS_SHELL_COMMAND(moduleTestLedShellCmd, "test:StatusLED", _testLedShellCmdCb);
483

    
484
/*
485
 * LIS331DLH (accelerometer)
486
 */
487
#include <module_test_LIS331DLH.h>
488
static int _testLis331dlhShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
489
{
490
  return moduleTestLis331dlhShellCb(stream, argc, argv, NULL);
491
}
492
AOS_SHELL_COMMAND(moduleTestLis331dlhShellCmd, "test:Accelerometer", _testLis331dlhShellCmdCb);
493

    
494
/*
495
 * LTC4412 (power path controller)
496
 */
497
#include <module_test_LTC4412.h>
498
static int _testLtc4412ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
499
{
500
  return moduleTestLtc4412ShellCb(stream, argc, argv, NULL);
501
}
502
AOS_SHELL_COMMAND(moduleTestLtc4412ShellCmd, "test:PowerPathController", _testLtc4412ShellCmdCb);
503

    
504
/*
505
 * PCA9544A (I2C multiplexer)
506
 */
507
#include <module_test_PCA9544A.h>
508
static int _testPca9544aShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
509
{
510
  return moduleTestPca9544aShellCb(stream, argc, argv, NULL);
511
}
512
AOS_SHELL_COMMAND(moduleTestPca9544aShellCmd, "test:I2CMultiplexer", _testPca9544aShellCmdCb);
513

    
514
/*
515
 * TPS62113 (step-down converter)
516
 */
517
#include <module_test_TPS6211x.h>
518
static int _testTps6211xShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
519
{
520
  return moduleTestTps6211xShellCb(stream, argc, argv, NULL);
521
}
522
AOS_SHELL_COMMAND(moduleTestTps62113ShellCmd, "test:StepDownConverter", _testTps6211xShellCmdCb);
523

    
524
/*
525
 * VCNL4020 (proximity sensor)
526
 */
527
#include <module_test_VCNL4020.h>
528
static int _testVcnl4020ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
529
{
530
  return moduleTestVcnl4020ShellCb(stream, argc, argv, NULL);
531
}
532
AOS_SHELL_COMMAND(moduleTestVcnl4020ShellCmd, "test:ProximitySensor", _testVcnl4020ShellCmdCb);
533

    
534
/*
535
 * entire module
536
 */
537
static int _testAllShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
538
{
539
  (void)argc;
540
  (void)argv;
541

    
542
  int status = AOS_OK;
543
  char* targv[AMIROOS_CFG_SHELL_MAXARGS] = {NULL};
544
  aos_testresult_t result_test = {0, 0};
545
  aos_testresult_t result_total = {0, 0};
546

    
547
  /* A3906 (motor driver) */
548
  status |= moduleTestA3906ShellCb(stream, 0, targv, &result_test);
549
  result_total = aosTestResultAdd(result_total, result_test);
550

    
551
  /* AT24C01B (EEPROM) */
552
  status |= moduleTestAt24c01bShellCb(stream, 0, targv, &result_test);
553
  result_total = aosTestResultAdd(result_total, result_test);
554

    
555
  /* HMC5883L (compass) */
556
  status |= moduleTestHmc5883lShellCb(stream, 0, targv, &result_test);
557
  result_total = aosTestResultAdd(result_total, result_test);
558

    
559
  /* INA219 (power monitor) */
560
  status |= moduleTestIna219ShellCb(stream, 0, targv, &result_test);
561
  result_total = aosTestResultAdd(result_total, result_test);
562

    
563
  /* L3G4200D (gyroscope) */
564
  status |= moduleTestL3g4200dShellCb(stream, 0, targv, &result_test);
565
  result_total = aosTestResultAdd(result_total, result_test);
566

    
567
  /* Status LED */
568
  status |= moduleTestLedShellCb(stream, 0, targv, &result_test);
569
  result_total = aosTestResultAdd(result_total, result_test);
570

    
571
  /* LIS331DLH (accelerometer) */
572
  status |= moduleTestLis331dlhShellCb(stream, 0, targv, &result_test);
573
  result_total = aosTestResultAdd(result_total, result_test);
574

    
575
  /* LTC4412 (power path controller) */
576
  status |= moduleTestLtc4412ShellCb(stream, 0, targv, &result_test);
577
  result_total = aosTestResultAdd(result_total, result_test);
578

    
579
  /* PCA9544A (I2C multiplexer) */
580
  status |= moduleTestPca9544aShellCb(stream, 0, targv, &result_test);
581
  result_total = aosTestResultAdd(result_total, result_test);
582

    
583
  /* TPS62113 (step-down converter) */
584
  status |= moduleTestTps6211xShellCb(stream, 0, targv, &result_test);
585
  result_total = aosTestResultAdd(result_total, result_test);
586

    
587
  /* VCNL4020 (proximity sensor) */
588
  // wheel left
589
  targv[1] = "-wl";
590
  status |= moduleTestVcnl4020ShellCb(stream, 2, targv, &result_test);
591
  result_total = aosTestResultAdd(result_total, result_test);
592
  // front left
593
  targv[1] = "-fl";
594
  status |= moduleTestVcnl4020ShellCb(stream, 2, targv, &result_test);
595
  result_total = aosTestResultAdd(result_total, result_test);
596
  // front right
597
  targv[1] = "-fr";
598
  status |= moduleTestVcnl4020ShellCb(stream, 2, targv, &result_test);
599
  result_total = aosTestResultAdd(result_total, result_test);
600
  // wheel right
601
  targv[1] = "-wr";
602
  status |= moduleTestVcnl4020ShellCb(stream, 2, targv, &result_test);
603
  result_total = aosTestResultAdd(result_total, result_test);
604
  targv[1] = "";
605

    
606
  // print total result
607
  chprintf(stream, "\n");
608
  aosTestResultPrintSummary(stream, &result_total, "entire module");
609

    
610
  return status;
611
}
612
AOS_SHELL_COMMAND(moduleTestAllShellCmd, "test:all", _testAllShellCmdCb);
613

    
614
#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
615

    
616
/** @} */
617
/** @} */