rtc2 2.0.0.0
|
Functions | |
void | rtc2_cfg_setup (rtc2_cfg_t *cfg) |
Config Object Initialization function. | |
RTC2_RETVAL | rtc2_init (rtc2_t *ctx, rtc2_cfg_t *cfg) |
Initialization function. | |
void | rtc2_generic_write (rtc2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | rtc2_generic_read (rtc2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint8_t | rtc2_read_byte (rtc2_t *ctx, uint8_t reg_address) |
Generic read byte of data function. | |
void | rtc2_write_byte (rtc2_t *ctx, uint8_t reg_address, uint8_t write_data) |
Generic write byte of data function. | |
void | rtc2_enable_counting (rtc2_t *ctx) |
Enable counting function. | |
void | rtc2_disable_counting (rtc2_t *ctx) |
Disable counting function. | |
uint8_t | rtc2_get_time_seconds (rtc2_t *ctx) |
Get seconds function. | |
void | rtc2_set_time_seconds (rtc2_t *ctx, uint8_t seconds) |
Set seconds function. | |
uint8_t | rtc2_get_time_minutes (rtc2_t *ctx) |
Get hours function. | |
void | rtc2_set_time_minutes (rtc2_t *ctx, uint8_t minutes) |
Set minutes function. | |
uint8_t | rtc2_get_time_hours (rtc2_t *ctx) |
Set hours function. | |
void | rtc2_set_time_hours (rtc2_t *ctx, uint8_t hours) |
Set hours function. | |
uint8_t | rtc2_get_day_of_the_week (rtc2_t *ctx) |
Set day of the week function. | |
void | rtc2_set_day_of_the_week (rtc2_t *ctx, uint8_t w_day) |
Generic read function. | |
uint8_t | rtc2_get_date_day (rtc2_t *ctx) |
Get day function. | |
void | rtc2_set_date_day (rtc2_t *ctx, uint8_t date_day) |
Set day function. | |
uint8_t | rtc2_get_date_month (rtc2_t *ctx) |
Get month function. | |
void | rtc2_set_date_month (rtc2_t *ctx, uint8_t date_month) |
Set month function. | |
uint8_t | rtc2_get_date_year (rtc2_t *ctx) |
Get year function. | |
void | rtc2_set_date_year (rtc2_t *ctx, uint16_t date_year) |
Set year function. | |
void | rtc2_set_time (rtc2_t *ctx, uint8_t time_hours, uint8_t time_minutes, uint8_t time_seconds) |
Set time hours, minutes and seconds function. | |
void | rtc2_get_time (rtc2_t *ctx, uint8_t *time_hours, uint8_t *time_minutes, uint8_t *time_seconds) |
Get time hours, minutes and seconds function. | |
void | rtc2_set_date (rtc2_t *ctx, rtc2_data_t *date) |
Generic read function. | |
void | rtc2_get_date (rtc2_t *ctx, rtc2_data_t *date) |
Generic read function. | |
void | rtc2_set_frequency_sqwe (rtc2_t *ctx, uint8_t rate_select) |
Set frequency of square-wave output function. | |
void rtc2_cfg_setup | ( | rtc2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void rtc2_disable_counting | ( | rtc2_t * | ctx | ) |
Disable counting function.
ctx | Click object. |
@description Function disable counting on RTC 2 Click.
void rtc2_enable_counting | ( | rtc2_t * | ctx | ) |
Enable counting function.
ctx | Click object. @description Function enable counting on RTC 2 Click. |
void rtc2_generic_read | ( | rtc2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void rtc2_generic_write | ( | rtc2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
void rtc2_get_date | ( | rtc2_t * | ctx, |
rtc2_data_t * | date ) |
Generic read function.
ctx | Click object. |
data | Data parameters. |
@description Function gets date: day of the week, day, month and year data from the target register address ( 0x03, 0x04, 0x05 & 0x06 ) of DS1307 chip on RTC 2 Click.
uint8_t rtc2_get_date_day | ( | rtc2_t * | ctx | ) |
Get day function.
ctx | Click object. |
@description Function gets day data from the target register address ( 0x04 ) of DS1307 chip on RTC 2 Click.
uint8_t rtc2_get_date_month | ( | rtc2_t * | ctx | ) |
Get month function.
ctx | Click object. |
@description Function gets month data from the target register address ( 0x05 ) of DS1307 chip on RTC 2 Click.
uint8_t rtc2_get_date_year | ( | rtc2_t * | ctx | ) |
Get year function.
ctx | Click object. |
@description Function gets year data from the target register address ( 0x06 ) of DS1307 chip on RTC 2 Click.
uint8_t rtc2_get_day_of_the_week | ( | rtc2_t * | ctx | ) |
Set day of the week function.
ctx | Click object. |
@description Function gets day of the week data from tne target register address ( 0x03 ) of DS1307 chip on RTC 2 Click.
void rtc2_get_time | ( | rtc2_t * | ctx, |
uint8_t * | time_hours, | ||
uint8_t * | time_minutes, | ||
uint8_t * | time_seconds ) |
Get time hours, minutes and seconds function.
ctx | Click object. |
time_hours | Pointer of time hours. |
time_minutes | Pointer of time minutes. |
time_seconds | Pointer of time seconds. |
@description Function gets time: hours, minutes and seconds data from the target register address ( 0x00, 0x01 & 0x02 ) of DS1307 chip on RTC 2 Click.
uint8_t rtc2_get_time_hours | ( | rtc2_t * | ctx | ) |
Set hours function.
ctx | Click object. |
@description Function sets hours data to the target register address ( 0x02 ) of DS1307 chip on RTC 2 Click.
uint8_t rtc2_get_time_minutes | ( | rtc2_t * | ctx | ) |
Get hours function.
ctx | Click object. |
@description Function gets hours data from the target register address ( 0x02 ) of DS1307 chip on RTC 2 Click.
uint8_t rtc2_get_time_seconds | ( | rtc2_t * | ctx | ) |
Get seconds function.
ctx | Click object. |
@description Function gets seconds data from the target register address ( 0x00 ) of DS1307 chip on RTC 2 Click.
RTC2_RETVAL rtc2_init | ( | rtc2_t * | ctx, |
rtc2_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t rtc2_read_byte | ( | rtc2_t * | ctx, |
uint8_t | reg_address ) |
Generic read byte of data function.
ctx | Click object. |
reg_address | Register address. |
@description Function read the 8-bit of data from the target 8-bit register address of DS1307 chip on RTC 2 Click.
void rtc2_set_date | ( | rtc2_t * | ctx, |
rtc2_data_t * | date ) |
Generic read function.
ctx | Click object. |
date | Date parameters. |
@description Function sets date: day of the week, day, month and year data to the target register address ( 0x03, 0x04, 0x05 & 0x06 ) of DS1307 chip on RTC 2 Click.
void rtc2_set_date_day | ( | rtc2_t * | ctx, |
uint8_t | date_day ) |
Set day function.
ctx | Click object. |
date_day | Date day data. |
@description Function sets day data from the target register address ( 0x04 ) of DS1307 chip on RTC 2 Click.
void rtc2_set_date_month | ( | rtc2_t * | ctx, |
uint8_t | date_month ) |
Set month function.
ctx | Click object. |
date_month | Date month data. |
@description Function sets month data from the target register address ( 0x05 ) of DS1307 chip on RTC 2 Click.
void rtc2_set_date_year | ( | rtc2_t * | ctx, |
uint16_t | date_year ) |
Set year function.
ctx | Click object. |
date_year | Date year data. |
@description Function sets year data from the target register address ( 0x06 ) of DS1307 chip on RTC 2 Click.
void rtc2_set_day_of_the_week | ( | rtc2_t * | ctx, |
uint8_t | w_day ) |
Generic read function.
ctx | Click object. |
w_day | Day of the week data. |
@description Function sets day of the week data to the target register address ( 0x03 ) of DS1307 chip on RTC 2 Click.
void rtc2_set_frequency_sqwe | ( | rtc2_t * | ctx, |
uint8_t | rate_select ) |
Set frequency of square-wave output function.
ctx | Click object. |
rate_select | Rate selection of frequency of SQWE. |
@description Function set frequency of square-wave output of DS1307 chip on RTC 2 Click.
void rtc2_set_time | ( | rtc2_t * | ctx, |
uint8_t | time_hours, | ||
uint8_t | time_minutes, | ||
uint8_t | time_seconds ) |
Set time hours, minutes and seconds function.
ctx | Click object. |
time_hours | Time hours. |
time_minutes | Time minutes. |
time_seconds | Time seconds. |
@description Function sets time: hours, minutes and seconds data to the target register address ( 0x00, 0x01 & 0x02 ) of DS1307 chip on RTC 2 Click.
void rtc2_set_time_hours | ( | rtc2_t * | ctx, |
uint8_t | hours ) |
Set hours function.
ctx | Click object. |
hours | Time hours. |
@description Function sets hours data to the target register address ( 0x02 ) of DS1307 chip on RTC 2 Click.
void rtc2_set_time_minutes | ( | rtc2_t * | ctx, |
uint8_t | minutes ) |
Set minutes function.
ctx | Click object. |
minutes | Time minutes. |
@description Function sets minutes data to the target register address ( 0x01 ) of DS1307 chip on RTC 2 Click.
void rtc2_set_time_seconds | ( | rtc2_t * | ctx, |
uint8_t | seconds ) |
Set seconds function.
ctx | Click object. |
seconds | Time seconds. |
@description Function sets seconds data to the target register address ( 0x00 ) of DS1307 chip on RTC 2 Click.
void rtc2_write_byte | ( | rtc2_t * | ctx, |
uint8_t | reg_address, | ||
uint8_t | write_data ) |
Generic write byte of data function.
ctx | Click object. |
reg | Register address. |
write_data | Byte of data to write. |
@description Function write the 8-bit of data to the target 8-bit register address of DS1307 chip on RTC 2 Click.