rtc18 2.0.0.0
RTC 18 Click Driver

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

Topics

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

Functions

void rtc18_cfg_setup (rtc18_cfg_t *cfg)
 RTC 18 configuration object setup function.
 
err_t rtc18_init (rtc18_t *ctx, rtc18_cfg_t *cfg)
 RTC 18 initialization function.
 
err_t rtc18_default_cfg (rtc18_t *ctx)
 RTC 18 default configuration function.
 
err_t rtc18_generic_write (rtc18_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 RTC 18 I2C writing function.
 
err_t rtc18_generic_read (rtc18_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 RTC 18 I2C reading function.
 
err_t rtc18_write_register (rtc18_t *ctx, uint8_t reg, uint8_t data_in)
 RTC 18 write register function.
 
err_t rtc18_read_register (rtc18_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 18 read register function.
 
void rtc18_set_evi_pin (rtc18_t *ctx, uint8_t state)
 RTC 18 set EVI pin function.
 
uint8_t rtc18_get_int_pin (rtc18_t *ctx)
 RTC 18 get int pin function.
 
err_t rtc18_clear_periodic_interrupt (rtc18_t *ctx)
 RTC 18 clear periodic interrupt function.
 
err_t rtc18_set_time (rtc18_t *ctx, rtc18_time_t *time)
 RTC 18 set time function.
 
err_t rtc18_read_time (rtc18_t *ctx, rtc18_time_t *time)
 RTC 18 read time function.
 
err_t rtc18_set_date (rtc18_t *ctx, rtc18_date_t *date)
 RTC 18 set date function.
 
err_t rtc18_read_date (rtc18_t *ctx, rtc18_date_t *date)
 RTC 18 read date function.
 
err_t rtc18_read_temperature (rtc18_t *ctx, float *temperature)
 RTC 18 read temperature function.
 
err_t rtc18_write_eeprom (rtc18_t *ctx, uint8_t address, uint8_t data_in)
 RTC 18 write eeprom function.
 
err_t rtc18_read_eeprom (rtc18_t *ctx, uint8_t address, uint8_t *data_out)
 RTC 18 read eeprom function.
 

Detailed Description

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

◆ rtc18_cfg_setup()

void rtc18_cfg_setup ( rtc18_cfg_t * cfg)

RTC 18 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ rtc18_clear_periodic_interrupt()

err_t rtc18_clear_periodic_interrupt ( rtc18_t * ctx)

RTC 18 clear periodic interrupt function.

This function clears the periodic interrupt flag (UF) bit in STATUS register.

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

◆ rtc18_default_cfg()

err_t rtc18_default_cfg ( rtc18_t * ctx)

RTC 18 default configuration function.

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

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

◆ rtc18_generic_read()

err_t rtc18_generic_read ( rtc18_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

RTC 18 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 rtc18_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.

◆ rtc18_generic_write()

err_t rtc18_generic_write ( rtc18_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

RTC 18 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 rtc18_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.

◆ rtc18_get_int_pin()

uint8_t rtc18_get_int_pin ( rtc18_t * ctx)

RTC 18 get int pin function.

This function returns the INT pin logic state.

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

◆ rtc18_init()

err_t rtc18_init ( rtc18_t * ctx,
rtc18_cfg_t * cfg )

RTC 18 initialization function.

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

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

◆ rtc18_read_date()

err_t rtc18_read_date ( rtc18_t * ctx,
rtc18_date_t * date )

RTC 18 read date function.

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

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

◆ rtc18_read_eeprom()

err_t rtc18_read_eeprom ( rtc18_t * ctx,
uint8_t address,
uint8_t * data_out )

RTC 18 read eeprom function.

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

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

◆ rtc18_read_register()

err_t rtc18_read_register ( rtc18_t * ctx,
uint8_t reg,
uint8_t * data_out )

RTC 18 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 rtc18_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.

◆ rtc18_read_temperature()

err_t rtc18_read_temperature ( rtc18_t * ctx,
float * temperature )

RTC 18 read temperature function.

This function reads temperature measurements in Celsius.

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

◆ rtc18_read_time()

err_t rtc18_read_time ( rtc18_t * ctx,
rtc18_time_t * time )

RTC 18 read time function.

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

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

◆ rtc18_set_date()

err_t rtc18_set_date ( rtc18_t * ctx,
rtc18_date_t * date )

RTC 18 set date function.

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

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

◆ rtc18_set_evi_pin()

void rtc18_set_evi_pin ( rtc18_t * ctx,
uint8_t state )

RTC 18 set EVI pin function.

This function sets the EVI pin logic state.

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

◆ rtc18_set_time()

err_t rtc18_set_time ( rtc18_t * ctx,
rtc18_time_t * time )

RTC 18 set time function.

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

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

◆ rtc18_write_eeprom()

err_t rtc18_write_eeprom ( rtc18_t * ctx,
uint8_t address,
uint8_t data_in )

RTC 18 write eeprom function.

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

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

◆ rtc18_write_register()

err_t rtc18_write_register ( rtc18_t * ctx,
uint8_t reg,
uint8_t data_in )

RTC 18 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 rtc18_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.