From 423a535201be80049e4d316b66823840d358caaa Mon Sep 17 00:00:00 2001 From: Mori Naoyuki Date: Wed, 13 Mar 2019 23:42:54 +0900 Subject: [PATCH 1/6] Add: setAutoBootOnLoad() document (on M5Stack #127) Append to document : function return value / argument --- docs/en/api/power.md | 144 ++++++++++++++++++++++++++++++++++++-- docs/ja/api/power.md | 149 +++++++++++++++++++++++++++++++++++++--- docs/zh_CN/api/power.md | 144 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 418 insertions(+), 19 deletions(-) diff --git a/docs/en/api/power.md b/docs/en/api/power.md index a0801bf2..93578525 100644 --- a/docs/en/api/power.md +++ b/docs/en/api/power.md @@ -10,6 +10,17 @@ This function sets enable/disable power mode. +**Function argument** + +true: Output normally open. +false: Output normally close. + +**Function return value** + +true: controll success. +false: control failure. + + **Definition:** ```arduino @@ -32,9 +43,53 @@ bool setPowerBoostKeepOn(bool en){ } return false; } -#endif ``` +## setKeepLightLoad() + +**Syntax:** + +bool setKeepLightLoad(bool en); + +**Description:** + +Set mode of automatically shut down. + +**Function argument** + +true:when the current is too small, ip5306 will *not* automatically shut down. +false:when the current is too small, ip5306 will automatically shut down. + +**Function return value** +true: controll success. +false: control failure. + + +**Definition:** + +```arduino +bool setKeepLightLoad(bool en) { + uint8_t data; + Wire.beginTransmission(IP5306_ADDR); + Wire.write(IP5306_REG_SYS_CTL0); + Wire.endTransmission(); + + if(Wire.requestFrom(IP5306_ADDR, 1)) + { + data = Wire.read(); + + Wire.beginTransmission(IP5306_ADDR); + Wire.write(IP5306_REG_SYS_CTL0); + if (!en) Wire.write(data | LIGHT_LOAD_BIT); + else Wire.write(data &(~LIGHT_LOAD_BIT)); + Wire.endTransmission(); + return true; + } + return false; +} +``` + + ## setCharge() **Syntax:** @@ -44,11 +99,22 @@ bool setPowerBoostKeepOn(bool en){ **Description:** This function sets enable/disable charge mode. +If charge full,try set charge enable->disable->enable,can be recharged + +**Function argument** + +true:set to charge. +false:set to not charging + +**Function return value** + +true: controll success. +false: control failure. **Definition:** ```arduino -bool POWER::setCharge(bool en){ +bool setCharge(bool en){ uint8_t data; Wire.beginTransmission(IP5306_ADDR); Wire.write(IP5306_REG_SYS_CTL0); @@ -73,12 +139,21 @@ bool POWER::setCharge(bool en){ **Syntax:** -bool isChargeFull(bool en); +bool isChargeFull(); **Description:** This function check battery level. +**Function argument** + +no argument. + +**Function return value** + +true:battery is full +false:battery is not full + **Definition:** ```arduino @@ -105,7 +180,16 @@ bool isChargeFull(){ **Description:** -This function checks the existence of the battery controller +This function checks the existence of the battery controller on I2C + +**Function argument** + +no argument. + +**Function return value** + +true: battery controller found. +false:battery controller not found. **Definition:** @@ -122,12 +206,24 @@ bool canControl(){ **Syntax:** -bool isCharging(){ +bool isCharging(); **Description:** This function checks the state of the charge +**Function argument** + +no argument. + +**Function return value** + +true: in charging +false: not in charging + + +true:charge, false:discharge + **Definition:** ```arduino @@ -145,6 +241,44 @@ bool isCharging(){ return false; } ``` +## getBatteryLevel() + +**Syntax:** + +bool getBatteryLevel(); + +**Description:** + +This function checks the battery charging level + +**Function argument** + +no argument. + +**Function return value** + +percent of battery level.(0-100) +if can't communicate to controller ,return -1. + + +**Definition:** + +```arduino +int8_t getBatteryLevel() { + Wire.beginTransmission(0x75); + Wire.write(0x78); + if (Wire.endTransmission(false) == 0 && Wire.requestFrom(0x75, 1)) { + switch (Wire.read() & 0xF0) { + case 0xE0: return 25; + case 0xC0: return 50; + case 0x80: return 75; + case 0x00: return 100; + default: return 0; + } + } + return -1; +} +``` ## setWakeupButton() diff --git a/docs/ja/api/power.md b/docs/ja/api/power.md index 56334387..1b0c6541 100644 --- a/docs/ja/api/power.md +++ b/docs/ja/api/power.md @@ -10,7 +10,18 @@ 電源供給状態を設定します。 -**定義:** +**引数** + +true: 常時供給状態 +false: 常時切断状態 + +**戻り値** + +true: 制御成功 +false: 制御失敗 + + +**定義** ```arduino bool setPowerBoostKeepOn(bool en){ @@ -32,9 +43,53 @@ bool setPowerBoostKeepOn(bool en){ } return false; } -#endif ``` +## setKeepLightLoad() + +**構文:** + +bool setKeepLightLoad(bool en); + +**説明:** + +自動シャットダウン機能を設定します. + +**引数** + +true:極小消費電流時自動シャットダウンしません +false:極小消費電流時自動シャットダウンします + +**戻り値** +true: 制御成功 +false: 制御失敗 + + +**定義:** + +```arduino +bool setKeepLightLoad(bool en) { + uint8_t data; + Wire.beginTransmission(IP5306_ADDR); + Wire.write(IP5306_REG_SYS_CTL0); + Wire.endTransmission(); + + if(Wire.requestFrom(IP5306_ADDR, 1)) + { + data = Wire.read(); + + Wire.beginTransmission(IP5306_ADDR); + Wire.write(IP5306_REG_SYS_CTL0); + if (!en) Wire.write(data | LIGHT_LOAD_BIT); + else Wire.write(data &(~LIGHT_LOAD_BIT)); + Wire.endTransmission(); + return true; + } + return false; +} +``` + + ## setCharge() **構文:** @@ -43,7 +98,19 @@ bool setPowerBoostKeepOn(bool en){ **説明:** -充電状態を設定します。 +充電制御状態を指示します。 +満充電時は、有効→無効→有効とセットすることで再充電ができます。 + +**引数** + +true:充電開始指示 +false:充電中止指示 + +**戻り値** + +true: 制御成功 +false: 制御失敗 + **定義:** @@ -70,14 +137,22 @@ bool POWER::setCharge(bool en){ ``` ## isChargeFull() - **構文:** -bool isChargeFull(bool en); +bool isChargeFull(); **説明:** -満充電かを判定します +満充電かを判断します. + +**引数** + +なし. + +**戻り値** + +true:満充電 +false:満充電ではない **定義:** @@ -107,6 +182,15 @@ bool isChargeFull(){ 電源コントローラが使用可能かを判断します +**引数** + +なし. + +**戻り値** + +true: 電源コントローラーが見つかった +false:電源コントローラーが見つからない + **定義:** ```arduino @@ -122,12 +206,21 @@ bool canControl(){ **構文:** -bool isCharging(){ +bool isCharging(); **説明:** 充電中かを返答します +**引数** + +なし. + +**戻り値** + +true: 充電中 +false: 充電中ではない + **定義:** ```arduino @@ -145,6 +238,44 @@ bool isCharging(){ return false; } ``` +## getBatteryLevel() + +**構文:** + +bool getBatteryLevel(); + +**説明:** + +バッテリー残量を返します + +**引数** + +なし + +**戻り値** + +バッテリーレベルを(0-100)の範囲で返します。(単位:%) +もし残量が確認できる状態になければ -1を返します + + +**定義:** + +```arduino +int8_t getBatteryLevel() { + Wire.beginTransmission(0x75); + Wire.write(0x78); + if (Wire.endTransmission(false) == 0 && Wire.requestFrom(0x75, 1)) { + switch (Wire.read() & 0xF0) { + case 0xE0: return 25; + case 0xC0: return 50; + case 0x80: return 75; + case 0x00: return 100; + default: return 0; + } + } + return -1; +} +``` ## setWakeupButton() @@ -201,7 +332,7 @@ 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 +340,7 @@ bool boostMode(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(); diff --git a/docs/zh_CN/api/power.md b/docs/zh_CN/api/power.md index df774a8c..0e7fddf7 100644 --- a/docs/zh_CN/api/power.md +++ b/docs/zh_CN/api/power.md @@ -8,7 +8,18 @@ **功能:BOOST输出常开功能** -**函数实现:** +**参数** + +true: 始终供应 +false: 通常關閉 + +**返回值** + +true: 控制成功 +false: 控制失败 + + +**函数实现** ```arduino bool setPowerBoostKeepOn(bool en){ @@ -33,6 +44,51 @@ bool setPowerBoostKeepOn(bool en){ #endif ``` +## setKeepLightLoad() + +**函数原型:** + +bool setKeepLightLoad(bool en); + +**功能:** + +设置自动关机功能。 + +**参数** + +true:当电流消耗低时,不会发生自动关闭 +false:电流消耗低时自动关闭 + +**返回值** + +true: 控制成功 +false: 控制失败 + +**函数实现** + +```arduino +bool setKeepLightLoad(bool en) { + uint8_t data; + Wire.beginTransmission(IP5306_ADDR); + Wire.write(IP5306_REG_SYS_CTL0); + Wire.endTransmission(); + + if(Wire.requestFrom(IP5306_ADDR, 1)) + { + data = Wire.read(); + + Wire.beginTransmission(IP5306_ADDR); + Wire.write(IP5306_REG_SYS_CTL0); + if (!en) Wire.write(data | LIGHT_LOAD_BIT); + else Wire.write(data &(~LIGHT_LOAD_BIT)); + Wire.endTransmission(); + return true; + } + return false; +} +``` + + ## setCharge() **函数原型:** @@ -41,7 +97,16 @@ bool setPowerBoostKeepOn(bool en){ **功能:设置充电状态** -**函数实现:** +true:充电开始指令 +false:充电停止指令 + +**返回值** + +true: 控制成功 +false: 控制失败 + + +**定義:** ```arduino bool POWER::setCharge(bool en){ @@ -69,9 +134,20 @@ bool POWER::setCharge(bool en){ **函数原型:** -bool isChargeFull(bool en); +bool isChargeFull(); -**功能:确认完全充电** +**説明:** + +确认完全充电. + +**引数** + +なし. + +**戻り値** + +true:完全充电 +false:没有完全充电 **函数实现:** @@ -97,7 +173,18 @@ bool isChargeFull(){ bool canControl(); -**功能:确认可以使用电源控制器** +**功能:** + +确认完全充电 + +**参数** + +无. + +**返回值** + +true: 电源控制器发现 +false:找不到电源控制器 **函数实现:** @@ -118,6 +205,15 @@ bool canControl(){ **功能:确认是否正在充电** +**参数** + +无. + +**返回值** + +true: 在充电过程中 +false: 不收费 + **函数实现:** ```arduino @@ -135,6 +231,44 @@ bool isCharging(){ return false; } ``` +## getBatteryLevel() + +**函数原型:** + +bool getBatteryLevel(); + +**功能:** + +返回电池电量 + +**参数** + +无 + +**返回值** + +返回0到100范围内的电池电量.(单位:%) +如果无法检查剩余金额,则返回-1 + + +**函数实现:** + +```arduino +int8_t getBatteryLevel() { + Wire.beginTransmission(0x75); + Wire.write(0x78); + if (Wire.endTransmission(false) == 0 && Wire.requestFrom(0x75, 1)) { + switch (Wire.read() & 0xF0) { + case 0xE0: return 25; + case 0xC0: return 50; + case 0x80: return 75; + case 0x00: return 100; + default: return 0; + } + } + return -1; +} +``` ## setWakeupButton() From 0094fb172d2e584a4898b314545510f5dc5a3038 Mon Sep 17 00:00:00 2001 From: siosio Date: Thu, 14 Mar 2019 12:01:35 +0800 Subject: [PATCH 2/6] Update power.md --- docs/en/api/power.md | 93 +++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 49 deletions(-) diff --git a/docs/en/api/power.md b/docs/en/api/power.md index 93578525..a3c30b07 100644 --- a/docs/en/api/power.md +++ b/docs/en/api/power.md @@ -8,18 +8,17 @@ **Description:** -This function sets enable/disable power mode. +This function sets/unsets power boost mode. **Function argument** -true: Output normally open. -false: Output normally close. +true: Boost mode on, +false: Boost mode off. **Function return value** -true: controll success. -false: control failure. - +true: Control success, +false: Control failure. **Definition:** @@ -37,7 +36,7 @@ bool setPowerBoostKeepOn(bool en){ Wire.beginTransmission(IP5306_ADDR); Wire.write(IP5306_REG_SYS_CTL0); if (en) Wire.write(data | BOOST_OUT_BIT); - else Wire.write(data &(~BOOST_OUT_BIT)); + else Wire.write(data &(~BOOST_OUT_BIT)); Wire.endTransmission(); return true; } @@ -53,16 +52,17 @@ bool setPowerBoostKeepOn(bool en){ **Description:** -Set mode of automatically shut down. +This function sets/unsets to disable the automatic shutdown. **Function argument** -true:when the current is too small, ip5306 will *not* automatically shut down. -false:when the current is too small, ip5306 will automatically shut down. +true: When the current is too small, IP5306 will *not* automatically shutdown, +false: When the current is too small, IP5306 will automatically shutdown. **Function return value** -true: controll success. -false: control failure. + +true: Control success, +false: Control failure. **Definition:** @@ -81,7 +81,7 @@ bool setKeepLightLoad(bool en) { Wire.beginTransmission(IP5306_ADDR); Wire.write(IP5306_REG_SYS_CTL0); if (!en) Wire.write(data | LIGHT_LOAD_BIT); - else Wire.write(data &(~LIGHT_LOAD_BIT)); + else Wire.write(data &(~LIGHT_LOAD_BIT)); Wire.endTransmission(); return true; } @@ -89,7 +89,6 @@ bool setKeepLightLoad(bool en) { } ``` - ## setCharge() **Syntax:** @@ -98,18 +97,17 @@ bool setKeepLightLoad(bool en) { **Description:** -This function sets enable/disable charge mode. -If charge full,try set charge enable->disable->enable,can be recharged +This function sets/unsets charge mode. When the battery is fully charged, try set charge enable->disable->enable, It can be recharged. **Function argument** -true:set to charge. -false:set to not charging +true: Start charging, +false: Stop charging. **Function return value** -true: controll success. -false: control failure. +true: Control success, +false: Control failure. **Definition:** @@ -127,7 +125,7 @@ bool setCharge(bool en){ Wire.beginTransmission(IP5306_ADDR); Wire.write(IP5306_REG_SYS_CTL0); if (en) Wire.write(data | CHARGE_OUT_BIT); - else Wire.write(data &(~CHARGE_OUT_BIT)); + else Wire.write(data &(~CHARGE_OUT_BIT)); Wire.endTransmission(); return true; } @@ -143,16 +141,16 @@ bool setCharge(bool en){ **Description:** -This function check battery level. +This function checks if the battery is fully charged. **Function argument** -no argument. +No argument. **Function return value** -true:battery is full -false:battery is not full +true: Full charged, +false: Not full charged. **Definition:** @@ -180,16 +178,16 @@ bool isChargeFull(){ **Description:** -This function checks the existence of the battery controller on I2C +This function checks the existence of the battery controller on I2C. **Function argument** -no argument. +No argument. **Function return value** -true: battery controller found. -false:battery controller not found. +true: Battery controller is found, +false: Battery controller is not found. **Definition:** @@ -210,19 +208,16 @@ bool canControl(){ **Description:** -This function checks the state of the charge +This function checks the state of the charging. **Function argument** -no argument. +No argument. **Function return value** -true: in charging -false: not in charging - - -true:charge, false:discharge +true: In charging, +false: Not in charging. **Definition:** @@ -249,16 +244,16 @@ bool isCharging(){ **Description:** -This function checks the battery charging level +This function gets the battery level. **Function argument** -no argument. +No argument. **Function return value** -percent of battery level.(0-100) -if can't communicate to controller ,return -1. +Battery remaining percentage. (0-100 %) +Returns -1 if it can not communicate with the controller. **Definition:** @@ -289,7 +284,7 @@ int8_t getBatteryLevel() { **Description:** -This function set the port to exit sleep +This function sets the port to exit sleep mode. **Definition:** @@ -307,17 +302,17 @@ void setWakeupButton(uint8_t button) { **Description:** -This function reset the CPU. +This function resets the CPU. **Definition:** ```arduino -void POWER::reset() { +void reset() { esp_restart(); } ``` - + ## deepSleep() @@ -362,7 +357,7 @@ bool boostMode(bool en){ **Description:** -This function shifts to deep sleep mode +This function shifts to deep sleep mode. **Definition:** @@ -386,4 +381,4 @@ void deepSleep(){ } esp_deep_sleep_start(); } -``` \ No newline at end of file +``` From 2a71acd151691b0ce6e2c777ab5b0a18902f61ac Mon Sep 17 00:00:00 2001 From: siosio Date: Thu, 14 Mar 2019 12:05:25 +0800 Subject: [PATCH 3/6] Update power.md --- docs/en/api/power.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/api/power.md b/docs/en/api/power.md index a3c30b07..518e1e02 100644 --- a/docs/en/api/power.md +++ b/docs/en/api/power.md @@ -317,7 +317,7 @@ void reset() { **Syntax:** -bool boostMode(bool en) +bool batteryMode(bool en) **Description:** From 7556f7c5d560e84c80bbff480fe9853aa8a457b4 Mon Sep 17 00:00:00 2001 From: siosio Date: Thu, 14 Mar 2019 12:24:30 +0800 Subject: [PATCH 4/6] Update power.md --- docs/ja/api/power.md | 104 +++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 54 deletions(-) diff --git a/docs/ja/api/power.md b/docs/ja/api/power.md index 1b0c6541..b78ac331 100644 --- a/docs/ja/api/power.md +++ b/docs/ja/api/power.md @@ -4,7 +4,7 @@ **構文:** -bool setPowerBoostKeepOn(bool en); +bool setPowerBoostKeepOn(bool en) **説明:** @@ -12,14 +12,13 @@ **引数** -true: 常時供給状態 -false: 常時切断状態 +true: 常時供給モードon。 +false: 常時供給モードoff。 **戻り値** -true: 制御成功 -false: 制御失敗 - +true: 制御成功。 +false: 制御失敗。 **定義** @@ -37,7 +36,7 @@ bool setPowerBoostKeepOn(bool en){ Wire.beginTransmission(IP5306_ADDR); Wire.write(IP5306_REG_SYS_CTL0); if (en) Wire.write(data | BOOST_OUT_BIT); - else Wire.write(data &(~BOOST_OUT_BIT)); + else Wire.write(data &(~BOOST_OUT_BIT)); Wire.endTransmission(); return true; } @@ -49,21 +48,21 @@ bool setPowerBoostKeepOn(bool en){ **構文:** -bool setKeepLightLoad(bool en); +bool setKeepLightLoad(bool en) **説明:** -自動シャットダウン機能を設定します. +自動シャットダウン無効化機能を設定します。 **引数** -true:極小消費電流時自動シャットダウンしません -false:極小消費電流時自動シャットダウンします +true: 軽負荷時に自動シャットダウンしません。 +false: 軽負荷時に自動シャットダウンします。 **戻り値** -true: 制御成功 -false: 制御失敗 +true: 制御成功。 +false: 制御失敗。 **定義:** @@ -81,7 +80,7 @@ bool setKeepLightLoad(bool en) { Wire.beginTransmission(IP5306_ADDR); Wire.write(IP5306_REG_SYS_CTL0); if (!en) Wire.write(data | LIGHT_LOAD_BIT); - else Wire.write(data &(~LIGHT_LOAD_BIT)); + else Wire.write(data &(~LIGHT_LOAD_BIT)); Wire.endTransmission(); return true; } @@ -89,12 +88,11 @@ bool setKeepLightLoad(bool en) { } ``` - ## setCharge() **構文:** -bool setCharge(bool en); +bool setCharge(bool en) **説明:** @@ -103,14 +101,13 @@ bool setKeepLightLoad(bool en) { **引数** -true:充電開始指示 -false:充電中止指示 +true: 充電開始指示。 +false: 充電中止指示。 **戻り値** -true: 制御成功 -false: 制御失敗 - +true: 制御成功。 +false: 制御失敗。 **定義:** @@ -128,7 +125,7 @@ bool POWER::setCharge(bool en){ Wire.beginTransmission(IP5306_ADDR); Wire.write(IP5306_REG_SYS_CTL0); if (en) Wire.write(data | CHARGE_OUT_BIT); - else Wire.write(data &(~CHARGE_OUT_BIT)); + else Wire.write(data &(~CHARGE_OUT_BIT)); Wire.endTransmission(); return true; } @@ -139,20 +136,20 @@ bool POWER::setCharge(bool en){ ## isChargeFull() **構文:** -bool isChargeFull(); +bool isChargeFull() **説明:** -満充電かを判断します. +満充電かを判断します。 **引数** -なし. +なし。 **戻り値** -true:満充電 -false:満充電ではない +true: 満充電。 +false: 満充電ではない。 **定義:** @@ -176,20 +173,20 @@ bool isChargeFull(){ **構文:** -bool canControl(); +bool canControl() **説明:** -電源コントローラが使用可能かを判断します +電源コントローラが制御可能かどうかを判断します。 **引数** -なし. +なし。 **戻り値** -true: 電源コントローラーが見つかった -false:電源コントローラーが見つからない +true: 電源コントローラーを制御可能。 +false: 電源コントローラーを制御不可能。 **定義:** @@ -206,20 +203,20 @@ bool canControl(){ **構文:** -bool isCharging(); +bool isCharging() **説明:** -充電中かを返答します +充電状態かどうかを判断します。 **引数** -なし. +なし。 **戻り値** -true: 充電中 -false: 充電中ではない +true: 充電中。 +false: 充電中ではない。 **定義:** @@ -238,15 +235,16 @@ bool isCharging(){ return false; } ``` + ## getBatteryLevel() **構文:** -bool getBatteryLevel(); +bool getBatteryLevel() **説明:** -バッテリー残量を返します +バッテリー残量(%)を返します。 **引数** @@ -255,8 +253,7 @@ bool isCharging(){ **戻り値** バッテリーレベルを(0-100)の範囲で返します。(単位:%) -もし残量が確認できる状態になければ -1を返します - +もし残量が確認できる状態になければ-1を返します。 **定義:** @@ -277,16 +274,15 @@ int8_t getBatteryLevel() { } ``` - ## setWakeupButton() **構文:** -void setWakeupButton(uint8_t button){ +void setWakeupButton(uint8_t button) **説明:** -スリープ復帰信号ポートを設定します +スリープ復帰信号ポートを設定します。 **定義:** @@ -300,35 +296,35 @@ void setWakeupButton(uint8_t button) { **構文:** -void reset() +void reset(); **説明:** -CPUをリセットします +CPUをリセットします。 **定義:** ```arduino -void POWER::reset() { +void reset() { esp_restart(); } ``` - + ## deepSleep() @@ -359,7 +355,7 @@ bool boostMode(bool en){ **説明:** -省エネモードに移行します +deep sleepモードに移行します。 **定義:** @@ -383,4 +379,4 @@ void deepSleep(){ } esp_deep_sleep_start(); } -``` \ No newline at end of file +``` From c600e77fd0c7273476d17a7999821e90ea9ddcf5 Mon Sep 17 00:00:00 2001 From: siosio Date: Thu, 14 Mar 2019 12:30:40 +0800 Subject: [PATCH 5/6] Update power.md --- docs/en/api/power.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/en/api/power.md b/docs/en/api/power.md index 518e1e02..ca886bc3 100644 --- a/docs/en/api/power.md +++ b/docs/en/api/power.md @@ -4,16 +4,16 @@ **Syntax:** -bool setPowerBoostKeepOn(bool en); +bool setPowerBoostKeepOn(bool en) **Description:** -This function sets/unsets power boost mode. +This function sets/unsets always boost output mode. **Function argument** -true: Boost mode on, -false: Boost mode off. +true: Turn on always boost output mode, +false: Turn off always boost output mode. **Function return value** @@ -48,7 +48,7 @@ bool setPowerBoostKeepOn(bool en){ **Syntax:** -bool setKeepLightLoad(bool en); +bool setKeepLightLoad(bool en) **Description:** @@ -93,7 +93,7 @@ bool setKeepLightLoad(bool en) { **Syntax:** -bool setCharge(bool en); +bool setCharge(bool en) **Description:** @@ -137,7 +137,7 @@ bool setCharge(bool en){ **Syntax:** -bool isChargeFull(); +bool isChargeFull() **Description:** @@ -174,7 +174,7 @@ bool isChargeFull(){ **Syntax:** -bool canControl(); +bool canControl() **Description:** @@ -204,7 +204,7 @@ bool canControl(){ **Syntax:** -bool isCharging(); +bool isCharging() **Description:** @@ -240,7 +240,7 @@ bool isCharging(){ **Syntax:** -bool getBatteryLevel(); +bool getBatteryLevel() **Description:** @@ -280,7 +280,7 @@ int8_t getBatteryLevel() { **Syntax:** -void setWakeupButton(uint8_t button){ +void setWakeupButton(uint8_t button) **Description:** From a9bd75a4b062ae0d4bf3037d7688f5e453c3db0d Mon Sep 17 00:00:00 2001 From: siosio Date: Thu, 14 Mar 2019 12:32:42 +0800 Subject: [PATCH 6/6] Update power.md --- docs/zh_CN/api/power.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/zh_CN/api/power.md b/docs/zh_CN/api/power.md index 0e7fddf7..e31b8f36 100644 --- a/docs/zh_CN/api/power.md +++ b/docs/zh_CN/api/power.md @@ -4,7 +4,7 @@ **函数原型:** -bool setPowerBoostKeepOn(bool en); +bool setPowerBoostKeepOn(bool en) **功能:BOOST输出常开功能** @@ -48,7 +48,7 @@ bool setPowerBoostKeepOn(bool en){ **函数原型:** -bool setKeepLightLoad(bool en); +bool setKeepLightLoad(bool en) **功能:** @@ -93,7 +93,7 @@ bool setKeepLightLoad(bool en) { **函数原型:** -bool setCharge(bool en); +bool setCharge(bool en) **功能:设置充电状态** @@ -134,7 +134,7 @@ bool POWER::setCharge(bool en){ **函数原型:** -bool isChargeFull(); +bool isChargeFull() **説明:** @@ -171,7 +171,7 @@ bool isChargeFull(){ **函数原型:** -bool canControl(); +bool canControl() **功能:** @@ -201,7 +201,7 @@ bool canControl(){ **函数原型:** -bool isCharging(){ +bool isCharging() **功能:确认是否正在充电** @@ -235,7 +235,7 @@ bool isCharging(){ **函数原型:** -bool getBatteryLevel(); +bool getBatteryLevel() **功能:** @@ -275,7 +275,7 @@ int8_t getBatteryLevel() { **函数原型:** -void setWakeupButton(uint8_t button){ +void setWakeupButton(uint8_t button) **功能:设置睡眠返回端口** @@ -298,24 +298,24 @@ void setWakeupButton(uint8_t button) { **函数实现:** ```arduino -void POWER::reset() { +void reset() { esp_restart(); } ``` - -## boostMode() + ## deepSleep() @@ -368,4 +368,4 @@ void deepSleep(){ } esp_deep_sleep_start(); } -``` \ No newline at end of file +```