Revision ee884101 modules/LightRing_1-2/module.h
modules/LightRing_1-2/module.h | ||
---|---|---|
56 | 56 |
extern CANConfig moduleHalCanConfig; |
57 | 57 |
|
58 | 58 |
/** |
59 |
* @brief I2C driver to access the EEPROM and the breakout header. |
|
59 |
* @brief I2C driver to access the EEPROM, power monitor and the breakout header.
|
|
60 | 60 |
*/ |
61 |
#define MODULE_HAL_I2C_EEPROM_BREAKOUT I2CD2
|
|
61 |
#define MODULE_HAL_I2C_EEPROM_PWRMTR_BREAKOUT I2CD2
|
|
62 | 62 |
|
63 | 63 |
/** |
64 |
* @brief Configuration for the EEPROM & breakout I2C driver.
|
|
64 |
* @brief Configuration for the EEPROM, power monitor and breakout I2C driver.
|
|
65 | 65 |
*/ |
66 |
extern I2CConfig moduleHalI2cEepromBreakoutConfig; |
|
66 |
extern I2CConfig moduleHalI2cEepromPwrmtrBreakoutConfig;
|
|
67 | 67 |
|
68 | 68 |
/** |
69 | 69 |
* @brief Serial driver of the programmer interface. |
... | ... | |
299 | 299 |
#define MODULE_INIT_TESTS() { \ |
300 | 300 |
/* add unit-test shell commands */ \ |
301 | 301 |
aosShellAddCommand(&aos.shell, &moduleUtAlldAt24c01b.shellcmd); \ |
302 |
aosShellAddCommand(&aos.shell, &moduleUtAlldIna219.shellcmd); \ |
|
303 |
aosShellAddCommand(&aos.shell, &moduleUtAlldLed.shellcmd); \ |
|
304 |
aosShellAddCommand(&aos.shell, &moduleUtAlldMic9404x.shellcmd); \ |
|
302 | 305 |
aosShellAddCommand(&aos.shell, &moduleUtAlldTlc5947.shellcmd); \ |
303 | 306 |
} |
304 | 307 |
|
... | ... | |
309 | 312 |
/* serial driver */ \ |
310 | 313 |
sdStart(&MODULE_HAL_PROGIF, &moduleHalProgIfConfig); \ |
311 | 314 |
/* I2C */ \ |
312 |
moduleHalI2cEepromBreakoutConfig.clock_speed = (AT24C01B_LLD_I2C_MAXFREQUENCY < moduleHalI2cEepromBreakoutConfig.clock_speed) ? AT24C01B_LLD_I2C_MAXFREQUENCY : moduleHalI2cEepromBreakoutConfig.clock_speed; \ |
|
313 |
moduleHalI2cEepromBreakoutConfig.duty_cycle = (moduleHalI2cEepromBreakoutConfig.clock_speed <= 100000) ? STD_DUTY_CYCLE : FAST_DUTY_CYCLE_2; \ |
|
314 |
i2cStart(&MODULE_HAL_I2C_EEPROM_BREAKOUT, &moduleHalI2cEepromBreakoutConfig); \ |
|
315 |
moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed = (AT24C01B_LLD_I2C_MAXFREQUENCY < moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed) ? AT24C01B_LLD_I2C_MAXFREQUENCY : moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed; \ |
|
316 |
moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed = (INA219_LLD_I2C_MAXFREQUENCY < moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed) ? INA219_LLD_I2C_MAXFREQUENCY : moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed; \ |
|
317 |
moduleHalI2cEepromPwrmtrBreakoutConfig.duty_cycle = (moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed <= 100000) ? STD_DUTY_CYCLE : FAST_DUTY_CYCLE_2; \ |
|
318 |
i2cStart(&MODULE_HAL_I2C_EEPROM_PWRMTR_BREAKOUT, &moduleHalI2cEepromPwrmtrBreakoutConfig); \ |
|
315 | 319 |
/* SPI */ \ |
316 | 320 |
spiStart(&MODULE_HAL_SPI_LIGHT, &moduleHalSpiLightConfig); \ |
317 | 321 |
} |
... | ... | |
323 | 327 |
/* SPI */ \ |
324 | 328 |
spiStop(&MODULE_HAL_SPI_LIGHT); \ |
325 | 329 |
/* I2C */ \ |
326 |
i2cStop(&MODULE_HAL_I2C_EEPROM_BREAKOUT); \
|
|
330 |
i2cStop(&MODULE_HAL_I2C_EEPROM_PWRMTR_BREAKOUT); \
|
|
327 | 331 |
/* don't stop the serial driver so messages can still be printed */ \ |
328 | 332 |
} |
329 | 333 |
|
... | ... | |
385 | 389 |
*/ |
386 | 390 |
/*===========================================================================*/ |
387 | 391 |
#include <alld_AT24C01B.h> |
392 |
#include <alld_INA219.h> |
|
388 | 393 |
#include <alld_LED.h> |
394 |
#include <alld_MIC9404x.h> |
|
395 |
//#include <alld_SNx5C3221E.h> |
|
389 | 396 |
#include <alld_TLC5947.h> |
390 | 397 |
|
391 | 398 |
/** |
... | ... | |
394 | 401 |
extern AT24C01BDriver moduleLldEeprom; |
395 | 402 |
|
396 | 403 |
/** |
404 |
* @brief Power monitor (VLED 4.2) driver. |
|
405 |
*/ |
|
406 |
extern INA219Driver moduleLldPowerMonitorVled; |
|
407 |
|
|
408 |
/** |
|
397 | 409 |
* @brief Status LED driver. |
398 | 410 |
*/ |
399 | 411 |
extern LEDDriver moduleLldStatusLed; |
400 | 412 |
|
401 | 413 |
/** |
414 |
* @brief Power switch driver (1.8V). |
|
415 |
*/ |
|
416 |
extern MIC9404xDriver moduleLldPowerSwitchV18; |
|
417 |
|
|
418 |
/** |
|
419 |
* @brief Power switch driver (3.3V). |
|
420 |
*/ |
|
421 |
extern MIC9404xDriver moduleLldPowerSwitchV33; |
|
422 |
|
|
423 |
/** |
|
424 |
* @brief Power switch driver (4.2V). |
|
425 |
*/ |
|
426 |
extern MIC9404xDriver moduleLldPowerSwitchV42; |
|
427 |
|
|
428 |
/** |
|
429 |
* @brief Power switch driver (5.0V). |
|
430 |
*/ |
|
431 |
extern MIC9404xDriver moduleLldPowerSwitchV50; |
|
432 |
|
|
433 |
/** |
|
434 |
* @brief Pseudo power switch driver (VSYS). |
|
435 |
* @details There is no actual MIC9040x device, but the swicthable circuit behaves analogous. |
|
436 |
*/ |
|
437 |
extern MIC9404xDriver moduleLldPowerSwitchVsys; |
|
438 |
|
|
439 |
/** |
|
402 | 440 |
* @brief LED PWM driver. |
403 | 441 |
*/ |
404 | 442 |
extern TLC5947Driver moduleLldLedPwm; |
... | ... | |
413 | 451 |
/*===========================================================================*/ |
414 | 452 |
#if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
415 | 453 |
#include <ut_alld_AT24C01B_v1.h> |
454 |
#include <ut_alld_INA219_v1.h> |
|
455 |
#include <ut_alld_LED_v1.h> |
|
456 |
#include <ut_alld_MIC9404x_v1.h> |
|
457 |
//#include <ut_alld_SNx5C3221E_v1.h> |
|
416 | 458 |
#include <ut_alld_TLC5947_v1.h> |
417 | 459 |
|
418 | 460 |
/** |
... | ... | |
421 | 463 |
extern aos_unittest_t moduleUtAlldAt24c01b; |
422 | 464 |
|
423 | 465 |
/** |
466 |
* @brief INA219 (power monitor) unit test object. |
|
467 |
*/ |
|
468 |
extern aos_unittest_t moduleUtAlldIna219; |
|
469 |
|
|
470 |
/** |
|
471 |
* @brief Status LED unit test object. |
|
472 |
*/ |
|
473 |
extern aos_unittest_t moduleUtAlldLed; |
|
474 |
|
|
475 |
/** |
|
476 |
* @brief Power switch unit test object. |
|
477 |
*/ |
|
478 |
extern aos_unittest_t moduleUtAlldMic9404x; |
|
479 |
|
|
480 |
/** |
|
424 | 481 |
* @brief LED PWM driver unit test object. |
425 | 482 |
*/ |
426 | 483 |
extern aos_unittest_t moduleUtAlldTlc5947; |
Also available in: Unified diff