timer 2.0.0.0
|
Functions | |
void | timer_cfg_setup (timer_cfg_t *cfg) |
Config Object Initialization function. | |
TIMER_RETVAL | timer_init (timer_t *ctx, timer_cfg_t *cfg) |
Initialization function. | |
void | timer_generic_write (timer_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | timer_generic_read (timer_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | timer_hw_reset (timer_t *ctx) |
Hardwere reset function. | |
void | timer_read_eeprom (timer_t *ctx) |
Read data from the EEPROM memory function. | |
void | timer_write_byte_eeprom (timer_t *ctx, uint8_t location, uint8_t write_data) |
Write data from the EEPROM memory function. | |
uint8_t | timer_read_byte_eeprom (timer_t *ctx, uint8_t location) |
Read the byte of data from the EEPROM memory function. | |
uint8_t | timer_get_configuration (timer_t *ctx) |
Get configuration data function. | |
uint32_t | timer_get_etc_data (timer_t *ctx) |
Get elapsed time counter (ETC) data function. | |
void | timer_set_etc_data (timer_t *ctx, uint32_t etc_value) |
Set elapsed time counter (ETC) data function. | |
uint32_t | timer_get_etc_seconds (timer_t *ctx) |
Get elapsed time counter (ETC) seconds function. | |
void | timer_get_time (timer_t *ctx, uint16_t *time_days, uint8_t *time_hours, uint8_t *time_minutes, uint8_t *time_seconds) |
Set elapsed time counter (ETC) time function. | |
void | timer_set_etc_seconds (timer_t *ctx, uint32_t etc_seconds) |
Set elapsed time counter (ETC) seconds function. | |
uint16_t | timer_get_ec_data (timer_t *ctx) |
Get event counter (EC) data function. | |
void | timer_set_ec_data (timer_t *ctx, uint16_t ec_value) |
Set elapsed time counter (EC) data function. | |
uint16_t | timer_get_ec_seconds (timer_t *ctx) |
Get elapsed time counter (EC) seconds function. | |
void | timer_set_ec_seconds (timer_t *ctx, uint16_t ec_seconds) |
Set elapsed time counter (EC) seconds function. | |
uint32_t | timer_get_alarm_data (timer_t *ctx) |
Get alarm data function. | |
void | timer_set_alarm_data (timer_t *ctx, uint32_t a_data) |
Set alarm data function. | |
uint32_t | timer_get_alarm_seconds (timer_t *ctx) |
Get alarm seconds function. | |
void | timer_get_alarm_time (timer_t *ctx, uint16_t *time_days, uint8_t *time_hours, uint8_t *time_minutes, uint8_t *time_seconds) |
Get alarm time. | |
void | timer_set_alarm_seconds (timer_t *ctx, uint32_t alarm_seconds) |
Set alarm seconds function. | |
uint8_t | timer_check_write_disable (timer_t *ctx) |
Check write disable ( write protection ) function. | |
void | timer_disable_write (timer_t *ctx) |
Disable write data ( write protection ) function. | |
void | timer_enable_write (timer_t *ctx) |
Enable write data function. | |
void | timer_alarm_output_select (timer_t *ctx) |
Set alarm output select function. | |
void | timer_reset_enable (timer_t *ctx) |
Set enable reset function. | |
void | timer_set_alarm_polarity (timer_t *ctx) |
Set alarm polarity function. | |
uint8_t | timer_get_alarm_flag (timer_t *ctx) |
Get alarm flag function. | |
void | timer_soft_reset (timer_t *ctx) |
Soft reset function. | |
uint8_t | timer_check_interrupt (timer_t *ctx) |
Check interrupt function. | |
void timer_alarm_output_select | ( | timer_t * | ctx | ) |
Set alarm output select function.
ctx | Click object. |
@description Function set alarm output select by set bit 3 to the target 8-bit CONFIG register address of DS1682 total elapsed time recorder on Timer Click.
void timer_cfg_setup | ( | timer_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t timer_check_interrupt | ( | timer_t * | ctx | ) |
Check interrupt function.
ctx | Click object. |
@description Function checks the interrupt state, state of ALM pin on Timer Click.
uint8_t timer_check_write_disable | ( | timer_t * | ctx | ) |
Check write disable ( write protection ) function.
ctx | Click object. |
@description Function check write disable ( write protection ) by read from the target 8-bit CONFIG register address of DS1682 total elapsed time recorder on Timer Click and return status of bit 4.
void timer_disable_write | ( | timer_t * | ctx | ) |
Disable write data ( write protection ) function.
ctx | Click object. |
@description Function disable write data ( write protection ) by write twice value of 0xAA to the target 8-bit WRITE_DISABLE register address of DS1682 total elapsed time recorder on Timer Click.
void timer_enable_write | ( | timer_t * | ctx | ) |
Enable write data function.
ctx | Click object. |
@description Function enable write data by write twice value of 0xF0 to the target 8-bit WRITE_DISABLE register address of DS1682 total elapsed time recorder on Timer Click.
void timer_generic_read | ( | timer_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 timer_generic_write | ( | timer_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.
uint32_t timer_get_alarm_data | ( | timer_t * | ctx | ) |
Get alarm data function.
ctx | Click object. |
@description Function read the 32-bit alarm data from the target 8-bit ALARM register address of DS1682 total elapsed time recorder on Timer Click.
uint8_t timer_get_alarm_flag | ( | timer_t * | ctx | ) |
Get alarm flag function.
ctx | Click object. |
@description Function get alarm flag by read and return status of bit 6 from the target 8-bit CONFIG register address of DS1682 total elapsed time recorder on Timer Click.
uint32_t timer_get_alarm_seconds | ( | timer_t * | ctx | ) |
Get alarm seconds function.
ctx | Click object. |
@description Function read the 32-bit alarm seconds from the target 8-bit ALARM register address of DS1682 total elapsed time recorder on Timer Click.
void timer_get_alarm_time | ( | timer_t * | ctx, |
uint16_t * | time_days, | ||
uint8_t * | time_hours, | ||
uint8_t * | time_minutes, | ||
uint8_t * | time_seconds ) |
Get alarm time.
ctx | Click object. |
time_days | pointer of time days |
time_hours | pointer of time hours [ 0 h : 23 h ] |
time_minutes | pointer of time minutes [ 0 min : 59 min ] |
time_seconds | pointer of time seconds [ 0 sec : 59 sec ] |
@description Function get 16-bit day and 8-bit alarm hours, minutes and seconds.
uint8_t timer_get_configuration | ( | timer_t * | ctx | ) |
Get configuration data function.
ctx | Click object. |
@description Function read the 8-bit configuration data from the target 8-bit configuration register address of DS1682 total elapsed time recorder on Timer Click.
uint16_t timer_get_ec_data | ( | timer_t * | ctx | ) |
Get event counter (EC) data function.
ctx | Click object. |
@description Function read the 32-bit elapsed time counter (EC) data from the target 8-bit EC register address of DS1682 total elapsed time recorder on Timer Click.
uint16_t timer_get_ec_seconds | ( | timer_t * | ctx | ) |
Get elapsed time counter (EC) seconds function.
ctx | Click object. |
@description Function read the 16-bit elapsed time counter (EC) seconds from the target 8-bit EC register address of DS1682 total elapsed time recorder on Timer Click.
uint32_t timer_get_etc_data | ( | timer_t * | ctx | ) |
Get elapsed time counter (ETC) data function.
ctx | Click object. |
@description Function read the 32-bit elapsed time counter (ETC) data from the target 8-bit ETC register address of DS1682 total elapsed time recorder on Timer Click.
uint32_t timer_get_etc_seconds | ( | timer_t * | ctx | ) |
Get elapsed time counter (ETC) seconds function.
ctx | Click object. |
@description Function read the 32-bit elapsed time counter (ETC) seconds from the target 8-bit ETC register address of DS1682 total elapsed time recorder on Timer Click.
void timer_get_time | ( | timer_t * | ctx, |
uint16_t * | time_days, | ||
uint8_t * | time_hours, | ||
uint8_t * | time_minutes, | ||
uint8_t * | time_seconds ) |
Set elapsed time counter (ETC) time function.
ctx | Click object. |
time_days | pointer of time days |
time_hours | pointer of time hours [ 0 h : 23 h ] |
time_minutes | pointer of time minutes [ 0 min : 59 min ] |
time_seconds | pointer of time seconds [ 0 sec : 59 sec ] |
@description Function write the 32-bit elapsed time counter (ETC) time to the target 8-bit ETC register address of DS1682 total elapsed time recorder on Timer Click.
void timer_hw_reset | ( | timer_t * | ctx | ) |
Hardwere reset function.
ctx | Click object. |
@description Function hardwere reset device by set RST pin on Timer Click.
TIMER_RETVAL timer_init | ( | timer_t * | ctx, |
timer_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 timer_read_byte_eeprom | ( | timer_t * | ctx, |
uint8_t | location ) |
Read the byte of data from the EEPROM memory function.
ctx | Click object. |
location | EEPROM location from 1 to 10 |
@description Function read 8-bit data from the target EEPROM memory location of DS1682 total elapsed time recorder on Timer Click.
void timer_read_eeprom | ( | timer_t * | ctx | ) |
Read data from the EEPROM memory function.
ctx | Click object. |
@description Function read all data from the EEPROM memory of DS1682 total elapsed time recorder on Timer Click.
void timer_reset_enable | ( | timer_t * | ctx | ) |
Set enable reset function.
ctx | Click object. |
@description Function set enable reset by set bit 2 to the target 8-bit CONFIG register address of DS1682 total elapsed time recorder on Timer Click.
void timer_set_alarm_data | ( | timer_t * | ctx, |
uint32_t | a_data ) |
Set alarm data function.
ctx | Click object. |
a_data | 32-bit read data ( quarter seconds ) |
@description Function write the 32-bit alarm data to the target 8-bit ALARM register address of DS1682 total elapsed time recorder on Timer Click.
void timer_set_alarm_polarity | ( | timer_t * | ctx | ) |
Set alarm polarity function.
ctx | Click object. |
@description Function set alarm polarity by set bit 1 to the target 8-bit CONFIG register address of DS1682 total elapsed time recorder on Timer Click.
void timer_set_alarm_seconds | ( | timer_t * | ctx, |
uint32_t | alarm_seconds ) |
Set alarm seconds function.
ctx | Click object. |
alarm_seconds | 32-bit read data ( quarter seconds ) |
@description Function write the 32-bit alarm seconds to the target 8-bit ALARM register address of DS1682 total elapsed time recorder on Timer Click.
void timer_set_ec_data | ( | timer_t * | ctx, |
uint16_t | ec_value ) |
Set elapsed time counter (EC) data function.
ctx | Click object. |
ec_value | 16-bit read data ( quarter seconds ) |
@description Function write the 16-bit elapsed time counter (EC) data to the target 8-bit EC register address of DS1682 total elapsed time recorder on Timer Click.
void timer_set_ec_seconds | ( | timer_t * | ctx, |
uint16_t | ec_seconds ) |
Set elapsed time counter (EC) seconds function.
ctx | Click object. |
ec_seconds | 16-bit read data ( quarter seconds ) |
@description Function write the 16-bit elapsed time counter (EC) seconds to the target 8-bit EC register address of DS1682 total elapsed time recorder on Timer Click.
void timer_set_etc_data | ( | timer_t * | ctx, |
uint32_t | etc_value ) |
Set elapsed time counter (ETC) data function.
ctx | Click object. |
etc_value | 32-bit read data ( quarter seconds ) |
@description Function write the 32-bit elapsed time counter (ETC) data to the target 8-bit ETC register address of DS1682 total elapsed time recorder on Timer Click.
void timer_set_etc_seconds | ( | timer_t * | ctx, |
uint32_t | etc_seconds ) |
Set elapsed time counter (ETC) seconds function.
ctx | Click object. |
etc_seconds | 32-bit read data ( quarter seconds ) |
@description Function write the 32-bit elapsed time counter (ETC) seconds to the target 8-bit ETC register address of DS1682 total elapsed time recorder on Timer Click.
void timer_soft_reset | ( | timer_t * | ctx | ) |
Soft reset function.
ctx | Click object. |
@description Function software reset by set bit 2 to the target 8-bit CONFIG register address and write twice value of 0x55 to the target 8-bit RESET of DS1682 total elapsed time recorder on Timer Click.
void timer_write_byte_eeprom | ( | timer_t * | ctx, |
uint8_t | location, | ||
uint8_t | write_data ) |
Write data from the EEPROM memory function.
ctx | Click object. |
location | EEPROM location from 1 to 10 |
write_data | 8-bit data to write |
@description Function write data to the target EEPROM memory location of DS1682 total elapsed time recorder on Timer Click.