rtc7
2.0.0.0
|
Functions | |
void | rtc7_cfg_setup (rtc7_cfg_t *cfg) |
Config Object Initialization function. More... | |
RTC7_RETVAL | rtc7_init (rtc7_t *ctx, rtc7_cfg_t *cfg) |
Initialization function. More... | |
void | rtc7_generic_write (rtc7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. More... | |
void | rtc7_generic_read (rtc7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. More... | |
uint8_t | rtc7_write_reg (rtc7_t *ctx, uint8_t register_address, uint8_t transfer_data) |
Write one byte function. More... | |
uint8_t | rtc7_read_reg (rtc7_t *ctx, uint8_t register_address, uint8_t n_bytes, uint8_t *data_out) |
Read one byte function. More... | |
uint8_t | rtc7_init_time (rtc7_t *ctx, int8_t time_zone, uint8_t time_mode) |
Initialization function. More... | |
void | rtc7_enable_dst (rtc7_t *ctx) |
Distance Enable function. More... | |
void | rtc7_disable_dst (rtc7_t *ctx) |
Distance Disable function. More... | |
uint8_t | rtc7_set_osc (rtc7_t *ctx, uint8_t enable_osc, uint8_t clk_in, uint8_t clk_out) |
Oscillator Set function. More... | |
uint8_t | rtc7_set_timer (rtc7_t *ctx, uint8_t enable_timer, uint8_t timer_freq) |
Timer Set function. More... | |
void | rtc7_reset (rtc7_t *ctx) |
Reset function. More... | |
void | rtc7_get_gmt_time (rtc7_t *ctx, rtc7_time_t *gmt_time) |
Get Gmt Time function. More... | |
void | rtc7_get_local_time (rtc7_t *ctx, rtc7_time_t *local_time) |
Get Local Time function. More... | |
uint8_t | rtc7_set_gmt_time (rtc7_t *ctx, rtc7_time_t *time) |
Set Gmt Time function. More... | |
uint8_t | rtc7_check_interr (rtc7_t *ctx) |
Interrupt Check function. More... | |
uint8_t | rtc7_check_psw (rtc7_t *ctx) |
Power Switch Control function. More... | |
void rtc7_cfg_setup | ( | rtc7_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
uint8_t rtc7_check_interr | ( | rtc7_t * | ctx | ) |
Interrupt Check function.
ctx | Click object. |
This function checks the interrupt state, state of INTA pin. This pin also can be used as input for external clock.
uint8_t rtc7_check_psw | ( | rtc7_t * | ctx | ) |
Power Switch Control function.
ctx | Click object. |
This function checks the state of Power Switch Control output pin.
void rtc7_disable_dst | ( | rtc7_t * | ctx | ) |
Distance Disable function.
ctx | Click object. |
This function doesn't include time distance measurement in calculations.
void rtc7_enable_dst | ( | rtc7_t * | ctx | ) |
Distance Enable function.
ctx | Click object. |
This function includes time distance measurement in calculations.
void rtc7_generic_read | ( | rtc7_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 rtc7_generic_write | ( | rtc7_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 rtc7_get_gmt_time | ( | rtc7_t * | ctx, |
rtc7_time_t * | gmt_time | ||
) |
Get Gmt Time function.
ctx | Click object. |
gmt_time | Structure where time data be stored. |
This function gets the gmt time data in both time formats.
void rtc7_get_local_time | ( | rtc7_t * | ctx, |
rtc7_time_t * | local_time | ||
) |
Get Local Time function.
ctx | Click object. |
local_time | Structure where local time data be stored. |
This function gets the local time data including the determined time zone in calculations. Function gets time data in both time formats.
RTC7_RETVAL rtc7_init | ( | rtc7_t * | ctx, |
rtc7_cfg_t * | cfg | ||
) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
uint8_t rtc7_init_time | ( | rtc7_t * | ctx, |
int8_t | time_zone, | ||
uint8_t | time_mode | ||
) |
Initialization function.
ctx | Click object. |
time_zone | Determines the local time zone (from 14 to -12). |
time_mode | 0x00 - 24 hours format, 0x40 - 12 hours format. |
This function performs the device initialization.
uint8_t rtc7_read_reg | ( | rtc7_t * | ctx, |
uint8_t | register_address, | ||
uint8_t | n_bytes, | ||
uint8_t * | data_out | ||
) |
Read one byte function.
ctx | Click object. |
register_address | Address which from data be read. |
n_bytes | Number of bytes to be read. |
data_out | Buffer where data be stored. |
This function writes one byte data to the register.
void rtc7_reset | ( | rtc7_t * | ctx | ) |
Reset function.
ctx | Click object. |
This function performs the device reset.
uint8_t rtc7_set_gmt_time | ( | rtc7_t * | ctx, |
rtc7_time_t * | time | ||
) |
Set Gmt Time function.
ctx | Click object. |
time | Structure which from time data be written. |
This function sets the gmt time to desired value.
uint8_t rtc7_set_osc | ( | rtc7_t * | ctx, |
uint8_t | enable_osc, | ||
uint8_t | clk_in, | ||
uint8_t | clk_out | ||
) |
Oscillator Set function.
ctx | Click object. |
enable_osc | 0x00 - enable osc, 0x08 - disable osc. |
clk_in | Determines the input frequency. |
clk_out | Determines the output frequency. |
This function performs the oscillator to be configured and enabled.
uint8_t rtc7_set_timer | ( | rtc7_t * | ctx, |
uint8_t | enable_timer, | ||
uint8_t | timer_freq | ||
) |
Timer Set function.
ctx | Click object. |
enable_timer | 0x00 - disable timer, 0x10 - enable timer. |
timer_freq | Determines the timer frequency. |
This function performs the timer to be configured and enabled.
uint8_t rtc7_write_reg | ( | rtc7_t * | ctx, |
uint8_t | register_address, | ||
uint8_t | transfer_data | ||
) |
Write one byte function.
ctx | Click object. |
register_address | Address where data be written. |
transfer_data | Data to be written. |
This function writes one byte data to the register.