38 #include "drv_digital_out.h" 39 #include "drv_digital_in.h" 40 #include "drv_i2c_master.h" 53 #define TIMER_MAP_MIKROBUS( cfg, mikrobus ) \ 54 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \ 55 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \ 56 cfg.evt = MIKROBUS( mikrobus, MIKROBUS_RST ); \ 57 cfg.alm = MIKROBUS( mikrobus, MIKROBUS_INT ) 64 #define TIMER_RETVAL uint8_t 67 #define TIMER_INIT_ERROR 0xFF 74 #define TIMER_I2C_ADDR 0x6B 81 #define TIMER_REG_CONFIG 0x00 82 #define TIMER_REG_ALARM 0x01 83 #define TIMER_REG_ELAPSED 0x05 84 #define TIMER_REG_EVT_CNTR 0x09 85 #define TIMER_REG_EEPROM 0x0B 86 #define TIMER_REG_RESET 0x1D 87 #define TIMER_REG_WRITE_DISABLE 0x1E 88 #define TIMER_REG_WRITE_MEM_DISABLE 0x1F 95 #define TIMER_ECMSB_BIT 0x01 96 #define TIMER_AP_BIT 0x02 97 #define TIMER_RE_BIT 0x04 98 #define TIMER_AOS_BIT 0x08 99 #define TIMER_WMDF_BIT 0x10 100 #define TIMER_WDF_BIT 0x20 101 #define TIMER_AF_BIT 0x40 108 #define TIMER_EEPROM_SIZE 10 324 void timer_get_time (
timer_t *ctx, uint16_t *time_days, uint8_t *time_hours, uint8_t *time_minutes, uint8_t *time_seconds );
429 void timer_get_alarm_time (
timer_t *ctx, uint16_t *time_days, uint8_t *time_hours, uint8_t *time_minutes, uint8_t *time_seconds );
pin_name_t alm
Definition: timer.h:154
void timer_alarm_output_select(timer_t *ctx)
Set alarm output select function.
digital_out_t evt
Definition: timer.h:125
void timer_enable_write(timer_t *ctx)
Enable write data function.
void timer_soft_reset(timer_t *ctx)
Soft reset function.
void timer_cfg_setup(timer_cfg_t *cfg)
Config Object Initialization function.
Click ctx object definition.
Definition: timer.h:121
pin_name_t sda
Definition: timer.h:149
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.
uint32_t timer_get_etc_data(timer_t *ctx)
Get elapsed time counter (ETC) data function.
uint16_t timer_get_ec_seconds(timer_t *ctx)
Get elapsed time counter (EC) seconds function.
uint32_t timer_get_alarm_seconds(timer_t *ctx)
Get alarm seconds function.
Click configuration structure definition.
Definition: timer.h:144
void timer_set_ec_seconds(timer_t *ctx, uint16_t ec_seconds)
Set elapsed time counter (EC) seconds 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_reset_enable(timer_t *ctx)
Set enable reset function.
uint8_t timer_check_interrupt(timer_t *ctx)
Check interrupt function.
pin_name_t evt
Definition: timer.h:153
uint16_t timer_get_ec_data(timer_t *ctx)
Get event counter (EC) data function.
void timer_hw_reset(timer_t *ctx)
Hardwere reset function.
pin_name_t scl
Definition: timer.h:148
#define TIMER_RETVAL
Definition: timer.h:64
void timer_set_etc_data(timer_t *ctx, uint32_t etc_value)
Set elapsed time counter (ETC) data function.
uint8_t timer_get_configuration(timer_t *ctx)
Get configuration data function.
uint32_t i2c_speed
Definition: timer.h:158
uint32_t timer_get_alarm_data(timer_t *ctx)
Get alarm data function.
void timer_set_etc_seconds(timer_t *ctx, uint32_t etc_seconds)
Set elapsed time counter (ETC) seconds function.
digital_in_t alm
Definition: timer.h:129
void timer_set_alarm_data(timer_t *ctx, uint32_t a_data)
Set alarm data function.
uint8_t i2c_address
Definition: timer.h:159
i2c_master_t i2c
Definition: timer.h:133
void timer_write_byte_eeprom(timer_t *ctx, uint8_t location, uint8_t write_data)
Write data from the EEPROM memory function.
uint8_t slave_address
Definition: timer.h:137
uint8_t timer_check_write_disable(timer_t *ctx)
Check write disable ( write protection ) function.
void timer_set_ec_data(timer_t *ctx, uint16_t ec_value)
Set elapsed time counter (EC) data function.
void timer_read_eeprom(timer_t *ctx)
Read data from the EEPROM memory function.
void timer_generic_write(timer_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
void timer_disable_write(timer_t *ctx)
Disable write data ( write protection ) function.
uint8_t timer_get_alarm_flag(timer_t *ctx)
Get alarm flag function.
TIMER_RETVAL timer_init(timer_t *ctx, timer_cfg_t *cfg)
Initialization function.
uint8_t timer_read_byte_eeprom(timer_t *ctx, uint8_t location)
Read the byte of data from the EEPROM memory function.
void timer_generic_read(timer_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
void timer_set_alarm_polarity(timer_t *ctx)
Set alarm polarity function.