/* RTC Configuration on Wakeup. 
Enable the backup domain clocks and write access to the backup domain. If the RTC has not been enabled, set the clock source and prescaler value. The parameters are not used if the RTC has already been enabled. */
void rtc_auto_awake(enum rcc_osc clock_source, uint32_t prescale_val)
/* RTC Configuration on Wakeup. 
Enable the backup domain clocks and write access to the backup domain. If the RTC has not been enabled, set the clock source and prescaler value. The parameters are not used if the RTC has already been enabled. */
void rtc_auto_awake(enum rcc_osc clock_source, uint32_t prescale_val)
{
	uint32_t reg32;
	rcc_periph_clock_enable(RCC_PWR);
	rcc_periph_clock_enable(RCC_BKP);
	reg32 = rcc_rtc_clock_enabled_flag();
	if (reg32 != 0) {
		rtc_awake_from_standby();
	} else {
		rtc_awake_from_off(clock_source);
		rtc_set_prescale_val(prescale_val);
	}
}
/**@}