9#define LUAT_PM_SLEEP_MODE_NONE 0
10#define LUAT_PM_SLEEP_MODE_IDLE 1
11#define LUAT_PM_SLEEP_MODE_LIGHT 2
12#define LUAT_PM_SLEEP_MODE_DEEP 3
13#define LUAT_PM_SLEEP_MODE_STANDBY 4
15#define LUAT_PM_POWER_MODE_NORMAL (0)
16#define LUAT_PM_POWER_MODE_HIGH_PERFORMANCE (1)
17#define LUAT_PM_POWER_MODE_BALANCED (2)
18#define LUAT_PM_POWER_MODE_POWER_SAVER (3)
int luat_pm_dtimer_list(size_t *count, size_t *list)
获取所有深度休眠定时器的剩余时间,单位ms
int luat_pm_request(int mode)
请求进入指定的休眠模式
int luat_pm_set_power_mode(uint8_t mode, uint8_t sub_mode)
设置联网低功耗模式,等同于AT+POWERMODE
int luat_pm_reset(void)
重启
LUAT_PM_POWERON_REASON
开机原因
int luat_pm_release(int mode)
退出休眠模式
int luat_pm_dtimer_stop(int id)
停止底层定时器
uint32_t luat_pm_dtimer_remain(int id)
深度休眠定时器剩余时间,单位ms
enum LUAT_PM_POWERON_REASON LUAT_PM_POWERON_REASON_E
开机原因
int luat_pm_dtimer_wakeup_id(int *id)
获取唤醒定时器id
int luat_pm_dtimer_start(int id, size_t timeout)
启动底层定时器,在休眠模式下依然生效. 只触发一次
int luat_pm_dtimer_check(int id)
检查底层定时器运行状态
int luat_pm_get_poweron_reason(void)
开机原因
int luat_pm_check(void)
检查休眠状态
int luat_pm_force(int mode)
强制进入指定的休眠模式,忽略某些外设的影响,比如USB
int luat_pm_last_state(int *lastState, int *rtcOrPad)
唤醒原因,用于判断是从开机是否是由休眠状态下开机/唤醒
int luat_pm_wakeup_pin(int pin, int val)
配置唤醒引脚,只针对esp系列
int luat_pm_poweroff(void)
关机
int luat_pm_iovolt_ctrl(int id, int val)
设置IO电压域的电平
int luat_pm_power_ctrl(int id, uint8_t val)
开启内部的电源控制,注意不是所有的平台都支持,可能部分平台支持部分选项,看硬件
@ LUAT_PM_POWER_LDO_CTL_PIN
@ LUAT_PM_POWER_WORK_MODE
@ LUAT_PM_POWER_DAC_EN_PIN
@ LUAT_PM_POWER_POWERKEY_MODE
@ LUAT_PM_POWERON_REASON_EXTERNAL
@ LUAT_PM_POWERON_REASON_UNKNOWN
@ LUAT_PM_POWERON_REASON_FOTA
@ LUAT_PM_POWERON_REASON_TOOL
@ LUAT_PM_POWERON_REASON_SWRESET
@ LUAT_PM_POWERON_REASON_EXCEPTION
@ LUAT_PM_POWERON_REASON_NORMAL
@ LUAT_PM_POWERON_REASON_HWRESET
@ LUAT_PM_POWERON_REASON_WDT
@ LUAT_PM_POWERON_REASON_ALARM
@ LUAT_PM_POWERON_REASON_CHARGING
@ LUAT_PM_LDO_TYPE_KEYLED