rtc2  2.0.0.0
Functions
Public function

Functions

void rtc2_cfg_setup (rtc2_cfg_t *cfg)
 Config Object Initialization function. More...
 
RTC2_RETVAL rtc2_init (rtc2_t *ctx, rtc2_cfg_t *cfg)
 Initialization function. More...
 
void rtc2_generic_write (rtc2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void rtc2_generic_read (rtc2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
uint8_t rtc2_read_byte (rtc2_t *ctx, uint8_t reg_address)
 Generic read byte of data function. More...
 
void rtc2_write_byte (rtc2_t *ctx, uint8_t reg_address, uint8_t write_data)
 Generic write byte of data function. More...
 
void rtc2_enable_counting (rtc2_t *ctx)
 Enable counting function. More...
 
void rtc2_disable_counting (rtc2_t *ctx)
 Disable counting function. More...
 
uint8_t rtc2_get_time_seconds (rtc2_t *ctx)
 Get seconds function. More...
 
void rtc2_set_time_seconds (rtc2_t *ctx, uint8_t seconds)
 Set seconds function. More...
 
uint8_t rtc2_get_time_minutes (rtc2_t *ctx)
 Get hours function. More...
 
void rtc2_set_time_minutes (rtc2_t *ctx, uint8_t minutes)
 Set minutes function. More...
 
uint8_t rtc2_get_time_hours (rtc2_t *ctx)
 Set hours function. More...
 
void rtc2_set_time_hours (rtc2_t *ctx, uint8_t hours)
 Set hours function. More...
 
uint8_t rtc2_get_day_of_the_week (rtc2_t *ctx)
 Set day of the week function. More...
 
void rtc2_set_day_of_the_week (rtc2_t *ctx, uint8_t w_day)
 Generic read function. More...
 
uint8_t rtc2_get_date_day (rtc2_t *ctx)
 Get day function. More...
 
void rtc2_set_date_day (rtc2_t *ctx, uint8_t date_day)
 Set day function. More...
 
uint8_t rtc2_get_date_month (rtc2_t *ctx)
 Get month function. More...
 
void rtc2_set_date_month (rtc2_t *ctx, uint8_t date_month)
 Set month function. More...
 
uint8_t rtc2_get_date_year (rtc2_t *ctx)
 Get year function. More...
 
void rtc2_set_date_year (rtc2_t *ctx, uint16_t date_year)
 Set year function. More...
 
void rtc2_set_time (rtc2_t *ctx, uint8_t time_hours, uint8_t time_minutes, uint8_t time_seconds)
 Set time hours, minutes and seconds function. More...
 
void rtc2_get_time (rtc2_t *ctx, uint8_t *time_hours, uint8_t *time_minutes, uint8_t *time_seconds)
 Get time hours, minutes and seconds function. More...
 
void rtc2_set_date (rtc2_t *ctx, rtc2_data_t *date)
 Generic read function. More...
 
void rtc2_get_date (rtc2_t *ctx, rtc2_data_t *date)
 Generic read function. More...
 
void rtc2_set_frequency_sqwe (rtc2_t *ctx, uint8_t rate_select)
 Set frequency of square-wave output function. More...
 

Detailed Description

Function Documentation

◆ rtc2_cfg_setup()

void rtc2_cfg_setup ( rtc2_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ rtc2_disable_counting()

void rtc2_disable_counting ( rtc2_t ctx)

Disable counting function.

Parameters
ctxClick object.

@description Function disable counting on RTC 2 Click.

◆ rtc2_enable_counting()

void rtc2_enable_counting ( rtc2_t ctx)

Enable counting function.

Parameters
ctxClick object. @description Function enable counting on RTC 2 Click.

◆ rtc2_generic_read()

void rtc2_generic_read ( rtc2_t ctx,
uint8_t  reg,
uint8_t *  data_buf,
uint8_t  len 
)

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ rtc2_generic_write()

void rtc2_generic_write ( rtc2_t ctx,
uint8_t  reg,
uint8_t *  data_buf,
uint8_t  len 
)

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ rtc2_get_date()

void rtc2_get_date ( rtc2_t ctx,
rtc2_data_t date 
)

Generic read function.

Parameters
ctxClick object.
dataData parameters.

@description Function gets date: day of the week, day, month and year data from the target register address ( 0x03, 0x04, 0x05 & 0x06 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_get_date_day()

uint8_t rtc2_get_date_day ( rtc2_t ctx)

Get day function.

Parameters
ctxClick object.

@description Function gets day data from the target register address ( 0x04 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_get_date_month()

uint8_t rtc2_get_date_month ( rtc2_t ctx)

Get month function.

Parameters
ctxClick object.

@description Function gets month data from the target register address ( 0x05 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_get_date_year()

uint8_t rtc2_get_date_year ( rtc2_t ctx)

Get year function.

Parameters
ctxClick object.

@description Function gets year data from the target register address ( 0x06 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_get_day_of_the_week()

uint8_t rtc2_get_day_of_the_week ( rtc2_t ctx)

Set day of the week function.

Parameters
ctxClick object.

@description Function gets day of the week data from tne target register address ( 0x03 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_get_time()

void rtc2_get_time ( rtc2_t ctx,
uint8_t *  time_hours,
uint8_t *  time_minutes,
uint8_t *  time_seconds 
)

Get time hours, minutes and seconds function.

Parameters
ctxClick object.
time_hoursPointer of time hours.
time_minutesPointer of time minutes.
time_secondsPointer of time seconds.

@description Function gets time: hours, minutes and seconds data from the target register address ( 0x00, 0x01 & 0x02 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_get_time_hours()

uint8_t rtc2_get_time_hours ( rtc2_t ctx)

Set hours function.

Parameters
ctxClick object.

@description Function sets hours data to the target register address ( 0x02 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_get_time_minutes()

uint8_t rtc2_get_time_minutes ( rtc2_t ctx)

Get hours function.

Parameters
ctxClick object.

@description Function gets hours data from the target register address ( 0x02 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_get_time_seconds()

uint8_t rtc2_get_time_seconds ( rtc2_t ctx)

Get seconds function.

Parameters
ctxClick object.

@description Function gets seconds data from the target register address ( 0x00 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_init()

RTC2_RETVAL rtc2_init ( rtc2_t ctx,
rtc2_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ rtc2_read_byte()

uint8_t rtc2_read_byte ( rtc2_t ctx,
uint8_t  reg_address 
)

Generic read byte of data function.

Parameters
ctxClick object.
reg_addressRegister address.

@description Function read the 8-bit of data from the target 8-bit register address of DS1307 chip on RTC 2 Click.

◆ rtc2_set_date()

void rtc2_set_date ( rtc2_t ctx,
rtc2_data_t date 
)

Generic read function.

Parameters
ctxClick object.
dateDate parameters.

@description Function sets date: day of the week, day, month and year data to the target register address ( 0x03, 0x04, 0x05 & 0x06 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_set_date_day()

void rtc2_set_date_day ( rtc2_t ctx,
uint8_t  date_day 
)

Set day function.

Parameters
ctxClick object.
date_dayDate day data.

@description Function sets day data from the target register address ( 0x04 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_set_date_month()

void rtc2_set_date_month ( rtc2_t ctx,
uint8_t  date_month 
)

Set month function.

Parameters
ctxClick object.
date_monthDate month data.

@description Function sets month data from the target register address ( 0x05 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_set_date_year()

void rtc2_set_date_year ( rtc2_t ctx,
uint16_t  date_year 
)

Set year function.

Parameters
ctxClick object.
date_yearDate year data.

@description Function sets year data from the target register address ( 0x06 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_set_day_of_the_week()

void rtc2_set_day_of_the_week ( rtc2_t ctx,
uint8_t  w_day 
)

Generic read function.

Parameters
ctxClick object.
w_dayDay of the week data.

@description Function sets day of the week data to the target register address ( 0x03 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_set_frequency_sqwe()

void rtc2_set_frequency_sqwe ( rtc2_t ctx,
uint8_t  rate_select 
)

Set frequency of square-wave output function.

Parameters
ctxClick object.
rate_selectRate selection of frequency of SQWE.

@description Function set frequency of square-wave output of DS1307 chip on RTC 2 Click.

◆ rtc2_set_time()

void rtc2_set_time ( rtc2_t ctx,
uint8_t  time_hours,
uint8_t  time_minutes,
uint8_t  time_seconds 
)

Set time hours, minutes and seconds function.

Parameters
ctxClick object.
time_hoursTime hours.
time_minutesTime minutes.
time_secondsTime seconds.

@description Function sets time: hours, minutes and seconds data to the target register address ( 0x00, 0x01 & 0x02 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_set_time_hours()

void rtc2_set_time_hours ( rtc2_t ctx,
uint8_t  hours 
)

Set hours function.

Parameters
ctxClick object.
hoursTime hours.

@description Function sets hours data to the target register address ( 0x02 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_set_time_minutes()

void rtc2_set_time_minutes ( rtc2_t ctx,
uint8_t  minutes 
)

Set minutes function.

Parameters
ctxClick object.
minutesTime minutes.

@description Function sets minutes data to the target register address ( 0x01 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_set_time_seconds()

void rtc2_set_time_seconds ( rtc2_t ctx,
uint8_t  seconds 
)

Set seconds function.

Parameters
ctxClick object.
secondsTime seconds.

@description Function sets seconds data to the target register address ( 0x00 ) of DS1307 chip on RTC 2 Click.

◆ rtc2_write_byte()

void rtc2_write_byte ( rtc2_t ctx,
uint8_t  reg_address,
uint8_t  write_data 
)

Generic write byte of data function.

Parameters
ctxClick object.
regRegister address.
write_dataByte of data to write.

@description Function write the 8-bit of data to the target 8-bit register address of DS1307 chip on RTC 2 Click.