LTlib LaurTec Library  4.0.0 Beta
Open Source C Library for Microchip Microcontrollers based on XC8 Compiler
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
PCF8563.h File Reference
#include "LTlib.h"

Go to the source code of this file.

Macros

#define PCF8563_I2C_MODULE_1
 
#define PCF8563_I2C_open   I2C1_open
 
#define PCF8563_I2C_baud_rate   I2C1_baud_rate
 
#define PCF8563_I2C_write_byte_to_external_device   I2C1_write_byte_to_external_device
 
#define PCF8563_I2C_read_byte_from_external_device   I2C1_read_byte_from_external_device
 
#define RTCC_WRITE_ADD   0xA2
 
#define RTCC_DO   0x00
 
#define RTCC_LU   0x01
 
#define RTCC_MA   0x02
 
#define RTCC_ME   0x03
 
#define RTCC_GI   0x04
 
#define RTCC_VE   0x05
 
#define RTCC_SA   0x06
 
#define RTCC_SU   0x00
 
#define RTCC_MO   0x01
 
#define RTCC_TU   0x02
 
#define RTCC_WE   0x03
 
#define RTCC_TR   0x04
 
#define RTCC_FR   0x05
 
#define RTCC_SA   0x06
 
#define RTCC_ENABLE_ON   0b00000000
 
#define RTCC_ENABLE_OFF   0b10000000
 
#define RTCC_ALARM_ENABLED   0b00000000
 
#define RTCC_ALARM_DISABLED   0b10000000
 
#define RTCC_CONTROL_REG_2_ADDR   0x01
 
#define RTCC_SECONDS_ADDR   0x02
 
#define RTCC_MINUTES_ADDR   0x03
 
#define RTCC_HOURS_ADDR   0x04
 
#define RTCC_DAYS_ADDR   0x05
 
#define RTCC_DAY_WEEK_ADDR   0x06
 
#define RTCC_MONTHS_ADDR   0x07
 
#define RTCC_YEARS_ADDR   0x08
 
#define RTCC_MINUTS_ALARM_ADDR   0x09
 
#define RTCC_HOURS_ALARM_ADDR   0x0A
 
#define RTCC_DAYS_ALARM_ADDR   0x0B
 
#define RTCC_DAY_WEEK_ALARM_ADDR   0x0C
 
#define RTCC_MAX_MINUTES   0x60
 
#define RTCC_MAX_HOURS   0x24
 
#define RTCC_MAX_YEARS   0xA0
 
#define RTCC_MAX_MONTHS   0x13
 
#define RTCC_MAX_DAYS   0x32
 
#define initialize_RTCC   RTCC_initialize
 
#define set_seconds_RTCC   RTCC_set_seconds
 
#define get_seconds_RTCC   RTCC_get_seconds
 
#define set_minutes_RTCC   RTCC_set_minutes
 
#define get_minutes_RTCC   RTCC_get_minutes
 
#define set_hours_RTCC   RTCC_set_hours
 
#define get_hours_RTCC   RTCC_get_hours
 
#define get_time_seconds_RTCC   RTCC_get_time_seconds
 
#define get_time_RTCC   RTCC_get_time
 
#define set_days_RTCC   RTCC_set_days
 
#define get_days_RTCC   RTCC_get_days
 
#define set_day_of_the_week_RTCC   RTCC_set_day_of_the_week
 
#define get_day_of_the_week_RTCC   RTCC_get_day_of_the_week
 
#define set_months_RTCC   RTCC_set_months
 
#define get_months_RTCC   RTCC_get_months
 
#define set_years_RTCC   RTCC_set_years
 
#define get_years_RTCC   RTCC_get_years
 
#define get_date_RTCC   RTCC_get_date
 
#define set_minutes_alarm_RTCC   RTCC_set_minutes_alarm
 
#define set_hours_alarm_RTCC   RTCC_set_hours_alarm
 
#define set_days_alarm_RTCC   RTCC_set_days_alarm
 
#define set_day_of_the_week_alarm_RTCC   RTCC_set_day_of_the_week_alarm
 
#define enable_alarm_interrupt_RTCC   RTCC_enable_alarm_interrupt
 
#define disable_alarm_interrupt_RTCC   RTCC_disable_alarm_interrupt
 
#define is_alarm_ON_RTCC   RTCC_is_alarm_ON
 
#define increment_minutes_RTCC   RTCC_increment_minutes
 
#define increment_hours_RTCC   RTCC_increment_hours
 
#define increment_years_RTCC   RTCC_increment_years
 
#define increment_months_RTCC   RTCC_increment_months
 
#define increment_days_RTCC   RTCC_increment_days
 

Functions

void RTCC_initialize (unsigned int baud_rate_KHz)
 
signed char RTCC_set_seconds (unsigned char seconds)
 
unsigned char RTCC_get_seconds (void)
 
signed char RTCC_set_minutes (unsigned char minutes)
 
unsigned char RTCC_get_minutes (void)
 
signed char RTCC_set_hours (unsigned char hours)
 
unsigned char RTCC_get_hours (void)
 
unsigned char * RTCC_get_time_seconds (void)
 
unsigned char * RTCC_get_time (void)
 
signed char RTCC_set_days (unsigned char days)
 
unsigned char RTCC_get_days (void)
 
signed char RTCC_set_day_of_the_week (unsigned char day_of_the_week)
 
signed char RTCC_get_day_of_the_week (void)
 
signed char RTCC_set_months (unsigned char months)
 
unsigned char RTCC_get_months (void)
 
signed char RTCC_set_years (unsigned char years)
 
unsigned char RTCC_get_years (void)
 
unsigned char * RTCC_get_date (void)
 
signed char RTCC_set_minutes_alarm (unsigned char minutes, unsigned char alarm_enable)
 
signed char RTCC_set_hours_alarm (unsigned char hours, unsigned char alarm_enable)
 
signed char RTCC_set_days_alarm (unsigned char days, unsigned char alarm_enable)
 
signed char RTCC_set_day_of_the_week_alarm (unsigned char day_of_the_week, unsigned char alarm_enable)
 
signed char RTCC_enable_alarm_interrupt (void)
 
signed char RTCC_disable_alarm_interrupt (void)
 
unsigned char RTCC_is_alarm_ON (void)
 
signed char RTCC_increment_minutes (void)
 
signed char RTCC_increment_hours (void)
 
signed char RTCC_increment_years (void)
 
signed char RTCC_increment_months (void)
 
signed char RTCC_increment_days (void)
 

Macro Definition Documentation

#define disable_alarm_interrupt_RTCC   RTCC_disable_alarm_interrupt

Definition at line 500 of file PCF8563.h.

#define enable_alarm_interrupt_RTCC   RTCC_enable_alarm_interrupt

Definition at line 486 of file PCF8563.h.

#define get_date_RTCC   RTCC_get_date

Definition at line 391 of file PCF8563.h.

#define get_day_of_the_week_RTCC   RTCC_get_day_of_the_week

Definition at line 326 of file PCF8563.h.

#define get_days_RTCC   RTCC_get_days

Definition at line 297 of file PCF8563.h.

#define get_hours_RTCC   RTCC_get_hours

Definition at line 250 of file PCF8563.h.

#define get_minutes_RTCC   RTCC_get_minutes

Definition at line 223 of file PCF8563.h.

#define get_months_RTCC   RTCC_get_months

Definition at line 353 of file PCF8563.h.

#define get_seconds_RTCC   RTCC_get_seconds

Definition at line 196 of file PCF8563.h.

#define get_time_RTCC   RTCC_get_time

Definition at line 270 of file PCF8563.h.

#define get_time_seconds_RTCC   RTCC_get_time_seconds

Definition at line 260 of file PCF8563.h.

#define get_years_RTCC   RTCC_get_years

Definition at line 381 of file PCF8563.h.

#define increment_days_RTCC   RTCC_increment_days

Definition at line 588 of file PCF8563.h.

#define increment_hours_RTCC   RTCC_increment_hours

Definition at line 542 of file PCF8563.h.

#define increment_minutes_RTCC   RTCC_increment_minutes

Definition at line 527 of file PCF8563.h.

#define increment_months_RTCC   RTCC_increment_months

Definition at line 572 of file PCF8563.h.

#define increment_years_RTCC   RTCC_increment_years

Definition at line 557 of file PCF8563.h.

#define initialize_RTCC   RTCC_initialize

Definition at line 168 of file PCF8563.h.

#define is_alarm_ON_RTCC   RTCC_is_alarm_ON

Definition at line 512 of file PCF8563.h.

#define PCF8563_I2C_baud_rate   I2C1_baud_rate

Definition at line 70 of file PCF8563.h.

#define PCF8563_I2C_MODULE_1

Definition at line 65 of file PCF8563.h.

#define PCF8563_I2C_open   I2C1_open

Definition at line 69 of file PCF8563.h.

#define PCF8563_I2C_read_byte_from_external_device   I2C1_read_byte_from_external_device

Definition at line 72 of file PCF8563.h.

#define PCF8563_I2C_write_byte_to_external_device   I2C1_write_byte_to_external_device

Definition at line 71 of file PCF8563.h.

#define RTCC_ALARM_DISABLED   0b10000000

Definition at line 122 of file PCF8563.h.

#define RTCC_ALARM_ENABLED   0b00000000

Definition at line 121 of file PCF8563.h.

#define RTCC_CONTROL_REG_2_ADDR   0x01

Definition at line 129 of file PCF8563.h.

#define RTCC_DAY_WEEK_ADDR   0x06

Definition at line 134 of file PCF8563.h.

#define RTCC_DAY_WEEK_ALARM_ADDR   0x0C

Definition at line 140 of file PCF8563.h.

#define RTCC_DAYS_ADDR   0x05

Definition at line 133 of file PCF8563.h.

#define RTCC_DAYS_ALARM_ADDR   0x0B

Definition at line 139 of file PCF8563.h.

#define RTCC_DO   0x00

Definition at line 94 of file PCF8563.h.

#define RTCC_ENABLE_OFF   0b10000000

Definition at line 119 of file PCF8563.h.

#define RTCC_ENABLE_ON   0b00000000

Definition at line 118 of file PCF8563.h.

#define RTCC_FR   0x05

Definition at line 108 of file PCF8563.h.

#define RTCC_GI   0x04

Definition at line 98 of file PCF8563.h.

#define RTCC_HOURS_ADDR   0x04

Definition at line 132 of file PCF8563.h.

#define RTCC_HOURS_ALARM_ADDR   0x0A

Definition at line 138 of file PCF8563.h.

#define RTCC_LU   0x01

Definition at line 95 of file PCF8563.h.

#define RTCC_MA   0x02

Definition at line 96 of file PCF8563.h.

#define RTCC_MAX_DAYS   0x32

Definition at line 150 of file PCF8563.h.

#define RTCC_MAX_HOURS   0x24

Definition at line 147 of file PCF8563.h.

#define RTCC_MAX_MINUTES   0x60

Definition at line 146 of file PCF8563.h.

#define RTCC_MAX_MONTHS   0x13

Definition at line 149 of file PCF8563.h.

#define RTCC_MAX_YEARS   0xA0

Definition at line 148 of file PCF8563.h.

#define RTCC_ME   0x03

Definition at line 97 of file PCF8563.h.

#define RTCC_MINUTES_ADDR   0x03

Definition at line 131 of file PCF8563.h.

#define RTCC_MINUTS_ALARM_ADDR   0x09

Definition at line 137 of file PCF8563.h.

#define RTCC_MO   0x01

Definition at line 104 of file PCF8563.h.

#define RTCC_MONTHS_ADDR   0x07

Definition at line 135 of file PCF8563.h.

#define RTCC_SA   0x06

Definition at line 109 of file PCF8563.h.

#define RTCC_SA   0x06

Definition at line 109 of file PCF8563.h.

#define RTCC_SECONDS_ADDR   0x02

Definition at line 130 of file PCF8563.h.

#define RTCC_SU   0x00

Definition at line 103 of file PCF8563.h.

#define RTCC_TR   0x04

Definition at line 107 of file PCF8563.h.

#define RTCC_TU   0x02

Definition at line 105 of file PCF8563.h.

#define RTCC_VE   0x05

Definition at line 99 of file PCF8563.h.

#define RTCC_WE   0x03

Definition at line 106 of file PCF8563.h.

#define RTCC_WRITE_ADD   0xA2

Definition at line 87 of file PCF8563.h.

#define RTCC_YEARS_ADDR   0x08

Definition at line 136 of file PCF8563.h.

#define set_day_of_the_week_alarm_RTCC   RTCC_set_day_of_the_week_alarm

Definition at line 472 of file PCF8563.h.

#define set_day_of_the_week_RTCC   RTCC_set_day_of_the_week

Definition at line 314 of file PCF8563.h.

#define set_days_alarm_RTCC   RTCC_set_days_alarm

Definition at line 451 of file PCF8563.h.

#define set_days_RTCC   RTCC_set_days

Definition at line 286 of file PCF8563.h.

#define set_hours_alarm_RTCC   RTCC_set_hours_alarm

Definition at line 431 of file PCF8563.h.

#define set_hours_RTCC   RTCC_set_hours

Definition at line 239 of file PCF8563.h.

#define set_minutes_alarm_RTCC   RTCC_set_minutes_alarm

Definition at line 411 of file PCF8563.h.

#define set_minutes_RTCC   RTCC_set_minutes

Definition at line 212 of file PCF8563.h.

#define set_months_RTCC   RTCC_set_months

Definition at line 342 of file PCF8563.h.

#define set_seconds_RTCC   RTCC_set_seconds

Definition at line 185 of file PCF8563.h.

#define set_years_RTCC   RTCC_set_years

Definition at line 370 of file PCF8563.h.

Function Documentation

signed char RTCC_disable_alarm_interrupt ( void  )

This function disable the interrupt pin functionality.

Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision

Definition at line 353 of file DS1337.c.

References DS1337_I2C_write_byte_to_external_device, PCF8563_I2C_write_byte_to_external_device, RTCC_CONTROL_REG_1_ADDR, RTCC_CONTROL_REG_2_ADDR, and RTCC_WRITE_ADD.

signed char RTCC_enable_alarm_interrupt ( void  )

This function enables the interrupt pin functionality.

Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision

Definition at line 340 of file DS1337.c.

References DS1337_I2C_write_byte_to_external_device, PCF8563_I2C_write_byte_to_external_device, RTCC_CONTROL_REG_1_ADDR, RTCC_CONTROL_REG_2_ADDR, and RTCC_WRITE_ADD.

unsigned char* RTCC_get_date ( void  )

This function reads the Date from the RTC. The Format DD/MM/YY

Returns
Date that is read back, as ASCII string terminated with /0

Definition at line 258 of file DS1337.c.

References get_days_RTCC, get_months_RTCC, get_years_RTCC, RTCC_get_days(), RTCC_get_months(), and RTCC_get_years().

signed char RTCC_get_day_of_the_week ( void  )

This function reads the Weekday from the RTC.

Returns
Days of the week that is read back,.
Note
Use the constants to compare the Day of the week (either Italian or English). [DO, LU, MA, ME, GI, VE, SA] or [SU, MO, TU, WE, TR, FR, SA]
unsigned char RTCC_get_days ( void  )

This function reads the day from the RTC.

Returns
Days that are read back, in BCD format (eg. 12 is 0x12 or 0b00010010).
Note
Days are in BCD format.

Definition at line 200 of file DS1337.c.

References DS1337_I2C_read_byte_from_external_device, PCF8563_I2C_read_byte_from_external_device, RTCC_DAYS_ADDR, and RTCC_WRITE_ADD.

unsigned char RTCC_get_hours ( void  )

This function reads the hours from the RTC.

Returns
Hours that are read back, in BCD format (eg. 12 is 0x12 or 0b00010010).
Note
Hours are in BCD format.

Definition at line 116 of file DS1337.c.

References DS1337_I2C_read_byte_from_external_device, PCF8563_I2C_read_byte_from_external_device, RTCC_HOURS_ADDR, and RTCC_WRITE_ADD.

unsigned char RTCC_get_minutes ( void  )

This function reads the minutes from the RTC.

Returns
Minutes that are read back, in BCD format (eg. 22 min. is 0x22 or 0b00100010).
Note
Seconds are in BCD format.

Definition at line 93 of file DS1337.c.

References DS1337_I2C_read_byte_from_external_device, PCF8563_I2C_read_byte_from_external_device, RTCC_MINUTES_ADDR, and RTCC_WRITE_ADD.

unsigned char RTCC_get_months ( void  )

This function reads the months from the RTC.

Returns
Months that are read back, in BCD format (eg. 12 is 0x12 or 0b00010010).
Note
Months are in BCD format.

Definition at line 224 of file DS1337.c.

References DS1337_I2C_read_byte_from_external_device, PCF8563_I2C_read_byte_from_external_device, RTCC_MONTHS_ADDR, and RTCC_WRITE_ADD.

unsigned char RTCC_get_seconds ( void  )

This function reads the second from the RTC.

Returns
Second that are read back, in BCD format (eg. 22 sec. is 0x22 or 0b00100010).
Note
Seconds are in BCD format.

Definition at line 66 of file DS1337.c.

References DS1337_I2C_read_byte_from_external_device, PCF8563_I2C_read_byte_from_external_device, RTCC_SECONDS_ADDR, and RTCC_WRITE_ADD.

unsigned char* RTCC_get_time ( void  )

This function reads the time from the RTC. The format is HH:MM (without seconds)

Returns
Time that is read back, as ASCII string terminated with /0

Definition at line 163 of file DS1337.c.

References get_hours_RTCC, get_minutes_RTCC(), RTCC_get_hours(), and RTCC_get_minutes().

unsigned char* RTCC_get_time_seconds ( void  )

This function reads the time from the RTC. The format is HH:MM.ss

Returns
Time that is read back, as ASCII string terminated with /0

Definition at line 130 of file DS1337.c.

References get_hours_RTCC, get_minutes_RTCC(), get_seconds_RTCC, RTCC_get_hours(), RTCC_get_minutes(), and RTCC_get_seconds().

unsigned char RTCC_get_years ( void  )

This function reads the Year from the RTC.

Returns
Year that is read back, in BCD format (eg. 12 is 0x12 or 0b00010010 represents 2012).
Note
Year are in BCD format. 2012 is read as 0x12.

Definition at line 247 of file DS1337.c.

References DS1337_I2C_read_byte_from_external_device, PCF8563_I2C_read_byte_from_external_device, RTCC_WRITE_ADD, and RTCC_YEARS_ADDR.

signed char RTCC_increment_days ( void  )

This function increments the Days inside the RTCC.

Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Note
The function automatically checks the overflow.

Definition at line 526 of file DS1337.c.

References get_days_RTCC, RTCC_get_days(), RTCC_MAX_DAYS, RTCC_set_days(), and set_days_RTCC.

signed char RTCC_increment_hours ( void  )

This function increments the hours inside the RTCC.

Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Note
The function automatically checks the overflow.

Definition at line 422 of file DS1337.c.

References get_hours_RTCC, RTCC_get_hours(), RTCC_MAX_HOURS, RTCC_set_hours(), and set_hours_RTCC.

signed char RTCC_increment_minutes ( void  )

This function increments the minutes inside the RTCC.

Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Note
The function automatically checks the overflow and automatically increments the hours.

Definition at line 387 of file DS1337.c.

References get_minutes_RTCC(), RTCC_get_minutes(), RTCC_MAX_MINUTES, RTCC_set_minutes(), and set_minutes_RTCC.

signed char RTCC_increment_months ( void  )

This function increments the Months inside the RTCC.

Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Note
The function automatically checks the overflow.

Definition at line 492 of file DS1337.c.

References get_months_RTCC, RTCC_get_months(), RTCC_MAX_MONTHS, RTCC_set_months(), and set_months_RTCC.

signed char RTCC_increment_years ( void  )

This function increments the Years inside the RTCC.

Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Note
The function automatically checks the overflow.

Definition at line 457 of file DS1337.c.

References get_years_RTCC, RTCC_get_years(), RTCC_MAX_YEARS, RTCC_set_years(), and set_years_RTCC.

void RTCC_initialize ( unsigned int  baud_rate_KHz)

This function initialize the I2C module accordingly to the clock and baud rate.

Parameters
crystal_frequency_MHzClock frequency expressed in MHz
baud_rate_KHzBaud rate expressed in KHz
Returns
Note
If other devices are connected on the I2C bus the baud rate would be changed by the function. Among several calls from different device initializations, only the last one will be reflected in the I2C module configuration.

This function initialize the I2C module accordingly to the clock and baud rate.

Parameters
baud_rate_KHzBaud rate expressed in KHz
Returns
Note
If other devices are connected on the I2C bus the baud rate would be changed by the function. Among several calls from different device initializations, only the last one will be reflected in the I2C module configuration.

Definition at line 46 of file DS1337.c.

References DS1337_I2C_baud_rate, DS1337_I2C_open, I2C_MASTER, PCF8563_I2C_baud_rate, and PCF8563_I2C_open.

unsigned char RTCC_is_alarm_ON ( void  )

This function checks if the Alarm id ON using polling method.

Returns
status Alarm status 1: ON 0:OFF
Note
If the alarm is on, AF flag is automatically cleaned.

Definition at line 363 of file DS1337.c.

References DS1337_I2C_read_byte_from_external_device, DS1337_I2C_write_byte_to_external_device, PCF8563_I2C_read_byte_from_external_device, PCF8563_I2C_write_byte_to_external_device, RTCC_CONTROL_REG_2_ADDR, and RTCC_WRITE_ADD.

signed char RTCC_set_day_of_the_week ( unsigned char  day_of_the_week)

This function writes the WeekDay in the RTC.

Parameters
day_of_the_weekDay of the week to be written [0..6].
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Note
Use the constants to specify the Day of the week (either Italian or English). [DO, LU, MA, ME, GI, VE, SA] or [SU, MO, TU, WE, TR, FR, SA]

Definition at line 211 of file PCF8563.c.

References PCF8563_I2C_write_byte_to_external_device, RTCC_DAY_WEEK_ADDR, and RTCC_WRITE_ADD.

signed char RTCC_set_day_of_the_week_alarm ( unsigned char  day_of_the_week,
unsigned char  alarm_enable 
)

This function writes the WeekDays for the alarm, in the RTC.

Parameters
day_of_the_weekDays of the week to be written.
alarmEnableEnable the alarm or not (for matching) [Enable_ON , Enable_OFF]
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Note
Use the constants to set the Day of the week (either Italian or English). [DO, LU, MA, ME, GI, VE, SA] or [SU, MO, TU, WE, TR, FR, SA]
Use the constants Enable_ON and Enable_OFF

Definition at line 348 of file PCF8563.c.

References PCF8563_I2C_write_byte_to_external_device, RTCC_DAY_WEEK_ALARM_ADDR, and RTCC_WRITE_ADD.

signed char RTCC_set_days ( unsigned char  days)

This function writes the days in the RTC.

Parameters
daysDay to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010).
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Warning
Days are in BCD format. Decimal format won't work!

Definition at line 191 of file DS1337.c.

References DS1337_I2C_write_byte_to_external_device, PCF8563_I2C_write_byte_to_external_device, RTCC_DAYS_ADDR, and RTCC_WRITE_ADD.

signed char RTCC_set_days_alarm ( unsigned char  days,
unsigned char  alarm_enable 
)

This function writes the Days for the alarm, in the RTC.

Parameters
daysDays to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010).
alarmEnableEnable the alarm or not (for matching) [Enable_ON , Enable_OFF]
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Warning
Days are in BCD format. Decimal format won't work!
Note
Use the constants Enable_ON and Enable_OFF

This function writes the Days for the alarm, in the RTC.

Parameters
daysDays to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010).
alarmEnableEnable the alarm or not (for matching) [ENABLE_ON , ENABLE_OFF]
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Warning
Days are in BCD format. Decimal format won't work!
Note
Use the constants ENABLE_ON and ENABLE_OFF

Definition at line 328 of file DS1337.c.

References DS1337_I2C_write_byte_to_external_device, PCF8563_I2C_write_byte_to_external_device, RTCC_DAYS_ALARM_ADDR, and RTCC_WRITE_ADD.

signed char RTCC_set_hours ( unsigned char  hours)

This function writes the hours in the RTC.

Parameters
hoursHours to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010).
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Warning
Hours are in BCD format. Decimal format won't work!

Definition at line 107 of file DS1337.c.

References DS1337_I2C_write_byte_to_external_device, PCF8563_I2C_write_byte_to_external_device, RTCC_HOURS_ADDR, and RTCC_WRITE_ADD.

signed char RTCC_set_hours_alarm ( unsigned char  hours,
unsigned char  alarm_enable 
)

This function writes the hours for the alarm, in the RTC.

Parameters
hoursHours to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010).
alarmEnableEnable the alarm or not (for matching) [Enable_ON , Enable_OFF]
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Warning
Hours are in BCD format. Decimal format won't work!
Note
Use the constants Enable_ON and Enable_OFF

This function writes the hours for the alarm, in the RTC.

Parameters
hoursHours to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010).
alarmEnableEnable the alarm or not (for matching) [ENABLE_ON , ENABLE_OFF]
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Warning
Hours are in BCD format. Decimal format won't work!
Note
Use the constants ENABLE_ON and ENABLE_OFF

Definition at line 317 of file DS1337.c.

References DS1337_I2C_write_byte_to_external_device, PCF8563_I2C_write_byte_to_external_device, RTCC_HOURS_ALARM_ADDR, and RTCC_WRITE_ADD.

signed char RTCC_set_minutes ( unsigned char  minutes)

This function writes the seconds in the RTC.

Parameters
minutesMinutes to be written, as 2 digits BCD format (eg. 22 min. is 0x22 or 0b00100010).
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Warning
Minutes are in BCD format. Decimal format won't work!

Definition at line 83 of file DS1337.c.

References DS1337_I2C_write_byte_to_external_device, PCF8563_I2C_write_byte_to_external_device, RTCC_MINUTES_ADDR, and RTCC_WRITE_ADD.

signed char RTCC_set_minutes_alarm ( unsigned char  minutes,
unsigned char  alarm_enable 
)

This function writes the minutes for the alarm, in the RTC.

Parameters
minutesMinutes to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010).
alarmEnableEnable the alarm or not (for matching) [Enable_ON , Enable_OFF]
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Warning
Minutes are in BCD format. Decimal format won't work!
Note
Use the constants Enable_ON and Enable_OFF

This function writes the minutes for the alarm, in the RTC.

Parameters
minutesMinutes to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010).
alarmEnableEnable the alarm or not (for matching) [ENABLE_ON , ENABLE_OFF]
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Warning
Minutes are in BCD format. Decimal format won't work!
Note
Use the constants ENABLE_ON and ENABLE_OFF

Definition at line 304 of file DS1337.c.

References DS1337_I2C_write_byte_to_external_device, PCF8563_I2C_write_byte_to_external_device, RTCC_MINUTS_ALARM_ADDR, and RTCC_WRITE_ADD.

signed char RTCC_set_months ( unsigned char  months)

This function writes the moths in the RTC.

Parameters
monthsMonths to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010).
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Warning
Months are in BCD format. Decimal format won't work!

Definition at line 214 of file DS1337.c.

References DS1337_I2C_write_byte_to_external_device, PCF8563_I2C_write_byte_to_external_device, RTCC_MONTHS_ADDR, and RTCC_WRITE_ADD.

signed char RTCC_set_seconds ( unsigned char  seconds)

This function writes the seconds in the RTC.

Parameters
secondsSeconds to be written, as 2 digits BCD format (eg. 22 sec. is 0x22 or 0b00100010).
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Warning
Seconds are in BCD format. Decimal format won't work!

Definition at line 56 of file DS1337.c.

References DS1337_I2C_write_byte_to_external_device, PCF8563_I2C_write_byte_to_external_device, RTCC_SECONDS_ADDR, and RTCC_WRITE_ADD.

signed char RTCC_set_years ( unsigned char  years)

This function writes the Year in the RTC.

Parameters
yearsYear to be written, as 2 digits BCD format (eg. 2012 is only 0x12 or 0b00010010).
Returns
status 0: The info has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
Warning
Years are in BCD format. Decimal format won't work!
Note
2012 is written as 12.

Definition at line 238 of file DS1337.c.

References DS1337_I2C_write_byte_to_external_device, PCF8563_I2C_write_byte_to_external_device, RTCC_WRITE_ADD, and RTCC_YEARS_ADDR.