rtc15 2.2.0
Loading...
Searching...
No Matches
RTC 15 Click Driver

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

Topics

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

Functions

void rtc15_cfg_setup (rtc15_cfg_t *cfg)
 RTC 15 configuration object setup function.
err_t rtc15_init (rtc15_t *ctx, rtc15_cfg_t *cfg)
 RTC 15 initialization function.
err_t rtc15_default_cfg (rtc15_t *ctx)
 RTC 15 default configuration function.
err_t rtc15_write_regs (rtc15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 RTC 15 write multiple registers function.
err_t rtc15_read_regs (rtc15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 RTC 15 read multiple registers function.
err_t rtc15_write_reg (rtc15_t *ctx, uint8_t reg, uint8_t data_in)
 RTC 15 write single register function.
err_t rtc15_read_reg (rtc15_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 15 read single register function.
void rtc15_enable_device (rtc15_t *ctx)
 RTC 15 enable device function.
void rtc15_disable_device (rtc15_t *ctx)
 RTC 15 disable device function.
void rtc15_enable_clkout (rtc15_t *ctx)
 RTC 15 enable clock output function.
void rtc15_disable_clkout (rtc15_t *ctx)
 RTC 15 disable clock output function.
uint8_t rtc15_get_int_pin (rtc15_t *ctx)
 RTC 15 get interrupt pin function.
err_t rtc15_check_communication (rtc15_t *ctx)
 RTC 15 check communication function.
err_t rtc15_set_time (rtc15_t *ctx, rtc15_time_t *time)
 RTC 15 set time function.
err_t rtc15_read_time (rtc15_t *ctx, rtc15_time_t *time)
 RTC 15 read time function.
err_t rtc15_set_date (rtc15_t *ctx, rtc15_date_t *date)
 RTC 15 set date function.
err_t rtc15_read_date (rtc15_t *ctx, rtc15_date_t *date)
 RTC 15 read date function.

Detailed Description

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

◆ rtc15_cfg_setup()

void rtc15_cfg_setup ( rtc15_cfg_t * cfg)

RTC 15 configuration object setup function.

This function initializes Click configuration structure to initial values.

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

◆ rtc15_check_communication()

err_t rtc15_check_communication ( rtc15_t * ctx)

RTC 15 check communication function.

This function performs a write-read test on the RAM register to verify communication.

Parameters
[in]ctx: Click context object. See rtc15_t object definition for detailed explanation.
Returns
  • 0 - Success (communication established),
  • -1 - Error.
Note
None.

◆ rtc15_default_cfg()

err_t rtc15_default_cfg ( rtc15_t * ctx)

RTC 15 default configuration function.

This function executes a default configuration of RTC 15 Click board.

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

◆ rtc15_disable_clkout()

void rtc15_disable_clkout ( rtc15_t * ctx)

RTC 15 disable clock output function.

This function sets the CLE pin to low logic state.

Parameters
[in]ctx: Click context object. See rtc15_t object definition for detailed explanation.
Note
None.

◆ rtc15_disable_device()

void rtc15_disable_device ( rtc15_t * ctx)

RTC 15 disable device function.

This function sets the EN pin to low logic state.

Parameters
[in]ctx: Click context object. See rtc15_t object definition for detailed explanation.
Note
None.

◆ rtc15_enable_clkout()

void rtc15_enable_clkout ( rtc15_t * ctx)

RTC 15 enable clock output function.

This function sets the CLE pin to high logic state.

Parameters
[in]ctx: Click context object. See rtc15_t object definition for detailed explanation.
Note
None.

◆ rtc15_enable_device()

void rtc15_enable_device ( rtc15_t * ctx)

RTC 15 enable device function.

This function sets the EN pin to high logic state.

Parameters
[in]ctx: Click context object. See rtc15_t object definition for detailed explanation.
Note
None.

◆ rtc15_get_int_pin()

uint8_t rtc15_get_int_pin ( rtc15_t * ctx)

RTC 15 get interrupt pin function.

This function returns the logic state of the INT pin.

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

◆ rtc15_init()

err_t rtc15_init ( rtc15_t * ctx,
rtc15_cfg_t * cfg )

RTC 15 initialization function.

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

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

◆ rtc15_read_date()

err_t rtc15_read_date ( rtc15_t * ctx,
rtc15_date_t * date )

RTC 15 read date function.

This function reads the current date (day, day of week, month, year) from the RTC.

Parameters
[in]ctx: Click context object. See rtc15_t object definition for detailed explanation.
[out]date: Pointer to the date structure to store the read values. See rtc15_date_t object definition for structure fields.
Returns
  • 0 - Success,
  • -1 - Error.
Note
Date values are returned in decimal format.

◆ rtc15_read_reg()

err_t rtc15_read_reg ( rtc15_t * ctx,
uint8_t reg,
uint8_t * data_out )

RTC 15 read single register function.

This function reads a single byte from the selected register.

Parameters
[in]ctx: Click context object. See rtc15_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Pointer to the memory to store the read byte.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ rtc15_read_regs()

err_t rtc15_read_regs ( rtc15_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

RTC 15 read multiple registers function.

This function reads a sequence of bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See rtc15_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Pointer to the buffer to store read data.
[in]len: Number of bytes to read.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ rtc15_read_time()

err_t rtc15_read_time ( rtc15_t * ctx,
rtc15_time_t * time )

RTC 15 read time function.

This function reads the current time (hours, minutes, seconds) from the RTC.

Parameters
[in]ctx: Click context object. See rtc15_t object definition for detailed explanation.
[out]time: Pointer to the time structure to store the read values. See rtc15_time_t object definition for structure fields.
Returns
  • 0 - Success,
  • -1 - Error.
Note
Time values are returned in decimal format.

◆ rtc15_set_date()

err_t rtc15_set_date ( rtc15_t * ctx,
rtc15_date_t * date )

RTC 15 set date function.

This function sets the current date (day, day of week, month, year) in the RTC.

Parameters
[in]ctx: Click context object. See rtc15_t object definition for detailed explanation.
[in]date: Pointer to the date structure. See rtc15_date_t object definition for structure fields.
Returns
  • 0 - Success,
  • -1 - Error.
Note
Date values must be provided in decimal format.

◆ rtc15_set_time()

err_t rtc15_set_time ( rtc15_t * ctx,
rtc15_time_t * time )

RTC 15 set time function.

This function sets the current time (hours, minutes, seconds) in the RTC.

Parameters
[in]ctx: Click context object. See rtc15_t object definition for detailed explanation.
[in]time: Pointer to the time structure. See rtc15_time_t object definition for structure fields.
Returns
  • 0 - Success,
  • -1 - Error.
Note
Time values must be provided in decimal format.

◆ rtc15_write_reg()

err_t rtc15_write_reg ( rtc15_t * ctx,
uint8_t reg,
uint8_t data_in )

RTC 15 write single register function.

This function writes a single byte to the selected register.

Parameters
[in]ctx: Click context object. See rtc15_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data byte to write.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ rtc15_write_regs()

err_t rtc15_write_regs ( rtc15_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

RTC 15 write multiple registers function.

This function writes a sequence of bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See rtc15_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Pointer to the data to be written.
[in]len: Number of bytes to write.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.