rtc6 2.0.0.0
|
Functions | |
void | rtc6_cfg_setup (rtc6_cfg_t *cfg) |
Config Object Initialization function. | |
RTC6_RETVAL | rtc6_init (rtc6_t *ctx, rtc6_cfg_t *cfg) |
Initialization function. | |
void | rtc6_default_cfg (rtc6_t *ctx, int8_t time_zone, rtc6_time_t *utc_time, rtc6_time_t *alarm_time) |
Click Default Configuration function. | |
void | rtc6_generic_write (rtc6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | rtc6_generic_read (rtc6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint8_t | rtc6_init_fun (rtc6_t *ctx, int8_t time_zone) |
void | rtc6_enable_swo (rtc6_t *ctx, uint8_t swo) |
Enable Square Wave Output. | |
void | rtc6_disable_swo (rtc6_t *ctx) |
Disables Square Wave Output. | |
void | rtc6_battery_enable (rtc6_t *ctx) |
Enables automatic switch to battery. | |
void | rtc6_get_gmt_time (rtc6_t *ctx, rtc6_time_t *gmt_time) |
Gets the current GMT time set in the RTC. | |
void | rtc6_set_gmt_time (rtc6_t *ctx, rtc6_time_t *set_time) |
Sets the UTC GMT time. | |
void | rtc6_get_local_time (rtc6_t *ctx, rtc6_time_t *local_time) |
Calculates the current local time. | |
uint32_t | rtc6_get_gmt_unix_time (rtc6_t *ctx) |
Calculates the current GMT time in UNIX epoch time. | |
uint32_t | rtc6_get_local_unix_time (rtc6_t *ctx) |
Calculates the current local time in UNIX epoch time. | |
uint8_t | rtc6_is_leap_year (rtc6_t *ctx) |
Checks if the current year is a leap one. | |
uint8_t | rtc6_is_power_failure (rtc6_t *ctx) |
Checks if a power failure has occured. | |
void | rtc6_get_last_power_failure (rtc6_t *ctx, rtc6_time_t *last_time) |
Gets the time of the last power failure. | |
void | rtc6_set_alarm (rtc6_t *ctx, uint8_t alarm, uint8_t trigger, rtc6_time_t *time) |
Sets the desired alarm. | |
void | rtc6_disable_alarm (rtc6_t *ctx, uint8_t alarm) |
Disables the alarm. | |
void | rtc6_read_alarm (rtc6_t *ctx, uint8_t alarm, rtc6_time_t *get_alarm) |
Reads the alarm time. | |
uint8_t | rtc6_is_active_alarm (rtc6_t *ctx) |
Check if the alarm is activated. | |
void | rtc6_repeat_alarm (rtc6_t *ctx, uint8_t alarm, uint32_t sec) |
Repeat Alarm. | |
void | rtc6_write_sram (rtc6_t *ctx, uint8_t addr, uint8_t data_in) |
Writes data to the SRAM. | |
uint8_t | rtc6_read_sram (rtc6_t *ctx, uint8_t addr) |
Reads data from an SRAM. | |
void | rtc6_write_eeprom_protect_on (rtc6_t *ctx) |
Write protect on. | |
void | rtc6_write_eeprom_protect_off (rtc6_t *ctx) |
Write protect off. | |
uint8_t | rtc6_eeprom_is_locked (rtc6_t *ctx) |
Lock check function. | |
void | rtc6_write_eeprom (rtc6_t *ctx, uint8_t addr, uint8_t *data_in, uint8_t data_size) |
Writes data to EEPROM. | |
void | rtc6_read_eeprom (rtc6_t *ctx, uint8_t addr, uint8_t *data_out, uint8_t data_size) |
Reads data from EEPROM. | |
void | rtc6_read_unique_id (rtc6_t *ctx, uint8_t *unique_id) |
Reads unique ID. | |
void rtc6_battery_enable | ( | rtc6_t * | ctx | ) |
Enables automatic switch to battery.
ctx | Click object. |
@description This function enables automatic switch to battery on VCC failure.
void rtc6_cfg_setup | ( | rtc6_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void rtc6_default_cfg | ( | rtc6_t * | ctx, |
int8_t | time_zone, | ||
rtc6_time_t * | utc_time, | ||
rtc6_time_t * | alarm_time ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Rtc6 click.
void rtc6_disable_alarm | ( | rtc6_t * | ctx, |
uint8_t | alarm ) |
Disables the alarm.
ctx | Click object. |
alarm | Desired alarm to be disabled (alarm 0 or alarm 1) |
@description This function disables the alarm.
void rtc6_disable_swo | ( | rtc6_t * | ctx | ) |
Disables Square Wave Output.
ctx | Click object. |
@description This function deisables square wave output.
uint8_t rtc6_eeprom_is_locked | ( | rtc6_t * | ctx | ) |
Lock check function.
ctx | Click object. |
@description This function checks if EEPROM is locked.
void rtc6_enable_swo | ( | rtc6_t * | ctx, |
uint8_t | swo ) |
Enable Square Wave Output.
ctx | Click object. |
swo | Frequency of output |
@description This function enables and sets square wave output. Available options:
- RTC6_SWO_1HZ - RTC6_SWO_4_096KHZ - RTC6_SWO_8_192KHZ - RTC6_SWO_32_768KHZ
void rtc6_generic_read | ( | rtc6_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 |
@description This function reads data from the desired register.
void rtc6_generic_write | ( | rtc6_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. |
@description This function writes data to the desired register.
void rtc6_get_gmt_time | ( | rtc6_t * | ctx, |
rtc6_time_t * | gmt_time ) |
Gets the current GMT time set in the RTC.
ctx | Click object. |
gmt_time | A buffer in which GMT time values will be stored |
@description This function gets current GMT time and sets it in the RTC.
uint32_t rtc6_get_gmt_unix_time | ( | rtc6_t * | ctx | ) |
Calculates the current GMT time in UNIX epoch time.
ctx | Click object. |
GMT | time converted to UNIX epoch time |
@description This function calculates and returns current GMT time in UNIX epoch time.
void rtc6_get_last_power_failure | ( | rtc6_t * | ctx, |
rtc6_time_t * | last_time ) |
Gets the time of the last power failure.
ctx | Click object. |
last_time | time of the power failure |
@description This functions gets the of the last power faulure.
void rtc6_get_local_time | ( | rtc6_t * | ctx, |
rtc6_time_t * | local_time ) |
Calculates the current local time.
ctx | Click object. |
local_time | A buffer in which local time values will be stored |
@description This function calculates current local time.
uint32_t rtc6_get_local_unix_time | ( | rtc6_t * | ctx | ) |
Calculates the current local time in UNIX epoch time.
ctx | Click object. |
local | time converted to UNIX epoch time |
@description This function calculates and returns current local time in UNIX epoch time.
RTC6_RETVAL rtc6_init | ( | rtc6_t * | ctx, |
rtc6_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t rtc6_init_fun | ( | rtc6_t * | ctx, |
int8_t | time_zone ) |
uint8_t rtc6_is_active_alarm | ( | rtc6_t * | ctx | ) |
Check if the alarm is activated.
ctx | Click object. |
0 | - if not active alarm or 1 - if active alarm |
@description This function checks if the alarm is activated by checking the state of the int_pin pin.
uint8_t rtc6_is_leap_year | ( | rtc6_t * | ctx | ) |
Checks if the current year is a leap one.
ctx | Click object. |
0 | - on a leap year or 1 - if not a leap year |
@description This function checks if current year is a leap year and returns an appropriate value.
uint8_t rtc6_is_power_failure | ( | rtc6_t * | ctx | ) |
Checks if a power failure has occured.
ctx | Click object. |
0 | if a power failure detected or 1 if no power failure was detected |
@description This function checks if power failure has occured and returns an appropriate value.
void rtc6_read_alarm | ( | rtc6_t * | ctx, |
uint8_t | alarm, | ||
rtc6_time_t * | get_alarm ) |
Reads the alarm time.
ctx | Click object. |
alarm | Desired alarm to be read (alarm 0 or alarm 1) |
get_alarm | Struct in which Alarm time values will be stored |
@description This function reads the alarm time.
void rtc6_read_eeprom | ( | rtc6_t * | ctx, |
uint8_t | addr, | ||
uint8_t * | data_out, | ||
uint8_t | data_size ) |
Reads data from EEPROM.
ctx | Click object. |
addr | Address from where to start reading |
data_out | Variable which will hold the read data |
data_size | Number of bytes to be read |
@description This functiom reads data from EEPROM registers of the RTC
uint8_t rtc6_read_sram | ( | rtc6_t * | ctx, |
uint8_t | addr ) |
Reads data from an SRAM.
ctx | Click object. |
addr | Register address |
read | data byte |
@description This function reads data from an SRAM register
void rtc6_read_unique_id | ( | rtc6_t * | ctx, |
uint8_t * | unique_id ) |
Reads unique ID.
ctx | Click object. |
unique | ID (8 bytes) |
@description This funciton reads unique ID from EEPROM registers of the RTC
void rtc6_repeat_alarm | ( | rtc6_t * | ctx, |
uint8_t | alarm, | ||
uint32_t | sec ) |
Repeat Alarm.
ctx | Click object. |
alarm | Desired alarm to be read (alarm 0 or alarm 1) |
sec | Number of seconds for which the alarm will repeat |
@description This funtion sets up repeats for the alarm.
void rtc6_set_alarm | ( | rtc6_t * | ctx, |
uint8_t | alarm, | ||
uint8_t | trigger, | ||
rtc6_time_t * | time ) |
Sets the desired alarm.
ctx | Click object. |
alarm | Desired alarm to be set (alarm 0 or alarm 1) |
trigger | Desired trigger for the alarm |
time | Desired alarm time to be set |
@description This function sets the desired alarm.
void rtc6_set_gmt_time | ( | rtc6_t * | ctx, |
rtc6_time_t * | set_time ) |
Sets the UTC GMT time.
ctx | Click object. |
set_time | GMT time to be set. |
@description This function sets GMT/UTC time.
void rtc6_write_eeprom | ( | rtc6_t * | ctx, |
uint8_t | addr, | ||
uint8_t * | data_in, | ||
uint8_t | data_size ) |
Writes data to EEPROM.
ctx | Click object. |
addr | Address from where to start writing |
data_in | Data to be written |
data_size | Number of bytes to be written |
@description This function writes data to EEPROM registers of RTC
void rtc6_write_eeprom_protect_off | ( | rtc6_t * | ctx | ) |
Write protect off.
ctx | Click object. |
@description This function turns EEPROM write protection off.
void rtc6_write_eeprom_protect_on | ( | rtc6_t * | ctx | ) |
Write protect on.
ctx | Click object. |
@description This function turns EEPROM write protection on.
void rtc6_write_sram | ( | rtc6_t * | ctx, |
uint8_t | addr, | ||
uint8_t | data_in ) |
Writes data to the SRAM.
ctx | Click object. |
addr | Address of the desired register |
data_in | Data to be written |
@description This function writes data to the SRAM registers of the RTC