RandoSY / jallib

Automatically exported from code.google.com/p/jallib
0 stars 0 forks source link

Refactoring of RTC libraries #185

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

Looks like lots of function are identical for DS1307, MCP 794X and PCF 8563.
i2c device address is different and MCP series has some additional functions 
like storing the power failure and resumption time stamps.

Apart from the above mentioned rtc's Ds1302 and PIC internal RTC also can share 
some common functionality.
All of them require bcd routines.

Original issue reported on code.google.com by robhamerling on 9 Sep 2012 at 8:29

GoogleCodeExporter commented 8 years ago
Matt's (MCP 7940) and Rob's (hardware RTC)  libraries seems to be well written.
It would be better to deprecate functions and procedures in other libraries and 
have a common API.
Sunnish

Original comment by robhamerling on 9 Sep 2012 at 8:30

GoogleCodeExporter commented 8 years ago
Work on refactoring has started, taking the RTCC_HW library as model.
Common routines like bcd2bin, mult60, day-of-week calculation, etc. will go to 
a common library. The DS1302 library will be the first to be adapted. 

Original comment by robhamerling on 23 Apr 2013 at 2:41

GoogleCodeExporter commented 8 years ago
In addition following suggestions may be added to the RTC libraries (when not 
already present).
1. functions to read/write individual values of second, minute. hour, day, 
month and year.
2. add aliases to device files for variable with 'deviating' names, esp. 
T1CON_T1OSCEN for T1CON_SOSCEN.
3. modify RTCC_HW library to use RTCCFG_RTCPTR in stead of RTCCFG_RTCPTR1 and 
RTCCFG_RTCPTR0.

Original comment by robhamerling on 10 Jul 2013 at 7:16