rtc17 2.0.0.0
RTC 17 Click Driver

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

Topics

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

Functions

void rtc17_cfg_setup (rtc17_cfg_t *cfg)
 RTC 17 configuration object setup function.
 
err_t rtc17_init (rtc17_t *ctx, rtc17_cfg_t *cfg)
 RTC 17 initialization function.
 
err_t rtc17_default_cfg (rtc17_t *ctx)
 RTC 17 default configuration function.
 
err_t rtc17_write_register (rtc17_t *ctx, uint8_t reg, uint8_t data_in)
 RTC 17 write register function.
 
err_t rtc17_write_multiple_registers (rtc17_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 RTC 17 write multiple registers function.
 
err_t rtc17_read_register (rtc17_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 17 read register function.
 
err_t rtc17_read_multiple_registers (rtc17_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 RTC 17 read multiple registers function.
 
uint8_t rtc17_get_int_pin (rtc17_t *ctx)
 RTC 17 get int pin function.
 
err_t rtc17_clear_interrupts (rtc17_t *ctx)
 RTC 17 clear interrupts function.
 
err_t rtc17_set_time (rtc17_t *ctx, rtc17_time_t *time)
 RTC 17 set time function.
 
err_t rtc17_read_time (rtc17_t *ctx, rtc17_time_t *time)
 RTC 17 read time function.
 
err_t rtc17_set_date (rtc17_t *ctx, rtc17_date_t *date)
 RTC 17 set date function.
 
err_t rtc17_read_date (rtc17_t *ctx, rtc17_date_t *date)
 RTC 17 read date function.
 

Detailed Description

API for configuring and manipulating RTC 17 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

◆ rtc17_cfg_setup()

void rtc17_cfg_setup ( rtc17_cfg_t * cfg)

RTC 17 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ rtc17_clear_interrupts()

err_t rtc17_clear_interrupts ( rtc17_t * ctx)

RTC 17 clear interrupts function.

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

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

◆ rtc17_default_cfg()

err_t rtc17_default_cfg ( rtc17_t * ctx)

RTC 17 default configuration function.

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

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

◆ rtc17_get_int_pin()

uint8_t rtc17_get_int_pin ( rtc17_t * ctx)

RTC 17 get int pin function.

This function returns the INT pin logic state.

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

◆ rtc17_init()

err_t rtc17_init ( rtc17_t * ctx,
rtc17_cfg_t * cfg )

RTC 17 initialization function.

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

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

◆ rtc17_read_date()

err_t rtc17_read_date ( rtc17_t * ctx,
rtc17_date_t * date )

RTC 17 read date function.

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

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

◆ rtc17_read_multiple_registers()

err_t rtc17_read_multiple_registers ( rtc17_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

RTC 17 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 rtc17_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.

◆ rtc17_read_register()

err_t rtc17_read_register ( rtc17_t * ctx,
uint8_t reg,
uint8_t * data_out )

RTC 17 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 rtc17_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.

◆ rtc17_read_time()

err_t rtc17_read_time ( rtc17_t * ctx,
rtc17_time_t * time )

RTC 17 read time function.

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

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

◆ rtc17_set_date()

err_t rtc17_set_date ( rtc17_t * ctx,
rtc17_date_t * date )

RTC 17 set date function.

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

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

◆ rtc17_set_time()

err_t rtc17_set_time ( rtc17_t * ctx,
rtc17_time_t * time )

RTC 17 set time function.

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

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

◆ rtc17_write_multiple_registers()

err_t rtc17_write_multiple_registers ( rtc17_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

RTC 17 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 rtc17_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.

◆ rtc17_write_register()

err_t rtc17_write_register ( rtc17_t * ctx,
uint8_t reg,
uint8_t data_in )

RTC 17 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 rtc17_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.