EDF - OnePIC MCU  v1.1.0
source/base/include/OnePIC_rtcc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tagRTCC
 Union to access rtcc registers. More...
#define mRTCCInit()   RTCCInit()
 Sets the RTCC to 00:00:00.
#define mRTCCSet()   RTCCSet()
 Sets the RTCC to 00:00:00.
#define mRTCCGetSec()   _time_chk.sec
 returns the second
#define mRTCCGetMin()   _time_chk.min
 returns the minute
#define mRTCCGetHour()   _time_chk.hr
 returns the hour
#define mRTCCGetWkDay()   (_time_chk.wkd-1)
 returns the current weekday
#define mRTCCGetDay()   _time_chk.day
 returns the day
#define mRTCCGetMonth()   _time_chk.mth
 returns the month
#define mRTCCGetYear()   _time_chk.yr
 returns the year
#define mRTCCSetSec(__rtccdat)
 sets the second
#define mRTCCSetMin(__rtccdat)
 set minute
#define mRTCCSetHour(__rtccdat)
 set hour
#define mRTCCSetWkDay(__rtccdat)
 set weekday
#define mRTCCSetDay(__rtccdat)
 set day
#define mRTCCSetMonth(__rtccdat)
 set month
#define mRTCCSetYear(__rtccdat)
 set year
#define mRTCCDec2Bin(Dec)   (10 * (Dec >> 4) + (Dec & 0x0f))
#define mRTCCBin2Dec(Bin)   (((Bin / 10) << 4) | (Bin % 10))
#define mRTCCGetBinSec()   mRTCCDec2Bin(mRTCCGetSec())
#define mRTCCGetBinMin()   mRTCCDec2Bin(mRTCCGetMin())
#define mRTCCGetBinHour()   mRTCCDec2Bin(mRTCCGetHour())
#define mRTCCGetBinWkDay()   mRTCCDec2Bin(mRTCCGetWkDay())
#define mRTCCGetBinDay()   mRTCCDec2Bin(mRTCCGetDay())
#define mRTCCGetBinMonth()   mRTCCDec2Bin(mRTCCGetMonth())
#define mRTCCGetBinYear()   mRTCCDec2Bin(mRTCCGetYear())
typedef struct tagRTCC RTCC
RTCC _time
 contains the time
RTCC _pwr_on
 used to reload time when powered on
RTCC _pwr_off
 used to save time when power off
RTCC _time_chk
 used as input/output for get/set operations
unsigned char _rtcc_flag
 The flag stops updating time and date and used for get/set operations.
char _day_time_str [16]
 Contain date/time string -> Sat 10:01:15.
char _date_str [16]
 Contians date string -> Sep 30, 2005.
char _time_str [9]
 containg time string 12:32:49
void RTCCInit (void)
 Enable the oscillator for the RTCC.
void RTCCProcessEvents (void)
 grabs the current time from the RTCC and translate it into strings.
void RTCCSet (void)
 uploads time and date from _time_chk into clock.
void RTCCSetBinSec (unsigned char Sec)
 verifies setting seconds range, translates it into BCD format and writes into _time_chk structure. To write the structure into clock RTCCSet must be called.
void RTCCSetBinMin (unsigned char Min)
 verifies a setting minutes range, translates it into BCD format and writes into _time_chk structure. To write the structure into clock RTCCSet must be called.
void RTCCSetBinHour (unsigned char Hour)
 verifies a setting hours range, translates it into BCD format and writes into _time_chk structure. To write the structure into clock RTCCSet must be called.
void RTCCSetBinDay (unsigned char Day)
 verifies a setting day range, translates it into BCD format and writes into _time_chk structure. To write the structure into clock RTCCSet must be called.
void RTCCSetBinMonth (unsigned char Month)
 verifies a setting month range, translates it into BCD format and writes into _time_chk structure. To write the structure into clock RTCCSet must be called.
void RTCCSetBinYear (unsigned char Year)
 verifies a setting year range, translates it into BCD format and writes into _time_chk structure. To write the structure into clock RTCCSet must be called.
void RTCCReadTime (RTCC *t)
 read the RTCC current Time
void RTCCCalculateWeekDay (void)
 reads day, month and year from _time_chk and calculates week day. Than It writes result into _time_chk. To write the structure into clock RTCCSet must be called.

Detailed Description

Definition in file OnePIC_rtcc.h.


Define Documentation

#define mRTCCSetDay (   __rtccdat)
Value:
_time_chk.day = __rtccdat; \
    _rtcc_flag = 1;

set day

Definition at line 181 of file OnePIC_rtcc.h.

#define mRTCCSetHour (   __rtccdat)
Value:
_time_chk.hr = __rtccdat;   \
    _rtcc_flag = 1;

set hour

Definition at line 173 of file OnePIC_rtcc.h.

#define mRTCCSetMin (   __rtccdat)
Value:
_time_chk.min = __rtccdat; \
    _rtcc_flag = 1;

set minute

Definition at line 169 of file OnePIC_rtcc.h.

#define mRTCCSetMonth (   __rtccdat)
Value:
_time_chk.mth = __rtccdat;   \
    _rtcc_flag = 1;

set month

Definition at line 185 of file OnePIC_rtcc.h.

#define mRTCCSetSec (   __rtccdat)
Value:
_time_chk.sec = __rtccdat; \
    _rtcc_flag = 1;

sets the second

Definition at line 165 of file OnePIC_rtcc.h.

#define mRTCCSetWkDay (   __rtccdat)
Value:
_time_chk.wkd = __rtccdat+1;   \
    _rtcc_flag = 1;

set weekday

Definition at line 177 of file OnePIC_rtcc.h.

#define mRTCCSetYear (   __rtccdat)
Value:
_time_chk.yr = __rtccdat;   \
    _rtcc_flag = 1;

set year

Definition at line 189 of file OnePIC_rtcc.h.