rtc_sleep_init() function
Prepare the chip to enter sleep mode This function configures various power control state machines to handle entry into light sleep or deep sleep mode, switches APB and CPU clock source (usually to XTAL), and sets bias voltages for digital and RTC power domains. This function does not actually enter sleep mode; this is done using rtc_sleep_start function. Software may do some other actions between rtc_sleep_init and rtc_sleep_start, such as set wakeup timer and configure wakeup sources.
Arguments
cfg
sleep mode configuration