CDY version that shares functionality with Counter

Dependencies:   SDFileSystem_HelloWorld mbed FATFileSystem

Committer:
Charles David Young
Date:
Mon Nov 05 09:52:17 2018 -0700
Revision:
3:c547dba5d39b
Parent:
0:aa13e1c335cd
debug

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Charles David Young 0:aa13e1c335cd 1
Charles David Young 0:aa13e1c335cd 2 /** \addtogroup hal */
Charles David Young 0:aa13e1c335cd 3 /** @{*/
Charles David Young 0:aa13e1c335cd 4 /* mbed Microcontroller Library
Charles David Young 0:aa13e1c335cd 5 * Copyright (c) 2006-2013 ARM Limited
Charles David Young 0:aa13e1c335cd 6 *
Charles David Young 0:aa13e1c335cd 7 * Licensed under the Apache License, Version 2.0 (the "License");
Charles David Young 0:aa13e1c335cd 8 * you may not use this file except in compliance with the License.
Charles David Young 0:aa13e1c335cd 9 * You may obtain a copy of the License at
Charles David Young 0:aa13e1c335cd 10 *
Charles David Young 0:aa13e1c335cd 11 * http://www.apache.org/licenses/LICENSE-2.0
Charles David Young 0:aa13e1c335cd 12 *
Charles David Young 0:aa13e1c335cd 13 * Unless required by applicable law or agreed to in writing, software
Charles David Young 0:aa13e1c335cd 14 * distributed under the License is distributed on an "AS IS" BASIS,
Charles David Young 0:aa13e1c335cd 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Charles David Young 0:aa13e1c335cd 16 * See the License for the specific language governing permissions and
Charles David Young 0:aa13e1c335cd 17 * limitations under the License.
Charles David Young 0:aa13e1c335cd 18 */
Charles David Young 0:aa13e1c335cd 19 #ifndef MBED_RTC_API_H
Charles David Young 0:aa13e1c335cd 20 #define MBED_RTC_API_H
Charles David Young 0:aa13e1c335cd 21
Charles David Young 0:aa13e1c335cd 22 #include "device.h"
Charles David Young 0:aa13e1c335cd 23
Charles David Young 0:aa13e1c335cd 24 #if DEVICE_RTC
Charles David Young 0:aa13e1c335cd 25
Charles David Young 0:aa13e1c335cd 26 #include <time.h>
Charles David Young 0:aa13e1c335cd 27
Charles David Young 0:aa13e1c335cd 28 #ifdef __cplusplus
Charles David Young 0:aa13e1c335cd 29 extern "C" {
Charles David Young 0:aa13e1c335cd 30 #endif
Charles David Young 0:aa13e1c335cd 31
Charles David Young 0:aa13e1c335cd 32 /**
Charles David Young 0:aa13e1c335cd 33 * \defgroup hal_rtc RTC hal functions
Charles David Young 0:aa13e1c335cd 34 * @{
Charles David Young 0:aa13e1c335cd 35 */
Charles David Young 0:aa13e1c335cd 36
Charles David Young 0:aa13e1c335cd 37 /** Initialize the RTC peripheral
Charles David Young 0:aa13e1c335cd 38 *
Charles David Young 0:aa13e1c335cd 39 */
Charles David Young 0:aa13e1c335cd 40 void rtc_init(void);
Charles David Young 0:aa13e1c335cd 41
Charles David Young 0:aa13e1c335cd 42 /** Deinitialize RTC
Charles David Young 0:aa13e1c335cd 43 *
Charles David Young 0:aa13e1c335cd 44 * TODO: The function is not used by rtc api in mbed-drivers.
Charles David Young 0:aa13e1c335cd 45 */
Charles David Young 0:aa13e1c335cd 46 void rtc_free(void);
Charles David Young 0:aa13e1c335cd 47
Charles David Young 0:aa13e1c335cd 48 /** Get the RTC enable status
Charles David Young 0:aa13e1c335cd 49 *
Charles David Young 0:aa13e1c335cd 50 * @retval 0 disabled
Charles David Young 0:aa13e1c335cd 51 * @retval 1 enabled
Charles David Young 0:aa13e1c335cd 52 */
Charles David Young 0:aa13e1c335cd 53 int rtc_isenabled(void);
Charles David Young 0:aa13e1c335cd 54
Charles David Young 0:aa13e1c335cd 55 /** Get the current time from the RTC peripheral
Charles David Young 0:aa13e1c335cd 56 *
Charles David Young 0:aa13e1c335cd 57 * @return The current time
Charles David Young 0:aa13e1c335cd 58 */
Charles David Young 0:aa13e1c335cd 59 time_t rtc_read(void);
Charles David Young 0:aa13e1c335cd 60
Charles David Young 0:aa13e1c335cd 61 /** Set the current time to the RTC peripheral
Charles David Young 0:aa13e1c335cd 62 *
Charles David Young 0:aa13e1c335cd 63 * @param t The current time to be set
Charles David Young 0:aa13e1c335cd 64 */
Charles David Young 0:aa13e1c335cd 65 void rtc_write(time_t t);
Charles David Young 0:aa13e1c335cd 66
Charles David Young 0:aa13e1c335cd 67 /**@}*/
Charles David Young 0:aa13e1c335cd 68
Charles David Young 0:aa13e1c335cd 69 #ifdef __cplusplus
Charles David Young 0:aa13e1c335cd 70 }
Charles David Young 0:aa13e1c335cd 71 #endif
Charles David Young 0:aa13e1c335cd 72
Charles David Young 0:aa13e1c335cd 73 #endif
Charles David Young 0:aa13e1c335cd 74
Charles David Young 0:aa13e1c335cd 75 #endif
Charles David Young 0:aa13e1c335cd 76
Charles David Young 0:aa13e1c335cd 77 /** @}*/