rtc21  2.1.0.0
Modules | Functions
RTC 21 Click Driver

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...
 

Detailed Description

API for configuring and manipulating RTC 21 Click driver.

Function Documentation

◆ rtc21_cfg_setup()

void rtc21_cfg_setup ( rtc21_cfg_t cfg)

RTC 21 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See rtc21_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ rtc21_generic_read()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc21_generic_write()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc21_get_ft_pin()

uint8_t rtc21_get_ft_pin ( rtc21_t ctx)

RTC 21 get ft pin function.

This function returns the FT/OUT pin logic state.

Parameters
[in]ctx: Click context object. See rtc21_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ rtc21_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc21_read_date()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc21_read_register()

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.

Parameters
[in]ctx: Click context object. See rtc21_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc21_read_time()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc21_set_date()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc21_set_time()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc21_write_register()

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.

Parameters
[in]ctx: Click context object. See rtc21_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.