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

  1. enum [LpcType]($api-api-LinkIoT-Power.md#gaa6139ca73fa81742134fe74345ccb748)

Description:

Enumerates low power consumption modes.

Enumerator

Description

NO_SLEEP 

No sleep

LIGHT_SLEEP 

Light sleep

DEEP_SLEEP 

Deep sleep

RebootCause

  1. enum [RebootCause]($api-api-LinkIoT-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()

  1. 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()

  1. unsigned int LpcSetType ([LpcType]($api-api-LinkIoT-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()

  1. void RebootDevice ([RebootCause]($api-api-LinkIoT-Power.md#gaeac1b873015f5b0a8aa7f3c068507426) cause)

Description:

Reboots the device using different causes.

Parameters:

Name

Description

cause Indicates the reboot cause.