Configure the RTC with RtcConfig
masterThe RtcConfig struct allows you to define the clock source, wakeup clock source, and prescaler factors for the Real-Time Clock. You can use a builder-like pattern to configure these settings before initializing the Rtc instance.
Available clock sources (RtcClockSource):
NoClock(0b00)LSE(0b01): Low Speed External oscillatorLSI(0b10): Low Speed Internal oscillatorHSE(0b11): High Speed External oscillator divided by 32
Available wakeup clock sources (RtcWakeupClockSource):
RtcClkDiv16(0b000)RtcClkDiv8(0b001)RtcClkDiv4(0b010)RtcClkDiv2(0b011)CkSpre(0b100): Typically 1 Hz clock.
let config = RtcConfig::default()
.clock_config(RtcClockSource::LSE)
.async_prescaler(127)
.sync_prescaler(255)
.wakeup_clock_config(RtcWakeupClockSource::CkSpre);
// Use config to initialize Rtc...