SDK3.5
This document shows Ameba SDK 3.5 APIs
Data Structures | Functions
SLEEP_EX

sleep extended functions More...

Data Structures

struct  _SLEEP_WKUP_EVENT_
 

Functions

void deepsleep_ex (uint32_t wakeup_event, uint32_t sleep_duration)
 To make the system entering the Deep Sleep power saving mode. The CPU, memory and peripheral power is off when entering deep sleep power saving mode. The program needs to be reload and all peripheral needs be re-configure when system resume. More...
 
void standby_wakeup_event_del (uint32_t wakeup_event)
 To delete a wake up event for wakeing up the system from the deep standby power saving mode. More...
 

Ameba1 Only

typedef struct _SLEEP_WKUP_EVENT_ SLEEP_WAKEUP_EVENT
 
typedef struct _SLEEP_WKUP_EVENT_PSLEEP_WAKEUP_EVENT
 
void deepstandby_ex (void)
 To make the system entering the Deep Standby power saving. The CPU, memory and part fo peripheral power is off when entering deep standby power saving mode. The program needs to be reload from the flash at system resume. More...
 
void standby_wakeup_event_add (uint32_t wakeup_event, uint32_t sleep_duration_ms, uint32_t gpio_active)
 To add a wake up event to wake up the system from the deep standby power saving mode. More...
 

AmebaZ Only

void deepstandby_ex (uint32_t sleep_duration_ms)
 To make the system entering the Deep Standby power saving. The CPU, memory and part fo peripheral power is off when entering deep standby power saving mode. The program needs to be reload from the flash at system resume. More...
 
void standby_wakeup_event_add (uint32_t wakeup_event, uint32_t gpio_active)
 To add a wake up event to wake up the system from the deep standby power saving mode. More...
 

Ameba Common

void sleep_ex (uint32_t wakeup_event, uint32_t sleep_duration)
 To make the system entering the Clock Gated power saving. This function just make the system to enter the clock gated power saving mode and pending on wake up event waitting. The user application need to configure the peripheral to generate system wake up event, like GPIO interrupt, G-Timer timeout, etc. befor entering power saving mode. More...
 
void sleep_ex_selective (uint32_t wakeup_event, uint32_t sleep_duration, uint32_t clk_sourec_enable, uint32_t sdr_enable)
 To make the system entering the Clock Gated power saving. This function just make the system to enter the clock gated power saving mode and pending on wake up event waitting. The user application need to configure the peripheral to generate system wake up event, like GPIO interrupt , G-Timer timeout, etc. befor entering power saving mode. More...
 

Detailed Description

sleep extended functions

Function Documentation

void deepsleep_ex ( uint32_t  wakeup_event,
uint32_t  sleep_duration 
)

To make the system entering the Deep Sleep power saving mode. The CPU, memory and peripheral power is off when entering deep sleep power saving mode. The program needs to be reload and all peripheral needs be re-configure when system resume.

Parameters
wakeup_eventA bit map of wake up event. This parameter can be any combination of the following values:
  • DSLEEP_WAKEUP_BY_TIMER
  • DSLEEP_WAKEUP_BY_GPIO
sleep_durationthe system sleep duration in ms, only valid for DSLEEP_WAKEUP_BY_TIMER wake up event.
Return values
None
void deepstandby_ex ( void  )

To make the system entering the Deep Standby power saving. The CPU, memory and part fo peripheral power is off when entering deep standby power saving mode. The program needs to be reload from the flash at system resume.

Return values
None
void deepstandby_ex ( uint32_t  sleep_duration_ms)

To make the system entering the Deep Standby power saving. The CPU, memory and part fo peripheral power is off when entering deep standby power saving mode. The program needs to be reload from the flash at system resume.

Parameters
sleep_duration_msthe system sleep duration in ms, only valid for STANDBY_WAKEUP_BY_STIMER wake up event.
Return values
None
void sleep_ex ( uint32_t  wakeup_event,
uint32_t  sleep_duration 
)

To make the system entering the Clock Gated power saving. This function just make the system to enter the clock gated power saving mode and pending on wake up event waitting. The user application need to configure the peripheral to generate system wake up event, like GPIO interrupt, G-Timer timeout, etc. befor entering power saving mode.

Parameters
wakeup_eventA bit map of wake up event. This parameter can be any combination of the following values:
  • SLEEP_WAKEUP_BY_STIMER
  • SLEEP_WAKEUP_BY_GTIMER
  • SLEEP_WAKEUP_BY_GPIO_INT
  • SLEEP_WAKEUP_BY_WLAN
  • SLEEP_WAKEUP_BY_SDIO
  • SLEEP_WAKEUP_BY_USB
  • SLEEP_WAKEUP_BY_GPIO
  • SLEEP_WAKEUP_BY_UART
  • SLEEP_WAKEUP_BY_I2C
  • SLEEP_WAKEUP_BY_RTC
  • SLEEP_WAKEUP_BY_RESETPIN
sleep_durationthe system sleep duration in ms, only valid for SLEEP_WAKEUP_BY_STIMER wake up event.
Return values
None
void sleep_ex_selective ( uint32_t  wakeup_event,
uint32_t  sleep_duration,
uint32_t  clk_sourec_enable,
uint32_t  sdr_enable 
)

To make the system entering the Clock Gated power saving. This function just make the system to enter the clock gated power saving mode and pending on wake up event waitting. The user application need to configure the peripheral to generate system wake up event, like GPIO interrupt , G-Timer timeout, etc. befor entering power saving mode.

Parameters
wakeup_eventA bit map of wake up event. This parameter can be any combination of the following values:
  • SLEEP_WAKEUP_BY_STIMER
  • SLEEP_WAKEUP_BY_GTIMER
  • SLEEP_WAKEUP_BY_GPIO_INT
  • SLEEP_WAKEUP_BY_WLAN
  • SLEEP_WAKEUP_BY_SDIO
  • SLEEP_WAKEUP_BY_USB
  • SLEEP_WAKEUP_BY_GPIO
  • SLEEP_WAKEUP_BY_UART
  • SLEEP_WAKEUP_BY_I2C
  • SLEEP_WAKEUP_BY_RTC
  • SLEEP_WAKEUP_BY_RESETPIN
sleep_durationthe system sleep duration in ms, only valid for SLEEP_WAKEUP_BY_STIMER wake up event.
clk_sourec_enablethe option for SCLK on(1)/off(0)
sdr_enablethe option for turn off the SDR controller (1:off, 0:on)
Return values
None
void standby_wakeup_event_add ( uint32_t  wakeup_event,
uint32_t  sleep_duration_ms,
uint32_t  gpio_active 
)

To add a wake up event to wake up the system from the deep standby power saving mode.

Parameters
wakeup_eventA bit map of wake up event. This parameter can be any combination of the following values:
  • STANDBY_WAKEUP_BY_STIMER
  • STANDBY_WAKEUP_BY_GPIO
  • STANDBY_WAKEUP_BY_RTC
  • STANDBY_WAKEUP_BY_RESETPIN
sleep_duration_msthe system sleep duration in ms, only valid for STANDBY_WAKEUP_BY_STIMER wake up event.
gpio_optionfor a GPIO pin to wake up the system by goes high or low This parameter can be any combination of the following values:
  • WAKEUP_BY_GPIO_NONE
  • WAKEUP_BY_GPIO_WAKEUP0_LOW
  • WAKEUP_BY_GPIO_WAKEUP0_HIG
  • WAKEUP_BY_GPIO_WAKEUP1_LOW
  • WAKEUP_BY_GPIO_WAKEUP1_HIG
  • WAKEUP_BY_GPIO_WAKEUP2_LOW
  • WAKEUP_BY_GPIO_WAKEUP2_HIG
  • WAKEUP_BY_GPIO_WAKEUP3_LOW
  • WAKEUP_BY_GPIO_WAKEUP3_HIG
Return values
None
void standby_wakeup_event_add ( uint32_t  wakeup_event,
uint32_t  gpio_active 
)

To add a wake up event to wake up the system from the deep standby power saving mode.

Parameters
wakeup_eventA bit map of wake up event. This parameter can be any combination of the following values:
  • STANDBY_WAKEUP_BY_STIMER
  • STANDBY_WAKEUP_BY_GPIO
  • STANDBY_WAKEUP_BY_RTC
  • STANDBY_WAKEUP_BY_RESETPIN
gpio_optionfor a GPIO pin to wake up the system by goes high or low This parameter can be any combination of the following values:
  • WAKEUP_BY_GPIO_NONE
  • WAKEUP_BY_GPIO_WAKEUP0_LOW
  • WAKEUP_BY_GPIO_WAKEUP0_HIG
  • WAKEUP_BY_GPIO_WAKEUP1_LOW
  • WAKEUP_BY_GPIO_WAKEUP1_HIG
  • WAKEUP_BY_GPIO_WAKEUP2_LOW
  • WAKEUP_BY_GPIO_WAKEUP2_HIG
  • WAKEUP_BY_GPIO_WAKEUP3_LOW
  • WAKEUP_BY_GPIO_WAKEUP3_HIG
Return values
None
void standby_wakeup_event_del ( uint32_t  wakeup_event)

To delete a wake up event for wakeing up the system from the deep standby power saving mode.

Parameters
wakeup_eventA bit map of wake up event. This parameter can be any combination of the following values:
  • STANDBY_WAKEUP_BY_STIMER
  • STANDBY_WAKEUP_BY_GPIO
  • STANDBY_WAKEUP_BY_RTC
  • STANDBY_WAKEUP_BY_RESETPIN
Return values
None