Expand description
Minimal AXP2101 PMIC driver for M5Stack CoreS3 (I2C 0x34).
Only DLDO1 (backlight), battery voltage ADC, VBUS detection and soft power-off are used.
Register map (XPowersLib isVbusGood, M5Unified isVBUS):
0x00 Power status bit 5 = VBUS good (bit 3 is battery-connected)
0x10 Common config bit 0 = soft power-off (also PWRON-shut / PWROK / discharge)
0x34 VBAT ADC high bits[5:0] = high 6 bits of 14-bit reading (1 mV/LSB)
0x35 VBAT ADC low bits[7:0] = low 8 bits
0x90 LDO enable bit 7 = DLDO1 enable
0x99 DLDO1 voltage bits[4:0] = (mV − 500) / 100, range 500–3400 mV
Datasheet: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/products/core/CoreS3/AXP2101_Datasheet_V1.1_en.pdf Also: https://github.com/lewisxhe/XPowersLib (register reference)