mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-16 07:16:30 +00:00
Berry add axp.power_off()
for AXP192 devices
This commit is contained in:
parent
343919cd56
commit
9252b6b75d
@ -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
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user