/* Initializes the RTC device, include clock, RTC registers and function.  */
int32_t hal_rtc_init(rtc_dev_t *rtc)
/* Initializes the RTC device, include clock, RTC registers and function.  */
int32_t hal_rtc_init(rtc_dev_t *rtc)
{
	RTC_InitTypeDef RTC_InitStruct;
	RCC_PeriphClockSource_RTC(0);
	RTC_StructInit(&RTC_InitStruct);
	RTC_InitStruct.RTC_HourFormat = RTC_HourFormat_24;
	RTC_Init(&RTC_InitStruct);
	rtc_en = 1;
	return 0;
}