rtc_ds1307.h
Go to the documentation of this file.
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
void rtc_ds1307_setup(void);
bool rtc_ds1307_oscillator_disabled(void);
uint16_t rtc_ds1307_read_square_wave(void);
uint8_t rtc_ds1307_read_seconds(void);
uint8_t rtc_ds1307_read_minutes(void);
uint8_t rtc_ds1307_read_hours(void);
uint8_t rtc_ds1307_read_day(void);
uint8_t rtc_ds1307_read_date(void);
uint8_t rtc_ds1307_read_month(void);
uint8_t rtc_ds1307_read_year(void);
uint8_t* rtc_ds1307_read_time(void);
bool rtc_ds1307_read_ram(uint8_t* data, uint8_t start, uint8_t length);
bool rtc_ds1307_oscillator_disable(void);
bool rtc_ds1307_oscillator_enable(void);
bool rtc_ds1307_write_square_wave(uint16_t frequency);
bool rtc_ds1307_write_seconds(uint8_t seconds);
bool rtc_ds1307_write_minutes(uint8_t minutes);
bool rtc_ds1307_write_hours(uint8_t hours);
bool rtc_ds1307_write_day(uint8_t day);
bool rtc_ds1307_write_date(uint8_t date);
bool rtc_ds1307_write_month(uint8_t month);
bool rtc_ds1307_write_year(uint8_t year);
bool rtc_ds1307_write_time(uint8_t seconds, uint8_t minutes, uint8_t hours, uint8_t day, uint8_t date, uint8_t month, uint8_t year);
bool rtc_ds1307_write_ram(uint8_t* data, uint8_t start, uint8_t length);
rtc_ds1307_read_year
uint8_t rtc_ds1307_read_year(void)
read year from RTC IC
Definition: rtc_ds1307.c:151
rtc_ds1307_oscillator_disable
bool rtc_ds1307_oscillator_disable(void)
disable RTC IC oscillator
Definition: rtc_ds1307.c:203
rtc_ds1307_write_day
bool rtc_ds1307_write_day(uint8_t day)
write day into RTC IC
Definition: rtc_ds1307.c:291
rtc_ds1307_read_ram
bool rtc_ds1307_read_ram(uint8_t *data, uint8_t start, uint8_t length)
read user RAM from RTC IC
Definition: rtc_ds1307.c:189
rtc_ds1307_read_seconds
uint8_t rtc_ds1307_read_seconds(void)
read seconds from RTC IC
Definition: rtc_ds1307.c:71
rtc_ds1307_read_day
uint8_t rtc_ds1307_read_day(void)
read day from RTC IC
Definition: rtc_ds1307.c:115
rtc_ds1307_setup
void rtc_ds1307_setup(void)
setup communication with RTC IC configure the I2C port defined in the sources
Definition: rtc_ds1307.c:38
rtc_ds1307_write_square_wave
bool rtc_ds1307_write_square_wave(uint16_t frequency)
write square wave output frequency (in Hz)
Definition: rtc_ds1307.c:225
rtc_ds1307_write_ram
bool rtc_ds1307_write_ram(uint8_t *data, uint8_t start, uint8_t length)
write user RAM from RTC IC
Definition: rtc_ds1307.c:386
rtc_ds1307_write_seconds
bool rtc_ds1307_write_seconds(uint8_t seconds)
write seconds into RTC IC
Definition: rtc_ds1307.c:251
rtc_ds1307_oscillator_enable
bool rtc_ds1307_oscillator_enable(void)
enable RTC IC oscillator
Definition: rtc_ds1307.c:214
rtc_ds1307_write_month
bool rtc_ds1307_write_month(uint8_t month)
write month into RTC IC
Definition: rtc_ds1307.c:315
rtc_ds1307_read_minutes
uint8_t rtc_ds1307_read_minutes(void)
read minutes from RTC IC
Definition: rtc_ds1307.c:83
rtc_ds1307_oscillator_disabled
bool rtc_ds1307_oscillator_disabled(void)
verify if oscillator is disabled
Definition: rtc_ds1307.c:44
rtc_ds1307_read_hours
uint8_t rtc_ds1307_read_hours(void)
read hours from RTC IC
Definition: rtc_ds1307.c:95
rtc_ds1307_write_time
bool rtc_ds1307_write_time(uint8_t seconds, uint8_t minutes, uint8_t hours, uint8_t day, uint8_t date, uint8_t month, uint8_t year)
write time into RTC IC
Definition: rtc_ds1307.c:339
rtc_ds1307_read_time
uint8_t * rtc_ds1307_read_time(void)
read time from RTC IC
Definition: rtc_ds1307.c:162
rtc_ds1307_write_year
bool rtc_ds1307_write_year(uint8_t year)
write year into RTC IC
Definition: rtc_ds1307.c:327
rtc_ds1307_write_minutes
bool rtc_ds1307_write_minutes(uint8_t minutes)
write minutes into RTC IC
Definition: rtc_ds1307.c:267
rtc_ds1307_write_hours
bool rtc_ds1307_write_hours(uint8_t hours)
write hours into RTC IC
Definition: rtc_ds1307.c:279
rtc_ds1307_write_date
bool rtc_ds1307_write_date(uint8_t date)
write date into RTC IC
Definition: rtc_ds1307.c:303
rtc_ds1307_read_square_wave
uint16_t rtc_ds1307_read_square_wave(void)
read square wave output frequency (in Hz)
Definition: rtc_ds1307.c:54
rtc_ds1307_read_date
uint8_t rtc_ds1307_read_date(void)
read date from RTC IC
Definition: rtc_ds1307.c:127
rtc_ds1307_read_month
uint8_t rtc_ds1307_read_month(void)
read month from RTC IC
Definition: rtc_ds1307.c:139