Revision 4532b1ab
modules/LightRing_1-2/module.c | ||
---|---|---|
549 | 549 |
aosUtRun(stream, &moduleUtAlldP9221r, NULL); |
550 | 550 |
return AOS_OK; |
551 | 551 |
} |
552 |
|
|
553 | 552 |
static ut_p9221rdata_t _utP9221rData = { |
554 | 553 |
/* driver */ &moduleQiCharger, // !!!! |
555 | 554 |
/* x alignment */ 0.0f, |
... | ... | |
559 | 558 |
/* current */ 0.0f, |
560 | 559 |
/* timeout */ MICROSECONDS_PER_SECOND, |
561 | 560 |
}; |
562 |
|
|
563 | 561 |
aos_unittest_t moduleUtAlldP9221r = { |
564 | 562 |
/* name */ "P9221R", |
565 | 563 |
/* info */ "qi charger", |
modules/LightRing_1-2/module.h | ||
---|---|---|
304 | 304 |
aosShellAddCommand(&aos.shell, &moduleUtAlldLed.shellcmd); \ |
305 | 305 |
aosShellAddCommand(&aos.shell, &moduleUtAlldMic9404x.shellcmd); \ |
306 | 306 |
aosShellAddCommand(&aos.shell, &moduleUtAlldTlc5947.shellcmd); \ |
307 |
aosShellAddCommand(&aos.shell, &moduleUtAlldP9221r.shellcmd); \ |
|
307 | 308 |
} |
308 | 309 |
|
309 | 310 |
/** |
periphery-lld/AMiRo-LLD | ||
---|---|---|
1 |
Subproject commit 7aa812e97bfc19fb3259858dc76fd3b21d18afb9 |
|
1 |
Subproject commit 2344a77144d55915be8ee12bb5abd41c0ad86e56 |
unittests/periphery-lld/src/ut_alld_P9221R_v1.c | ||
---|---|---|
54 | 54 |
// local variables |
55 | 55 |
aos_utresult_t result = {0, 0}; |
56 | 56 |
uint32_t status; |
57 |
uint16_t data[18];
|
|
57 |
uint16_t data[19];
|
|
58 | 58 |
|
59 | 59 |
chprintf(stream, "read registers...\n"); |
60 |
status = p9221r_lld_read_register(((ut_p9221rdata_t*)ut->data)->PRd, P9221R_LLD_REGISTER_BATTERY_STATUS_SENT, data, 18, ((ut_p9221rdata_t*)ut->data)->timeout);
|
|
60 |
status = p9221r_lld_read_register(((ut_p9221rdata_t*)ut->data)->PRd, P9221R_LLD_REGISTER_BATTERY_STATUS_SENT, data, 19, ((ut_p9221rdata_t*)ut->data)->timeout);
|
|
61 | 61 |
if (status == APAL_STATUS_SUCCESS) { |
62 | 62 |
aosUtPassed(stream, &result); |
63 |
for(int i=0; i<18; i++){
|
|
63 |
for(int i=0; i<19; i++){
|
|
64 | 64 |
chprintf(stream, "register: %02x, data: %u \n", 0x3A+i, data[i]); |
65 | 65 |
} |
66 | 66 |
} else { |
Also available in: Unified diff