ST STM32L0x3 Reference Manual page 1010

Ultra-low-power advanced arm-based 32-bit mcus
Table of Contents

Advertisement

Code examples
RTC->TR
RTC->ISR
RTC->WPR
RTC->WPR
A.15.2
RTC alarm configuration code example
/* (1) Write access for RTC registers */
/* (2) Disable alarm A to modify it */
/* (3) Wait until it is allow to modify alarm A value */
/* (4) Modify alarm A mask to have an interrupt each 1Hz */
/* (5) Enable alarm A and alarm A interrupt */
/* (6) Disable write access */
RTC->WPR
RTC->WPR
RTC->CR
while((RTC->ISR
{
/* add time out here for a robust application */
}
RTC->ALRMAR
RTC_ALRMAR_MSK1;
RTC->CR
RTC->WPR
RTC->WPR
A.15.3
RTC WUT configuration code example
/* (1) Write access for RTC registers */
/* (2) Disable wake up timerto modify it */
/* (3) Wait until it is allow to modify wake up reload value */
/* (4) Modify wake up value reload counter to have a wake up each 1Hz */
/* (5) Enable wake up counter and wake up interrupt */
/* (6) Disable write access */
RTC->WPR
RTC->WPR
RTC->CR
while((RTC->ISR
{
/* add time out here for a robust application */
}
RTC->WUTR
RTC->CR
RTC->WPR
RTC->WPR
1010/1043
=
RTC_TR_PM
| Time;
=~ RTC_ISR_INIT;
= 0xFE;
/* (7) */
= 0x64;
/* (7) */
= 0xCA;
/* (1) */
= 0x53;
/* (1) */
&=~ RTC_CR_ALRAE;
& RTC_ISR_ALRAWF) != RTC_ISR_ALRAWF)
=
RTC_ALRMAR_MSK4
/* (4) */
=
RTC_CR_ALRAIE
| RTC_CR_ALRAE;
= 0xFE;
/* (6) */
= 0x64;
/* (6) */
= 0xCA;
/* (1) */
= 0x53;
/* (1) */
&=~ RTC_CR_WUTE;
/* (2) */
& RTC_ISR_WUTWF) != RTC_ISR_WUTWF)
= 0x9C0;
/* (4) */
=
RTC_CR_WUTE
| RTC_CR_WUTIE;
= 0xFE;
/* (6) */
= 0x64;
/* (6) */
/* (5) */
/* (6) */
/* (2) */
|
RTC_ALRMAR_MSK3
/* (5) */
/* (5) */
RM0367 Rev 7
/* (3) */
|
RTC_ALRMAR_MSK2
/* (3) */
RM0367
|

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32L0x3 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents