Merge pull request #14971 from s-hadinger/axp_power_off

Berry add `axp.power_off()` for AXP192 devices
This commit is contained in:
s-hadinger 2022-02-24 20:57:20 +01:00 committed by GitHub
commit 4778c9c8e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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