PIC18 LaurTec Library
3.3.1
Open Source C Library for PIC18 Microcontrollers based on C18 - XC8 Compilers
|
#include <i2c.h>
Go to the source code of this file.
Functions | |
void | PCF8563_initialize (unsigned char crystal_frequency_MHz, 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) |
#define disable_alarm_interrupt_RTCC RTCC_disable_alarm_interrupt |
#define enable_alarm_interrupt_RTCC RTCC_enable_alarm_interrupt |
#define get_date_RTCC RTCC_get_date |
#define get_day_of_the_week_RTCC RTCC_get_day_of_the_week |
#define get_days_RTCC RTCC_get_days |
#define get_hours_RTCC RTCC_get_hours |
#define get_minutes_RTCC RTCC_get_minutes |
#define get_months_RTCC RTCC_get_months |
#define get_seconds_RTCC RTCC_get_seconds |
#define get_time_RTCC RTCC_get_time |
#define get_time_seconds_RTCC RTCC_get_time_seconds |
#define get_years_RTCC RTCC_get_years |
#define increment_days_RTCC RTCC_increment_days |
#define increment_hours_RTCC RTCC_increment_hours |
#define increment_minutes_RTCC RTCC_increment_minutes |
#define increment_months_RTCC RTCC_increment_months |
#define increment_years_RTCC RTCC_increment_years |
#define initialize_PCF8563 PCF8563_initialize |
#define is_alarm_ON_RTCC RTCC_is_alarm_ON |
#define set_day_of_the_week_alarm_RTCC RTCC_set_day_of_the_week_alarm |
#define set_day_of_the_week_RTCC RTCC_set_day_of_the_week |
#define set_days_alarm_RTCC RTCC_set_days_alarm |
#define set_days_RTCC RTCC_set_days |
#define set_hours_alarm_RTCC RTCC_set_hours_alarm |
#define set_hours_RTCC RTCC_set_hours |
#define set_minutes_alarm_RTCC RTCC_set_minutes_alarm |
#define set_minutes_RTCC RTCC_set_minutes |
#define set_months_RTCC RTCC_set_months |
#define set_seconds_RTCC RTCC_set_seconds |
#define set_years_RTCC RTCC_set_years |
void PCF8563_initialize | ( | 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 |
signed char RTCC_disable_alarm_interrupt | ( | void | ) |
This function disable the interrupt pin functionality.
Definition at line 357 of file DS1337.c.
References RTCC_CONFIGURATION_REG_ADDR, 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.
Definition at line 344 of file DS1337.c.
References RTCC_CONFIGURATION_REG_ADDR, 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
Definition at line 262 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.
unsigned char RTCC_get_days | ( | void | ) |
This function reads the day from the RTC.
Definition at line 204 of file DS1337.c.
References RTCC_DAYS_ADDR, and RTCC_WRITE_ADD.
unsigned char RTCC_get_hours | ( | void | ) |
This function reads the hours from the RTC.
Definition at line 120 of file DS1337.c.
References RTCC_HOURS_ADDR, and RTCC_WRITE_ADD.
unsigned char RTCC_get_minutes | ( | void | ) |
This function reads the minutes from the RTC.
Definition at line 97 of file DS1337.c.
References RTCC_MINUTES_ADDR, and RTCC_WRITE_ADD.
unsigned char RTCC_get_months | ( | void | ) |
This function reads the months from the RTC.
Definition at line 228 of file DS1337.c.
References RTCC_MONTHS_ADDR, and RTCC_WRITE_ADD.
unsigned char RTCC_get_seconds | ( | void | ) |
This function reads the second from the RTC.
Definition at line 70 of file DS1337.c.
References 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)
Definition at line 167 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
Definition at line 134 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.
Definition at line 251 of file DS1337.c.
References RTCC_WRITE_ADD, and RTCC_YEARS_ADDR.
signed char RTCC_increment_days | ( | void | ) |
This function increments the Days inside the RTCC.
Definition at line 530 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.
Definition at line 426 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.
Definition at line 391 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.
Definition at line 496 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.
Definition at line 461 of file DS1337.c.
References get_years_RTCC, RTCC_get_years(), RTCC_MAX_YEARS, RTCC_set_years(), and set_years_RTCC.
unsigned char RTCC_is_alarm_ON | ( | void | ) |
This function checks if the Alarm id ON using polling method.
Definition at line 367 of file DS1337.c.
References RTCC_ALARM_CONTROL_REG_1_ADDR, RTCC_ALARM_CONTROL_REG_2_ADDR, RTCC_CONFIGURATION_REG_ADDR, 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.
day_of_the_week | Day of the week to be written [0..6]. |
Definition at line 216 of file PCF8563.c.
References 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.
day_of_the_week | Days of the week to be written. |
alarmEnable | Enable the alarm or not (for matching) [Enable_ON , Enable_OFF] |
Definition at line 353 of file PCF8563.c.
References 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.
days | Day to be written, as 2 digits BCD format (eg. 12 is 0x12 or 0b00010010). |
Definition at line 195 of file DS1337.c.
References 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.
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] |
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 RTCC_ALARM_CONTROL_REG_1_ADDR, RTCC_DAYS_ALARM_ADDR, RTCC_ENABLE_ON, and RTCC_WRITE_ADD.
signed char RTCC_set_hours | ( | 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 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.
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] |
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 RTCC_ALARM_CONTROL_REG_1_ADDR, RTCC_ENABLE_ON, RTCC_HOURS_ALARM_ADDR, and RTCC_WRITE_ADD.
signed char RTCC_set_minutes | ( | 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 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.
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] |
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 RTCC_ALARM_CONTROL_REG_1_ADDR, RTCC_ENABLE_ON, RTCC_MINUTS_ALARM_ADDR, and RTCC_WRITE_ADD.
signed char RTCC_set_months | ( | 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 RTCC_MONTHS_ADDR, and RTCC_WRITE_ADD.
signed char RTCC_set_seconds | ( | 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 RTCC_SECONDS_ADDR, and RTCC_WRITE_ADD.
signed char RTCC_set_years | ( | 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 RTCC_WRITE_ADD, and RTCC_YEARS_ADDR.