Skip to content
Snippets Groups Projects
Commit a8727197 authored by Silvano Seva's avatar Silvano Seva Committed by Federico
Browse files

In STM32 RTC driver, addded the possibility to enable/disable RTC clock...

In STM32 RTC driver, addded the possibility to enable/disable RTC clock output. By default the RTC CCO signal is disabled, to enable it either define the directive 'RTC_CLKOUT_ENABLE' or uncomment the corresponding line in the stm32_rtc.h file

Signed-off-by: default avatarTerraneo Federico <fede.tft@miosix.org>
parent 5fcfcec6
Branches
Tags
No related merge requests found
...@@ -303,7 +303,9 @@ Rtc::Rtc() : tc(getTickFrequency()) ...@@ -303,7 +303,9 @@ Rtc::Rtc() : tc(getTickFrequency())
| RCC_BDCR_LSEON //External 32KHz oscillator enabled | RCC_BDCR_LSEON //External 32KHz oscillator enabled
| RCC_BDCR_RTCSEL_0; //Select LSE as clock source for RTC | RCC_BDCR_RTCSEL_0; //Select LSE as clock source for RTC
RCC_SYNC(); RCC_SYNC();
#ifdef RTC_CLKOUT_ENABLE
BKP->RTCCR=BKP_RTCCR_CCO; //Output RTC clock/64 on pin BKP->RTCCR=BKP_RTCCR_CCO; //Output RTC clock/64 on pin
#endif
} }
while((RCC->BDCR & RCC_BDCR_LSERDY)==0) ; //Wait for LSE to start while((RCC->BDCR & RCC_BDCR_LSERDY)==0) ; //Wait for LSE to start
......
...@@ -32,6 +32,12 @@ ...@@ -32,6 +32,12 @@
namespace miosix { namespace miosix {
///
/// Uncomment this directive to enable the RTC clock output functionality
///
//#define RTC_CLKOUT_ENABLE
/** /**
* Puts the MCU in deep sleep until the specified absolute time. * Puts the MCU in deep sleep until the specified absolute time.
* \param value absolute wait time in nanoseconds * \param value absolute wait time in nanoseconds
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment