This is a RTC additional function. This is only for Nucleo F401RE & F411RE mbed(Added L152RE, F334R8, L476RG & F746xx). If you connected battery backup circuit for internal RTC, you can make a power-off and reset condition. RTC still has proper time and date.
Dependents: Nucleo_rtos_sample PB_Emma_Ethernet
Please refer following NOTE information.
/users/kenjiArai/notebook/nucleo-series-rtc-control-under-power-onoff-and-re/
Diff: SetRTC.h
- Revision:
- 7:fa32602e23ec
- Parent:
- 6:ef7d2c83034d
- Child:
- 13:44e5327acb05
--- a/SetRTC.h Thu Feb 19 02:56:12 2015 +0000 +++ b/SetRTC.h Sat May 16 00:34:50 2015 +0000 @@ -7,7 +7,7 @@ * http://www.page.sannet.ne.jp/kenjia/index.html * http://mbed.org/users/kenjiArai/ * Created: October 24th, 2014 - * Revised: Feburary 19th, 2015 + * Revised: May 16th, 2015 * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE @@ -52,17 +52,21 @@ * int main() { * time_t seconds; * - * CheckRTC(); + * if (SetRTC(0) == 1) { // No use COMP(PB5 or 6) (only L152RE) + * PRINTF("Use External CLK (Good for RTC)\r\n"); + * } else { + * PRINTF("Use Internal CLK (Bad for RTC)\r\n"); + * } * printf("Time: %s", ctime(&seconds)); * } * @endcode */ /** Check and Set RTC - * @param none + * @param use_comparator = 1 Use COMP(only for L152 PB5 or 6 set-up), =0 no HW modification * @return if proper setting = 1, if not = 0 */ -int32_t SetRTC(void); +int32_t SetRTC(uint8_t use_comparator); /** Show(print) RTC related registers * @param none