Revision c4989d30
| modules/LightRing_1-2/module.c | ||
|---|---|---|
| 436 | 436 |
/* configuration */ NULL, |
| 437 | 437 |
}; |
| 438 | 438 |
|
| 439 |
P9221RDriver moduleQiCharger = {
|
|
| 440 |
/* I2C Driver */ &MODULE_HAL_I2C_EEPROM_PWRMTR_BREAKOUT, |
|
| 441 |
/* I²C address */ P9221R_LLD_I2C_ADDR_FIXED, |
|
| 442 |
/* current LSB (uA) */ 0x00u, |
|
| 443 |
/* configuration */ NULL, |
|
| 444 |
}; |
|
| 445 |
|
|
| 439 | 446 |
LEDDriver moduleLldStatusLed = {
|
| 440 | 447 |
/* LED enable Gpio */ &moduleGpioLed, |
| 441 | 448 |
}; |
| ... | ... | |
| 533 | 540 |
}; |
| 534 | 541 |
|
| 535 | 542 |
/* |
| 543 |
* P9221R (qi charger) |
|
| 544 |
*/ |
|
| 545 |
static int _utShellCmdCb_AlldP9221r(BaseSequentialStream* stream, int argc, char* argv[]) |
|
| 546 |
{
|
|
| 547 |
(void)argc; |
|
| 548 |
(void)argv; |
|
| 549 |
aosUtRun(stream, &moduleUtAlldP9221r, NULL); |
|
| 550 |
return AOS_OK; |
|
| 551 |
} |
|
| 552 |
static ut_p9221rdata_t _utP9221rData = {
|
|
| 553 |
/* driver */ &moduleLldPowerMonitorVled, |
|
| 554 |
/* expected voltage */ 4.2f, |
|
| 555 |
/* tolerance */ 0.2f, |
|
| 556 |
/* timeout */ MICROSECONDS_PER_SECOND, |
|
| 557 |
}; |
|
| 558 |
aos_unittest_t moduleUtAlldP9221r = {
|
|
| 559 |
/* name */ "P9221R", |
|
| 560 |
/* info */ "qi charger", |
|
| 561 |
/* test function */ utAlldP9221rFunc, |
|
| 562 |
/* shell command */ {
|
|
| 563 |
/* name */ "unittest:QiCharger", |
|
| 564 |
/* callback */ _utShellCmdCb_AlldP9221r, |
|
| 565 |
/* next */ NULL, |
|
| 566 |
}, |
|
| 567 |
/* data */ &_utP9221rData, |
|
| 568 |
}; |
|
| 569 |
|
|
| 570 |
/* |
|
| 536 | 571 |
* Status LED |
| 537 | 572 |
*/ |
| 538 | 573 |
static int _utShellCmdCb_AlldLed(BaseSequentialStream* stream, int argc, char* argv[]) |
| modules/LightRing_1-2/module.h | ||
|---|---|---|
| 407 | 407 |
extern INA219Driver moduleLldPowerMonitorVled; |
| 408 | 408 |
|
| 409 | 409 |
/** |
| 410 |
* @brief Power monitor (VLED 4.2) driver. |
|
| 411 |
*/ |
|
| 412 |
extern P9221RDriver moduleQiCharger; |
|
| 413 |
|
|
| 414 |
/** |
|
| 410 | 415 |
* @brief Status LED driver. |
| 411 | 416 |
*/ |
| 412 | 417 |
extern LEDDriver moduleLldStatusLed; |
| modules/PowerManagement_1-2/module.h | ||
|---|---|---|
| 444 | 444 |
aosShellAddCommand(&aos.shell, &moduleUtAlldBq27500.shellcmd); \ |
| 445 | 445 |
aosShellAddCommand(&aos.shell, &moduleUtAlldBq27500Bq24103a.shellcmd); \ |
| 446 | 446 |
aosShellAddCommand(&aos.shell, &moduleUtAlldIna219.shellcmd); \ |
| 447 |
aosShellAddCommand(&aos.shell, &moduleUtAlldP9221r.shellcmd); \ |
|
| 447 | 448 |
aosShellAddCommand(&aos.shell, &moduleUtAlldPklcs1212e4001.shellcmd); \ |
| 448 | 449 |
aosShellAddCommand(&aos.shell, &moduleUtAlldLed.shellcmd); \ |
| 449 | 450 |
aosShellAddCommand(&aos.shell, &moduleUtAlldTps62113.shellcmd); \ |
| ... | ... | |
| 595 | 596 |
#include <alld_bq241xx.h> |
| 596 | 597 |
#include <alld_bq27500.h> |
| 597 | 598 |
#include <alld_INA219.h> |
| 599 |
#include <alld_P9221R.h> |
|
| 598 | 600 |
#include <alld_LED.h> |
| 599 | 601 |
#include <alld_PKxxxExxx.h> |
| 600 | 602 |
#include <alld_TPS6211x.h> |
| ... | ... | |
| 752 | 754 |
#include <ut_alld_bq27500_v1.h> |
| 753 | 755 |
#include <ut_alld_bq27500_v1_bq241xx_v1.h> |
| 754 | 756 |
#include <ut_alld_INA219_v1.h> |
| 757 |
#include <ut_alld_P9221R_v1.h> |
|
| 755 | 758 |
#include <ut_alld_LED_v1.h> |
| 756 | 759 |
#include <ut_alld_PKxxxExxx_v1.h> |
| 757 | 760 |
#include <ut_alld_TPS6211x_v1.h> |
| ... | ... | |
| 788 | 791 |
extern aos_unittest_t moduleUtAlldIna219; |
| 789 | 792 |
|
| 790 | 793 |
/** |
| 794 |
* @brief P9221R (qi charger) unit test object. |
|
| 795 |
*/ |
|
| 796 |
extern aos_unittest_t moduleUtAlldP9221r; |
|
| 797 |
|
|
| 798 |
/** |
|
| 791 | 799 |
* @brief Status LED unit test object. |
| 792 | 800 |
*/ |
| 793 | 801 |
extern aos_unittest_t moduleUtAlldLed; |
| periphery-lld/AMiRo-LLD | ||
|---|---|---|
| 1 |
Subproject commit 1473a57f96b8bcbcac3400ca3458b7a08fed5881 |
|
| 1 |
Subproject commit 7aa812e97bfc19fb3259858dc76fd3b21d18afb9 |
|
Also available in: Unified diff