PIC18 LaurTec Library
3.2.0
Open Source C Library for PIC18 Microcontrollers based on C18 - XC8 Compilers
|
#include "DS1337.h"
Go to the source code of this file.
Functions | |
void | initialize_DS1337 (unsigned char crystal_frequency_MHz, unsigned int baud_rate_KHz) |
signed char | set_seconds_RTCC (unsigned char seconds) |
unsigned char | get_seconds_RTCC (void) |
signed char | set_minutes_RTCC (unsigned char minutes) |
unsigned char | get_minutes_RTCC (void) |
signed char | set_hours_RTCC (unsigned char hours) |
unsigned char | get_hours_RTCC (void) |
unsigned char * | get_time_seconds_RTCC (void) |
unsigned char * | get_time_RTCC (void) |
signed char | set_days_RTCC (unsigned char days) |
unsigned char | get_days_RTCC (void) |
signed char | set_months_RTCC (unsigned char months) |
unsigned char | get_months_RTCC (void) |
signed char | set_years_RTCC (unsigned char years) |
unsigned char | get_years_RTCC (void) |
unsigned char * | get_date_RTCC (void) |
signed char | set_seconds_alarm_RTCC (unsigned char seconds, unsigned char alarm_enable) |
signed char | set_minutes_alarm_RTCC (unsigned char minutes, unsigned char alarm_enable) |
signed char | set_hours_alarm_RTCC (unsigned char hours, unsigned char alarm_enable) |
signed char | set_days_alarm_RTCC (unsigned char days, unsigned char alarm_enable) |
signed char | enable_alarm_interrupt_RTCC (void) |
signed char | disable_alarm_interrupt_RTCC (void) |
unsigned char | is_alarm_ON_RTCC (void) |
signed char | increment_minutes_RTCC (void) |
signed char | increment_hours_RTCC (void) |
signed char | increment_years_RTCC (void) |
signed char | increment_months_RTCC (void) |
signed char | increment_days_RTCC (void) |
signed char disable_alarm_interrupt_RTCC | ( | void | ) |
This function disable the interrupt pin functionality.
Definition at line 357 of file DS1337.c.
References CONTROL_REG_1_ADDR, and WRITE_ADD.
signed char enable_alarm_interrupt_RTCC | ( | void | ) |
This function enables the interrupt pin functionality.
Definition at line 344 of file DS1337.c.
References CONTROL_REG_1_ADDR, and WRITE_ADD.
unsigned char* get_date_RTCC | ( | void | ) |
This function reads the Date from the RTC. The Format DD/MM/YY
Definition at line 262 of file DS1337.c.
References get_days_RTCC(), get_months_RTCC(), and get_years_RTCC().
unsigned char get_days_RTCC | ( | void | ) |
unsigned char get_hours_RTCC | ( | void | ) |
This function reads the hours from the RTC.
Definition at line 120 of file DS1337.c.
References HOURS_ADDR, and WRITE_ADD.
unsigned char get_minutes_RTCC | ( | void | ) |
This function reads the minutes from the RTC.
Definition at line 97 of file DS1337.c.
References MINUTES_ADDR, and WRITE_ADD.
unsigned char get_months_RTCC | ( | void | ) |
This function reads the months from the RTC.
Definition at line 228 of file DS1337.c.
References MONTHS_ADDR, and WRITE_ADD.
unsigned char get_seconds_RTCC | ( | void | ) |
This function reads the second from the RTC.
Definition at line 70 of file DS1337.c.
References SECONDS_ADDR, and WRITE_ADD.
unsigned char* get_time_RTCC | ( | void | ) |
This function reads the time from the RTC. The format is HH:MM (without seconds)
Definition at line 167 of file DS1337.c.
References get_hours_RTCC(), and get_minutes_RTCC().
unsigned char* get_time_seconds_RTCC | ( | void | ) |
This function reads the time from the RTC. The format is HH:MM.ss
Definition at line 134 of file DS1337.c.
References get_hours_RTCC(), get_minutes_RTCC(), and get_seconds_RTCC().
unsigned char get_years_RTCC | ( | void | ) |
This function reads the Year from the RTC.
Definition at line 251 of file DS1337.c.
References WRITE_ADD, and YEARS_ADDR.
signed char increment_days_RTCC | ( | void | ) |
This function increments the Days inside the RTCC.
Definition at line 530 of file DS1337.c.
References get_days_RTCC(), MAX_DAYS, and set_days_RTCC().
signed char increment_hours_RTCC | ( | void | ) |
This function increments the hours inside the RTCC.
Definition at line 426 of file DS1337.c.
References get_hours_RTCC(), MAX_HOURS, and set_hours_RTCC().
signed char increment_minutes_RTCC | ( | void | ) |
This function increments the minutes inside the RTCC.
Definition at line 391 of file DS1337.c.
References get_minutes_RTCC(), MAX_MINUTES, and set_minutes_RTCC().
signed char increment_months_RTCC | ( | void | ) |
This function increments the Months inside the RTCC.
Definition at line 496 of file DS1337.c.
References get_months_RTCC(), MAX_MONTHS, and set_months_RTCC().
signed char increment_years_RTCC | ( | void | ) |
This function increments the Years inside the RTCC.
Definition at line 461 of file DS1337.c.
References get_years_RTCC(), MAX_YEARS, and set_years_RTCC().
void initialize_DS1337 | ( | unsigned char | crystal_frequency_MHz, |
unsigned int | baud_rate_KHz | ||
) |
This function initialize the I2C module accordingly to the clock and baud rate.
crystal_frequency_MHz | Clock frequency expressed in MHz |
baud_rate_KHz | Baud rate expressed in KHz |
unsigned char is_alarm_ON_RTCC | ( | void | ) |
This function checks if the Alarm id ON using polling method.
Definition at line 367 of file DS1337.c.
References CONTROL_REG_2_ADDR, and WRITE_ADD.
signed char set_days_alarm_RTCC | ( | unsigned char | days, |
unsigned char | alarm_enable | ||
) |
This function writes the Days for the alarm, in the RTC.
days | Days to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010). |
alarmEnable | Enable the alarm or not (for matching) [ENABLE_ON , ENABLE_OFF] |
Definition at line 332 of file DS1337.c.
References DAYS_ALARM_ADDR, and WRITE_ADD.
signed char set_days_RTCC | ( | unsigned char | days | ) |
This function writes the days in the RTC.
days | Day to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010). |
signed char set_hours_alarm_RTCC | ( | unsigned char | hours, |
unsigned char | alarm_enable | ||
) |
This function writes the hours for the alarm, in the RTC.
hours | Hours to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010). |
alarmEnable | Enable the alarm or not (for matching) [ENABLE_ON , ENABLE_OFF] |
Definition at line 321 of file DS1337.c.
References HOURS_ALARM_ADDR, and WRITE_ADD.
signed char set_hours_RTCC | ( | unsigned char | hours | ) |
This function writes the hours in the RTC.
hours | Hours to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010). |
Definition at line 111 of file DS1337.c.
References HOURS_ADDR, and WRITE_ADD.
signed char set_minutes_alarm_RTCC | ( | unsigned char | minutes, |
unsigned char | alarm_enable | ||
) |
This function writes the minutes for the alarm, in the RTC.
minutes | Minutes to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010). |
alarmEnable | Enable the alarm or not (for matching) [ENABLE_ON , ENABLE_OFF] |
Definition at line 308 of file DS1337.c.
References MINUTS_ALARM_ADDR, and WRITE_ADD.
signed char set_minutes_RTCC | ( | unsigned char | minutes | ) |
This function writes the seconds in the RTC.
minutes | Minutes to be written, as 2 digits BCD format (eg. 22 min. is 0x22 or 0b00100010). |
Definition at line 87 of file DS1337.c.
References MINUTES_ADDR, and WRITE_ADD.
signed char set_months_RTCC | ( | unsigned char | months | ) |
This function writes the moths in the RTC.
months | Months to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010). |
Definition at line 218 of file DS1337.c.
References MONTHS_ADDR, and WRITE_ADD.
signed char set_seconds_alarm_RTCC | ( | unsigned char | seconds, |
unsigned char | alarm_enable | ||
) |
This function writes the seconds for the alarm, in the RTC.
seconds | Seconds to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010). |
alarmEnable | Enable the alarm or not (for matching) [ENABLE_ON , ENABLE_OFF] |
Definition at line 296 of file DS1337.c.
References SECONDS_ALARM_ADDR, and WRITE_ADD.
signed char set_seconds_RTCC | ( | unsigned char | seconds | ) |
This function writes the seconds in the RTC.
seconds | Seconds to be written, as 2 digits BCD format (eg. 22 sec. is 0x22 or 0b00100010). |
Definition at line 60 of file DS1337.c.
References SECONDS_ADDR, and WRITE_ADD.
signed char set_years_RTCC | ( | unsigned char | years | ) |
This function writes the Year in the RTC.
years | Year to be written, as 2 digits BCD format (eg. 2012 is only 0x12 or 0b00010010). |
Definition at line 242 of file DS1337.c.
References WRITE_ADD, and YEARS_ADDR.