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;
98 unsigned char minutes;
102 minutes = minutes & 0b01111111;
121 {
unsigned char hours;
125 hours = hours & 0b00111111;
135 static unsigned char time[9];
141 time[1] = (value & 0b00001111)+48;
142 time[0] = (value >> 4)+48;
147 time[4] = (value & 0b00001111)+48;
148 time[3] = (value >> 4)+48;
153 time[7] = (value & 0b00001111)+48;
154 time[6] = (value >> 4)+48;
168 static unsigned char time[6];
174 time[1] = (value & 0b00001111)+48;
175 time[0] = (value >> 4)+48;
180 time[4] = (value & 0b00001111)+48;
181 time[3] = (value >> 4)+48;
208 days = days & 0b00111111;
227 unsigned char day_of_the_week;
231 day_of_the_week = day_of_the_week & 0b00000111;
232 return (day_of_the_week);
251 unsigned char months;
255 months = months & 0b00011111;
285 static unsigned char date[9];
291 date[1] = (value & 0b00001111)+48;
292 date[0] = (value >> 4)+48;
297 date[4] = (value & 0b00001111)+48;
298 date[3] = (value >> 4)+48;
304 date[7] = (value & 0b00001111)+48;
305 date[6] = (value >> 4)+48;
320 minutes = minutes + alarm_enable;
333 hours = hours + alarm_enable;
344 days = days + alarm_enable;
356 day_of_the_week_alarm = day_of_the_week_alarm + alarm_enable;
393 value = value & 0xF7;
411 unsigned char minutes;
422 if ((minutes&0x0F) > (
unsigned char) 9 ) {
456 if ((hours&0x0F) > (
unsigned char) 9 ) {
490 if ((years&0x0F) > (
unsigned char) 9 ) {
513 unsigned char months;
524 if ((months&0x0F) > (
unsigned char) 9 ) {
557 if ((days&0x0F) > (
unsigned char) 9 ) {