rtc16 2.0.0.0
RTC 16 Click Driver

API for configuring and manipulating RTC 16 Click driver. More...

Topics

 RTC 16 Registers List
 List of registers of RTC 16 Click driver.
 
 RTC 16 Registers Settings
 Settings for registers of RTC 16 Click driver.
 
 RTC 16 MikroBUS Map
 MikroBUS pin mapping of RTC 16 Click driver.
 

Functions

void rtc16_cfg_setup (rtc16_cfg_t *cfg)
 RTC 16 configuration object setup function.
 
err_t rtc16_init (rtc16_t *ctx, rtc16_cfg_t *cfg)
 RTC 16 initialization function.
 
err_t rtc16_default_cfg (rtc16_t *ctx)
 RTC 16 default configuration function.
 
err_t rtc16_write_register (rtc16_t *ctx, uint8_t reg, uint8_t data_in)
 RTC 16 write register function.
 
err_t rtc16_write_multiple_registers (rtc16_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 RTC 16 write multiple registers function.
 
err_t rtc16_read_register (rtc16_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 16 read register function.
 
err_t rtc16_read_register_fast (rtc16_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 16 read register fast function.
 
err_t rtc16_read_multiple_registers (rtc16_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 RTC 16 read multiple registers function.
 
err_t rtc16_read_multiple_registers_fast (rtc16_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 RTC 16 read multiple registers fast function.
 
uint8_t rtc16_get_int_pin (rtc16_t *ctx)
 RTC 16 get int pin function.
 
err_t rtc16_clear_interrupts (rtc16_t *ctx)
 RTC 16 clear interrupts function.
 
err_t rtc16_set_time (rtc16_t *ctx, rtc16_time_t *time)
 RTC 16 set time function.
 
err_t rtc16_read_time (rtc16_t *ctx, rtc16_time_t *time)
 RTC 16 read time function.
 
err_t rtc16_set_date (rtc16_t *ctx, rtc16_date_t *date)
 RTC 16 set date function.
 
err_t rtc16_read_date (rtc16_t *ctx, rtc16_date_t *date)
 RTC 16 read date function.
 

Detailed Description

API for configuring and manipulating RTC 16 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ rtc16_cfg_setup()

void rtc16_cfg_setup ( rtc16_cfg_t * cfg)

RTC 16 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ rtc16_clear_interrupts()

err_t rtc16_clear_interrupts ( rtc16_t * ctx)

RTC 16 clear interrupts function.

This function clears the interrupt and alarm flag bits in Control 2 register.

Parameters
[in]ctx: Click context object. See rtc16_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc16_default_cfg()

err_t rtc16_default_cfg ( rtc16_t * ctx)

RTC 16 default configuration function.

This function executes a default configuration of RTC 16 click board.

Parameters
[in]ctx: Click context object. See rtc16_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ rtc16_get_int_pin()

uint8_t rtc16_get_int_pin ( rtc16_t * ctx)

RTC 16 get int pin function.

This function returns the INT pin logic state.

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

◆ rtc16_init()

err_t rtc16_init ( rtc16_t * ctx,
rtc16_cfg_t * cfg )

RTC 16 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See rtc16_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See rtc16_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc16_read_date()

err_t rtc16_read_date ( rtc16_t * ctx,
rtc16_date_t * date )

RTC 16 read date function.

This function reads the current date values - day of week, day, month and year.

Parameters
[in]ctx: Click context object. See rtc16_t object definition for detailed explanation.
[out]date: Date object structure. See rtc16_date_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc16_read_multiple_registers()

err_t rtc16_read_multiple_registers ( rtc16_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

RTC 16 read multiple registers 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 rtc16_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read [up to 16 bytes].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc16_read_multiple_registers_fast()

err_t rtc16_read_multiple_registers_fast ( rtc16_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

RTC 16 read multiple registers fast function.

This function reads a desired number of data bytes starting from the selected register performing fast read command by using I2C serial interface.

Parameters
[in]ctx: Click context object. See rtc16_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read [up to 16 bytes].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc16_read_register()

err_t rtc16_read_register ( rtc16_t * ctx,
uint8_t reg,
uint8_t * data_out )

RTC 16 read register function.

This function reads a data byte from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See rtc16_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.

◆ rtc16_read_register_fast()

err_t rtc16_read_register_fast ( rtc16_t * ctx,
uint8_t reg,
uint8_t * data_out )

RTC 16 read register fast function.

This function reads a data byte from the selected register performing fast read command by using I2C serial interface.

Parameters
[in]ctx: Click context object. See rtc16_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.

◆ rtc16_read_time()

err_t rtc16_read_time ( rtc16_t * ctx,
rtc16_time_t * time )

RTC 16 read time function.

This function reads the current time values - second, minute and hour.

Parameters
[in]ctx: Click context object. See rtc16_t object definition for detailed explanation.
[out]time: Time object structure. See rtc16_time_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc16_set_date()

err_t rtc16_set_date ( rtc16_t * ctx,
rtc16_date_t * date )

RTC 16 set date function.

This function sets the starting date values - day of week, day, month and year.

Parameters
[in]ctx: Click context object. See rtc16_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 rtc16_date_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc16_set_time()

err_t rtc16_set_time ( rtc16_t * ctx,
rtc16_time_t * time )

RTC 16 set time function.

This function sets the starting time values - second, minute and hour.

Parameters
[in]ctx: Click context object. See rtc16_t object definition for detailed explanation.
[in]time: Time object structure that carries second, minute and hour values in Decimal format. See rtc16_time_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc16_write_multiple_registers()

err_t rtc16_write_multiple_registers ( rtc16_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

RTC 16 write multiple registers 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 rtc16_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written [up to 16 bytes].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rtc16_write_register()

err_t rtc16_write_register ( rtc16_t * ctx,
uint8_t reg,
uint8_t data_in )

RTC 16 write register function.

This function writes a desired data byte to the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See rtc16_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.