led_clock-old/lib/rtc_ds1307.h

56 lines
1.9 KiB
C
Raw Normal View History

/* 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/>.
*
*/
/** @file rtc_ds1307.h
* @author King Kévin <kingkevin@cuvoodoo.info>
* @date 2016
* @brief this library handles communication with the I2C RTC IC Maxim DS1307
* @todo control register and user RAM are not handled
* peripherals used: I2C @ref rtc_ds1307_i2c
*/
#pragma once
/** @brief setup communication with RTC IC
* configure the I2C port defined in the sources
*/
void rtc_setup(void);
/** @brief read seconds (0-59) from RTC IC
* @return the number of seconds of the current time
*/
uint8_t rtc_read_seconds(void);
/** @brief read minutes (0-59) from RTC IC
* @return the number of minutes of the current time
*/
uint8_t rtc_read_minutes(void);
/** @brief read hours (0-23) from RTC IC
* @return the number of hours of the current time
*/
uint8_t rtc_read_hours(void);
/** @brief read day (1-7) from RTC IC
* @return the day of the current time, 1 being Sunday
*/
uint8_t rtc_read_day(void);
/** @brief read date (1-31) from RTC IC
* @return the date (day of the month) of the current time
*/
uint8_t rtc_read_date(void);
/** @brief read month (1-12) from RTC IC
* @return the month of the current time
*/
uint8_t rtc_read_month(void);
/** @brief read year (00-99) from RTC IC
* @return the year of the current time
*/
uint8_t rtc_read_year(void);