capslider2 2.0.0.0
capslider2.h File Reference

This file contains API for CAP SLIDER 2 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  capslider2_t
 Click ctx object definition. More...
 
struct  capslider2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define CAPSLIDER2_MAP_MIKROBUS(cfg, mikrobus)
 
#define CAPSLIDER2_RETVAL   uint8_t
 
#define CAPSLIDER2_OK   0x00
 
#define CAPSLIDER2_INIT_ERROR   0xFF
 
#define CAPSLDR2_DEVICE_ADDR   0x64
 
#define CAPSLDR2_DEVICE_INFO_REG   0x00
 
#define CAPSLDR2_SYSTEM_FLAGS_REG   0x01
 
#define CAPSLDR2_WHEEL_COORDNT_REG   0x02
 
#define CAPSLDR2_TOUCH_BYTES_REG   0x03
 
#define CAPSLDR2_COUNTS_REG   0x04
 
#define CAPSLDR2_LTA_REG   0x05
 
#define CAPSLDR2_MULTIPLIERS_REG   0x06
 
#define CAPSLDR2_COMPENS_REG   0x07
 
#define CAPSLDR2_PROXSETT_REG   0x08
 
#define CAPSLDR2_THRESH_REG   0x09
 
#define CAPSLDR2_TIMINGS_REG   0x0A
 
#define CAPSLDR2_TARGETS_REG   0x0B
 
#define CAPSLDR2_PWM_DUTY_REG   0x0C
 
#define CAPSLDR2_PWM_LIM_REG   0x0D
 
#define CAPSLDR2_ACTIVE_CHANN_REG   0x0E
 
#define CAPSLDR2_BUZZER_REG   0x0F
 
#define CAPSLDR2_DEV_INFO_NBYTES   2
 
#define CAPSLDR2_SYST_FLAGS_NBYTES   1
 
#define CAPSLDR2_WHEEL_NBYTES   4
 
#define CAPSLDR2_TOUCH_NBYTES   2
 
#define CAPSLDR2_COUNTS_NBYTES   18
 
#define CAPSLDR2_LTA_NBYTES   18
 
#define CAPSLDR2_MULTIPL_NBYTES   10
 
#define CAPSLDR2_COMPENS_NBYTES   10
 
#define CAPSLDR2_PROXSETT_NBYTES   6
 
#define CAPSLDR2_THRESH_NBYTES   10
 
#define CAPSLDR2_TIMINGS_NBYTES   13
 
#define CAPSLDR2_TARGETS_NBYTES   10
 
#define CAPSLDR2_PWM_DUTY_NBYTES   8
 
#define CAPSLDR2_PWM_LIM_NBYTES   2
 
#define CAPSLDR2_ACT_CHANN_NBYTES   2
 
#define CAPSLDR2_BUZZER_NBYTES   1
 
#define CAPSLDR2_BUZZER_EN   0x80
 
#define CAPSLDR2_BUZZER_DC_HIGH   0x04
 
#define CAPSLDR2_BUZZER_DC_LOW   0x00
 
#define CAPSLDR2_BUZZER_PERM_EN   0x02
 
#define CAPSLDR2_BUZZER_BURST_EN   0x01
 
#define CAPSLDR2_CH0_PROX_EN   0x001
 
#define CAPSLDR2_CH1_EN   0x002
 
#define CAPSLDR2_CH2_EN   0x004
 
#define CAPSLDR2_CH3_EN   0x008
 
#define CAPSLDR2_CH4_EN   0x010
 
#define CAPSLDR2_CH5_EN   0x020
 
#define CAPSLDR2_CH6_EN   0x040
 
#define CAPSLDR2_CH7_EN   0x080
 
#define CAPSLDR2_CH8_EN   0x100
 
#define CAPSLDR2_CH9_EN   0x200
 
#define CAPSLDR2_PWM_OFF   0x00
 
#define CAPSLDR2_PWM_CONST   0x20
 
#define CAPSLDR2_PWM_DECR_0_PERCENTS   0x80
 
#define CAPSLDR2_PWM_DECR_LIM   0xA0
 
#define CAPSLDR2_PWM_INCR_100_PERCENTS   0xC0
 
#define CAPSLDR2_PWM_INCR_LIM   0xE0
 
#define CAPSLDR2_PWM_DUTY_0_PERCENTS   0x00
 
#define CAPSLDR2_PWM_DUTY_25_PERCENTS   0x10
 
#define CAPSLDR2_PWM_DUTY_50_PERCENTS   0x18
 
#define CAPSLDR2_PWM_DUTY_75_PERCENTS   0x1C
 
#define CAPSLDR2_PWM_DUTY_100_PERCENTS   0x1F
 
#define CAPSLDR2_DATA_READY   0
 
#define CAPSLDR2_DATA_NOT_READY   1
 
#define CAPSLDR2_INVALID_ADDR   0xFF
 
#define CAPSLDR2_INVALID_NBYTES   0xFE
 
#define CAPSLDR2_INVALID_CHANNEL   0xFD
 
#define CAPSLDR2_OK   0x00
 
#define CAPSLDR2_LED_INTENSITY   0
 
#define CAPSLDR2_LED_NUMBER   1
 

Functions

void capslider2_cfg_setup (capslider2_cfg_t *cfg)
 Config Object Initialization function.
 
CAPSLIDER2_RETVAL capslider2_init (capslider2_t *ctx, capslider2_cfg_t *cfg)
 Initialization function.
 
void capslider2_generic_write (capslider2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void capslider2_generic_read (capslider2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t capsldr2_write_reg (capslider2_t *ctx, uint8_t register_address, uint8_t *data_in, uint8_t n_bytes)
 Generic Write function.
 
uint8_t capsldr2_read_reg (capslider2_t *ctx, uint8_t register_address, uint8_t *data_out, uint8_t n_bytes)
 Generic Read function.
 
uint8_t capsldr2_check_data_ready (capslider2_t *ctx)
 Data Ready Check function.
 
uint8_t capsldr2_enable_chann (capslider2_t *ctx, uint16_t sel_chann)
 Channel Enable function.
 
void capsldr2_get_data (capslider2_t *ctx, uint16_t *wheel_data1, uint16_t *wheel_data2)
 Data Get function.
 
void capsldr2_set_output (capslider2_t *ctx, uint8_t input_data, uint8_t output_mode)
 Output Set function.
 
void capsldr2_set_threshold (capslider2_t *ctx, uint8_t thresh_value)
 Threshold Set function.
 
void capsldr2_reset (capslider2_t *ctx)
 Reset function.
 
void capsldr2_config (capslider2_t *ctx)
 Config function.
 

Detailed Description

This file contains API for CAP SLIDER 2 Click driver.