SDK4.0 This document shows Ameba SDK 4.0 APIs

- Main Page
- Modules
- Data Structures
- Files

Data Structures | Functions
SLEEP_EX
Ameba SDK » HAL

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...
#define | SLEEP_WAKEUP_BY_GTIMER (SLP_GTIMER)
#define | SLEEP_WAKEUP_BY_NFC (SLP_NFC)
#define | STANDBY_WAKEUP_BY_NFC (BIT1)
#define | STANDBY_WAKEUP_BY_PA5 (BIT4)
#define | STANDBY_WAKEUP_BY_PC7 (BIT5)
#define | STANDBY_WAKEUP_BY_PD5 (BIT6)
#define | STANDBY_WAKEUP_BY_PE3 (BIT7)

## 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...
#define | SLEEP_WAKEUP_BY_STIMER (SLP_STIMER)
#define | SLEEP_WAKEUP_BY_STIMER (BIT_SYSON_WEVT_SYSTIM_MSK)
#define | SLEEP_WAKEUP_BY_GPIO_INT (SLP_GPIO)
#define | SLEEP_WAKEUP_BY_GPIO_INT (BIT_SYSON_WEVT_GPIO_MSK)
#define | SLEEP_WAKEUP_BY_WLAN (SLP_WL)
#define | SLEEP_WAKEUP_BY_WLAN (BIT_SYSON_WEVT_WLAN_MSK)
#define | SLEEP_WAKEUP_BY_SDIO (SLP_SDIO)
#define | SLEEP_WAKEUP_BY_SDIO (BIT_SYSON_WEVT_SDIO_MSK)
#define | SLEEP_WAKEUP_BY_USB (SLP_USB)
#define | SLEEP_WAKEUP_BY_USB (BIT_SYSON_WEVT_USB_MSK)
#define | STANDBY_WAKEUP_BY_STIMER (BIT0)
#define | STANDBY_WAKEUP_BY_STIMER (BIT_SYSON_WEVT_A33_AND_A33GPIO_MSK)
#define | DSLEEP_WAKEUP_BY_TIMER (DS_TIMER33)
#define | DSLEEP_WAKEUP_BY_TIMER BIT(0)
#define | DSLEEP_WAKEUP_BY_GPIO (DS_GPIO)
#define | DSLEEP_WAKEUP_BY_GPIO BIT(2)
#define | SLEEP_WAKEUP_BY_GPIO (BIT_SYSON_WEVT_GPIO_DSTBY_MSK)
#define | SLEEP_WAKEUP_BY_UART (BIT_SYSON_WEVT_UART0_MSK | BIT_SYSON_WEVT_UART1_MSK)
#define | SLEEP_WAKEUP_BY_I2C (BIT_SYSON_WEVT_I2C0_MSK | BIT_SYSON_WEVT_I2C1_MSK)
#define | SLEEP_WAKEUP_BY_RTC (BIT_SYSON_WEVT_RTC_MSK)
#define | STANDBY_WAKEUP_BY_GPIO (BIT_SYSON_WEVT_GPIO_DSTBY_MSK)
#define | STANDBY_WAKEUP_BY_RTC (BIT_SYSON_WEVT_RTC_MSK)

## 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_event | A 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_duration | the 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_ms | the 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_event | A 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_duration | the 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_event | A 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_duration | the system sleep duration in ms, only valid for SLEEP_WAKEUP_BY_STIMER wake up event.
  clk_sourec_enable | the option for SCLK on(1)/off(0)
  sdr_enable | the 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_event | A 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_ms | the system sleep duration in ms, only valid for STANDBY_WAKEUP_BY_STIMER wake up event.
  gpio_option | for 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_event | A 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_option | for 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_event | A 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 |