rtc21
2.1.0.0
|
API for configuring and manipulating RTC 21 Click driver. More...
Modules | |
RTC 21 Registers List | |
List of registers of RTC 21 Click driver. | |
RTC 21 Registers Settings | |
Settings for registers of RTC 21 Click driver. | |
RTC 21 MikroBUS Map | |
MikroBUS pin mapping of RTC 21 Click driver. | |
Functions | |
void | rtc21_cfg_setup (rtc21_cfg_t *cfg) |
RTC 21 configuration object setup function. More... | |
err_t | rtc21_init (rtc21_t *ctx, rtc21_cfg_t *cfg) |
RTC 21 initialization function. More... | |
err_t | rtc21_generic_write (rtc21_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
RTC 21 I2C writing function. More... | |
err_t | rtc21_generic_read (rtc21_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
RTC 21 I2C reading function. More... | |
err_t | rtc21_write_register (rtc21_t *ctx, uint8_t reg, uint8_t data_in) |
RTC 21 write register function. More... | |
err_t | rtc21_read_register (rtc21_t *ctx, uint8_t reg, uint8_t *data_out) |
RTC 21 read register function. More... | |
uint8_t | rtc21_get_ft_pin (rtc21_t *ctx) |
RTC 21 get ft pin function. More... | |
err_t | rtc21_set_time (rtc21_t *ctx, rtc21_time_t *time) |
RTC 21 set time function. More... | |
err_t | rtc21_read_time (rtc21_t *ctx, rtc21_time_t *time) |
RTC 21 read time function. More... | |
err_t | rtc21_set_date (rtc21_t *ctx, rtc21_date_t *date) |
RTC 21 set date function. More... | |
err_t | rtc21_read_date (rtc21_t *ctx, rtc21_date_t *date) |
RTC 21 read date function. More... | |
API for configuring and manipulating RTC 21 Click driver.
void rtc21_cfg_setup | ( | rtc21_cfg_t * | cfg | ) |
RTC 21 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See rtc21_cfg_t object definition for detailed explanation. |
err_t rtc21_generic_read | ( | rtc21_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
RTC 21 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 rtc21_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 rtc21_generic_write | ( | rtc21_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
RTC 21 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 rtc21_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 rtc21_get_ft_pin | ( | rtc21_t * | ctx | ) |
RTC 21 get ft pin function.
This function returns the FT/OUT pin logic state.
[in] | ctx | : Click context object. See rtc21_t object definition for detailed explanation. |
err_t rtc21_init | ( | rtc21_t * | ctx, |
rtc21_cfg_t * | cfg | ||
) |
RTC 21 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See rtc21_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See rtc21_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rtc21_read_date | ( | rtc21_t * | ctx, |
rtc21_date_t * | date | ||
) |
RTC 21 read date function.
This function reads the current date values - day of week, day, month and year.
[in] | ctx | : Click context object. See rtc21_t object definition for detailed explanation. |
[out] | date | : Date object structure. See rtc21_date_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rtc21_read_register | ( | rtc21_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
RTC 21 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See rtc21_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rtc21_read_time | ( | rtc21_t * | ctx, |
rtc21_time_t * | time | ||
) |
RTC 21 read time function.
This function reads the current time values - second, minute and hour.
[in] | ctx | : Click context object. See rtc21_t object definition for detailed explanation. |
[out] | time | : Time object structure. See rtc21_time_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rtc21_set_date | ( | rtc21_t * | ctx, |
rtc21_date_t * | date | ||
) |
RTC 21 set date function.
This function sets the starting date values - day of week, day, month and year.
[in] | ctx | : Click context object. See rtc21_t object definition for detailed explanation. |
[in] | date | : Date object structure that carries day of week, day, month and year values in Decimal format. See rtc21_date_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rtc21_set_time | ( | rtc21_t * | ctx, |
rtc21_time_t * | time | ||
) |
RTC 21 set time function.
This function sets the starting time values - second, minute and hour.
[in] | ctx | : Click context object. See rtc21_t object definition for detailed explanation. |
[in] | time | : Time object structure that carries second, minute and hour values in Decimal format. See rtc21_time_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rtc21_write_register | ( | rtc21_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
RTC 21 write register function.
This function writes data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See rtc21_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.