touchpad2 2.0.0.0
touchpad2.h File Reference

This file contains API for TouchPad 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  touchpad2_t
 TouchPad 2 Click context object. More...
 
struct  touchpad2_cfg_t
 TouchPad 2 Click configuration object. More...
 
struct  touchpad2_ver_info_t
 TouchPad 2 device version information object. More...
 
struct  touchpad2_touch_t
 TouchPad 2 XY data object. More...
 
struct  touchpad2_channel_setup_t
 TouchPad Channel Setup object. More...
 

Macros

#define TOUCHPAD2_CMD_VERSION_INFO   0x00
 TouchPad 2 description register.
 
#define TOUCHPAD2_CMD_XY_DATA   0x01
 
#define TOUCHPAD2_CMD_PROXIMITY_STATUS   0x02
 
#define TOUCHPAD2_CMD_TOUCH_STATUS   0x03
 
#define TOUCHPAD2_CMD_COUNT_VALUES   0x04
 
#define TOUCHPAD2_CMD_LONG_TERM_AVERAGES   0x05
 
#define TOUCHPAD2_CMD_ATI_COMPENSATION   0x06
 
#define TOUCHPAD2_CMD_PORT_CONTROL   0x07
 
#define TOUCHPAD2_CMD_SNAP_STATUS   0x08
 
#define TOUCHPAD2_CMD_CONTROL_SETTINGS   0x10
 
#define TOUCHPAD2_CMD_THRESHOLD_SETTINGS   0x11
 
#define TOUCHPAD2_CMD_ATI_SETTINGS   0x12
 
#define TOUCHPAD2_CMD_FILTER_SETTINGS   0x13
 
#define TOUCHPAD2_CMD_TIMING_SETTINGS   0x14
 
#define TOUCHPAD2_CMD_CHANNEL_SETUP   0x15
 
#define TOUCHPAD2_CMD_HARDWARE_CONFIG_SETTINGS   0x16
 
#define TOUCHPAD2_CMD_ACTIVE_CHANNELS   0x17
 
#define TOUCHPAD2_CMD_DEBOUNCE_SETTINGS   0x18
 
#define TOUCHPAD2_CMD_PM_PROXIMITY_STATUS   0x20
 
#define TOUCHPAD2_CMD_PM_COUNT_VALUES   0x21
 
#define TOUCHPAD2_CMD_PM_LONG_TERM_AVERAGES   0x22
 
#define TOUCHPAD2_CMD_PM_ATI_COMPENSATION   0x23
 
#define TOUCHPAD2_CMD_PM_ATI_SETTINGS   0x24
 
#define TOUCHPAD2_CMD_BOOTLOADER   0xFF
 
#define TOUCHPAD2_SET_DEV_ADDR   0x74
 TouchPad 2 description setting.
 
#define TOUCHPAD2_SHOW_RESET   0x80
 TouchPad 2 XY Info Byte bit definitions.
 
#define TOUCHPAD2_MODE_INDICATOR   0x40
 
#define TOUCHPAD2_NOISE_STATUS   0x20
 
#define TOUCHPAD2_LP_STATUS   0x10
 
#define TOUCHPAD2_SNAP_OUTPUT   0x08
 
#define TOUCHPAD2_NO_OF_FINGERS   0x07
 
#define TOUCHPAD2_ACK_RESET   0x80
 TouchPad 2 Control Settings 0 and 1 definitions.
 
#define TOUCHPAD2_AUTO_MODES   0x40
 
#define TOUCHPAD2_SINGLE_XY   0x20
 
#define TOUCHPAD2_PM_RESEED   0x10
 
#define TOUCHPAD2_MODE_SELECT   0x08
 
#define TOUCHPAD2_AUTO_ATI   0x04
 
#define TOUCHPAD2_TRACKPAD_RESEED   0x02
 
#define TOUCHPAD2_EVENT_MODE   0x01
 
#define TOUCHPAD2_DIS_PROX_EVENT   0x80
 
#define TOUCHPAD2_DIS_TOUCH_EVENT   0x40
 
#define TOUCHPAD2_DIS_SNAP_EVENT   0x20
 
#define TOUCHPAD2_DIS_PMPROX_EVENT   0x10
 
#define TOUCHPAD2_REVERSE_EN   0x08
 
#define TOUCHPAD2_SLEEP_EN   0x04
 
#define TOUCHPAD2_LOW_POWER   0x02
 
#define TOUCHPAD2_SNAP_EN   0x01
 
#define TOUCHPAD2_DIS_NM_FILTER   0x10
 TouchPad 2 Control Filter Settings definitions.
 
#define TOUCHPAD2_DIS_PM_FILTER   0x08
 
#define TOUCHPAD2_SELECT_TOUCH_FILTER   0x04
 
#define TOUCHPAD2_DIS_HOVER_FILTER   0x02
 
#define TOUCHPAD2_DIS_TOUCH_FILTER   0x01
 
#define TOUCHPAD2_CHARGE_TYPE_SELF_CHARG   0x80
 TouchPad 2 PM Setup definitions.
 
#define TOUCHPAD2_CHARGE_MUTUAL_SELF_CHARG   0x00
 
#define TOUCHPAD2_RX_GROUP_RXB   0x40
 
#define TOUCHPAD2_RX_GROUP_RXA   0x00
 
#define TOUCHPAD2_SUM_OF_TP_RX   0x10
 
#define TOUCHPAD2_SUM_OF_TP_TX   0x00
 
#define TOUCHPAD2_RX_SELECT   0x0F
 
#define TOUCHPAD2_TX_CFG_DEFAULT   0x001F
 
#define TOUCHPAD2_ND_ENABLE   0x20
 TouchPad 2 Hardware Settings definitions.
 
#define TOUCHPAD2_RX_FLOAT   0x04
 
#define TOUCHPAD2_CK_FREQ_2   0x40
 
#define TOUCHPAD2_CK_FREQ_1   0x20
 
#define TOUCHPAD2_CK_FREQ_0   0x10
 
#define TOUCHPAD2_ANA_DEAD_TIME   0x02
 
#define TOUCHPAD2_INCR_PHASE   0x01
 
#define TOUCHPAD2_STAB_TIME_1   0x80
 
#define TOUCHPAD2_STAB_TIME_0   0x40
 
#define TOUCHPAD2_OPAMP_BIAS_1   0x20
 
#define TOUCHPAD2_OPAMP_BIAS_0   0x10
 
#define TOUCHPAD2_VTRIP_3   0x08
 
#define TOUCHPAD2_VTRIP_2   0x04
 
#define TOUCHPAD2_VTRIP_1   0x02
 
#define TOUCHPAD2_VTRIP_0   0x01
 
#define TOUCHPAD2_UPLEN_2   0x40
 
#define TOUCHPAD2_UPLEN_1   0x20
 
#define TOUCHPAD2_UPLEN_0   0x10
 
#define TOUCHPAD2_PASSLEN_2   0x04
 
#define TOUCHPAD2_PASSLEN_1   0x02
 
#define TOUCHPAD2_PASSLEN_0   0x01
 
#define TOUCHPAD2_PALM_REJECT   0x08
 TouchPad 2 XY Config definitions.
 
#define TOUCHPAD2_SWITCH_XY_AXIS   0x04
 
#define TOUCHPAD2_FLIP_Y   0x02
 
#define TOUCHPAD2_FLIP_X   0x01
 
#define TOUCHPAD2_PROX_EVENT   0x80
 TouchPad 2 System Config definitions.
 
#define TOUCHPAD2_TOUCH_EVENT   0x40
 
#define TOUCHPAD2_SNAP_EVENT   0x20
 
#define TOUCHPAD2_ALP_PROX_EVENT   0x10
 
#define TOUCHPAD2_REATI_EVENT   0x08
 
#define TOUCHPAD2_TP_EVENT   0x04
 
#define TOUCHPAD2_GESTURE_EVENT   0x02
 
#define TOUCHPAD2_EVENT_MODE   0x01
 
#define TOUCHPAD2_ALP_COUNT_FILTER   0x08
 
#define TOUCHPAD2_IIR_SELECT   0x04
 
#define TOUCHPAD2_MAV_FILTER   0x02
 
#define TOUCHPAD2_IIR_FILTER   0x01
 
#define TOUCHPAD2_CHARGE_TYPE   0x80
 TouchPad 2 ALP Channel Setup definitions.
 
#define TOUCHPAD2_RX_GROUP   0x40
 
#define TOUCHPAD2_PROX_REV   0x20
 
#define TOUCHPAD2_ALP_ENABLE   0x10
 
#define TOUCHPAD2_RX7_TX2   0x80
 TouchPad 2 Rx To Tx definitions.
 
#define TOUCHPAD2_RX6_TX3   0x40
 
#define TOUCHPAD2_RX5_TX4   0x20
 
#define TOUCHPAD2_RX4_TX5   0x10
 
#define TOUCHPAD2_RX3_TX6   0x08
 
#define TOUCHPAD2_RX2_TX7   0x04
 
#define TOUCHPAD2_RX1_TX8   0x02
 
#define TOUCHPAD2_RX0_TX9   0x01
 
#define TOUCHPAD2_PROXIMITY_STATUS   0x00
 TouchPad 2 status selection.
 
#define TOUCHPAD2_TOUCH_STATUS   0x01
 
#define TOUCHPAD2_SNAP_STATUS   0x02
 
#define TOUCHPAD2_ID_TAG_TOUCH_1   0x01
 TouchPad 2 ID tag selection.
 
#define TOUCHPAD2_ID_TAG_TOUCH_2   0x02
 
#define TOUCHPAD2_ID_TAG_TOUCH_3   0x03
 
#define TOUCHPAD2_ID_TAG_TOUCH_4   0x04
 
#define TOUCHPAD2_ID_TAG_TOUCH_5   0x05
 
#define TOUCHPAD2_ID_TAG_HOVER_1   0x81
 
#define TOUCHPAD2_ID_TAG_HOVER_2   0x82
 
#define TOUCHPAD2_ID_TAG_HOVER_3   0x83
 
#define TOUCHPAD2_ID_TAG_HOVER_4   0x84
 
#define TOUCHPAD2_ID_TAG_HOVER_5   0x85
 
#define TOUCHPAD2_IQS525_PRODUCT_NUMBER   0x34
 TouchPad 2 Product Number selection.
 
#define TOUCHPAD2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  touchpad2_return_value_t { TOUCHPAD2_OK = 0 , TOUCHPAD2_ERROR = -1 }
 TouchPad 2 Click return value data. More...
 

Functions

void touchpad2_cfg_setup (touchpad2_cfg_t *cfg)
 TouchPad 2 configuration object setup function.
 
err_t touchpad2_init (touchpad2_t *ctx, touchpad2_cfg_t *cfg)
 TouchPad 2 initialization function.
 
err_t touchpad2_default_cfg (touchpad2_t *ctx)
 TouchPad 2 default configuration function.
 
err_t touchpad2_generic_write (touchpad2_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 TouchPad 2 I2C writing function.
 
err_t touchpad2_generic_read (touchpad2_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 TouchPad 2 I2C reading function.
 
uint8_t touchpad2_check_interrupt (touchpad2_t *ctx)
 TouchPad 2 check interrupt function.
 
void touchpad2_wait_ready (touchpad2_t *ctx)
 TouchPad 2 wait ready function.
 
err_t touchpad2_channel_setup (touchpad2_t *ctx, touchpad2_channel_setup_t ch_setup)
 TouchPad 2 channel setup function.
 
err_t touchpad2_check_version (touchpad2_t *ctx, touchpad2_ver_info_t *ver_info)
 TouchPad 2 check version function.
 
err_t touchpad2_get_touch (touchpad2_t *ctx, touchpad2_touch_t *touch_data)
 TouchPad 2 get touch function.
 
err_t touchpad2_get_all_data (touchpad2_t *ctx, uint8_t *rx_data)
 TouchPad 2 get all data function.
 
err_t touchpad2_get_status (touchpad2_t *ctx, uint8_t sel_status, uint16_t *rx_data)
 TouchPad 2 get status function.
 

Detailed Description

This file contains API for TouchPad 2 Click Driver.

Enumeration Type Documentation

◆ touchpad2_return_value_t

TouchPad 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
TOUCHPAD2_OK 
TOUCHPAD2_ERROR