Skip to content

Commit

Permalink
Add setPowerBoostKeepOn
Browse files Browse the repository at this point in the history
  • Loading branch information
vshymanskyy committed Jul 18, 2019
1 parent 6848dde commit e2bca06
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion examples/Arduino_GSM_OTA/utilities.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
#define IP5306_ADDR 0x75
#define IP5306_REG_SYS_CTL0 0x00

bool setPowerBoostKeepOn(int en)
{
Wire.beginTransmission(IP5306_ADDR);
Wire.write(IP5306_REG_SYS_CTL0);
if (en) {
Wire.write(0x37); // Set bit1: 1 enable 0 disable boost keep on
} else {
Wire.write(0x35); // 0x37 is default reg value
}
return Wire.endTransmission() == 0;
}

void printDeviceInfo()
{
Serial.println();
Serial.println("--------------------------");
Serial.println(String("Firmware: ") + "v1.0.0 build " __DATE__ " " __TIME__);
Serial.println(String("Build: ") + __DATE__ " " __TIME__);
#if defined(ESP8266)
Serial.println(String("Flash: ") + ESP.getFlashChipRealSize() / 1024 + "K");
Serial.println(String("ESP core: ") + ESP.getCoreVersion());
Expand Down

0 comments on commit e2bca06

Please sign in to comment.