Skip to content

Commit

Permalink
M5.Axp.PowerOff ().
Browse files Browse the repository at this point in the history
I implemented M5.Axp.PowerOff ().
  • Loading branch information
yamjp committed Oct 5, 2020
1 parent 9cf73d3 commit 73c6583
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/AXP192.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,4 +467,10 @@ void AXP192::SetLDO2( bool State )
else
buf = ~(1<<2) & buf;
Write1Byte( 0x12 , buf );
}
}

// Cut all power, except for LDO1 (RTC)
void AXP192::PowerOff()
{
Write1Byte(0x32, Read8bit(0x32) | 0x80); // MSB for Power Off
}
3 changes: 3 additions & 0 deletions src/AXP192.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class AXP192 {
void SetCoulombClear();
void SetLDO2( bool State );

// -- Power Off
void PowerOff();

public:
void Write1Byte( uint8_t Addr , uint8_t Data );
uint8_t Read8bit( uint8_t Addr );
Expand Down

0 comments on commit 73c6583

Please sign in to comment.