STM32L0系列 测试基于L053 初始化void MX_RTC_Init(void)
{
LL_RTC_InitTypeDef RTC_InitStruct = {0};
/* Peripheral clock enable */
LL_RCC_EnableRTC();
/* RTC interrupt Init */
NVIC_SetPriority(RTC_IRQn, 0);
NVIC_EnableIRQ(RTC_IRQn);
/** Initialize RTC and set the Time and Date
*/
RTC_InitStruct.HourFormat = LL_RTC_HOURFORMAT_24HOUR;
RTC_InitStruct.AsynchPrescaler = 127;
RTC_InitStruct.SynchPrescaler = 255;
LL_RTC_Init(RTC, &RTC_InitStruct);
/** Initialize RTC and set the Time and Date
*/
/** Enable the WakeUp
*/
LL_RTC_DisableWriteProtection(RTC);
LL_RTC_WAKEUP_SetClock(RTC, LL_RTC_WAKEUPCLOCK_CKSPRE);
LL_EXTI_EnableIT_0_31(LL_EXTI_LINE_20);
LL_EXTI_EnableRisingTrig_0_31(LL_EXTI_LINE_20);
LL_RTC_WAKEUP_Enable(RTC);
LL_RTC_EnableWriteProtection(RTC);
}
|
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 本文链接:https://blog.csdn.net/Roomen0/article/details/114519978 ———————————————— 版权声明:本文为CSDN博主「Logan Li」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/Roomen0/article/details/114519978