Hello,
I'm struggling waking up a TTGO t-call board from deep sleep when board is powered only on battery. It appears the power chip ip5306 (an i2c device) powers down the whole circuit if the current is minimal, such as the case with deep sleep of the onboard esp32. There seems to be a solution by flipping a bit on an ip5306 register which solves the issue. Can someone help and port this small function into native micropython i2c.write/i2c.writeto_mem function?
porting function for IP5306 chip to micropython
Re: porting function for IP5306 chip to micropython
I wont guarantee it, but something like:
Code: Select all
from machine import Pin, SoftI2C
IP5306_ADDR = const(117) # 0x75
IP5306_REG_SYS_CTL0 = const(0x00)
BOOST_OUT_BIT = const (0x02)
def setPowerBoostKeepOn(i2c, en):
data_in = i2c.readfrom_mem(IP5306_ADDR, IP5306_REG_SYS_CTL0, 1)
data_out = bytes([data_in[0] | BOOST_OUT_BIT if en else data_in[0] & ~BOOST_OUT_BIT])
i2c.writeto_mem(IP5306_ADDR, IP5306_REG_SYS_CTL0, data_out)
i2c = SoftI2C(scl=Pin(22), sda=Pin(21))
setPowerBoostKeepOn(i2c, True)