CuVoodoo STM32F1 firmware template
|
library to communicate with the Maxim DS1307 I2C RTC IC (API) More...
Go to the source code of this file.
Functions | |
void | rtc_ds1307_setup (void) |
setup communication with RTC IC configure the I2C port defined in the sources | |
bool | rtc_ds1307_oscillator_disabled (void) |
verify if oscillator is disabled More... | |
uint16_t | rtc_ds1307_read_square_wave (void) |
read square wave output frequency (in Hz) More... | |
uint8_t | rtc_ds1307_read_seconds (void) |
read seconds from RTC IC More... | |
uint8_t | rtc_ds1307_read_minutes (void) |
read minutes from RTC IC More... | |
uint8_t | rtc_ds1307_read_hours (void) |
read hours from RTC IC More... | |
uint8_t | rtc_ds1307_read_day (void) |
read day from RTC IC More... | |
uint8_t | rtc_ds1307_read_date (void) |
read date from RTC IC More... | |
uint8_t | rtc_ds1307_read_month (void) |
read month from RTC IC More... | |
uint8_t | rtc_ds1307_read_year (void) |
read year from RTC IC More... | |
uint8_t * | rtc_ds1307_read_time (void) |
read time from RTC IC More... | |
bool | rtc_ds1307_read_ram (uint8_t start, uint8_t *data, uint8_t length) |
read user RAM from RTC IC More... | |
bool | rtc_ds1307_read_rom (uint16_t start, uint8_t *data, uint16_t length) |
read ROM from AT24Cxx EEPROM More... | |
bool | rtc_ds1307_oscillator_disable (void) |
disable RTC IC oscillator More... | |
bool | rtc_ds1307_oscillator_enable (void) |
enable RTC IC oscillator More... | |
bool | rtc_ds1307_write_square_wave (uint16_t frequency) |
write square wave output frequency (in Hz) More... | |
bool | rtc_ds1307_write_seconds (uint8_t seconds) |
write seconds into RTC IC More... | |
bool | rtc_ds1307_write_minutes (uint8_t minutes) |
write minutes into RTC IC More... | |
bool | rtc_ds1307_write_hours (uint8_t hours) |
write hours into RTC IC More... | |
bool | rtc_ds1307_write_day (uint8_t day) |
write day into RTC IC More... | |
bool | rtc_ds1307_write_date (uint8_t date) |
write date into RTC IC More... | |
bool | rtc_ds1307_write_month (uint8_t month) |
write month into RTC IC More... | |
bool | rtc_ds1307_write_year (uint8_t year) |
write year into RTC IC More... | |
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 More... | |
bool | rtc_ds1307_write_ram (uint8_t start, uint8_t *data, uint8_t length) |
write to user RAM on RTC IC More... | |
bool | rtc_ds1307_write_rom (uint16_t start, uint8_t *data, uint8_t length) |
write to ROM on AT24Cxx EEPROM More... | |
library to communicate with the Maxim DS1307 I2C RTC IC (API)
Definition in file rtc_ds1307.h.
bool rtc_ds1307_oscillator_disable | ( | void | ) |
disable RTC IC oscillator
Definition at line 219 of file rtc_ds1307.c.
bool rtc_ds1307_oscillator_disabled | ( | void | ) |
verify if oscillator is disabled
Definition at line 46 of file rtc_ds1307.c.
bool rtc_ds1307_oscillator_enable | ( | void | ) |
enable RTC IC oscillator
Definition at line 230 of file rtc_ds1307.c.
uint8_t rtc_ds1307_read_date | ( | void | ) |
read date from RTC IC
Definition at line 129 of file rtc_ds1307.c.
uint8_t rtc_ds1307_read_day | ( | void | ) |
read day from RTC IC
Definition at line 117 of file rtc_ds1307.c.
uint8_t rtc_ds1307_read_hours | ( | void | ) |
read hours from RTC IC
Definition at line 97 of file rtc_ds1307.c.
uint8_t rtc_ds1307_read_minutes | ( | void | ) |
read minutes from RTC IC
Definition at line 85 of file rtc_ds1307.c.
uint8_t rtc_ds1307_read_month | ( | void | ) |
read month from RTC IC
Definition at line 141 of file rtc_ds1307.c.
bool rtc_ds1307_read_ram | ( | uint8_t | start, |
uint8_t * | data, | ||
uint8_t | length | ||
) |
read user RAM from RTC IC
[in] | start | start of the user RAM to read (0-55) |
[out] | data | array to store the RAM read |
[in] | length | number of user RAM bytes to read (0-55) |
Definition at line 191 of file rtc_ds1307.c.
bool rtc_ds1307_read_rom | ( | uint16_t | start, |
uint8_t * | data, | ||
uint16_t | length | ||
) |
read ROM from AT24Cxx EEPROM
[in] | start | start address of the ROM to read (maximum depends on the EEPROM) |
[out] | data | array to store the ROM read |
[in] | length | number of bytes to read (maximum depends on the EEPROM) |
Definition at line 205 of file rtc_ds1307.c.
uint8_t rtc_ds1307_read_seconds | ( | void | ) |
read seconds from RTC IC
Definition at line 73 of file rtc_ds1307.c.
uint16_t rtc_ds1307_read_square_wave | ( | void | ) |
read square wave output frequency (in Hz)
Definition at line 56 of file rtc_ds1307.c.
uint8_t* rtc_ds1307_read_time | ( | void | ) |
read time from RTC IC
Definition at line 164 of file rtc_ds1307.c.
uint8_t rtc_ds1307_read_year | ( | void | ) |
read year from RTC IC
Definition at line 153 of file rtc_ds1307.c.
bool rtc_ds1307_write_date | ( | uint8_t | date | ) |
write date into RTC IC
[in] | date | day of the month (1-31) |
Definition at line 319 of file rtc_ds1307.c.
bool rtc_ds1307_write_day | ( | uint8_t | day | ) |
write day into RTC IC
[in] | day | day of the week (1-7, 1 is Sunday) |
Definition at line 307 of file rtc_ds1307.c.
bool rtc_ds1307_write_hours | ( | uint8_t | hours | ) |
write hours into RTC IC
[in] | hours | number of hours (0-23) |
Definition at line 295 of file rtc_ds1307.c.
bool rtc_ds1307_write_minutes | ( | uint8_t | minutes | ) |
write minutes into RTC IC
[in] | minutes | number of minutes (0-59) |
Definition at line 283 of file rtc_ds1307.c.
bool rtc_ds1307_write_month | ( | uint8_t | month | ) |
write month into RTC IC
[in] | month | month of the year (1-12) |
Definition at line 331 of file rtc_ds1307.c.
bool rtc_ds1307_write_ram | ( | uint8_t | start, |
uint8_t * | data, | ||
uint8_t | length | ||
) |
write to user RAM on RTC IC
[in] | start | start of the user RAM to write (0-55) |
[in] | data | array of byte to write in RAM |
[in] | length | number of user RAM bytes to write (0-55) |
Definition at line 402 of file rtc_ds1307.c.
bool rtc_ds1307_write_rom | ( | uint16_t | start, |
uint8_t * | data, | ||
uint8_t | length | ||
) |
write to ROM on AT24Cxx EEPROM
[in] | start | start address of the ROM to write (maximum depends on the EEPROM) |
[in] | data | array to write in ROM |
[in] | length | number of bytes to write (maximum depends on the EEPROM) |
Definition at line 415 of file rtc_ds1307.c.
bool rtc_ds1307_write_seconds | ( | uint8_t | seconds | ) |
write seconds into RTC IC
[in] | seconds | number of seconds (0-59) |
Definition at line 267 of file rtc_ds1307.c.
bool rtc_ds1307_write_square_wave | ( | uint16_t | frequency | ) |
write square wave output frequency (in Hz)
[in] | frequency | square wave output frequency in Hz (0 to disable, 1, 4096, 8192, 32768) |
Definition at line 241 of file rtc_ds1307.c.
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
[in] | seconds | number of seconds (0-59) |
[in] | minutes | number of minutes (0-59) |
[in] | hours | number of hours (0-23) |
[in] | day | day of the week (1-7, 1 is Sunday) |
[in] | date | day of the month (1-31) |
[in] | month | month of the year (1-12) |
[in] | year | year of the century (00-99) |
Definition at line 355 of file rtc_ds1307.c.
bool rtc_ds1307_write_year | ( | uint8_t | year | ) |
write year into RTC IC
[in] | year | year of the century (00-99) |
Definition at line 343 of file rtc_ds1307.c.