39 #error The PCF8563 Library supports only PIC18 devices
51 OpenI2C(MASTER, SLEW_ON);
53 SSPADD = (((crystal_frequency_MHz *1000)/4)/baud_rate_KHz)-1;
72 unsigned char seconds;
77 seconds = seconds & 0b01111111;
99 unsigned char minutes;
103 minutes = minutes & 0b01111111;
122 {
unsigned char hours;
126 hours = hours & 0b00111111;
136 static unsigned char time[9];
142 time[1] = (value & 0b00001111)+48;
143 time[0] = (value >> 4)+48;
148 time[4] = (value & 0b00001111)+48;
149 time[3] = (value >> 4)+48;
154 time[7] = (value & 0b00001111)+48;
155 time[6] = (value >> 4)+48;
169 static unsigned char time[6];
175 time[1] = (value & 0b00001111)+48;
176 time[0] = (value >> 4)+48;
181 time[4] = (value & 0b00001111)+48;
182 time[3] = (value >> 4)+48;
210 days = days & 0b00111111;
229 unsigned char day_of_the_week;
233 day_of_the_week = day_of_the_week & 0b00000111;
234 return (day_of_the_week);
253 unsigned char months;
257 months = months & 0b00011111;
287 static unsigned char date[9];
293 date[1] = (value & 0b00001111)+48;
294 date[0] = (value >> 4)+48;
299 date[4] = (value & 0b00001111)+48;
300 date[3] = (value >> 4)+48;
306 date[7] = (value & 0b00001111)+48;
307 date[6] = (value >> 4)+48;
322 minutes = minutes + alarm_enable;
335 hours = hours + alarm_enable;
346 days = days + alarm_enable;
358 day_of_the_week_alarm = day_of_the_week_alarm + alarm_enable;
395 value = value & 0xF7;
413 unsigned char minutes;
424 if ((minutes&0x0F) > (
unsigned char) 9 ) {
459 if ((hours&0x0F) > (
unsigned char) 9 ) {
464 if (hours == (
unsigned char)
MAX_HOURS) {
494 if ((years&0x0F) > (
unsigned char) 9 ) {
499 if (years == (
unsigned char)
MAX_YEARS) {
518 unsigned char months;
529 if ((months&0x0F) > (
unsigned char) 9 ) {
563 if ((days&0x0F) > (
unsigned char) 9 ) {
568 if (days == (
unsigned char)
MAX_DAYS) {