ATY_LIB V2_102_230218
ATY_LIB for general devices or ALGO
 
Loading...
Searching...
No Matches
fw_rtc.h File Reference
#include "fw_conf.h"
#include "fw_types.h"

Go to the source code of this file.

Macros

#define RTC_SetRunState(__STATE__)   SFRX_ASSIGN(RTCCR, 0, (__STATE__))
 
#define RTC_SetClockSource(__SOURCE__)   SFRX_ASSIGN(RTCCFG, 1, (__SOURCE__))
 
#define RTC_ConfigClockApply()   SFRX_SET(RTCCFG, 0)
 
#define RTC_ClearAllInterrupts()   (RTCIF = 0x00)
 
#define RTC_IsAlarmInterrupt()   (RTCIF & 0x80)
 
#define RTC_ClearAlarmInterrupt()   (RTCIF &= ~0x80)
 
#define RTC_IsDayInterrupt()   (RTCIF & 0x40)
 
#define RTC_ClearDayInterrupt()   (RTCIF &= ~0x40)
 
#define RTC_IsHourInterrupt()   (RTCIF & 0x20)
 
#define RTC_ClearHourInterrupt()   (RTCIF &= ~0x20)
 
#define RTC_IsMinuteInterrupt()   (RTCIF & 0x10)
 
#define RTC_ClearMinuteInterrupt()   (RTCIF &= ~0x10)
 
#define RTC_IsSecondInterrupt()   (RTCIF & 0x08)
 
#define RTC_ClearSecondInterrupt()   (RTCIF &= ~0x08)
 
#define RTC_IsSecondDiv2Interrupt()   (RTCIF & 0x04)
 
#define RTC_ClearSecondDiv2Interrupt()   (RTCIF &= ~0x04)
 
#define RTC_IsSecondDiv8Interrupt()   (RTCIF & 0x02)
 
#define RTC_ClearSecondDiv8Interrupt()   (RTCIF &= ~0x02)
 
#define RTC_IsSecondDiv32Interrupt()   (RTCIF & 0x01)
 
#define RTC_ClearSecondDiv32Interrupt()   (RTCIF &= ~0x01)
 
#define RTC_ConfigAlarm(__HOUR__, __MIN__, __SEC__, __SSEC__)
 
#define RTC_ConfigClock(__YEAR__, __MON__, __DAY__, __HOUR__, __MIN__, __SEC__, __SSEC__)
 

Enumerations

enum  RTC_ClockSource_t { RTC_ClockSource_External = 0x00 , RTC_ClockSource_Internal = 0x01 }
 

Macro Definition Documentation

◆ RTC_ClearAlarmInterrupt

#define RTC_ClearAlarmInterrupt ( )    (RTCIF &= ~0x80)

Definition at line 36 of file fw_rtc.h.

◆ RTC_ClearAllInterrupts

#define RTC_ClearAllInterrupts ( )    (RTCIF = 0x00)

Call SFRX_ON(); before calling following macros

Definition at line 34 of file fw_rtc.h.

◆ RTC_ClearDayInterrupt

#define RTC_ClearDayInterrupt ( )    (RTCIF &= ~0x40)

Definition at line 38 of file fw_rtc.h.

◆ RTC_ClearHourInterrupt

#define RTC_ClearHourInterrupt ( )    (RTCIF &= ~0x20)

Definition at line 40 of file fw_rtc.h.

◆ RTC_ClearMinuteInterrupt

#define RTC_ClearMinuteInterrupt ( )    (RTCIF &= ~0x10)

Definition at line 42 of file fw_rtc.h.

◆ RTC_ClearSecondDiv2Interrupt

#define RTC_ClearSecondDiv2Interrupt ( )    (RTCIF &= ~0x04)

Definition at line 46 of file fw_rtc.h.

◆ RTC_ClearSecondDiv32Interrupt

#define RTC_ClearSecondDiv32Interrupt ( )    (RTCIF &= ~0x01)

Definition at line 50 of file fw_rtc.h.

◆ RTC_ClearSecondDiv8Interrupt

#define RTC_ClearSecondDiv8Interrupt ( )    (RTCIF &= ~0x02)

Definition at line 48 of file fw_rtc.h.

◆ RTC_ClearSecondInterrupt

#define RTC_ClearSecondInterrupt ( )    (RTCIF &= ~0x08)

Definition at line 44 of file fw_rtc.h.

◆ RTC_ConfigAlarm

#define RTC_ConfigAlarm (   __HOUR__,
  __MIN__,
  __SEC__,
  __SSEC__ 
)
Value:
do { \
SFRX_ON(); \
ALAHOUR = (__HOUR__ & 0x1F); \
ALAMIN = (__MIN__ & 0x3F); \
ALASEC = (__SEC__ & 0x3F); \
ALASSEC = (__SSEC__ & 0x7F); \
SFRX_OFF(); \
} while(0)
#define ALAHOUR
Definition: fw_reg_stc8g.h:339
#define ALASEC
Definition: fw_reg_stc8g.h:341
#define ALASSEC
Definition: fw_reg_stc8g.h:342
#define ALAMIN
Definition: fw_reg_stc8g.h:340

Set Alarm

Definition at line 55 of file fw_rtc.h.

◆ RTC_ConfigClock

#define RTC_ConfigClock (   __YEAR__,
  __MON__,
  __DAY__,
  __HOUR__,
  __MIN__,
  __SEC__,
  __SSEC__ 
)
Value:
do { \
SFRX_ON(); \
INIYEAR = (__YEAR__ & 0x7F); \
INIMONTH = (__MON__ & 0x0F); \
INIDAY = (__DAY__ & 0x1F); \
INIHOUR = (__HOUR__ & 0x1F); \
INIMIN = (__MIN__ & 0x3F); \
INISEC = (__SEC__ & 0x3F); \
INISSEC = (__SSEC__ & 0x7F); \
SFRX_OFF(); \
} while(0)
#define INIMONTH
Definition: fw_reg_stc8g.h:344
#define INISSEC
Definition: fw_reg_stc8g.h:349
#define INISEC
Definition: fw_reg_stc8g.h:348
#define INIYEAR
Definition: fw_reg_stc8g.h:343
#define INIDAY
Definition: fw_reg_stc8g.h:345
#define INIMIN
Definition: fw_reg_stc8g.h:347
#define INIHOUR
Definition: fw_reg_stc8g.h:346

Set clock initial value

Definition at line 66 of file fw_rtc.h.

◆ RTC_ConfigClockApply

#define RTC_ConfigClockApply ( )    SFRX_SET(RTCCFG, 0)

Definition at line 29 of file fw_rtc.h.

◆ RTC_IsAlarmInterrupt

#define RTC_IsAlarmInterrupt ( )    (RTCIF & 0x80)

Definition at line 35 of file fw_rtc.h.

◆ RTC_IsDayInterrupt

#define RTC_IsDayInterrupt ( )    (RTCIF & 0x40)

Definition at line 37 of file fw_rtc.h.

◆ RTC_IsHourInterrupt

#define RTC_IsHourInterrupt ( )    (RTCIF & 0x20)

Definition at line 39 of file fw_rtc.h.

◆ RTC_IsMinuteInterrupt

#define RTC_IsMinuteInterrupt ( )    (RTCIF & 0x10)

Definition at line 41 of file fw_rtc.h.

◆ RTC_IsSecondDiv2Interrupt

#define RTC_IsSecondDiv2Interrupt ( )    (RTCIF & 0x04)

Definition at line 45 of file fw_rtc.h.

◆ RTC_IsSecondDiv32Interrupt

#define RTC_IsSecondDiv32Interrupt ( )    (RTCIF & 0x01)

Definition at line 49 of file fw_rtc.h.

◆ RTC_IsSecondDiv8Interrupt

#define RTC_IsSecondDiv8Interrupt ( )    (RTCIF & 0x02)

Definition at line 47 of file fw_rtc.h.

◆ RTC_IsSecondInterrupt

#define RTC_IsSecondInterrupt ( )    (RTCIF & 0x08)

Definition at line 43 of file fw_rtc.h.

◆ RTC_SetClockSource

#define RTC_SetClockSource (   __SOURCE__)    SFRX_ASSIGN(RTCCFG, 1, (__SOURCE__))

Definition at line 28 of file fw_rtc.h.

◆ RTC_SetRunState

#define RTC_SetRunState (   __STATE__)    SFRX_ASSIGN(RTCCR, 0, (__STATE__))

Definition at line 27 of file fw_rtc.h.

Enumeration Type Documentation

◆ RTC_ClockSource_t

Enumerator
RTC_ClockSource_External 
RTC_ClockSource_Internal 

Definition at line 21 of file fw_rtc.h.

22{
RTC_ClockSource_t
Definition: fw_rtc.h:22
@ RTC_ClockSource_Internal
Definition: fw_rtc.h:24
@ RTC_ClockSource_External
Definition: fw_rtc.h:23