rtc4 2.0.0.0
|
API for configuring and manipulating RTC 4 Click driver. More...
Topics | |
RTC 4 Commands List | |
List of commands of RTC 4 Click driver. | |
RTC 4 time values list. | |
List of time values. | |
RTC 4 Settings | |
Settings of RTC 4 Click driver. | |
RTC 4 MikroBUS Map | |
MikroBUS pin mapping of RTC 4 Click driver. | |
Functions | |
void | rtc4_cfg_setup (rtc4_cfg_t *cfg) |
RTC 4 configuration object setup function. | |
void | rtc4_gpio_selection (rtc4_cfg_t *cfg, rtc4_gpio_sel_t gpio_sel) |
RTC 4 driver interface setup function. | |
err_t | rtc4_init (rtc4_t *ctx, rtc4_cfg_t *cfg) |
RTC 4 initialization function. | |
err_t | rtc4_check_communication (rtc4_t *ctx) |
RTC 4 check communication function. | |
uint8_t | rtc4_get_interrupt (rtc4_t *ctx) |
RTC 4 get interrupt function. | |
err_t | rtc4_set_unix_and_int (rtc4_t *ctx, uint32_t unix_time, uint8_t int_interval) |
RTC 4 set unix and interrupt interval function. | |
err_t | rtc4_get_unix_time (rtc4_t *ctx, uint32_t *unix_time) |
RTC 4 get unix time function. | |
void | rtc4_unix_to_date_time (uint32_t unix_time, rtc4_time_t *time, rtc4_date_t *date) |
RTC 4 unix to date time function. | |
void | rtc4_date_time_to_unix (rtc4_date_t *date, rtc4_time_t *time, uint32_t *unix_time) |
RTC 4 date time to unix function. | |
err_t | rtc4_set_date_time (rtc4_t *ctx, rtc4_date_t *date, rtc4_time_t *time, uint8_t int_interval) |
RTC 4 set date time function. | |
err_t | rtc4_get_date_time (rtc4_t *ctx, rtc4_date_t *date, rtc4_time_t *time) |
RTC 4 get date time function. | |
API for configuring and manipulating RTC 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void rtc4_cfg_setup | ( | rtc4_cfg_t * | cfg | ) |
RTC 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See rtc4_cfg_t object definition for detailed explanation. |
err_t rtc4_check_communication | ( | rtc4_t * | ctx | ) |
RTC 4 check communication function.
This function checks the communication by reading the ROM address as well as verifying family code and Maxim CRC 8.
[in] | ctx | : Click context object. See rtc4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void rtc4_date_time_to_unix | ( | rtc4_date_t * | date, |
rtc4_time_t * | time, | ||
uint32_t * | unix_time ) |
RTC 4 date time to unix function.
This function converts date time to the unix time.
[in] | date | : Pointing to the address from where to get date. See rtc4_date_t object definition for detailed explanation. |
[in] | time | : Pointing to the address from where to get time. See rtc4_time_t object definition for detailed explanation. |
[out] | unix_time | : Pointing to the address where to store unix time. |
err_t rtc4_get_date_time | ( | rtc4_t * | ctx, |
rtc4_date_t * | date, | ||
rtc4_time_t * | time ) |
RTC 4 get date time function.
This function gets RTC4 time and date structure.
[in] | ctx | : Click context object. |
[out] | date | : Pointing to the address where to store date. See rtc4_date_t object definition for detailed explanation. |
[out] | time | : Pointing to the address where to store time. See rtc4_time_t object definition for detailed explanation. |
0
- Success, -1
- Error. uint8_t rtc4_get_interrupt | ( | rtc4_t * | ctx | ) |
RTC 4 get interrupt function.
This function checks the interrupt state of the DS2417 Real time clock/calendar.
[in] | ctx | : Click context object. See rtc4_t object definition for detailed explanation. |
0
- INT pin state low, 1
- INT pin state high. err_t rtc4_get_unix_time | ( | rtc4_t * | ctx, |
uint32_t * | unix_time ) |
RTC 4 get unix time function.
This function gets unix time of the DS2417 Real time clock/calender.
[in] | ctx | : Click context object. See rtc4_t object definition for detailed explanation. |
[out] | unix_time | : Pointing to the address where to store unix time. |
0
- Success, -1
- Error.void rtc4_gpio_selection | ( | rtc4_cfg_t * | cfg, |
rtc4_gpio_sel_t | gpio_sel ) |
RTC 4 driver interface setup function.
This function sets a communication GPIO pin which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See rtc4_cfg_t object definition for detailed explanation. |
[in] | gpio_sel | : GPIO pin selection. See rtc4_gpio_sel_t object definition for detailed explanation. |
err_t rtc4_init | ( | rtc4_t * | ctx, |
rtc4_cfg_t * | cfg ) |
RTC 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See rtc4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See rtc4_cfg_t object definition for detailed explanation. |
err_t rtc4_set_date_time | ( | rtc4_t * | ctx, |
rtc4_date_t * | date, | ||
rtc4_time_t * | time, | ||
uint8_t | int_interval ) |
RTC 4 set date time function.
This function sets date and time structure along with interrupt interval.
[in] | ctx | : Click context object. |
[in] | date | : Pointing to the address from where to set date. See rtc4_date_t object definition for detailed explanation. |
[in] | time | : Pointing to the address from where to set date. See rtc4_time_t object definition for detailed explanation. |
[in] | int_interval | : Interrupt interval. |
0
- Success, -1
- Error. err_t rtc4_set_unix_and_int | ( | rtc4_t * | ctx, |
uint32_t | unix_time, | ||
uint8_t | int_interval ) |
RTC 4 set unix and interrupt interval function.
This function sets both unix time and interrupt interval.
[in] | ctx | : Click context object. See rtc4_t object definition for detailed explanation. |
[in] | unix_time | : Unix time we want to set. |
[in] | int_interval | : Interrupt interval we want to set. |
0
- Success, -1
- Error. void rtc4_unix_to_date_time | ( | uint32_t | unix_time, |
rtc4_time_t * | time, | ||
rtc4_date_t * | date ) |
RTC 4 unix to date time function.
This function converts unix time to the human-readable format.
[in] | unix_time | : Unix time we want to convert. |
[out] | time | : Pointing to the address where to store time. See rtc4_time_t object definition for detailed explanation. |
[out] | date | : Pointing to the address where to store date. See rtc4_date_t object definition for detailed explanation. |