STM32L152 RTC 日历和自动唤醒功能配置
1、开发平台:
STM32L1-Discovery Keil 4
2、RTC Calendar和wake up
- STM32L152RC 带有一个硬件的实时时钟模块(RTC),可为用户提供日历功能,RTC也可以提供一个自动定时的功能,相当于是一个睡眠定时器,下面就看看该如何配置日历和定时:
void SYS_RTCInit(void)
{
static NVIC_InitTypeDef NVIC_InitStructure;
static EXTI_InitTypeDef EXTI_InitStructure;
static RTC_InitTypeDef RTC_InitStructure;
static RTC_TimeTypeDef RTC_TimeStructure;
static uint32_t AsynchPrediv = 0, SynchPrediv = 0;
RCC_APB1PeriphClockCmd(RCC_APB1