rtc19 2.1.0.0
RTC 19 Click Driver

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

Topics

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

Functions

void rtc19_cfg_setup (rtc19_cfg_t *cfg)
 RTC 19 configuration object setup function.
 
err_t rtc19_init (rtc19_t *ctx, rtc19_cfg_t *cfg)
 RTC 19 initialization function.
 
err_t rtc19_default_cfg (rtc19_t *ctx)
 RTC 19 default configuration function.
 
err_t rtc19_generic_write (rtc19_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 RTC 19 I2C writing function.
 
err_t rtc19_generic_read (rtc19_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 RTC 19 I2C reading function.
 
err_t rtc19_write_register (rtc19_t *ctx, uint8_t reg, uint8_t data_in)
 RTC 19 write register function.
 
err_t rtc19_read_register (rtc19_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 19 read register function.
 
void rtc19_set_din_pin (rtc19_t *ctx, uint8_t state)
 RTC 19 set din pin function.
 
uint8_t rtc19_get_psw_pin (rtc19_t *ctx)
 RTC 19 get psw pin function.
 
uint8_t rtc19_get_inta_pin (rtc19_t *ctx)
 RTC 19 get inta pin function.
 
uint8_t rtc19_get_intb_pin (rtc19_t *ctx)
 RTC 19 get intb pin function.
 
err_t rtc19_set_time (rtc19_t *ctx, rtc19_time_t *time)
 RTC 19 set time function.
 
err_t rtc19_read_time (rtc19_t *ctx, rtc19_time_t *time)
 RTC 19 read time function.
 
err_t rtc19_set_date (rtc19_t *ctx, rtc19_date_t *date)
 RTC 19 set date function.
 
err_t rtc19_read_date (rtc19_t *ctx, rtc19_date_t *date)
 RTC 19 read date function.
 
err_t rtc19_reset_device (rtc19_t *ctx)
 RTC 19 reset device function.
 
err_t rtc19_clear_interrupts (rtc19_t *ctx)
 RTC 19 clear interrupts function.
 

Detailed Description

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

◆ rtc19_cfg_setup()

void rtc19_cfg_setup ( rtc19_cfg_t * cfg)

RTC 19 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ rtc19_clear_interrupts()

err_t rtc19_clear_interrupts ( rtc19_t * ctx)

RTC 19 clear interrupts function.

This function clears interrupts by reading the STATUS register.

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

◆ rtc19_default_cfg()

err_t rtc19_default_cfg ( rtc19_t * ctx)

RTC 19 default configuration function.

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

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

◆ rtc19_generic_read()

err_t rtc19_generic_read ( rtc19_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

RTC 19 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 rtc19_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.

◆ rtc19_generic_write()

err_t rtc19_generic_write ( rtc19_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

RTC 19 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 rtc19_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.

◆ rtc19_get_inta_pin()

uint8_t rtc19_get_inta_pin ( rtc19_t * ctx)

RTC 19 get inta pin function.

This function returns the INTA pin logic state.

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

◆ rtc19_get_intb_pin()

uint8_t rtc19_get_intb_pin ( rtc19_t * ctx)

RTC 19 get intb pin function.

This function returns the INTB pin logic state.

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

◆ rtc19_get_psw_pin()

uint8_t rtc19_get_psw_pin ( rtc19_t * ctx)

RTC 19 get psw pin function.

This function returns the PSW pin logic state.

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

◆ rtc19_init()

err_t rtc19_init ( rtc19_t * ctx,
rtc19_cfg_t * cfg )

RTC 19 initialization function.

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

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

◆ rtc19_read_date()

err_t rtc19_read_date ( rtc19_t * ctx,
rtc19_date_t * date )

RTC 19 read date function.

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

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

◆ rtc19_read_register()

err_t rtc19_read_register ( rtc19_t * ctx,
uint8_t reg,
uint8_t * data_out )

RTC 19 read register function.

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

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

◆ rtc19_read_time()

err_t rtc19_read_time ( rtc19_t * ctx,
rtc19_time_t * time )

RTC 19 read time function.

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

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

◆ rtc19_reset_device()

err_t rtc19_reset_device ( rtc19_t * ctx)

RTC 19 reset device function.

This function performs the device reset by writing to the RTC_RESET register.

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

◆ rtc19_set_date()

err_t rtc19_set_date ( rtc19_t * ctx,
rtc19_date_t * date )

RTC 19 set date function.

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

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

◆ rtc19_set_din_pin()

void rtc19_set_din_pin ( rtc19_t * ctx,
uint8_t state )

RTC 19 set din pin function.

This function sets the DIN pin logic state.

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

◆ rtc19_set_time()

err_t rtc19_set_time ( rtc19_t * ctx,
rtc19_time_t * time )

RTC 19 set time function.

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

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

◆ rtc19_write_register()

err_t rtc19_write_register ( rtc19_t * ctx,
uint8_t reg,
uint8_t data_in )

RTC 19 write register function.

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

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