rtc3  2.0.0.0
Functions
Public function

Functions

void rtc3_cfg_setup (rtc3_cfg_t *cfg)
 Config Object Initialization function. More...
 
RTC3_RETVAL rtc3_init (rtc3_t *ctx, rtc3_cfg_t *cfg)
 Initialization function. More...
 
void rtc3_default_cfg (rtc3_t *ctx)
 Click Default Configuration function. More...
 
void rtc3_generic_write (rtc3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void rtc3_generic_read (rtc3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
void rtc3_enable_disable_counting (rtc3_t *ctx, uint8_t en_dis)
 Enable/Disable counting function. More...
 
uint8_t rtc3_get_time_value (rtc3_t *ctx, uint8_t time_part)
 Get time value function. More...
 
void rtc3_set_time_value (rtc3_t *ctx, uint8_t time_part, uint8_t time_addr)
 Set time values function. More...
 
uint8_t rtc3_get_date_day (rtc3_t *ctx)
 Get day function. More...
 
void rtc3_set_date_day (rtc3_t *ctx, uint8_t date_day)
 Set day function. More...
 
uint8_t rtc3_get_date_month (rtc3_t *ctx)
 Get month function. More...
 
void rtc3_set_date_month (rtc3_t *ctx, uint8_t date_month)
 Set month function. More...
 
uint8_t rtc3_get_date_year (rtc3_t *ctx)
 Get year function. More...
 
void rtc3_set_date_year (rtc3_t *ctx, uint16_t date_year)
 Set year function. More...
 
uint8_t rtc3_get_day_of_the_week (rtc3_t *ctx)
 Get day of the week function. More...
 
void rtc3_set_day_of_the_week (rtc3_t *ctx, uint8_t w_day)
 Set day of the week function. More...
 
void rtc3_set_time (rtc3_t *ctx)
 Set time hours, minutes, seconds and hundredth of a seconds function. More...
 
void rtc3_get_time (rtc3_t *ctx)
 Get time hours, minutes, seconds and hundredth of a seconds function. More...
 
void rtc3_set_date (rtc3_t *ctx)
 Set date hours, minutes and seconds function. More...
 
void rtc3_get_date (rtc3_t *ctx)
 Get time hours, minutes and seconds function. More...
 
void rtc3_set_calibration (rtc3_t *ctx, uint8_t cal_sign, uint8_t cal_mumber)
 Set calibration function. More...
 
void rtc3_set_trickle_charge (rtc3_t *ctx, uint8_t tch2)
 Set trickle charge control function. More...
 
void rtc3_set_trickle_charge_bypass (rtc3_t *ctx, uint8_t tcfe)
 Set trickle charge bypass control function. More...
 
void rtc3_set_special_function_key1 (rtc3_t *ctx, uint8_t sfkey1)
 Set special function key byte 1 function. More...
 
void rtc3_set_special_function_key2 (rtc3_t *ctx, uint8_t sfkey2)
 Set special function key byte 2 function. More...
 
void rtc3_set_frequency_calibration (rtc3_t *ctx, uint8_t ftf)
 Set frequency calibration control function. More...
 
uint8_t rtc3_get_interrupt (rtc3_t *ctx)
 Get state of interrupt pin function. More...
 

Detailed Description

Function Documentation

◆ rtc3_cfg_setup()

void rtc3_cfg_setup ( rtc3_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.

◆ rtc3_default_cfg()

void rtc3_default_cfg ( rtc3_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Rtc 3 click.

◆ rtc3_enable_disable_counting()

void rtc3_enable_disable_counting ( rtc3_t ctx,
uint8_t  en_dis 
)

Enable/Disable counting function.

Parameters
ctxClick object.

@description Function enables or disables counting on RTC 3 Click.

◆ rtc3_generic_read()

void rtc3_generic_read ( rtc3_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.

◆ rtc3_generic_write()

void rtc3_generic_write ( rtc3_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.

◆ rtc3_get_date()

void rtc3_get_date ( rtc3_t ctx)

Get time hours, minutes and seconds function.

Parameters
ctxClick object.

@description Function gets date: day of the week, day, month and year data from the target register address of PCF8583 chip on RTC 3 Click.

◆ rtc3_get_date_day()

uint8_t rtc3_get_date_day ( rtc3_t ctx)

Get day function.

Parameters
ctxClick object.
Return values
Dateday [ 1 - 31 ]

@description Function gets day data from the target register address of PCF8583 chip on RTC 3 Click.

◆ rtc3_get_date_month()

uint8_t rtc3_get_date_month ( rtc3_t ctx)

Get month function.

Parameters
ctxClick object.
Return values
Month[ 1 - 12 ]

@description Function gets month data from the target register address of PCF8583 chip on RTC 3 Click.

◆ rtc3_get_date_year()

uint8_t rtc3_get_date_year ( rtc3_t ctx)

Get year function.

Parameters
ctxClick object.
Return values
Year[ 00 - 99 ]

@description Function gets year data from the target register address of PCF8583 chip on RTC 3 Click.

◆ rtc3_get_day_of_the_week()

uint8_t rtc3_get_day_of_the_week ( rtc3_t ctx)

Get day of the week function.

Parameters
ctxClick object.
Return values
Dayof the week [ 1 - 7 ]

@description Function gets day of the week data from tne target register address of PCF8583 chip on RTC Click.

◆ rtc3_get_interrupt()

uint8_t rtc3_get_interrupt ( rtc3_t ctx)

Get state of interrupt pin function.

Parameters
ctxClick object.
Return values
stateof INT pin
  • 0: not active;
  • 1: active

@description Function get state of interrupt ( INT ) pin.

◆ rtc3_get_time()

void rtc3_get_time ( rtc3_t ctx)

Get time hours, minutes, seconds and hundredth of a seconds function.

Parameters
ctxClick object.

@description Function gets time: hours, minutes and seconds data from the target register address of PCF8583 chip on RTC 3 Click.

◆ rtc3_get_time_value()

uint8_t rtc3_get_time_value ( rtc3_t ctx,
uint8_t  time_part 
)

Get time value function.

Parameters
ctxClick object.
time_partTime part register address.
Return values
Partof the current time in hours [ 0 h - 23 h ], minutes [ 0 min - 59 min ], or seconds [ 0 sec - 59 sec ].

@description Function gets hundredths of a second, seconds, minutes or hours data from the target register address of PCF8583 chip on RTC 3 Click.

◆ rtc3_init()

RTC3_RETVAL rtc3_init ( rtc3_t ctx,
rtc3_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ rtc3_set_calibration()

void rtc3_set_calibration ( rtc3_t ctx,
uint8_t  cal_sign,
uint8_t  cal_mumber 
)

Set calibration function.

Parameters
ctxClick object.
calSignCalibration sign:
                         <pre>
                           - 0: POSITIV;
                           - 1: NEGATIV;
                         </pre>
calNumberCalibration number:
  • positiv: number/491520 ppm
  • negativ: number/245760 ppm @description Function set calibration by write CAL_CFG1 register of BQ32000 chip.

◆ rtc3_set_date()

void rtc3_set_date ( rtc3_t ctx)

Set date hours, minutes and seconds function.

Parameters
ctxClick object.

@description Function sets date: day of the week, day, month and year data to the target register address of PCF8583 chip on RTC 3 Click.

◆ rtc3_set_date_day()

void rtc3_set_date_day ( rtc3_t ctx,
uint8_t  date_day 
)

Set day function.

Parameters
ctxClick object.
date_dayDate day data [ 1 - 31 ]

@description Function sets day data from the target register address of PCF8583 chip on RTC 3 Click.

◆ rtc3_set_date_month()

void rtc3_set_date_month ( rtc3_t ctx,
uint8_t  date_month 
)

Set month function.

Parameters
ctxClick object.
date_monthDate month data [ 1 - 12 ]

@description Function sets month data from the target register address of PCF8583 chip on RTC 3 Click.

◆ rtc3_set_date_year()

void rtc3_set_date_year ( rtc3_t ctx,
uint16_t  date_year 
)

Set year function.

Parameters
ctxClick object.
date_yearDate year data [ 00 - 99 ]

@description Function sets year data from the target register address of PCF8583 chip on RTC 3 Click.

◆ rtc3_set_day_of_the_week()

void rtc3_set_day_of_the_week ( rtc3_t ctx,
uint8_t  w_day 
)

Set day of the week function.

Parameters
ctxClick object.
w_dayDay of the week data [ 1 - 7 ]
  • 1 : Monday;
  • 2 : Tuesday;
  • 3 : Wednesday;
  • 4 : Thursday;
  • 5 : Friday;
  • 6 : Saturday;
  • 7 : Sunday;

@description Function sets day of the week data to the target register address of PCF8583 chip on RTC Click.

◆ rtc3_set_frequency_calibration()

void rtc3_set_frequency_calibration ( rtc3_t ctx,
uint8_t  ftf 
)

Set frequency calibration control function.

Parameters
ctxClick object.
ftffrequency of the calibration output
  • 0: Normal 512 Hz calibration;
  • 1: 1 Hz calibration;

@description Function set force calibration control. FTF allows the frequency of the calibration output to be changed from 512 Hz to 1 Hz. By default, FTF is cleared, and the RTC outputs a 512-Hz calibration signal. Setting FTF forces the calibration signal to 1 Hz, and the calibration tracks the internal ppm adjustment.

Note
: The default 512-Hz calibration signal does not include the effect of the ppm adjustment.

◆ rtc3_set_special_function_key1()

void rtc3_set_special_function_key1 ( rtc3_t ctx,
uint8_t  sfkey1 
)

Set special function key byte 1 function.

Parameters
ctxClick object.
sfkey1special function key byte 1

@description Function set special function access key byte 1. Reads as 0x00, and key is 0x5E. The SF KEY 1 registers are used to enable access to the main special function register (SFR). Access to SFR is granted only after the special function keys are written sequentially to SF KEY 1. Each write to the SFR must be preceded by writing the SF keys to the SF key registers, in order, SF KEY 1 then SF KEY 2.

◆ rtc3_set_special_function_key2()

void rtc3_set_special_function_key2 ( rtc3_t ctx,
uint8_t  sfkey2 
)

Set special function key byte 2 function.

Parameters
ctxClick object.
sfkey2special function key byte 2

@description Function set special function access key byte 2. Reads as 0x00, and key is 0x5E. The SF KEY 2 registers are used to enable access to the main special function register (SFR). Access to SFR is granted only after the special function keys are written sequentially to SF KEY 2. Each write to the SFR must be preceded by writing the SF keys to the SF key registers, in order, SF KEY 1 then SF KEY 2.

◆ rtc3_set_time()

void rtc3_set_time ( rtc3_t ctx)

Set time hours, minutes, seconds and hundredth of a seconds function.

Parameters
ctxClick object.

@description Function sets time: hours, minutes and seconds data to the target register address of PCF8583 chip on RTC 3 Click.

◆ rtc3_set_time_value()

void rtc3_set_time_value ( rtc3_t ctx,
uint8_t  time_part,
uint8_t  time_addr 
)

Set time values function.

Parameters
ctxClick object.
time_partPart of time format ( hours, minutes or seconds ).
time_addrRegister address of the corresponding part of the time format.

@description Function sets seconds data to the target register address of PCF8583 chip on RTC 3 Click.

◆ rtc3_set_trickle_charge()

void rtc3_set_trickle_charge ( rtc3_t ctx,
uint8_t  tch2 
)

Set trickle charge control function.

Parameters
ctxClick object.
tch2trickle charge control
  • 0: Open;
  • 1: Closed;

@description Function set the TCH2 bit determines if the internal trickle charge switch is closed or open. All the trickle charge switches must be closed in order for trickle charging to occur.

◆ rtc3_set_trickle_charge_bypass()

void rtc3_set_trickle_charge_bypass ( rtc3_t ctx,
uint8_t  tcfe 
)

Set trickle charge bypass control function.

Parameters
ctxClick object.
tcfetrickle charge control
  • 0: Open;
  • 1: Closed;

@description Function set the trickle charge FET bypass. The TCFE bit is used to enable the trickle charge FET. When TCFE is 0, the FET is off.