EDF - OnePIC MCU
v1.1.0
|
![]() |
Functions | |
void | RTCCReadTime (RTCC *t) |
read the RTCC current Time | |
void | RTCCReadOffTime (RTCC *t) |
read the RTCC current Time | |
void | RTCCWriteTime (RTCC *t) |
Write the RTCC current Time. | |
void | RTCCProcessEvents (void) |
grabs the current time from the RTCC and translate it into strings. | |
void | RTCCInit (void) |
Enable the oscillator for the RTCC. | |
void | RTCCClear () |
Restart the clock. | |
void | RTCCSet (void) |
uploads time and date from _time_chk into clock. | |
void | RTCCUnlock (void) |
allows a writing into the clock registers. | |
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 | 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. | |
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. | |
Variables | |
RTCC | _time |
contains the time | |
RTCC | _time_chk |
used as input/output for get/set operations | |
RTCC | _pwr_off |
used to save time when power off | |
RTCC | _pwr_on |
used to reload time when powered on | |
unsigned char | temp [10] |
temporary buffer | |
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 | |
unsigned char | _rtcc_flag |
The flag stops updating time and date and used for get/set operations. | |
unsigned char | rtccBuf [32] |
contains all RTCC bytes | |
unsigned char | rtccWriteBuf [10] |
used for write operations | |
struct trb | rtcStart |
Sets "start" and VbatEn. | |
struct trb | rtcClearVbat |
clears the RTcc | |
struct trb | rtcRead |
Reads 1 byte at address 0x20 (seconds) | |
struct trb | rtcWrite |
write to RTCC | |
struct trb | rtcSaveInRAM |
also write to its RAM |
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.
Definition at line 543 of file OnePIC_rtcc.c.
void RTCCInit | ( | void | ) |
Enable the oscillator for the RTCC.
Definition at line 389 of file OnePIC_rtcc.c.
void RTCCProcessEvents | ( | void | ) |
grabs the current time from the RTCC and translate it into strings.
It updates time and date strings _day_time_str, _date_str, and _time, _time_chk structures.
Definition at line 208 of file OnePIC_rtcc.c.
void RTCCReadOffTime | ( | RTCC * | t | ) |
read the RTCC current Time
t | RTCC structure that holds RTCC register copy |
Definition at line 171 of file OnePIC_rtcc.c.
void RTCCReadTime | ( | RTCC * | t | ) |
read the RTCC current Time
t | RTCC structure that holds RTCC register copy |
Definition at line 147 of file OnePIC_rtcc.c.
void RTCCSet | ( | void | ) |
uploads time and date from _time_chk into clock.
Definition at line 441 of file OnePIC_rtcc.c.
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.
Day | Day binary value. |
Definition at line 589 of file OnePIC_rtcc.c.
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.
Hour | Hours binary value. |
Definition at line 522 of file OnePIC_rtcc.c.
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.
Min | Minutes binary value. |
Definition at line 506 of file OnePIC_rtcc.c.
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.
Month | Month binary value. |
Definition at line 623 of file OnePIC_rtcc.c.
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.
Sec | Seconds binary value. |
Definition at line 490 of file OnePIC_rtcc.c.
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.
Year | Year binary value. |
Definition at line 639 of file OnePIC_rtcc.c.
void RTCCWriteTime | ( | RTCC * | t | ) |
Write the RTCC current Time.
t | RTCC structure that holds RTCC register copy |
Definition at line 188 of file OnePIC_rtcc.c.
{ 0x6f, 2, 0, (unsigned char*) "\003\011", rtccBuf, 0, 0, (void *) 0 }
clears the RTcc
Definition at line 85 of file OnePIC_rtcc.c.
{ 0x6f, 1, 0x20, rtccWriteBuf, rtccBuf, 0, 0, (void *) 0 }
Reads 1 byte at address 0x20 (seconds)
Definition at line 100 of file OnePIC_rtcc.c.
{ 0x6f, 4, 0, rtccWriteBuf, rtccBuf, 0, 0, (void *) 0 }
also write to its RAM
Definition at line 130 of file OnePIC_rtcc.c.
{ 0x6f, 5, 0, (unsigned char*) "\000\200\000\000\010", rtccBuf, 0, 0, (void *) 0 }
Sets "start" and VbatEn.
Definition at line 70 of file OnePIC_rtcc.c.
{ 0x6f, 1, 0, rtccWriteBuf, rtccBuf, 0, 0, (void *) 0 }
write to RTCC
Definition at line 115 of file OnePIC_rtcc.c.