1.CUbe配置
RTC的时钟源是32K
2.编写代码
RTC_TimeTypeDef time;
RTC_DateTypeDef date;
HAL_RTC_GetTime(&hrtc,&time,RTC_FORMAT_BIN);
HAL_RTC_GetDate(&hrtc,&date,RTC_FORMAT_BIN);
sprintf(text,"%d:%d:%d: ",time.Hours,time.Minutes,time.Seconds);
LCD_DisplayStringLine(Line4,(u8 *)text);
sprintf(text,"%d:%d:%d: ",date.Year,date.Month,date.Date);
LCD_DisplayStringLine(Line5,(u8 *)text);