Simple ZephyrOS device driver using RTC as system/sample clock. This clock can be set and read.
Setup: The driver uses the LSE as clock source and assumes that it is connected to an 32768Hz oscilator.
With the current pre-divers setup the sub second resolutions is around 4ms. The miliseconds are calculated according to the datasheet.
note: The time stamping function of the stm32 rtc is not used. Means that if the ZephyrOS switches the context inside "stm32_rtc_getTimestamp" function, the result in ss, t, d can have some offset.
sources: