rtc 2.0.0.0
|
Functions | |
void | rtc_c_cfg_setup (rtc_c_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | rtc_c_init (rtc_c_t *ctx, rtc_c_cfg_t *cfg) |
Initialization function. | |
err_t | rtc_c_generic_write (rtc_c_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
RTC I2C writing function. | |
err_t | rtc_c_generic_read (rtc_c_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
RTC I2C reading function. | |
void | rtc_c_enable_disable_counting (rtc_c_t *ctx, uint8_t en_dis) |
Enable/Disable counting function. | |
void | rtc_c_read_time (rtc_c_t *ctx) |
Set control register to read time function. | |
void | rtc_c_read_date (rtc_c_t *ctx) |
Set control register to read date function. | |
uint8_t | rtc_c_get_time_value (rtc_c_t *ctx, uint8_t time_part) |
Get time value function. | |
void | rtc_c_set_time_value (rtc_c_t *ctx, uint8_t time_part, uint8_t time_addr) |
Set time values function. | |
uint8_t | rtc_c_get_date_day (rtc_c_t *ctx) |
Get day function. | |
void | rtc_c_set_date_day (rtc_c_t *ctx, uint8_t date_day) |
Set day function. | |
uint8_t | rtc_c_get_date_year (rtc_c_t *ctx) |
Get year function. | |
void | rtc_c_set_date_year (rtc_c_t *ctx, uint16_t date_year) |
Set year function. | |
uint8_t | rtc_c_check_leap_year (rtc_c_t *ctx) |
Check if it's a leap year function. | |
uint8_t | rtc_c_get_day_of_the_week (rtc_c_t *ctx) |
Get day of the week function. | |
void | rtc_c_set_day_of_the_week (rtc_c_t *ctx, uint8_t w_day) |
Set day of the week function. | |
uint8_t | rtc_c_get_date_month (rtc_c_t *ctx) |
Get month function. | |
void | rtc_c_set_date_month (rtc_c_t *ctx, uint8_t date_month) |
Set month function. | |
void | rtc_c_set_time (rtc_c_t *ctx) |
Set time hours, minutes, seconds and hundredth of a seconds function. | |
void | rtc_c_get_time (rtc_c_t *ctx) |
Get time hours, minutes, seconds and hundredth of a seconds function. | |
void | rtc_c_set_date (rtc_c_t *ctx) |
Set date hours, minutes and seconds function. | |
void | rtc_c_get_date (rtc_c_t *ctx) |
Get time hours, minutes and seconds function. | |
void | rtc_c_enable_disable_alarm (rtc_c_t *ctx, uint8_t en_dis) |
Enable/Disable alarm function. | |
void | rtc_c_set_alarm_value (rtc_c_t *ctx, uint8_t al_time_val, uint8_t al_time_type) |
Set alarm time value. | |
uint8_t | rtc_c_get_alarm_value (rtc_c_t *ctx, uint8_t alarm_addr) |
Get alarm time value function. | |
void | rtc_c_set_time_alarm (rtc_c_t *ctx) |
Set alarm time - minutes function. | |
void | rtc_c_get_time_alarm (rtc_c_t *ctx) |
Get the alarm time hours, minutes, seconds and hundredth of a seconds function. | |
void | rtc_c_enable_disable_interrupt (rtc_c_t *ctx, uint8_t flag) |
Enable alarm interrupt function. | |
uint8_t | rtc_c_get_interrupt (rtc_c_t *ctx) |
Get state of interrupt pin function. | |
void rtc_c_cfg_setup | ( | rtc_c_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
uint8_t rtc_c_check_leap_year | ( | rtc_c_t * | ctx | ) |
Check if it's a leap year function.
ctx | Click object. |
- 0 : Is't Leap Year - February has 28 days. - 1 : Is Leap Year - February has 29 days.
Function check if it's a leap year by read from the target register address of PCF8583 chip on RTC Click.
void rtc_c_enable_disable_alarm | ( | rtc_c_t * | ctx, |
uint8_t | en_dis ) |
Enable/Disable alarm function.
ctx | Click object. |
en_dis | Enable/Disable switch flag. |
Function enable alarm by set alarm control bit register to the target register address of PCF8583 chip on RTC Click.
void rtc_c_enable_disable_counting | ( | rtc_c_t * | ctx, |
uint8_t | en_dis ) |
Enable/Disable counting function.
ctx | Click object. |
en_dis | Enable/Disable flag. |
Function that enables or disables counting on RTC Click.
void rtc_c_enable_disable_interrupt | ( | rtc_c_t * | ctx, |
uint8_t | flag ) |
Enable alarm interrupt function.
ctx | Click object. |
flag | Enable/Disable switch flag. |
Function enables/disables alarm interrupt by setting alarm interrupt bit register to the target register address of PCF8583 chip on RTC Click.
err_t rtc_c_generic_read | ( | rtc_c_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
RTC I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See rtc_c_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rtc_c_generic_write | ( | rtc_c_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
RTC I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See rtc_c_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t rtc_c_get_alarm_value | ( | rtc_c_t * | ctx, |
uint8_t | alarm_addr ) |
Get alarm time value function.
ctx | Click object. |
alarm_addr | Address of the corresponding alarm time register |
Function getx alarm time value ( hundredth of a second, seconds, minutes or hours ) by reading time value from the target register address of PCF8583 chip on RTC Click.
void rtc_c_get_date | ( | rtc_c_t * | ctx | ) |
Get time hours, minutes and seconds function.
ctx | Click object. |
Function gets date: day of the week, day, month and year data from the target register address of PCF8583 chip on RTC Click.
uint8_t rtc_c_get_date_day | ( | rtc_c_t * | ctx | ) |
Get day function.
ctx | Click object. |
Function gets day data from the target register address of PCF8583 chip on RTC Click.
uint8_t rtc_c_get_date_month | ( | rtc_c_t * | ctx | ) |
Get month function.
ctx | Click object. |
Function gets month data from the target register address of PCF8583 chip on RTC Click.
uint8_t rtc_c_get_date_year | ( | rtc_c_t * | ctx | ) |
Get year function.
ctx | Click object. |
Function gets year data from the target register address of PCF8583 chip on RTC Click.
uint8_t rtc_c_get_day_of_the_week | ( | rtc_c_t * | ctx | ) |
Get day of the week function.
ctx | Click object. |
Function gets day of the week data from tne target register address of PCF8583 chip on RTC Click.
uint8_t rtc_c_get_interrupt | ( | rtc_c_t * | ctx | ) |
Get state of interrupt pin function.
ctx | Click object. |
- 0: not active; - 1: active
Function get state of interrupt ( INT ) pin.
void rtc_c_get_time | ( | rtc_c_t * | ctx | ) |
Get time hours, minutes, seconds and hundredth of a seconds function.
ctx | Click object. |
Function gets time: hours, minutes and seconds data from the target register address of PCF8583 chip on RTC Click.
void rtc_c_get_time_alarm | ( | rtc_c_t * | ctx | ) |
Get the alarm time hours, minutes, seconds and hundredth of a seconds function.
ctx | Click object. |
Function gets the alarm time: hours, minutes and seconds data from the target register address of PCF8583 chip on RTC Click.
uint8_t rtc_c_get_time_value | ( | rtc_c_t * | ctx, |
uint8_t | time_part ) |
Get time value function.
ctx | Click object. |
time_part | Time part register address. |
Function gets hundredths of a second, seconds, minutes or hours data from the target register address of PCF8583 chip on RTC Click.
err_t rtc_c_init | ( | rtc_c_t * | ctx, |
rtc_c_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
void rtc_c_read_date | ( | rtc_c_t * | ctx | ) |
Set control register to read date function.
ctx | Click object. |
Function sets control register to read time by setting read location bit of PCF8583 chip on RTC Click.
void rtc_c_read_time | ( | rtc_c_t * | ctx | ) |
Set control register to read time function.
ctx | Click object. |
Function sets control register to read time by clearing read location bit of PCF8583 chip on RTC Click.
void rtc_c_set_alarm_value | ( | rtc_c_t * | ctx, |
uint8_t | al_time_val, | ||
uint8_t | al_time_type ) |
Set alarm time value.
ctx | Click object. |
al_time_val | Alarm time part value ( hours, minutes, seconds, hundreths of a second ) |
al_time_type | Alarm time register address. |
Function set alarm time - hundredth of a seconds, seconds, minutes or hours by writing time part value to the target register address of PCF8583 chip on RTC Click.
void rtc_c_set_date | ( | rtc_c_t * | ctx | ) |
Set date hours, minutes and seconds function.
ctx | Click object. |
Function sets date: day of the week, day, month and year data to the target register address of PCF8583 chip on RTC Click.
void rtc_c_set_date_day | ( | rtc_c_t * | ctx, |
uint8_t | date_day ) |
Set day function.
ctx | Click object. |
date_day | Date day data [ 1 - 31 ] |
Function sets day data from the target register address of PCF8583 chip on RTC Click.
void rtc_c_set_date_month | ( | rtc_c_t * | ctx, |
uint8_t | date_month ) |
Set month function.
ctx | Click object. |
date_month | Date month data [ 1 - 12 ] |
Function sets month data from the target register address of PCF8583 chip on RTC Click.
void rtc_c_set_date_year | ( | rtc_c_t * | ctx, |
uint16_t | date_year ) |
Set year function.
ctx | Click object. |
date_year | Date year data [ 00 - 99 ] |
Function sets year data from the target register address of PCF8583 chip on RTC Click.
void rtc_c_set_day_of_the_week | ( | rtc_c_t * | ctx, |
uint8_t | w_day ) |
Set day of the week function.
ctx | Click object. |
w_day | Day of the week data [ 1 - 7 ] - 1 : Monday; - 2 : Tuesday; - 3 : Wednesday; - 4 : Thursday; - 5 : Friday; - 6 : Saturday; - 7 : Sunday; |
Function sets day of the week data to the target register address of PCF8583 chip on RTC Click.
void rtc_c_set_time | ( | rtc_c_t * | ctx | ) |
Set time hours, minutes, seconds and hundredth of a seconds function.
ctx | Click object. |
Function sets time: hours, minutes and seconds data to the target register address of PCF8583 chip on RTC Click.
void rtc_c_set_time_alarm | ( | rtc_c_t * | ctx | ) |
Set alarm time - minutes function.
ctx | Click object. |
Function set alarm time - minutes by write minutes value to the target register address of PCF8583 chip on RTC Click.
void rtc_c_set_time_value | ( | rtc_c_t * | ctx, |
uint8_t | time_part, | ||
uint8_t | time_addr ) |
Set time values function.
ctx | Click object. |
time_part | Part of time format ( hours, minutes, seconds or hundreths of a second ). |
time_addr | Register address of the corresponding part of the time format. |
Function sets seconds data to the target register address of PCF8583 chip on RTC Click.