AIROC™ BTSDK v4.9 - Documentation | ||||
Data Structures | |
union | tRTC_LHL_ADC_RTC_CTL_REG |
LHL_CTL register definition. Internal. More... | |
union | tRTC_REAL_TIME_CLOCK |
Real time clock read from hardware (48 bits). More... | |
struct | RtcTime |
Time structure. More... | |
struct | RtcState |
Internal runtime-state of RTC driver. More... | |
Enumerations | |
enum | { LHL_CTL_32K_OSC_POWER_UP = 0x04, LHL_CTL_32K_OSC_POWER_DN = 0x00, LHL_CTL_32K_OSC_POWER_MASK = 0x04 } |
Defines an Rtc driver. More... | |
enum | tRTC_LHL_CTL_RTC_ENABLE_MODE { LHL_CTL_RTC_ENABLE = 1, LHL_CTL_RTC_DISABLE = 0 } |
RTC enable type. | |
enum | { RTC_REF_CLOCK_SRC_32KHZ = 32, RTC_REF_CLOCK_SRC_128KHZ = 128 } |
Reference clock for the RTC. | |
enum | tRTC_REFERENCE_TIME_BASE_LINE { BASE_LINE_REF_YEAR = 2010, BASE_LINE_REF_MONTH = 1, BASE_LINE_REF_DATE = 1 } |
Time conversion reference timebase 2010/1/1. | |
Functions | |
void | rtc_init (void) |
Initialize the RTC block. | |
void | rtc_getRTCRawClock (tRTC_REAL_TIME_CLOCK *rtcClock) |
Reads current RTC value from hardware clock. More... | |
void | rtc_getRTCTime (RtcTime *timebuf) |
Get current time in RTC_time format. More... | |
BOOL32 | rtc_setRTCTime (RtcTime *newTime) |
Set the current time. More... | |
char * | rtc_ctime (RtcTime *timer, char *outbuf) |
Convert the time object pointed by timer to a c string containing a human-readable version of the corresponding local time and data. More... | |
void | rtc_sec2RtcTime (UINT32 second, RtcTime *rtctime) |
Convert the 32 bit seconds to time. More... | |
void | rtc_RtcTime2Sec (RtcTime *rtctime, UINT32 *second) |
Convert time to 32 bit seconds since timebase. More... | |
anonymous enum |
Defines an Rtc driver.
2073x support 48 bits RTC timer from either the internal 128 KHz RC oscillator or an external 32 KHz oscillator.
Usage:
(1) use rtc_setRTCTime() to set the current calendar time.
(2) user rtc_getRTCTime() to retrieve the current calendar. time.
(3) rtc_ctime(), will convert the RTC_time to ASCII user friendly string.RTC HW control bits.
char* rtc_ctime | ( | RtcTime * | timer, |
char * | outbuf | ||
) |
Convert the time object pointed by timer to a c string containing a human-readable version of the corresponding local time and data.
The returned string has the following format: Mmm dd hh:mm:ss yyyy where Mmm - the month in letters dd - the day of the month hh:mm:ss - time yyyy - year
timer | Pointer to the time structure that is to be converted to a C-String. |
outbuf | Pointer to a character buffer into which the converted string is stored. |
void rtc_getRTCRawClock | ( | tRTC_REAL_TIME_CLOCK * | rtcClock | ) |
Reads current RTC value from hardware clock.
rtcClock | Pointer to allocated RTC time structure into which the current time is to be copied into. |
void rtc_getRTCTime | ( | RtcTime * | timebuf | ) |
Get current time in RTC_time format.
timebuf | Pointer to allocated time structure into which the current time is to be copied into. |
void rtc_RtcTime2Sec | ( | RtcTime * | rtctime, |
UINT32 * | second | ||
) |
Convert time to 32 bit seconds since timebase.
rtctime | Pointer to the structure that contains the time. |
second | Number of seconds since timebase. |
void rtc_sec2RtcTime | ( | UINT32 | second, |
RtcTime * | rtctime | ||
) |
Convert the 32 bit seconds to time.
second | The number of seconds since timebase. |
rtctime | Pointer to an allocated time structure into which the converted time is returned. |
BOOL32 rtc_setRTCTime | ( | RtcTime * | newTime | ) |
Set the current time.
newTime | Pointer to time structure from which the current time is to be copied into the HW clock. |