27#define RTC_SetRunState(__STATE__) SFRX_ASSIGN(RTCCR, 0, (__STATE__))
28#define RTC_SetClockSource(__SOURCE__) SFRX_ASSIGN(RTCCFG, 1, (__SOURCE__))
29#define RTC_ConfigClockApply() SFRX_SET(RTCCFG, 0)
34#define RTC_ClearAllInterrupts() (RTCIF = 0x00)
35#define RTC_IsAlarmInterrupt() (RTCIF & 0x80)
36#define RTC_ClearAlarmInterrupt() (RTCIF &= ~0x80)
37#define RTC_IsDayInterrupt() (RTCIF & 0x40)
38#define RTC_ClearDayInterrupt() (RTCIF &= ~0x40)
39#define RTC_IsHourInterrupt() (RTCIF & 0x20)
40#define RTC_ClearHourInterrupt() (RTCIF &= ~0x20)
41#define RTC_IsMinuteInterrupt() (RTCIF & 0x10)
42#define RTC_ClearMinuteInterrupt() (RTCIF &= ~0x10)
43#define RTC_IsSecondInterrupt() (RTCIF & 0x08)
44#define RTC_ClearSecondInterrupt() (RTCIF &= ~0x08)
45#define RTC_IsSecondDiv2Interrupt() (RTCIF & 0x04)
46#define RTC_ClearSecondDiv2Interrupt() (RTCIF &= ~0x04)
47#define RTC_IsSecondDiv8Interrupt() (RTCIF & 0x02)
48#define RTC_ClearSecondDiv8Interrupt() (RTCIF &= ~0x02)
49#define RTC_IsSecondDiv32Interrupt() (RTCIF & 0x01)
50#define RTC_ClearSecondDiv32Interrupt() (RTCIF &= ~0x01)
55#define RTC_ConfigAlarm(__HOUR__, __MIN__, __SEC__, __SSEC__) do { \
57 ALAHOUR = (__HOUR__ & 0x1F); \
58 ALAMIN = (__MIN__ & 0x3F); \
59 ALASEC = (__SEC__ & 0x3F); \
60 ALASSEC = (__SSEC__ & 0x7F); \
66#define RTC_ConfigClock(__YEAR__, __MON__, __DAY__, __HOUR__, __MIN__, __SEC__, __SSEC__) do { \
68 INIYEAR = (__YEAR__ & 0x7F); \
69 INIMONTH = (__MON__ & 0x0F); \
70 INIDAY = (__DAY__ & 0x1F); \
71 INIHOUR = (__HOUR__ & 0x1F); \
72 INIMIN = (__MIN__ & 0x3F); \
73 INISEC = (__SEC__ & 0x3F); \
74 INISSEC = (__SSEC__ & 0x7F); \
@ RTC_ClockSource_Internal
@ RTC_ClockSource_External