mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
Implementation mistake: definition not in specification(batteryMode)
*Delete batteryMode *Add powerMode
This commit is contained in:
@@ -188,20 +188,20 @@ void POWER::reset() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool batteryMode(bool en)</mark>
|
||||
<mark>bool boostMode(bool en)</mark>
|
||||
|
||||
**Description:**
|
||||
|
||||
This function controls battery supply
|
||||
This function controls power supply
|
||||
|
||||
**Definition:**
|
||||
|
||||
```arduino
|
||||
bool batteryMode(bool en){
|
||||
bool boostMode(bool en){
|
||||
|
||||
uint8_t data;
|
||||
Wire.beginTransmission(IP5306_ADDR);
|
||||
Wire.write(IP5306_REG_READ1);
|
||||
Wire.write(IP5306_REG_SYS_CTL0);
|
||||
Wire.endTransmission();
|
||||
|
||||
if(Wire.requestFrom(IP5306_ADDR, 1))
|
||||
@@ -209,7 +209,7 @@ bool batteryMode(bool en){
|
||||
data = Wire.read();
|
||||
|
||||
Wire.beginTransmission(IP5306_ADDR);
|
||||
Wire.write(IP5306_REG_READ1);
|
||||
Wire.write(IP5306_REG_SYS_CTL0);
|
||||
if (en) Wire.write(data | BOOST_ENABLE_BIT);
|
||||
else Wire.write(data &(~BOOST_ENABLE_BIT));
|
||||
Wire.endTransmission();
|
||||
|
||||
Reference in New Issue
Block a user