timer 2.0.0.0
timer.h File Reference

This file contains API for Timer Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  timer_t
 Click ctx object definition. More...
 
struct  timer_cfg_t
 Click configuration structure definition. More...
 

Macros

#define TIMER_MAP_MIKROBUS(cfg, mikrobus)
 
#define TIMER_RETVAL   uint8_t
 
#define TIMER_OK   0x00
 
#define TIMER_INIT_ERROR   0xFF
 
#define TIMER_I2C_ADDR   0x6B
 
#define TIMER_REG_CONFIG   0x00
 
#define TIMER_REG_ALARM   0x01
 
#define TIMER_REG_ELAPSED   0x05
 
#define TIMER_REG_EVT_CNTR   0x09
 
#define TIMER_REG_EEPROM   0x0B
 
#define TIMER_REG_RESET   0x1D
 
#define TIMER_REG_WRITE_DISABLE   0x1E
 
#define TIMER_REG_WRITE_MEM_DISABLE   0x1F
 
#define TIMER_ECMSB_BIT   0x01
 
#define TIMER_AP_BIT   0x02
 
#define TIMER_RE_BIT   0x04
 
#define TIMER_AOS_BIT   0x08
 
#define TIMER_WMDF_BIT   0x10
 
#define TIMER_WDF_BIT   0x20
 
#define TIMER_AF_BIT   0x40
 
#define TIMER_EEPROM_SIZE   10
 

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.
 

Detailed Description

This file contains API for Timer Click driver.