rtc3 2.0.0.0
Public function

Functions

void rtc3_cfg_setup (rtc3_cfg_t *cfg)
 Config Object Initialization function.
 
err_t rtc3_init (rtc3_t *ctx, rtc3_cfg_t *cfg)
 Initialization function.
 
void rtc3_generic_write (rtc3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void rtc3_generic_read (rtc3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void rtc3_set_counting (rtc3_t *ctx, uint8_t en_dis)
 Enable/Disable counting function.
 
void rtc3_set_time (rtc3_t *ctx)
 Set time hours, minutes, seconds function.
 
void rtc3_get_time (rtc3_t *ctx)
 Get time hours, minutes, seconds function.
 
void rtc3_set_date (rtc3_t *ctx)
 Set day of the week, day, month and year function.
 
void rtc3_get_date (rtc3_t *ctx)
 Get day of the week, day, month and year function.
 
void rtc3_set_calibration (rtc3_t *ctx, uint8_t cal_sign, uint8_t cal_mumber)
 Set calibration function.
 
void rtc3_set_trickle_charge (rtc3_t *ctx, uint8_t tch2)
 Set trickle charge control function.
 
void rtc3_set_trickle_charge_bypass (rtc3_t *ctx, uint8_t tcfe)
 Set trickle charge bypass control function.
 
void rtc3_set_special_function_key1 (rtc3_t *ctx, uint8_t sfkey1)
 Set special function key byte 1 function.
 
void rtc3_set_special_function_key2 (rtc3_t *ctx, uint8_t sfkey2)
 Set special function key byte 2 function.
 
void rtc3_set_frequency_calibration (rtc3_t *ctx, uint8_t ftf)
 Set frequency calibration control function.
 
uint8_t rtc3_get_interrupt (rtc3_t *ctx)
 Get state of interrupt pin function.
 

Detailed Description

Function Documentation

◆ rtc3_cfg_setup()

void rtc3_cfg_setup ( rtc3_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ 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

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.

This function writes data to the desired register.

◆ rtc3_get_date()

void rtc3_get_date ( rtc3_t * ctx)

Get day of the week, day, month and year function.

Parameters
ctxClick object.

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_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
           

Function get state of interrupt ( INT ) pin.

◆ rtc3_get_time()

void rtc3_get_time ( rtc3_t * ctx)

Get time hours, minutes, seconds function.

Parameters
ctxClick object.

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

◆ rtc3_init()

err_t rtc3_init ( rtc3_t * ctx,
rtc3_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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.
cal_signCalibration sign:
                               - 0: POSITIV;
                               - 1: NEGATIV;
                             
cal_mumberCalibration number:
                               - positiv: number/491520 ppm
                               - negativ: number/245760 ppm
                             

Function set calibration by write CAL_CFG1 register of BQ32000 chip.

◆ rtc3_set_counting()

void rtc3_set_counting ( rtc3_t * ctx,
uint8_t en_dis )

Enable/Disable counting function.

Parameters
ctxClick object.

Function enables or disables counting on RTC 3 Click.

◆ rtc3_set_date()

void rtc3_set_date ( rtc3_t * ctx)

Set day of the week, day, month and year function.

Parameters
ctxClick object.

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_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;
                  

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

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

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 function.

Parameters
ctxClick object.

Function sets time: hours, minutes and 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;
                            

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;
                          

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.