[English]

PM APIs

PM Interface

The BK PM Driver supports following logical PM interfaces:

  • BK enter different sleep mode interface

  • BK clock control interface

  • BK power control interface

API Reference

Functions

void bk_enter_deep_sleep_mode(PS_DEEP_CTRL_PARAM *deep_param)

Request deep sleep,and wakeup by gpio/rtc/usb.

参数

deep_param:param – of deeps leep

  • wake_up_way - wakeup mode gpio/rtc/usb

  • gpio_index_map - The gpio bitmap which set 1 enable wakeup deep sleep. gpio_index_map is hex and every bits is map to gpio0-gpio31.

  • gpio_edge_map - The gpio edge bitmap for wakeup gpios, gpio_edge_map is hex and every bits is map to gpio0-gpio31. 0:rising,1:falling.

  • gpio_stay_lo_map - The gpio bitmap which need stay ,not change in deep sleep. gpio_index_lo_map is hex and every bits is map to gpio0-gpio31.

  • gpio_last_index_map - The gpio bitmap which set 1 enable wakeup deep sleep. gpio_index_map is hex and every bits is map to gpio32-gpio39.

  • gpio_last_edge_map - The gpio edge bitmap for wakeup gpios, gpio_edge_map is hex and every bits is map to gpio32-gpio39. 0:rising,1:falling.

  • gpio_stay_hi_map - The gpio bitmap which need stay ,not change in deep sleep. gpio_index_lo_map is hex and every bits is map to gpio32-gpio39.

  • sleep_time - the time secound when use PS_DEEP_WAKEUP_RTC wakeup.

  • lpo_32k_src - the RTC wakeup source.LPO_SELECT_ROSC or LPO_SELECT_32K_XTAL.

  • sleep_mode - MCU_LOW_VOLTAGE_SLEEP or other

返回

  • void

UINT32 bk_wlan_instant_lowvol_sleep(PS_DEEP_CTRL_PARAM *lowvol_param)

Request low vol sleep,and wakeup by gpio/rtc/usb.

参数

lowvol_param, : – param of low lov leep

  • wake_up_way - wakeup mode gpio/rtc/usb

  • gpio_index_map -The gpio bitmap which set 1 enable wakeup deep sleep. gpio_index_map is hex and every bits is map to gpio0-gpio31.

  • gpio_edge_map - The gpio edge bitmap for wakeup gpios, gpio_edge_map is hex and every bits is map to gpio0-gpio31. 0:rising,1:falling.

  • gpio_stay_lo_map - The gpio bitmap which need stay ,not change in deep sleep. gpio_index_lo_map is hex and every bits is map to gpio0-gpio31.

  • gpio_last_index_map - The gpio bitmap which set 1 enable wakeup deep sleep. gpio_index_map is hex and every bits is map to gpio32-gpio39.

  • gpio_last_edge_map - The gpio edge bitmap for wakeup gpios, gpio_edge_map is hex and every bits is map to gpio32-gpio39. 0:rising,1:falling.

  • gpio_stay_hi_map - The gpio bitmap which need stay ,not change in deep sleep. gpio_index_lo_map is hex and every bits is map to gpio32-gpio39.

  • sleep_time - the time secound when use PS_DEEP_WAKEUP_RTC wakeup.

  • lpo_32k_src - the RTC wakeup source.LPO_SELECT_ROSC or LPO_SELECT_32K_XTAL.

  • sleep_mode - MCU_LOW_VOLTAGE_SLEEP or other

返回

  • kNoErr : success

  • othesr : failed

int bk_wlan_dtim_rf_ps_mode_enable(void)

Enable dtim power save,close rf,and wakeup by ieee dtim dynamical.

参数

void

返回

  • kNoErr : success

  • others : failed

int bk_wlan_dtim_rf_ps_mode_disable(void)

Request exit power save by ieee dtim.

参数

void

返回

  • kNoErr : success.

  • othesr : failed

void power_save_set_listen_int(UINT16 listen_int)

set wifi listen interval in dtim sleep mode

参数

listen_int, : – dtim listen interval

void power_save_set_hw_tim_cnt_limit(uint32_t cnt)

set wifi hw_ tim interval in dtim sleep mode.

Attention

Set the cnt_limit for hw_tim, once hw_tim_cnt is over cnt_limit, hw_tim will be disabled until next beacon received (hw_tim_cnt reset to 0).

参数

cnt – : The cnt limit you want to pass, pass 0 if you want to disable hw_tim.

返回

  • void

int bk_wlan_mcu_ps_mode_enable(void)

Enable mcu power save,close mcu ,and wakeup by irq.

参数

void

返回

  • kNoErr : success.

  • others : failed

int bk_wlan_mcu_ps_mode_disable(void)

Disenable mcu power save.

参数

void

返回

  • kNoErr : success.

  • others : failed

bool sctrl_set_gpio_wakeup_index(UINT8 gpio_index, WAKEUP_GPIO_TYPE gpio_type)

set GPIO wakeup in wifi keepalive

参数
  • gpio_index, : – Pin x used to wakeup low voltage sleep

  • gpio_type, :

    • 0 - low level

    • 1 - high level

    • 2 - posedge

    • 3 - negedge

返回

  • true : success.

  • false : failed