1 Star 0 Fork 5.3K

hzcc / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
power.md 18.55 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

Power

Overview

Provides device power management functions.

This module is used to reboot the device and set low power consumption for the device.

Since:

1.0

Version:

1.0

Summary

Files

File Name

Description

lowpower.h

Sets low power consumption for the device.

reset.h

Reboots the device.

Enumerations

Enumeration Name

Description

LpcType { NO_SLEEP, LIGHT_SLEEP, DEEP_SLEEP }

Enumerates low power consumption modes.

RebootCause { SYS_REBOOT_CAUSE_UNKNOWN = 0, SYS_REBOOT_CAUSE_CMD, SYS_REBOOT_CAUSE_UPG, SYS_REBOOT_CAUSE_UPG_B, SYS_REBOOT_CAUSE_WIFI_MODE, SYS_REBOOT_CAUSE_USR_NORMAL_REBOOT, SYS_REBOOT_CAUSE_USR0, SYS_REBOOT_CAUSE_USR1, SYS_REBOOT_CAUSE_AT_BUSY, SYS_REBOOT_CAUSE_MAX }

Enumerates reboot causes.

Functions

Function Name

Description

LpcInit (void)

unsigned int

Initializes low power consumption.

LpcSetType (LpcType type)

unsigned int

Sets low power consumption for the device.

RebootDevice (RebootCause cause)

void

Reboots the device using different causes.

Details

Enumeration Type Documentation

LpcType

enum [LpcType](power.md#gaa6139ca73fa81742134fe74345ccb748)

Description:

Enumerates low power consumption modes.

Enumerator

Description

NO_SLEEP

No sleep

LIGHT_SLEEP

Light sleep

DEEP_SLEEP

Deep sleep

RebootCause

enum [RebootCause](power.md#gaeac1b873015f5b0a8aa7f3c068507426)

Description:

Enumerates reboot causes.

Enumerator

Description

SYS_REBOOT_CAUSE_UNKNOWN

Unknown cause

SYS_REBOOT_CAUSE_CMD

System reboot

SYS_REBOOT_CAUSE_UPG

Reboot upon an upgrade

SYS_REBOOT_CAUSE_UPG_B

Reboot upon an upgrade on the backup partition

SYS_REBOOT_CAUSE_WIFI_MODE

Reboot in Wi-Fi mode

SYS_REBOOT_CAUSE_USR_NORMAL_REBOOT

Normal reboot

SYS_REBOOT_CAUSE_USR0

Custom cause 0

SYS_REBOOT_CAUSE_USR1

Custom cause 1

SYS_REBOOT_CAUSE_AT_BUSY

Reboot upon busy AT commands

SYS_REBOOT_CAUSE_MAX

Maximum value

Function Documentation

LpcInit()

unsigned int LpcInit (void )

Description:

Initializes low power consumption.

Returns:

Returns WIFI_IOT_SUCCESS if the operation is successful; Returns an error code defined in wifiiot_errno.h otherwise.

LpcSetType()

unsigned int LpcSetType ([LpcType](power.md#gaa6139ca73fa81742134fe74345ccb748) type)

Description:

Sets low power consumption for the device.

Parameters:

Name

Description

type Indicates the low power consumption mode to set.

Returns:

Returns WIFI_IOT_SUCCESS if the operation is successful; Returns an error code defined in wifiiot_errno.h otherwise.

RebootDevice()

void RebootDevice ([RebootCause](power.md#gaeac1b873015f5b0a8aa7f3c068507426) cause)

Description:

Reboots the device using different causes.

Parameters:

Name

Description

cause Indicates the reboot cause.
1
https://gitee.com/hwang_zc/docs.git
git@gitee.com:hwang_zc/docs.git
hwang_zc
docs
docs
master

搜索帮助