Skip to content

Commit b7d405b

Browse files
committed
Enable dldo1
1 parent 3ca0e08 commit b7d405b

File tree

1 file changed

+15
-7
lines changed
  • ports/espressif/boards/lilygo_twatch_s3

1 file changed

+15
-7
lines changed

ports/espressif/boards/lilygo_twatch_s3/board.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,23 @@ static void enable_ldo(busio_i2c_obj_t *i2c, uint8_t ldo) {
7272
set_bit_in_register(i2c, 0x90, 1 << ldo);
7373
}
7474

75+
static void enable_dldo(busio_i2c_obj_t *i2c, uint8_t ldo) {
76+
if (ldo == 1) {
77+
write_register8(i2c, 0x99, 0x1C); // 3300mV
78+
set_bit_in_register(i2c, 0x90, 0x80);
79+
}
80+
}
81+
7582
// Init the AXP2101 by hand as to not include XPOWERS lib.
7683
static void pmic_init(busio_i2c_obj_t *i2c) {
77-
enable_ldo(i2c, 0);
78-
enable_ldo(i2c, 1);
79-
enable_ldo(i2c, 2);
80-
enable_ldo(i2c, 3);
81-
enable_ldo(i2c, 5);
82-
write_register8(i2c, 0x18, 0x0F);
83-
write_register8(i2c, 0x27, 0x1F);
84+
enable_ldo(i2c, 0); // _aldo1
85+
enable_ldo(i2c, 1); // _aldo2
86+
enable_ldo(i2c, 2); // _aldo3
87+
enable_ldo(i2c, 3); // _aldo4
88+
enable_ldo(i2c, 5); // _bldo2
89+
enable_dldo(i2c, 1); // _dldo1
90+
write_register8(i2c, 0x18, 0x0F); // RTC coin cell + 300mAh main charge limit
91+
write_register8(i2c, 0x27, 0x1F); // 2s on time + 10s off time
8492
}
8593

8694

0 commit comments

Comments
 (0)