ESP32-IDF
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Enumerations | Functions
, rtc registers and memory related apis

rtc apis More...

Macros

#define RTC_ENTRY_ADDR   RTC_STORE6
 
#define RTC_MEMORY_CRC   RTC_STORE7
 

Enumerations

enum  SLEEP_MODE { AWAKE = 0, LIGHT_SLEEP = BIT0, DEEP_SLEEP = BIT1 }
 
enum  RESET_REASON {
  NO_MEAN = 0, POWERON_RESET = 1, SW_RESET = 3, OWDT_RESET = 4,
  DEEPSLEEP_RESET = 5, SDIO_RESET = 6, TG0WDT_SYS_RESET = 7, TG1WDT_SYS_RESET = 8,
  RTCWDT_SYS_RESET = 9, INTRUSION_RESET = 10, TGWDT_CPU_RESET = 11, SW_CPU_RESET = 12,
  RTCWDT_CPU_RESET = 13, EXT_CPU_RESET = 14, RTCWDT_BROWN_OUT_RESET = 15, RTCWDT_RTC_RESET = 16
}
 
enum  WAKEUP_REASON {
  NO_SLEEP = 0, EXT_EVENT0_TRIG = BIT0, EXT_EVENT1_TRIG = BIT1, GPIO_TRIG = BIT2,
  TIMER_EXPIRE = BIT3, SDIO_TRIG = BIT4, MAC_TRIG = BIT5, UART0_TRIG = BIT6,
  UART1_TRIG = BIT7, TOUCH_TRIG = BIT8, SAR_TRIG = BIT9, BT_TRIG = BIT10
}
 
enum  WAKEUP_ENABLE {
  DISEN_WAKEUP = NO_SLEEP, EXT_EVENT0_TRIG_EN = EXT_EVENT0_TRIG, EXT_EVENT1_TRIG_EN = EXT_EVENT1_TRIG, GPIO_TRIG_EN = GPIO_TRIG,
  TIMER_EXPIRE_EN = TIMER_EXPIRE, SDIO_TRIG_EN = SDIO_TRIG, MAC_TRIG_EN = MAC_TRIG, UART0_TRIG_EN = UART0_TRIG,
  UART1_TRIG_EN = UART1_TRIG, TOUCH_TRIG_EN = TOUCH_TRIG, SAR_TRIG_EN = SAR_TRIG, BT_TRIG_EN = BT_TRIG
}
 
enum  RTC_INT_REASON {
  NO_INT = 0, WAKEUP_INT = BIT0, REJECT_INT = BIT1, SDIO_IDLE_INT = BIT2,
  RTC_WDT_INT = BIT3, RTC_TIME_VALID_INT = BIT4
}
 
enum  RTC_INT_EN {
  DISEN_INT = 0, WAKEUP_INT_EN = WAKEUP_INT, REJECT_INT_EN = REJECT_INT, SDIO_IDLE_INT_EN = SDIO_IDLE_INT,
  RTC_WDT_INT_EN = RTC_WDT_INT, RTC_TIME_VALID_INT_EN = RTC_TIME_VALID_INT
}
 

Functions

RESET_REASON rtc_get_reset_reason (int cpu_no)
 Get the reset reason for CPU. More...
 
WAKEUP_REASON rtc_get_wakeup_cause (void)
 Get the wakeup cause for CPU. More...
 
uint32_t calc_rtc_memory_crc (uint32_t start_addr, uint32_t crc_len)
 Get CRC for Fast RTC Memory. More...
 
void set_rtc_memory_crc (void)
 Set CRC of Fast RTC memory 0-0x7ff into RTC STORE7. More...
 
void software_reset (void)
 Software Reset digital core. More...
 
void software_reset_cpu (int cpu_no)
 Software Reset digital core. More...
 

Detailed Description

rtc apis

Macro Definition Documentation

#define RTC_ENTRY_ADDR   RTC_STORE6
#define RTC_MEMORY_CRC   RTC_STORE7

Enumeration Type Documentation

Enumerator
NO_MEAN 
POWERON_RESET 

1, Vbat power on reset

SW_RESET 

3, Software reset digital core

OWDT_RESET 

4, Legacy watch dog reset digital core

DEEPSLEEP_RESET 

3, Deep Sleep reset digital core

SDIO_RESET 

6, Reset by SLC module, reset digital core

TG0WDT_SYS_RESET 

7, Timer Group0 Watch dog reset digital core

TG1WDT_SYS_RESET 

8, Timer Group1 Watch dog reset digital core

RTCWDT_SYS_RESET 

9, RTC Watch dog Reset digital core

INTRUSION_RESET 

10, Instrusion tested to reset CPU

TGWDT_CPU_RESET 

11, Time Group reset CPU

SW_CPU_RESET 

12, Software reset CPU

RTCWDT_CPU_RESET 

13, RTC Watch dog Reset CPU

EXT_CPU_RESET 

14, for APP CPU, reseted by PRO CPU

RTCWDT_BROWN_OUT_RESET 

15, Reset when the vdd voltage is not stable

RTCWDT_RTC_RESET 

16, RTC Watch dog reset digital core and rtc module

enum RTC_INT_EN
Enumerator
DISEN_INT 
WAKEUP_INT_EN 
REJECT_INT_EN 
SDIO_IDLE_INT_EN 
RTC_WDT_INT_EN 
RTC_TIME_VALID_INT_EN 
Enumerator
NO_INT 
WAKEUP_INT 
REJECT_INT 
SDIO_IDLE_INT 
RTC_WDT_INT 
RTC_TIME_VALID_INT 
enum SLEEP_MODE
Enumerator
AWAKE 
LIGHT_SLEEP 
DEEP_SLEEP 
Enumerator
DISEN_WAKEUP 
EXT_EVENT0_TRIG_EN 
EXT_EVENT1_TRIG_EN 
GPIO_TRIG_EN 
TIMER_EXPIRE_EN 
SDIO_TRIG_EN 
MAC_TRIG_EN 
UART0_TRIG_EN 
UART1_TRIG_EN 
TOUCH_TRIG_EN 
SAR_TRIG_EN 
BT_TRIG_EN 
Enumerator
NO_SLEEP 
EXT_EVENT0_TRIG 
EXT_EVENT1_TRIG 
GPIO_TRIG 
TIMER_EXPIRE 
SDIO_TRIG 
MAC_TRIG 
UART0_TRIG 
UART1_TRIG 
TOUCH_TRIG 
SAR_TRIG 
BT_TRIG 

Function Documentation

uint32_t calc_rtc_memory_crc ( uint32_t  start_addr,
uint32_t  crc_len 
)

Get CRC for Fast RTC Memory.

Parameters
uint32_tstart_addr : 0 - 0x7ff for Fast RTC Memory.
uint32_tcrc_len : 0 - 0x7ff, 0 for 1 byte, 0x7ff for 0x800 byte.
Returns
uint32_t : CRC32 result
RESET_REASON rtc_get_reset_reason ( int  cpu_no)

Get the reset reason for CPU.

Parameters
intcpu_no : CPU no.
Returns
RESET_REASON
WAKEUP_REASON rtc_get_wakeup_cause ( void  )

Get the wakeup cause for CPU.

Parameters
intcpu_no : CPU no.
Returns
WAKEUP_REASON
void set_rtc_memory_crc ( void  )

Set CRC of Fast RTC memory 0-0x7ff into RTC STORE7.

Parameters
None
Returns
None
void software_reset ( void  )

Software Reset digital core.

Parameters
None
Returns
None
void software_reset_cpu ( int  cpu_no)

Software Reset digital core.

Parameters
intcpu_no : The CPU to reset, 0 for PRO CPU, 1 for APP CPU.
Returns
None