rtc3 2.0.0.0
|
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. | |
void rtc3_cfg_setup | ( | rtc3_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
void rtc3_generic_read | ( | rtc3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
This function reads data from the desired register.
void rtc3_generic_write | ( | rtc3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
This function writes data to the desired register.
void rtc3_get_date | ( | rtc3_t * | ctx | ) |
Get day of the week, day, month and year function.
ctx | Click 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.
uint8_t rtc3_get_interrupt | ( | rtc3_t * | ctx | ) |
Get state of interrupt pin function.
ctx | Click object. |
state | of INT pin - 0: not active; - 1: active |
Function get state of interrupt ( INT ) pin.
void rtc3_get_time | ( | rtc3_t * | ctx | ) |
Get time hours, minutes, seconds function.
ctx | Click object. |
Function gets time: hours, minutes and seconds data from the target register address of PCF8583 chip on RTC 3 Click.
err_t rtc3_init | ( | rtc3_t * | ctx, |
rtc3_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
void rtc3_set_calibration | ( | rtc3_t * | ctx, |
uint8_t | cal_sign, | ||
uint8_t | cal_mumber ) |
Set calibration function.
ctx | Click object. |
cal_sign | Calibration sign: - 0: POSITIV; - 1: NEGATIV; |
cal_mumber | Calibration number: - positiv: number/491520 ppm - negativ: number/245760 ppm |
Function set calibration by write CAL_CFG1 register of BQ32000 chip.
void rtc3_set_counting | ( | rtc3_t * | ctx, |
uint8_t | en_dis ) |
Enable/Disable counting function.
ctx | Click object. |
Function enables or disables counting on RTC 3 Click.
void rtc3_set_date | ( | rtc3_t * | ctx | ) |
Set day of the week, day, month and year function.
ctx | Click 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.
void rtc3_set_frequency_calibration | ( | rtc3_t * | ctx, |
uint8_t | ftf ) |
Set frequency calibration control function.
ctx | Click object. |
ftf | frequency 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.
void rtc3_set_special_function_key1 | ( | rtc3_t * | ctx, |
uint8_t | sfkey1 ) |
Set special function key byte 1 function.
ctx | Click object. |
sfkey1 | special 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.
void rtc3_set_special_function_key2 | ( | rtc3_t * | ctx, |
uint8_t | sfkey2 ) |
Set special function key byte 2 function.
ctx | Click object. |
sfkey2 | special 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.
void rtc3_set_time | ( | rtc3_t * | ctx | ) |
Set time hours, minutes, seconds function.
ctx | Click object. |
Function sets time: hours, minutes and seconds data to the target register address of PCF8583 chip on RTC 3 Click.
void rtc3_set_trickle_charge | ( | rtc3_t * | ctx, |
uint8_t | tch2 ) |
Set trickle charge control function.
ctx | Click object. |
tch2 | trickle 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.
void rtc3_set_trickle_charge_bypass | ( | rtc3_t * | ctx, |
uint8_t | tcfe ) |
Set trickle charge bypass control function.
ctx | Click object. |
tcfe | trickle 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.