The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
Diff: TARGET_NUCLEO_F412ZG/TARGET_STM/rtc_api_hal.h
- Revision:
- 167:84c0a372a020
- Parent:
- 161:aa5281ff4a02
- Child:
- 169:a7c7b631e539
--- a/TARGET_NUCLEO_F412ZG/TARGET_STM/rtc_api_hal.h Fri Apr 20 11:08:29 2018 +0100 +++ b/TARGET_NUCLEO_F412ZG/TARGET_STM/rtc_api_hal.h Fri May 11 16:51:14 2018 +0100 @@ -51,6 +51,20 @@ #define RTC_CLOCK LSI_VALUE #endif +/* PREDIV_A : 7-bit asynchronous prescaler */ +/* PREDIV_S : 15-bit synchronous prescaler */ +/* PREDIV_S is set in order to get a 1 Hz clock */ +#if DEVICE_LOWPOWERTIMER && !MBED_CONF_TARGET_LOWPOWERTIMER_LPTIM +/* PREDIV_A is set to a small value to improve the SubSeconds resolution */ +/* with a 32768Hz clock, PREDIV_A=7 gives a precision of 244us */ +#define PREDIV_A_VALUE 7 +#else /* DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM */ +/* PREDIV_A is set to the maximum value to improve the consumption */ +#define PREDIV_A_VALUE 127 +#endif /* DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM */ + +#define PREDIV_S_VALUE RTC_CLOCK / (PREDIV_A_VALUE + 1) - 1 + /** Read RTC time with subsecond precision. * * @return Time is microsecond