Checking program for RTC module inside CPU.
Dependents: RTC_w_COM Frequency_Counter_w_GPS_1PPS debug_tools Nucleo_RTC_Clock_setting ... more
CheckRTC.h
00001 /* 00002 * mbed Library program 00003 * Check RTC function and set proper clock if we can set 00004 * ONLY FOR "Nucleo Board" 00005 * 00006 * Copyright (c) 2010-2015 Kenji Arai / JH1PJL 00007 * http://www.page.sannet.ne.jp/kenjia/index.html 00008 * http://mbed.org/users/kenjiArai/ 00009 * Created: October 24th, 2014 00010 * Revised: May 16th, 2015 00011 * 00012 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 00013 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 00014 * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 00015 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00016 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00017 */ 00018 00019 #ifndef CHECK_RTC_H 00020 #define CHECK_RTC_H 00021 00022 #include "mbed.h" 00023 00024 #define TIMEOUT ((uint32_t)5000) 00025 00026 enum { 00027 UNKNOWN = -1, 00028 NG =0, 00029 OK 00030 }; 00031 00032 /** Checking program for RTC module inside CPU 00033 * Latest Nucleo board has external LSE Crystal X2 but no proper setting both HW ans SW 00034 * This program intends to use RTC with X2 00035 * 00036 * @code 00037 * #include "mbed.h" 00038 * #include "CheckRTC.h" 00039 * 00040 * int main() { 00041 * time_t seconds; 00042 * 00043 * CheckRTC(); 00044 * printf("Time: %s", ctime(&seconds)); 00045 * } 00046 * @endcode 00047 */ 00048 00049 /** Check and Set RTC 00050 * @param none 00051 * @return if proper setting = OK, if not = NG and UNKNOWN-> no support this program 00052 */ 00053 int32_t CheckRTC(void); 00054 uint32_t get_RTCSEL(void); 00055 00056 #endif // CHECK_RTC_H
Generated on Sun Jul 17 2022 04:55:46 by 1.7.2