touchclamp 2.0.0.0
touchclamp.h File Reference

This file contains API for TouchClamp 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  touchclamp_t
 Click ctx object definition. More...
 
struct  touchclamp_cfg_t
 Click configuration structure definition. More...
 

Macros

#define TOUCHCLAMP_MAP_MIKROBUS(cfg, mikrobus)
 
#define TOUCHCLAMP_RETVAL   uint8_t
 
#define TOUCHCLAMP_OK   0x00
 
#define TOUCHCLAMP_INIT_ERROR   0xFF
 
#define TOUCHCLAMP_I2C_ADDRESS   0x5A
 
#define TOUCHCLAMP_REG_TS1   0x00
 
#define TOUCHCLAMP_REG_TS2   0x01
 
#define TOUCHCLAMP_REG_OORS1   0x02
 
#define TOUCHCLAMP_REG_OORS2   0x03
 
#define TOUCHCLAMP_REG_E0FDL   0x04
 
#define TOUCHCLAMP_REG_E0FDH   0x05
 
#define TOUCHCLAMP_REG_E1FDL   0x06
 
#define TOUCHCLAMP_REG_E1FDH   0x07
 
#define TOUCHCLAMP_REG_E2FDL   0x08
 
#define TOUCHCLAMP_REG_E2FDH   0x09
 
#define TOUCHCLAMP_REG_E3FDL   0x0A
 
#define TOUCHCLAMP_REG_E3FDH   0x0B
 
#define TOUCHCLAMP_REG_E4FDL   0x0C
 
#define TOUCHCLAMP_REG_E4FDH   0x0D
 
#define TOUCHCLAMP_REG_E5FDL   0x0E
 
#define TOUCHCLAMP_REG_E5FDH   0x0F
 
#define TOUCHCLAMP_REG_E6FDL   0x10
 
#define TOUCHCLAMP_REG_E6FDH   0x11
 
#define TOUCHCLAMP_REG_E7FDL   0x12
 
#define TOUCHCLAMP_REG_E7FDH   0x13
 
#define TOUCHCLAMP_REG_E8FDL   0x14
 
#define TOUCHCLAMP_REG_E8FDH   0x15
 
#define TOUCHCLAMP_REG_E9FDL   0x16
 
#define TOUCHCLAMP_REG_E9FDH   0x17
 
#define TOUCHCLAMP_REG_E10FDL   0x18
 
#define TOUCHCLAMP_REG_E10FDH   0x19
 
#define TOUCHCLAMP_REG_E11FDL   0x1A
 
#define TOUCHCLAMP_REG_E11FDH   0x1B
 
#define TOUCHCLAMP_REG_E12FDL   0x1C
 
#define TOUCHCLAMP_REG_E12FDH   0x1D
 
#define TOUCHCLAMP_REG_E0BV   0x1E
 
#define TOUCHCLAMP_REG_E1BV   0x1F
 
#define TOUCHCLAMP_REG_E2BV   0x20
 
#define TOUCHCLAMP_REG_E3BV   0x21
 
#define TOUCHCLAMP_REG_E4BV   0x22
 
#define TOUCHCLAMP_REG_E5BV   0x23
 
#define TOUCHCLAMP_REG_E6BV   0x24
 
#define TOUCHCLAMP_REG_E7BV   0x25
 
#define TOUCHCLAMP_REG_E8BV   0x26
 
#define TOUCHCLAMP_REG_E9BV   0x27
 
#define TOUCHCLAMP_REG_E10BV   0x28
 
#define TOUCHCLAMP_REG_E11BV   0x29
 
#define TOUCHCLAMP_REG_E12BV   0x2A
 
#define TOUCHCLAMP_REG_MHDR   0x2B
 
#define TOUCHCLAMP_REG_NHDR   0x2C
 
#define TOUCHCLAMP_REG_NCLR   0x2D
 
#define TOUCHCLAMP_REG_FDLR   0x2E
 
#define TOUCHCLAMP_REG_MHDF   0x2F
 
#define TOUCHCLAMP_REG_NHDF   0x30
 
#define TOUCHCLAMP_REG_NCLF   0x31
 
#define TOUCHCLAMP_REG_FDLF   0x32
 
#define TOUCHCLAMP_REG_NHDT   0x33
 
#define TOUCHCLAMP_REG_NCLT   0x34
 
#define TOUCHCLAMP_REG_FDLT   0x35
 
#define TOUCHCLAMP_REG_MHDPROXR   0x36
 
#define TOUCHCLAMP_REG_NHDPROXR   0x37
 
#define TOUCHCLAMP_REG_NCLPROXR   0x38
 
#define TOUCHCLAMP_REG_FDLPROXR   0x39
 
#define TOUCHCLAMP_REG_MHDPROXF   0x3A
 
#define TOUCHCLAMP_REG_NHDPROXF   0x3B
 
#define TOUCHCLAMP_REG_NCLPROXF   0x3C
 
#define TOUCHCLAMP_REG_FDLPROXF   0x3D
 
#define TOUCHCLAMP_REG_NHDPROXT   0x3E
 
#define TOUCHCLAMP_REG_NCLPROXT   0x3F
 
#define TOUCHCLAMP_REG_FDLPROXT   0x40
 
#define TOUCHCLAMP_REG_E0TTH   0x41
 
#define TOUCHCLAMP_REG_E0RTH   0x42
 
#define TOUCHCLAMP_REG_E1TTH   0x43
 
#define TOUCHCLAMP_REG_E1RTH   0x44
 
#define TOUCHCLAMP_REG_E2TTH   0x45
 
#define TOUCHCLAMP_REG_E2RTH   0x46
 
#define TOUCHCLAMP_REG_E3TTH   0x47
 
#define TOUCHCLAMP_REG_E3RTH   0x48
 
#define TOUCHCLAMP_REG_E4TTH   0x49
 
#define TOUCHCLAMP_REG_E4RTH   0x4A
 
#define TOUCHCLAMP_REG_E5TTH   0x4B
 
#define TOUCHCLAMP_REG_E5RTH   0x4C
 
#define TOUCHCLAMP_REG_E6TTH   0x4D
 
#define TOUCHCLAMP_REG_E6RTH   0x4E
 
#define TOUCHCLAMP_REG_E7TTH   0x4F
 
#define TOUCHCLAMP_REG_E7RTH   0x50
 
#define TOUCHCLAMP_REG_E8TTH   0x51
 
#define TOUCHCLAMP_REG_E8RTH   0x52
 
#define TOUCHCLAMP_REG_E9TTH   0x53
 
#define TOUCHCLAMP_REG_E9RTH   0x54
 
#define TOUCHCLAMP_REG_E10TTH   0x55
 
#define TOUCHCLAMP_REG_E10RTH   0x56
 
#define TOUCHCLAMP_REG_E11TTH   0x57
 
#define TOUCHCLAMP_REG_E11RTH   0x58
 
#define TOUCHCLAMP_REG_E12TTH   0x59
 
#define TOUCHCLAMP_REG_E12RTH   0x5A
 
#define TOUCHCLAMP_REG_DTR   0x5B
 
#define TOUCHCLAMP_REG_AFE1   0x5C
 
#define TOUCHCLAMP_REG_AFE2   0x5D
 
#define TOUCHCLAMP_REG_ECR   0x5E
 
#define TOUCHCLAMP_REG_CDC0   0x5F
 
#define TOUCHCLAMP_REG_CDC1   0x60
 
#define TOUCHCLAMP_REG_CDC2   0x61
 
#define TOUCHCLAMP_REG_CDC3   0x62
 
#define TOUCHCLAMP_REG_CDC4   0x63
 
#define TOUCHCLAMP_REG_CDC5   0x64
 
#define TOUCHCLAMP_REG_CDC6   0x65
 
#define TOUCHCLAMP_REG_CDC7   0x66
 
#define TOUCHCLAMP_REG_CDC8   0x67
 
#define TOUCHCLAMP_REG_CDC9   0x68
 
#define TOUCHCLAMP_REG_CDC10   0x69
 
#define TOUCHCLAMP_REG_CDC11   0x6A
 
#define TOUCHCLAMP_REG_CDC12   0x6B
 
#define TOUCHCLAMP_REG_CDT01   0x6C
 
#define TOUCHCLAMP_REG_CDT23   0x6D
 
#define TOUCHCLAMP_REG_CDT45   0x6E
 
#define TOUCHCLAMP_REG_CDT67   0x6F
 
#define TOUCHCLAMP_REG_CDT89   0x70
 
#define TOUCHCLAMP_REG_CDT1011   0x71
 
#define TOUCHCLAMP_REG_CDT11   0x72
 
#define TOUCHCLAMP_REG_CTL0   0x73
 
#define TOUCHCLAMP_REG_CTL1   0x74
 
#define TOUCHCLAMP_REG_DAT   0x75
 
#define TOUCHCLAMP_REG_DIR   0x76
 
#define TOUCHCLAMP_REG_EN   0x77
 
#define TOUCHCLAMP_REG_SET   0x78
 
#define TOUCHCLAMP_REG_CLR   0x79
 
#define TOUCHCLAMP_REG_TOG   0x7A
 
#define TOUCHCLAMP_REG_ACCR0   0x7B
 
#define TOUCHCLAMP_REG_ACCR1   0x7C
 
#define TOUCHCLAMP_REG_USL   0x7D
 
#define TOUCHCLAMP_REG_LSL   0x7E
 
#define TOUCHCLAMP_REG_TL   0x7F
 
#define TOUCHCLAMP_REG_SRST   0x80
 
#define TOUCHCLAMP_ECR_INIT_VAL   0x00
 
#define TOUCHCLAMP_MHDR_MAX_VAL   0x01
 
#define TOUCHCLAMP_NHDR_MIN_VAL   0x01
 
#define TOUCHCLAMP_NCLR_DEF_VAL   0x10
 
#define TOUCHCLAMP_FDLR_DEF_VAL   0x20
 
#define TOUCHCLAMP_MHDF_DEF_VAL   0x01
 
#define TOUCHCLAMP_NHDF_DEF_VAL   0x01
 
#define TOUCHCLAMP_NCLF_DEF_VAL   0x10
 
#define TOUCHCLAMP_FDLF_DEF_VAL   0x20
 
#define TOUCHCLAMP_NHDT_DEF_VAL   0x01
 
#define TOUCHCLAMP_NCLT_DEF_VAL   0x10
 
#define TOUCHCLAMP_FDLT_DEF_VAL   0xFF
 
#define TOUCHCLAMP_MHDPROXR_DEF_VAL   0x0F
 
#define TOUCHCLAMP_NHDPROXR_DEF_VAL   0x0F
 
#define TOUCHCLAMP_NCLPROXR_DEF_VAL   0x00
 
#define TOUCHCLAMP_FDLPROXR_DEF_VAL   0x00
 
#define TOUCHCLAMP_MHDPROXF_DEF_VAL   0x01
 
#define TOUCHCLAMP_NHDPROXF_DEF_VAL   0x01
 
#define TOUCHCLAMP_NCLPROXF_DEF_VAL   0xFF
 
#define TOUCHCLAMP_NHDPROXT_DEF_VAL   0x00
 
#define TOUCHCLAMP_DTR_DEF_VAL   0x11
 
#define TOUCHCLAMP_AFE1_DEF_VAL   0xFF
 
#define TOUCHCLAMP_AFE2_DEF_VAL   0x30
 
#define TOUCHCLAMP_ECR_DEF_VAL   0x88
 
#define TOUCHCLAMP_BIT_MASK_SCRATCH   0xF8
 
#define TOUCHCLAMP_BIT_MASK_SAMP_PER   0x07
 
#define TOUCHCLAMP_BIT_MASK_STOP_BIT   0xC0
 
#define TOUCHCLAMP_BIT_MASK_SW_RESET   0x63
 
#define TOUCHCLAMP_TOUCH_POSITION_A   0x80
 
#define TOUCHCLAMP_TOUCH_POSITION_B   0x40
 
#define TOUCHCLAMP_TOUCH_POSITION_C   0x20
 
#define TOUCHCLAMP_TOUCH_POSITION_D   0x08
 
#define TOUCHCLAMP_TOUCH_POSITION_E   0x04
 
#define TOUCHCLAMP_TOUCH_POSITION_F   0x02
 
#define TOUCHCLAMP_TOUCH_POSITION_G   0x01
 
#define TOUCHCLAMP_TOUCH_POSITION_H   0x10
 
#define TOUCHCLAMP_NO_TOUCH   0x00
 

Functions

void touchclamp_cfg_setup (touchclamp_cfg_t *cfg)
 Config Object Initialization function.
 
TOUCHCLAMP_RETVAL touchclamp_init (touchclamp_t *ctx, touchclamp_cfg_t *cfg)
 Initialization function.
 
void touchclamp_default_cfg (touchclamp_t *ctx)
 Click Default Configuration function.
 
void touchclamp_generic_write (touchclamp_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void touchclamp_generic_read (touchclamp_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void touchclamp_soft_reset (touchclamp_t *ctx)
 Soft reset function.
 
void touchclamp_set_touch_threshold (touchclamp_t *ctx, uint8_t th_data)
 Setting touch threshold for a specified electrode function.
 
uint8_t touchclamp_get_touch_threshold (touchclamp_t *ctx, uint8_t electrode)
 Get the current touch threshold for a specified electrode function.
 
void touchclamp_set_release_threshold (touchclamp_t *ctx, uint8_t rth_data)
 Setting release threshold for a specified electrode function.
 
uint8_t touchclamp_get_release_threshold (touchclamp_t *ctx, uint8_t electrode)
 Get the current release threshold for a specified electrode function.
 
uint16_t touchclamp_get_touch_data (touchclamp_t *ctx)
 Get touch data function.
 
void touchclamp_set_sample_period (touchclamp_t *ctx, uint8_t sample_per)
 Sets the sample period function.
 
void touchclamp_digital_toggle (touchclamp_t *ctx, uint8_t electrode)
 Toggles electrode set as GPIO output function.
 
void touchclamp_stop (touchclamp_t *ctx)
 Stop touch clamp function.
 
uint8_t touchclamp_get_interrupt (touchclamp_t *ctx)
 Get state of interrupt pin function.
 

Detailed Description

This file contains API for TouchClamp Click driver.