rtc12 2.0.0.0
RTC 12 Click Driver

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

Topics

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

Functions

void rtc12_cfg_setup (rtc12_cfg_t *cfg)
 RTC 12 configuration object setup function.
 
err_t rtc12_init (rtc12_t *ctx, rtc12_cfg_t *cfg)
 RTC 12 initialization function.
 
err_t rtc12_default_cfg (rtc12_t *ctx)
 RTC 12 default configuration function.
 
err_t rtc12_generic_write (rtc12_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 RTC 12 data writing function.
 
err_t rtc12_generic_read (rtc12_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 RTC 12 data reading function.
 
err_t rtc12_set_ctrl_reg (rtc12_t *ctx, rtc12_control_t rtc_ctrl)
 RTC 12 set control register function.
 
err_t rtc12_get_ctrl_reg (rtc12_t *ctx, rtc12_control_t *rtc_ctrl)
 RTC 12 get control register function.
 
err_t rtc12_get_time (rtc12_t *ctx, rtc12_time_t *rtc_time)
 RTC 12 get time function.
 
err_t rtc12_set_time (rtc12_t *ctx, rtc12_time_t rtc_time)
 RTC 12 set time function.
 
err_t rtc12_get_date (rtc12_t *ctx, rtc12_date_t *rtc_date)
 RTC 12 get date function.
 
err_t rtc12_set_date (rtc12_t *ctx, rtc12_date_t rtc_date)
 RTC 12 get time function.
 
err_t rtc12_get_alarm_0 (rtc12_t *ctx, rtc12_alarm_t *rtc_alarm)
 RTC 12 get alarm 0 function.
 
err_t rtc12_set_alarm_0 (rtc12_t *ctx, rtc12_alarm_t rtc_alarm)
 RTC 12 get alarm 0 function.
 
err_t rtc12_get_alarm_1 (rtc12_t *ctx, rtc12_alarm_t *rtc_alarm)
 RTC 12 get alarm 1 function.
 
err_t rtc12_set_alarm_1 (rtc12_t *ctx, rtc12_alarm_t rtc_alarm)
 RTC 12 get alarm 1 function.
 
uint8_t rtc12_check_int (rtc12_t *ctx)
 RTC 12 check interrupt state function.
 
uint8_t rtc12_check_power_fail (rtc12_t *ctx)
 RTC 12 check power fail state function.
 

Detailed Description

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

◆ rtc12_cfg_setup()

void rtc12_cfg_setup ( rtc12_cfg_t * cfg)

RTC 12 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ rtc12_check_int()

uint8_t rtc12_check_int ( rtc12_t * ctx)

RTC 12 check interrupt state function.

This function check the interrupt state of the DS1343 Low-Current SPI/3-Wire RTCs on the RTC 12 click board™.

Parameters
[in]ctx: Click context object. See rtc12_t object definition for detailed explanation.
Returns
  • 0 - INT pin state low,
  • 1 - INT pin state high.
See #err_t definition for detailed explanation.
Note
None.

◆ rtc12_check_power_fail()

uint8_t rtc12_check_power_fail ( rtc12_t * ctx)

RTC 12 check power fail state function.

This function check the power fail state of the DS1343 Low-Current SPI/3-Wire RTCs on the RTC 12 click board™.

Parameters
[in]ctx: Click context object. See rtc12_t object definition for detailed explanation.
Returns
  • 0 - PF pin state low,
  • 1 - PF pin state high.
See #err_t definition for detailed explanation.
Note
None.

◆ rtc12_default_cfg()

err_t rtc12_default_cfg ( rtc12_t * ctx)

RTC 12 default configuration function.

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

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

◆ rtc12_generic_read()

err_t rtc12_generic_read ( rtc12_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

RTC 12 data reading function.

This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.

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

◆ rtc12_generic_write()

err_t rtc12_generic_write ( rtc12_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

RTC 12 data writing function.

This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.

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

◆ rtc12_get_alarm_0()

err_t rtc12_get_alarm_0 ( rtc12_t * ctx,
rtc12_alarm_t * rtc_alarm )

RTC 12 get alarm 0 function.

This function get RTC alarm 0 structure of the DS1343 Low-Current SPI/3-Wire RTCs on the RTC 12 click board™.

Parameters
[in]ctx: Click context object. See rtc12_t object definition for detailed explanation.
[out]rtc_alarm: Pointer of the RTC alarm 0 structure.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rtc12_get_alarm_1()

err_t rtc12_get_alarm_1 ( rtc12_t * ctx,
rtc12_alarm_t * rtc_alarm )

RTC 12 get alarm 1 function.

This function get RTC alarm 1 structure of the DS1343 Low-Current SPI/3-Wire RTCs on the RTC 12 click board™.

Parameters
[in]ctx: Click context object. See rtc12_t object definition for detailed explanation.
[out]rtc_alarm: Pointer of the RTC alarm 1 structure.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rtc12_get_ctrl_reg()

err_t rtc12_get_ctrl_reg ( rtc12_t * ctx,
rtc12_control_t * rtc_ctrl )

RTC 12 get control register function.

This function get a control register data of the DS1343 Low-Current SPI/3-Wire RTCs on the RTC 12 click board™.

Parameters
[in]ctx: Click context object. See rtc12_t object definition for detailed explanation.
[out]rtc_ctrl: RTC control structure.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rtc12_get_date()

err_t rtc12_get_date ( rtc12_t * ctx,
rtc12_date_t * rtc_date )

RTC 12 get date function.

This function get RTC data structure of the DS1343 Low-Current SPI/3-Wire RTCs on the RTC 12 click board™.

Parameters
[in]ctx: Click context object. See rtc12_t object definition for detailed explanation.
[out]rtc_date: Pointer of the RTC date structure.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rtc12_get_time()

err_t rtc12_get_time ( rtc12_t * ctx,
rtc12_time_t * rtc_time )

RTC 12 get time function.

This function get RTC time data structure of the DS1343 Low-Current SPI/3-Wire RTCs on the RTC 12 click board™.

Parameters
[in]ctx: Click context object. See rtc12_t object definition for detailed explanation.
[out]rtc_time: Pointer of the RTC time structure.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rtc12_init()

err_t rtc12_init ( rtc12_t * ctx,
rtc12_cfg_t * cfg )

RTC 12 initialization function.

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

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

◆ rtc12_set_alarm_0()

err_t rtc12_set_alarm_0 ( rtc12_t * ctx,
rtc12_alarm_t rtc_alarm )

RTC 12 get alarm 0 function.

This function get RTC alarm 0 data structure of the DS1343 Low-Current SPI/3-Wire RTCs on the RTC 12 click board™.

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

◆ rtc12_set_alarm_1()

err_t rtc12_set_alarm_1 ( rtc12_t * ctx,
rtc12_alarm_t rtc_alarm )

RTC 12 get alarm 1 function.

This function get RTC alarm 1 data structure of the DS1343 Low-Current SPI/3-Wire RTCs on the RTC 12 click board™.

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

◆ rtc12_set_ctrl_reg()

err_t rtc12_set_ctrl_reg ( rtc12_t * ctx,
rtc12_control_t rtc_ctrl )

RTC 12 set control register function.

This function sets a control register of the DS1343 Low-Current SPI/3-Wire RTCs on the RTC 12 click board™.

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

◆ rtc12_set_date()

err_t rtc12_set_date ( rtc12_t * ctx,
rtc12_date_t rtc_date )

RTC 12 get time function.

This function get RTC time data structure of the DS1343 Low-Current SPI/3-Wire RTCs on the RTC 12 click board™.

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

◆ rtc12_set_time()

err_t rtc12_set_time ( rtc12_t * ctx,
rtc12_time_t rtc_time )

RTC 12 set time function.

This function set RTC time data structure of the DS1343 Low-Current SPI/3-Wire RTCs on the RTC 12 click board™.

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