rtc11 2.0.0.0
|
API for configuring and manipulating RTC 11 Click driver. More...
Modules | |
RTC 11 Registers List | |
List of registers of RTC 11 Click driver. | |
RTC 11 Registers Settings | |
Settings for registers of RTC 11 Click driver. | |
RTC 11 MikroBUS Map | |
MikroBUS pin mapping of RTC 11 Click driver. | |
Functions | |
void | rtc11_cfg_setup (rtc11_cfg_t *cfg) |
RTC 11 configuration object setup function. More... | |
err_t | rtc11_init (rtc11_t *ctx, rtc11_cfg_t *cfg) |
RTC 11 initialization function. More... | |
void | rtc11_generic_write (rtc11_t *ctx, uint8_t reg, uint8_t *wr_data, uint16_t n_len) |
RTC 11 data writing function. More... | |
void | rtc11_generic_read (rtc11_t *ctx, uint8_t reg, uint8_t *rd_data, uint16_t n_len) |
RTC 11 data reading function. More... | |
uint8_t | rtc11_check_irq_1 (rtc11_t *ctx) |
Check Interrupt 1 pin function. More... | |
uint8_t | rtc11_check_irq_2 (rtc11_t *ctx) |
Check Interrupt 2 pin function. More... | |
void | rtc11_wdi (rtc11_t *ctx, uint8_t state) |
Watchdog reset function. More... | |
void | rtc11_ext_int (rtc11_t *ctx, uint8_t state) |
External interrupt function. More... | |
void | rtc11_set_time_hundredths (rtc11_t *ctx, uint8_t hundredths) |
Set hundredths function. More... | |
void | rtc11_set_time_seconds (rtc11_t *ctx, uint8_t seconds) |
Set seconds function. More... | |
void | rtc11_set_time_minutes (rtc11_t *ctx, uint8_t minutes) |
Set minutes function. More... | |
void | rtc11_set_time_hours (rtc11_t *ctx, uint8_t hours) |
Set hours function. More... | |
uint8_t | rtc11_get_time_hundredths (rtc11_t *ctx) |
Get hundredths function. More... | |
uint8_t | rtc11_get_time_seconds (rtc11_t *ctx) |
Get seconds function. More... | |
uint8_t | rtc11_get_time_minutes (rtc11_t *ctx) |
Get minutes function. More... | |
uint8_t | rtc11_get_time_hours (rtc11_t *ctx) |
Get hours function. More... | |
uint8_t | rtc11_get_date_day (rtc11_t *ctx) |
Get day function. More... | |
void | rtc11_set_date_day (rtc11_t *ctx, uint8_t date_day) |
Set day function. More... | |
uint8_t | rtc11_get_date_month (rtc11_t *ctx) |
Get month function. More... | |
void | rtc11_set_date_month (rtc11_t *ctx, uint8_t date_mth) |
Set month function. More... | |
uint8_t | rtc11_get_date_year (rtc11_t *ctx) |
Get year function. More... | |
void | rtc11_set_date_year (rtc11_t *ctx, uint16_t date_yrs) |
Set year function. More... | |
uint8_t | rtc11_get_century_flag (rtc11_t *ctx) |
Get century flag function. More... | |
uint8_t | rtc11_get_day_of_the_week (rtc11_t *ctx) |
Get day of the week function. More... | |
void | rtc11_set_day_of_the_week (rtc11_t *ctx, uint8_t w_day) |
Set day of the week function. More... | |
void | rtc11_set_ala_time_hundredths (rtc11_t *ctx, uint8_t hundredths) |
Set alarm time hundredths function. More... | |
void | rtc11_set_ala_time_seconds (rtc11_t *ctx, uint8_t seconds) |
Set alarm time seconds function. More... | |
void | rtc11_set_ala_time_minutes (rtc11_t *ctx, uint8_t minutes) |
Set alarm time minutes function. More... | |
void | rtc11_set_ala_time_hours (rtc11_t *ctx, uint8_t hours) |
Set alarm time hours function. More... | |
uint8_t | rtc11_get_ala_time_hundredths (rtc11_t *ctx) |
Get alarm time hundredths function. More... | |
uint8_t | rtc11_get_ala_time_seconds (rtc11_t *ctx) |
Get alarm time seconds function. More... | |
uint8_t | rtc11_get_ala_time_minutes (rtc11_t *ctx) |
Get alarm time minutes function. More... | |
uint8_t | rtc11_get_ala_time_hours (rtc11_t *ctx) |
Get alarm time hours function. More... | |
uint8_t | rtc11_get_ala_date_day (rtc11_t *ctx) |
Get alarm time days function. More... | |
void | rtc11_set_ala_date_day (rtc11_t *ctx, uint8_t date_day) |
Set alarm time day function. More... | |
uint8_t | rtc11_get_ala_date_month (rtc11_t *ctx) |
Get alarm time month function. More... | |
void | rtc11_set_ala_date_month (rtc11_t *ctx, uint8_t date_mth) |
Set alarm time month function. More... | |
uint8_t | rtc11_get_ala_day_of_the_week (rtc11_t *ctx) |
Get alarm time day of the week function. More... | |
void | rtc11_set_ala_day_of_the_week (rtc11_t *ctx, uint8_t w_day) |
Set alarm time day of the week function. More... | |
void | rtc11_soft_rst (rtc11_t *ctx) |
Software Reset function. More... | |
err_t | rtc11_set_time (rtc11_t *ctx, rtc11_time_t rtc_time) |
Set time hours, minutes and seconds function. More... | |
void | rtc11_get_time (rtc11_t *ctx, rtc11_time_t *rtc_time) |
Get time hours, minutes and seconds function. More... | |
err_t | rtc11_set_date (rtc11_t *ctx, rtc11_date_t rtc_date) |
Set date day of the week, day, month and year function. More... | |
void | rtc11_get_date (rtc11_t *ctx, rtc11_date_t *rtc_date) |
Get date day of the week, day, month and year function. More... | |
void | rtc11_stp_sys_slk (rtc11_t *ctx, uint8_t state) |
Stop the clocking system function. More... | |
void | rtc11_auto_rst (rtc11_t *ctx, uint8_t state) |
Auto reset enable function. More... | |
void | rtc11_write_rtc (rtc11_t *ctx, uint8_t state) |
Write RTC enable function. More... | |
void | rtc11_cen_en (rtc11_t *ctx, uint8_t state) |
Century Enable function. More... | |
void | rtc11_bat_low_int_en (rtc11_t *ctx, uint8_t state) |
Battery Low Interrupt Enable function. More... | |
void | rtc11_timer_int_en (rtc11_t *ctx, uint8_t state) |
Timer Interrupt Enable function. More... | |
void | rtc11_alarm_int_en (rtc11_t *ctx, uint8_t state) |
Alarm Interrupt Enable function. More... | |
void | rtc11_xt2_int_en (rtc11_t *ctx, uint8_t state) |
XT2 Interrupt Enable function. More... | |
void | rtc11_xt1_int_en (rtc11_t *ctx, uint8_t state) |
XT1 Interrupt Enable function. More... | |
void | rtc11_bat_mode_en (rtc11_t *ctx, uint8_t state) |
Batmode enable function. More... | |
API for configuring and manipulating RTC 11 Click driver.
void rtc11_alarm_int_en | ( | rtc11_t * | ctx, |
uint8_t | state | ||
) |
Alarm Interrupt Enable function.
Function is used to enable or disable Alarm Interrupt.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | state | : Value enables or disables the property. |
void rtc11_auto_rst | ( | rtc11_t * | ctx, |
uint8_t | state | ||
) |
Auto reset enable function.
Function is used to enable or disable auto reset interrupt flags.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | state | : Value enables or disables the property. |
void rtc11_bat_low_int_en | ( | rtc11_t * | ctx, |
uint8_t | state | ||
) |
Battery Low Interrupt Enable function.
Function is used to enable or disable Battery Low Interrupt.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | state | : Value enables or disables the property. |
void rtc11_bat_mode_en | ( | rtc11_t * | ctx, |
uint8_t | state | ||
) |
Batmode enable function.
Function is used to enable or disable the I/O interface when a Brownout Detection occurs.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | state | : Value enables or disables the property. |
void rtc11_cen_en | ( | rtc11_t * | ctx, |
uint8_t | state | ||
) |
Century Enable function.
Function is used to enable or disable Century Enable Interrupt.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | state | : Value enables or disables the property. |
void rtc11_cfg_setup | ( | rtc11_cfg_t * | cfg | ) |
RTC 11 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See rtc11_cfg_t object definition for detailed explanation. |
uint8_t rtc11_check_irq_1 | ( | rtc11_t * | ctx | ) |
Check Interrupt 1 pin function.
Function is used to check if an interrupt has occured.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_check_irq_2 | ( | rtc11_t * | ctx | ) |
Check Interrupt 2 pin function.
Function is used to check if an interrupt has occured.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
void rtc11_ext_int | ( | rtc11_t * | ctx, |
uint8_t | state | ||
) |
External interrupt function.
Function is used to set the state of the External interrupt input pin.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | state | : Value defines the state of the pin. |
void rtc11_generic_read | ( | rtc11_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rd_data, | ||
uint16_t | n_len | ||
) |
RTC 11 data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rd_data | : Output read data. |
[in] | n_len | : Number of bytes to be read. |
void rtc11_generic_write | ( | rtc11_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | wr_data, | ||
uint16_t | n_len | ||
) |
RTC 11 data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | wr_data | : Data to be written. |
[in] | n_len | : Number of bytes to be written. |
uint8_t rtc11_get_ala_date_day | ( | rtc11_t * | ctx | ) |
Get alarm time days function.
Function is used to get the alarm time days.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_get_ala_date_month | ( | rtc11_t * | ctx | ) |
Get alarm time month function.
Function is used to get the alarm time month.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_get_ala_day_of_the_week | ( | rtc11_t * | ctx | ) |
Get alarm time day of the week function.
Function is used to get the alarm time day of the week.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_get_ala_time_hours | ( | rtc11_t * | ctx | ) |
Get alarm time hours function.
Function is used to get the alarm time hours.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_get_ala_time_hundredths | ( | rtc11_t * | ctx | ) |
Get alarm time hundredths function.
Function is used to get the alarm time hundredths of a second.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_get_ala_time_minutes | ( | rtc11_t * | ctx | ) |
Get alarm time minutes function.
Function is used to get the alarm time minutes.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_get_ala_time_seconds | ( | rtc11_t * | ctx | ) |
Get alarm time seconds function.
Function is used to get the alarm time seconds.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_get_century_flag | ( | rtc11_t * | ctx | ) |
Get century flag function.
Function is used to get the century flag.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
void rtc11_get_date | ( | rtc11_t * | ctx, |
rtc11_date_t * | rtc_date | ||
) |
Get date day of the week, day, month and year function.
Function is used to get system date.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[out] | rtc_date | : Date structure See rtc11_date_t object definition for detailed explanation. |
uint8_t rtc11_get_date_day | ( | rtc11_t * | ctx | ) |
Get day function.
Function is used to get the days.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_get_date_month | ( | rtc11_t * | ctx | ) |
Get month function.
Function is used to get the month
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_get_date_year | ( | rtc11_t * | ctx | ) |
Get year function.
Function is used to get the year.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_get_day_of_the_week | ( | rtc11_t * | ctx | ) |
Get day of the week function.
Function is used to get the day of the week.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
void rtc11_get_time | ( | rtc11_t * | ctx, |
rtc11_time_t * | rtc_time | ||
) |
Get time hours, minutes and seconds function.
Function is used to get current system time.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[out] | rtc_time | : Time structure See rtc11_time_t object definition for detailed explanation. |
uint8_t rtc11_get_time_hours | ( | rtc11_t * | ctx | ) |
Get hours function.
Function is used to get the hours.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_get_time_hundredths | ( | rtc11_t * | ctx | ) |
Get hundredths function.
Function is used to get the hundredths of a second.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_get_time_minutes | ( | rtc11_t * | ctx | ) |
Get minutes function.
Function is used to get the minutes.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
uint8_t rtc11_get_time_seconds | ( | rtc11_t * | ctx | ) |
Get seconds function.
Function is used to get the seconds.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
err_t rtc11_init | ( | rtc11_t * | ctx, |
rtc11_cfg_t * | cfg | ||
) |
RTC 11 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See rtc11_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void rtc11_set_ala_date_day | ( | rtc11_t * | ctx, |
uint8_t | date_day | ||
) |
Set alarm time day function.
Function is used to set alarm time days.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | date_day | : Value defines alarm time day. |
void rtc11_set_ala_date_month | ( | rtc11_t * | ctx, |
uint8_t | date_mth | ||
) |
Set alarm time month function.
Function is used to set alarm time months.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | date_mth | : Value defines alarm time month. |
void rtc11_set_ala_day_of_the_week | ( | rtc11_t * | ctx, |
uint8_t | w_day | ||
) |
Set alarm time day of the week function.
Function is used to set alarm time day of the week.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | w_day | : Value defines alarm time day of the week. |
void rtc11_set_ala_time_hours | ( | rtc11_t * | ctx, |
uint8_t | hours | ||
) |
Set alarm time hours function.
Function is used to set alarm time hours.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | hours | : Value defines alarm time hours. |
void rtc11_set_ala_time_hundredths | ( | rtc11_t * | ctx, |
uint8_t | hundredths | ||
) |
Set alarm time hundredths function.
Function is used to set alarm time hundredths of a second.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | hundredths | : Value defines alarm time hundredths of a second. |
void rtc11_set_ala_time_minutes | ( | rtc11_t * | ctx, |
uint8_t | minutes | ||
) |
Set alarm time minutes function.
Function is used to set alarm time minutes.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | minutes | : Value defines alarm time minutes. |
void rtc11_set_ala_time_seconds | ( | rtc11_t * | ctx, |
uint8_t | seconds | ||
) |
Set alarm time seconds function.
Function is used to set alarm time seconds.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | seconds | : Value defines alarm time seconds. |
err_t rtc11_set_date | ( | rtc11_t * | ctx, |
rtc11_date_t | rtc_date | ||
) |
Set date day of the week, day, month and year function.
Function is used to set system date.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | rtc_date | : Date structure See rtc11_date_t object definition for detailed explanation. |
0
- Success, -1
- Error.void rtc11_set_date_day | ( | rtc11_t * | ctx, |
uint8_t | date_day | ||
) |
Set day function.
Function is used to set the days.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | date_day | : Value defines days. |
void rtc11_set_date_month | ( | rtc11_t * | ctx, |
uint8_t | date_mth | ||
) |
Set month function.
Function is used to set the month
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | date_mth | : Value defines month. |
void rtc11_set_date_year | ( | rtc11_t * | ctx, |
uint16_t | date_yrs | ||
) |
Set year function.
Function is used to set the year.
[in] | date_yrs | value defines year. |
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
void rtc11_set_day_of_the_week | ( | rtc11_t * | ctx, |
uint8_t | w_day | ||
) |
Set day of the week function.
Function is used to set the day of the week.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | w_day | value defines day of the week. |
err_t rtc11_set_time | ( | rtc11_t * | ctx, |
rtc11_time_t | rtc_time | ||
) |
Set time hours, minutes and seconds function.
Function is used to set system time.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | rtc_time | : Time structure See rtc11_time_t object definition for detailed explanation. |
0
- Success, -1
- Error.void rtc11_set_time_hours | ( | rtc11_t * | ctx, |
uint8_t | hours | ||
) |
Set hours function.
Function is used to set the hours.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | hours | : Value defines hours. |
void rtc11_set_time_hundredths | ( | rtc11_t * | ctx, |
uint8_t | hundredths | ||
) |
Set hundredths function.
Function is used to set the hundredths of a second.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | hundredths | : Value defines the hundredths of a second. |
void rtc11_set_time_minutes | ( | rtc11_t * | ctx, |
uint8_t | minutes | ||
) |
Set minutes function.
Function is used to set the minutes.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | minutes | : Value defines minutes. |
void rtc11_set_time_seconds | ( | rtc11_t * | ctx, |
uint8_t | seconds | ||
) |
Set seconds function.
Function is used to set the seconds.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | seconds | : Value defines seconds. |
void rtc11_soft_rst | ( | rtc11_t * | ctx | ) |
Software Reset function.
Function is used to perform software reset.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
void rtc11_stp_sys_slk | ( | rtc11_t * | ctx, |
uint8_t | state | ||
) |
Stop the clocking system function.
Function is used to start or stop clocking system.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | state | : Value enables or disables the property. |
void rtc11_timer_int_en | ( | rtc11_t * | ctx, |
uint8_t | state | ||
) |
Timer Interrupt Enable function.
Function is used to enable or disable Timer Interrupt.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | state | : Value enables or disables the property. |
void rtc11_wdi | ( | rtc11_t * | ctx, |
uint8_t | state | ||
) |
Watchdog reset function.
Function is used to set the state of the Watchdog reset input pin.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | state | : Value defines the state of the pin. |
void rtc11_write_rtc | ( | rtc11_t * | ctx, |
uint8_t | state | ||
) |
Write RTC enable function.
Function is used to enable or disable write to RTC.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | state | : Value enables or disables the property. |
void rtc11_xt1_int_en | ( | rtc11_t * | ctx, |
uint8_t | state | ||
) |
XT1 Interrupt Enable function.
Function is used to enable or disable XT1 Interrupt Enable.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | state | : Value enables or disables the property. |
void rtc11_xt2_int_en | ( | rtc11_t * | ctx, |
uint8_t | state | ||
) |
XT2 Interrupt Enable function.
Function is used to enable or disable XT2 Interrupt Enable.
[in] | ctx | : Click context object. See rtc11_t object definition for detailed explanation. |
[in] | state | : Value enables or disables the property. |