Berry add `axp.power_off()` for AXP192 devices

This commit is contained in:
Stephan Hadinger 2022-02-24 19:04:52 +01:00
parent 343919cd56
commit 9252b6b75d
4 changed files with 1815 additions and 1774 deletions

View File

@ -622,6 +622,7 @@ extern const bcstring be_const_str_point_arr;
extern const bcstring be_const_str_pop;
extern const bcstring be_const_str_pop_path;
extern const bcstring be_const_str_pow;
extern const bcstring be_const_str_power_off;
extern const bcstring be_const_str_preinit;
extern const bcstring be_const_str_print;
extern const bcstring be_const_str_public_key;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,11 @@ class AXP192 : I2C_Driver
super(self, I2C_Driver).init("AXP192", 0x34)
end
# power off the entire device from AXP192 - this is different from deepsleep
def power_off()
self.write_bit(0x32, 7, 1)
end
# Return True = Battery Exist
def battery_present()
if self.wire.read(self.addr, 0x01, 1) & 0x20 return true