Checking program for RTC module inside CPU.

Dependents:   RTC_w_COM Frequency_Counter_w_GPS_1PPS debug_tools Nucleo_RTC_Clock_setting ... more

Please refer below link.
http://developer.mbed.org/users/kenjiArai/notebook/nucleo-series-clock-structure-and-xtal-oscillation/

Files at this revision

API Documentation at this revision

Comitter:
kenjiArai
Date:
Sat Nov 01 01:46:04 2014 +0000
Parent:
0:01ddb8e35845
Child:
2:2ee7a7260cbf
Commit message:
Added register access routine

Changed in this revision

CheckRTC.cpp Show annotated file Show diff for this revision Revisions of this file
CheckRTC.h Show annotated file Show diff for this revision Revisions of this file
--- a/CheckRTC.cpp	Sat Nov 01 00:03:16 2014 +0000
+++ b/CheckRTC.cpp	Sat Nov 01 01:46:04 2014 +0000
@@ -73,6 +73,17 @@
 #endif
 }
 
+uint32_t get_RTCSEL(void){
+#if defined(TARGET_NUCLEO_F401RE) || defined(TARGET_NUCLEO_F411RE)
+    return ((RCC->BDCR >> 8) & 0x03);
+#elif defined(TARGET_NUCLEO_L152RE)
+    return ((RCC->CSR >> 16) & 0x03);
+#else
+    return 0;
+#endif
+}
+
+
 #if defined(TARGET_NUCLEO_F401RE) || defined(TARGET_NUCLEO_F411RE) || defined(TARGET_NUCLEO_L152RE)
 int32_t Set_RTC_LSE(void)
 {
--- a/CheckRTC.h	Sat Nov 01 00:03:16 2014 +0000
+++ b/CheckRTC.h	Sat Nov 01 01:46:04 2014 +0000
@@ -51,5 +51,6 @@
   * @return if proper setting = OK, if not = NG and UNKNOWN-> no support this program
   */
 int32_t CheckRTC(void);
+uint32_t get_RTCSEL(void);
 
 #endif      // CHECK_RTC_H