bf0_pm.h

Sifli Power management API.

Author

Sifli software development team

Unnamed Group

PM_DEBUG_PIN_HIGH()
PM_DEBUG_PIN_LOW()
PM_DEBUG_PIN_TOGGLE()
PM_DEBUG_PIN_ENABLE()
PM_DEBUG_PIN_INIT()
PM_NON_RETENTION_SECTION_NAME

non-retention section name

enum pm_scenario_name_t

Values:

enumerator PM_SCENARIO_UI
enumerator PM_SCENARIO_AUDIO
enumerator PM_SCENARIO_RFTEST
rt_uint32_t g_sleep_tick

Sleep ticks.

void pm_shutdown(void)
void aon_irq_handler_hook(uint32_t wsr)

AON IRQHandler hook.

It’s defined as weak function in pm module and called by AON_IRQHandler. User could reimplement it and perform customized action.

参数:
  • wsr[in] wakeup source

返回值:

void

uint32_t pm_get_wakeup_src(void)

get last wakeup source

返回值:

wakeup – source, for HPSYS, return HPSYS_AON_WSR_RTC and other value if SystemPowerOnModeGet() is PM_COLD_BOOT or PM_COLD_STANDBY return PMUC_WSR_RTC and other value if SystemPowerOnModeGet() is PM_HIBERNATE_BOOT or PM_SHUTDOWN_BOOT for LPSYS, return LPSYS_AON_WSR_RTC and other value if SystemPowerOnModeGet() is PM_COLD_BOOT or PM_COLD_STANDBY

uint32_t pm_get_power_mode(void)

get last low power mode

返回值:

low – power mode

rt_err_t pm_disable_pin_wakeup(uint8_t pin)

Disable pin wakeup.

参数:
  • pin – pin number, range: 0~5

返回值:

status

rt_err_t pm_enable_rtc_wakeup(void)

Enable RTC wakeup.

返回值:

status

rt_err_t pm_disable_rtc_wakeup(void)

Disable RTC wakeup.

返回值:

status

rt_tick_t pm_latch_tick(rt_tick_t curr_tick, uint32_t curr_time, float gtime_freq, void *user_data)

Calculate the compensated rt_tick.

参数:
  • curr_tick[in] current rt_tick

  • curr_time[in] current GTIME

  • gtime_freq[in] GTIMER frequency

  • user_data[in] user data

返回值:

compensated – rt_tick

void pm_set_last_latch_tick(rt_tick_t last_latch_tick)

Update last latch tick if rt_tick cannot be updated as expected.

参数:
  • last_latch_tick[in] last_latch_tick

返回:

void

rt_err_t pm_scenario_start(pm_scenario_name_t scenario)

Indicate specified scanario is started

参数:
  • scenario[in] scenario

rt_err_t pm_scenario_stop(pm_scenario_name_t scenario)

Indicate specified scanario is stopped

参数:
  • scenario[in] scenario

void pm_pin_restore(void)

Restore pin hardware state.

返回:

void

void pm_pin_backup(void)

Backup pin hardware state.

返回:

void

struct test_pm_data_restore_time_t

Public Members

uint32_t init_enter
uint32_t lcpu_wakeup
uint32_t preinit_begin
uint32_t acr_before
uint32_t acr_after
uint32_t xtal48_rdy
uint32_t dll_rdy
uint32_t pa_init_done
uint32_t pin_init_done
uint32_t power_rdy_exp
uint32_t power_rdy
uint32_t msp_init_done
uint32_t psram_rdy
uint32_t hal_init_done
uint32_t mpu_config_done
uint32_t ram_code_load_done
uint32_t restore_static_data_begin
uint32_t restore_static_data_done
uint32_t restore_ram_done
uint32_t restore_done
uint32_t device_resume_begin
uint32_t device_resume_done
struct test_pm_data_save_time_t

Public Members

uint32_t device_suspend_begin
uint32_t device_suspend_done
uint32_t save_start
uint32_t save_static_begin
uint32_t save_static_done
uint32_t save_done
struct test_pm_data_t

Public Members

test_pm_data_save_time_t save_time
test_pm_data_restore_time_t restore_time