Skip to content

Commit d765efd

Browse files
committed
Moved EXTEN and DCDC2 on register 0x12
1 parent 681eb66 commit d765efd

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

ports/espressif/boards/m5stack_core2/board.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ static bool pmic_set_power_source(uint8_t source, busio_i2c_obj_t *i2c) {
9999

100100
#if M5STACK_CORE2_5V_OUTPUT_ENABLE_DEFAULT
101101
// Set EXTENT output high to enable 5V power boost
102-
write_buf[0] = AXP192_EXTEN_DCDC2_CTRL;
102+
write_buf[0] = AXP192_DCDC13_LDO23_CTRL;
103103
rc = common_hal_busio_i2c_write_read(i2c, AXP192_I2C_ADDRESS, write_buf, 1, read_buf, sizeof(read_buf));
104104
if (rc != 0) {
105105
return false;
106106
}
107-
write_buf[1] = read_buf[0] | AXP192_EXTEN_DCDC2_CTRL_EXTEN;
107+
write_buf[1] = read_buf[0] | AXP192_DCDC13_LDO23_CTRL_EXTEN;
108108
rc = common_hal_busio_i2c_write(i2c, AXP192_I2C_ADDRESS, write_buf, sizeof(write_buf));
109109
if (rc != 0) {
110110
return false;
@@ -139,12 +139,12 @@ static bool pmic_set_power_source(uint8_t source, busio_i2c_obj_t *i2c) {
139139
}
140140

141141
// Set EXTENT output low to disable 5V power boost
142-
write_buf[0] = AXP192_EXTEN_DCDC2_CTRL;
142+
write_buf[0] = AXP192_DCDC13_LDO23_CTRL;
143143
rc = common_hal_busio_i2c_write_read(i2c, AXP192_I2C_ADDRESS, write_buf, 1, read_buf, sizeof(read_buf));
144144
if (rc != 0) {
145145
return false;
146146
}
147-
write_buf[1] = read_buf[0] & ~AXP192_EXTEN_DCDC2_CTRL_EXTEN;
147+
write_buf[1] = read_buf[0] & ~AXP192_DCDC13_LDO23_CTRL_EXTEN;
148148
rc = common_hal_busio_i2c_write(i2c, AXP192_I2C_ADDRESS, write_buf, sizeof(write_buf));
149149
if (rc != 0) {
150150
return false;

ports/espressif/pmic/axp192/axp192.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,11 @@
4242
#define AXP192_INPUT_POWER_STATE_ACIN_VBUS_PCB_SHORTED 0b00000010
4343
#define AXP192_INPUT_POWER_STATE_BOOT_SOURCE_ACIN_OR_VBUS 0b00000001
4444

45-
#define AXP192_EXTEN_DCDC2_CTRL 0x10
46-
#define AXP192_EXTEN_DCDC2_CTRL_EXTEN 0b00000100
47-
#define AXP192_EXTEN_DCDC2_CTRL_DCDC2 0b00000001
48-
4945
#define AXP192_DCDC13_LDO23_CTRL 0x12
5046
#define AXP192_DCDC13_LDO23_CTRL_EXTEN 0b01000000
51-
#define AXP192_DCDC13_LDO23_CTRL_LDO3 0b00001000
52-
#define AXP192_DCDC13_LDO23_CTRL_LDO2 0b00000100
47+
#define AXP192_DCDC13_LDO23_CTRL_DCDC2 0b00010000
48+
#define AXP192_DCDC13_LDO23_CTRL_LDO3 0b00001000
49+
#define AXP192_DCDC13_LDO23_CTRL_LDO2 0b00000100
5350
#define AXP192_DCDC13_LDO23_CTRL_DCDC3 0b00000010
5451
#define AXP192_DCDC13_LDO23_CTRL_DCDC1 0b00000001
5552

0 commit comments

Comments
 (0)