42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
67#define CAPWHEEL2_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
69 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
70 cfg.rdy = MIKROBUS( mikrobus, MIKROBUS_INT )
77#define CAPWHEEL2_RETVAL uint8_t
79#define CAPWHEEL2_OK 0x00
80#define CAPWHEEL2_INIT_ERROR 0xFF
87#define CAPWHEEL2_DEVICE_ADDRESS 0x44
94#define CAPWHEEL2_DEVICE_INFO 0x00
95#define CAPWHEEL2_SYS_FLAGS 0x01
96#define CAPWHEEL2_COORDINATES 0x02
97#define CAPWHEEL2_TOUCH_BYTES 0x03
98#define CAPWHEEL2_COUNTS 0x04
99#define CAPWHEEL2_LTA 0x05
100#define CAPWHEEL2_DELTAS 0x06
101#define CAPWHEEL2_MULTIPLIERS 0x07
102#define CAPWHEEL2_COMPENSATION 0x08
103#define CAPWHEEL2_PROX_SETTINGS 0x09
104#define CAPWHEEL2_THRESHOLDS 0x0A
105#define CAPWHEEL2_TIMINGS_AND_TARGETS 0x0B
106#define CAPWHEEL2_GESTURE_TIMERS 0x0C
107#define CAPWHEEL2_ACTIVE_CHANNELS 0x0D
114#define CAPWHEEL2_TAP_MASK 0x20
115#define CAPWHEEL2_TOUCH_MASK 0x02
116#define CAPWHEEL2_PROX_MASK 0x01
#define CAPWHEEL2_RETVAL
Definition capwheel2.h:77
uint8_t capwheel2_default_cfg(capwheel2_t *ctx)
Click Default Configuration function.
void capwheel2_cfg_setup(capwheel2_cfg_t *cfg)
Config Object Initialization function.
uint8_t capwheel2_i2c_read_wait(capwheel2_t *ctx, uint8_t register_address, uint8_t *read_buffer, uint8_t n_bytes)
Read wait function.
CAPWHEEL2_RETVAL capwheel2_init(capwheel2_t *ctx, capwheel2_cfg_t *cfg)
Initialization function.
void capwheel2_i2c_write_no_wait(capwheel2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Write function.
uint8_t capwheel2_i2c_write_wait(capwheel2_t *ctx, uint8_t register_address, uint8_t *register_values, uint8_t n_bytes)
Write wait function.
uint8_t capwheel2_int_get(capwheel2_t *ctx)
Getingg state of INT pin.
void capwheel2_i2c_read_no_wait(capwheel2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Read function.
uint8_t capwheel2_wait_for_rdy(capwheel2_t *ctx)
Waiting for RDY (INT) pin.
Click configuration structure definition.
Definition capwheel2.h:149
uint32_t i2c_speed
Definition capwheel2.h:161
pin_name_t scl
Definition capwheel2.h:152
pin_name_t rdy
Definition capwheel2.h:157
pin_name_t sda
Definition capwheel2.h:153
uint8_t i2c_address
Definition capwheel2.h:162
Click ctx object definition.
Definition capwheel2.h:130
i2c_master_t i2c
Definition capwheel2.h:137
uint8_t slave_address
Definition capwheel2.h:141
digital_in_t rdy
Definition capwheel2.h:133