Developer World
Spresense SDK Library v1.4.2-3df2e9d
pm.h File Reference
#include <queue.h>

Go to the source code of this file.

Classes

struct  pm_cpu_freqlock_s
 
struct  pm_cpu_wakelock_s
 

Macros

#define PM_BOOT_POR_NORMAL   (0x00000000ul) /** Power On Reset like as battery attached */
 
#define PM_BOOT_POR_DEADBATT   (0x00000001ul) /** Battery charged from DeadBattery state */
 
#define PM_BOOT_WDT_REBOOT   (0x00000002ul) /** System WDT expired or Explicitly Self Reboot */
 
#define PM_BOOT_WDT_RESET   (0x00000004ul) /** Chip WDT expired (might be used in HV-only system) */
 
#define PM_BOOT_DEEP_WKUPL   (0x00000008ul) /** In DeepSleep state, Detected WKUPL signal */
 
#define PM_BOOT_DEEP_WKUPS   (0x00000010ul) /** In DeepSleep state, Detected WKUPS signal */
 
#define PM_BOOT_DEEP_RTC   (0x00000020ul) /** In DeepSleep state, RTC Alarm expired */
 
#define PM_BOOT_DEEP_USB_ATTACH   (0x00000040ul) /** In DeepSleep state, USB Connected */
 
#define PM_BOOT_DEEP_OTHERS   (0x00000080ul) /** In DeepSleep state, Reserved others cause occurred */
 
#define PM_BOOT_COLD_SCU_INT   (0x00000100ul) /** In ColdSleep state, Detected SCU Interrupt */
 
#define PM_BOOT_COLD_RTC   (0x00001e00ul) /** In ColdSleep state, RTC Alarm Interrupt */
 
#define PM_BOOT_COLD_RTC_ALM0   (0x00000200ul) /** In ColdSleep state, RTC Alarm0 expired */
 
#define PM_BOOT_COLD_RTC_ALM1   (0x00000400ul) /** In ColdSleep state, RTC Alarm1 expired */
 
#define PM_BOOT_COLD_RTC_ALM2   (0x00000800ul) /** In ColdSleep state, RTC Alarm2 expired */
 
#define PM_BOOT_COLD_RTC_ALMERR   (0x00001000ul) /** In ColdSleep state, RTC Alarm Error occurred */
 
#define PM_BOOT_COLD_GPIO   (0x0fff0000ul) /** In ColdSleep state, Detected GPIO interrupt */
 
#define PM_BOOT_COLD_SEN_INT   (0x10000000ul) /** In ColdSleep state, Detected SEN_INT Interrupt */
 
#define PM_BOOT_COLD_PMIC_INT   (0x20000000ul) /** In ColdSleep state, Detected PMIC Interrupt */
 
#define PM_BOOT_COLD_USB_DETACH   (0x40000000ul) /** In ColdSleep state, USB Disconnected */
 
#define PM_BOOT_COLD_USB_ATTACH   (0x80000000ul) /** In ColdSleep state, USB Connected */
 
#define PMCMD_RAM_OFF   0 /* Power off */
 
#define PMCMD_RAM_RET   1 /* Retention */
 
#define PMCMD_RAM_ON   3 /* Power on */
 
#define PM_CPUFREQLOCK_FLAG_HV   (0x0001) /* request HV */
 
#define PM_CPUFREQLOCK_FLAG_LV   (0x4000) /* request LV */
 
#define PM_CPUFREQLOCK_TAG(prefix1, prefix2, num)   (((prefix1) << 24) + ((prefix2) << 16) + (num))
 
#define PM_CPUFREQLOCK_INIT(_tag, _flag)
 
#define PM_CPUWAKELOCK_TAG(prefix1, prefix2, num)   (((prefix1) << 24) + ((prefix2) << 16) + (num))
 
#define PM_CPUWAKELOCK_INIT(_tag)
 
#define EXTERN   extern "C"
 
#define up_pmstatdump()
 
#define up_pmic_set_notify(kind, cb)
 

Typedefs

typedef void(* pmic_notify_t) (void *arg)
 

Enumerations

enum  pm_sleepmode_e { PM_SLEEP_DEEP, PM_SLEEP_COLD }
 
enum  pmic_notify_e {
  PMIC_NOTIFY_ALARM = 0, PMIC_NOTIFY_WKUPS, PMIC_NOTIFY_WKUPL, PMIC_NOTIFY_LOWBATT,
  PMIC_NOTIFY_MAX
}
 

Functions

int up_pmramctrl (int cmd, uintptr_t addr, size_t size)
 
void up_pm_acquire_freqlock (struct pm_cpu_freqlock_s *lock)
 
void up_pm_release_freqlock (struct pm_cpu_freqlock_s *lock)
 
int up_pm_get_freqlock_count (struct pm_cpu_freqlock_s *lock)
 
void up_pm_acquire_wakelock (struct pm_cpu_wakelock_s *lock)
 
void up_pm_release_wakelock (struct pm_cpu_wakelock_s *lock)
 
int up_pm_count_acquire_wakelock (void)
 
uint32_t up_pm_get_bootcause (void)
 
uint32_t up_pm_get_bootmask (void)
 
uint32_t up_pm_set_bootmask (uint32_t mask)
 
uint32_t up_pm_clr_bootmask (uint32_t mask)
 
int up_pm_sleep (enum pm_sleepmode_e mode)
 
int up_pm_reboot (void)
 

Macro Definition Documentation

◆ PM_CPUFREQLOCK_INIT

#define PM_CPUFREQLOCK_INIT (   _tag,
  _flag 
)
Value:
{ \
.count = 0, \
.info = _tag, \
.flag = _flag, \
}

◆ PM_CPUWAKELOCK_INIT

#define PM_CPUWAKELOCK_INIT (   _tag)
Value:
{ \
.count = 0, \
.info = _tag, \
}