touchpad 2.0.0.0
touchpad.h File Reference

This file contains API for Touchpad 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  touchpad_t
 Click ctx object definition. More...
 
struct  touchpad_cfg_t
 Click configuration structure definition. More...
 
struct  touchpad_cord_t
 Coordinate structure definition. More...
 

Macros

#define TOUCHPAD_MAP_MIKROBUS(cfg, mikrobus)
 
#define TOUCHPAD_RETVAL   uint8_t
 
#define TOUCHPAD_OK   0x00
 
#define TOUCHPAD_INIT_ERROR   0xFF
 
#define TOUCHPAD_DEVICE_SLAVE_ADDR   0x25
 
#define TOUCHPAD_REG_FW_MAJOR   0x00
 
#define TOUCHPAD_REG_FW_MINOR   0x01
 
#define TOUCHPAD_REG_APP_ID_LSB   0x02
 
#define TOUCHPAD_REG_APP_ID_MSB   0x03
 
#define TOUCHPAD_REG_CMD   0x04
 
#define TOUCHPAD_REG_MODE   0x05
 
#define TOUCHPAD_REG_MODE_CON   0x06
 
#define TOUCHPAD_REG_TOUCH_STATE   0x10
 
#define TOUCHPAD_REG_TOUCH_X   0x11
 
#define TOUCHPAD_REG_TOUCH_Y   0x12
 
#define TOUCHPAD_REG_TOUCH_LSB   0x13
 
#define TOUCHPAD_REG_GESTURE_STATE   0x14
 
#define TOUCHPAD_REG_GESTURE_DIAG   0x15
 
#define TOUCHPAD_REG_NUM_OF_X_CHANNELS   0x20
 
#define TOUCHPAD_REG_NUM_OF_Y_CHANNELS   0x21
 
#define TOUCHPAD_REG_SCAN_COUNT   0x22
 
#define TOUCHPAD_REG_TOUCH_THR_X   0x23
 
#define TOUCHPAD_REG_TOUCH_THR_Y   0x24
 
#define TOUCHPAD_REG_ACTIVE_PERIOD_LSB   0x25
 
#define TOUCHPAD_REG_ACTIVE_PERIOD_MSB   0x26
 
#define TOUCHPAD_REG_IDLE_PERIOD_LSB   0x27
 
#define TOUCHPAD_REG_IDLE_PERIOD_MSB   0x28
 
#define TOUCHPAD_REG_IDLE_TIMEOUT   0x29
 
#define TOUCHPAD_REG_HYSTERESIS   0x2A
 
#define TOUCHPAD_REG_DEBOUNCE_UP   0x2B
 
#define TOUCHPAD_REG_DEBOUNCE_DOWN   0x2C
 
#define TOUCHPAD_REG_FILTER_TYPE   0x31
 
#define TOUCHPAD_REG_FILTER_THR   0x32
 
#define TOUCHPAD_REG_LARGE_ACTIVATION_THR_LSB   0x35
 
#define TOUCHPAD_REG_LARGE_ACTIVATION_THR_MSB   0x36
 
#define TOUCHPAD_REG_HORIZONTAL_SWIPE_DISTANCE   0x37
 
#define TOUCHPAD_REG_VERTICAL_SWIPE_DISTANCE   0x38
 
#define TOUCHPAD_REG_SWIPE_HOLD_BOUNDARY   0x39
 
#define TOUCHPAD_REG_TAP_DISTANCE   0x3A
 
#define TOUCHPAD_REG_DISTANCE_BETWEEN_TAPS   0x3B
 
#define TOUCHPAD_REG_TAP_HOLD_TIME_LSB   0x3C
 
#define TOUCHPAD_REG_TAP_HOLD_TIME_MSB   0x3D
 
#define TOUCHPAD_REG_GESTURE_CLICK_TIME   0x3E
 
#define TOUCHPAD_REG_SWIPE_HOLD_THRESHOLD   0x3F
 
#define TOUCHPAD_REG_MIN_SWIPE_VELOCITY   0x40
 
#define TOUCHPAD_REG_HORIZONTAL_GESTURE_ANGLE   0x41
 
#define TOUCHPAD_REG_VERTICAL_GESTURE_ANGLE   0x42
 
#define TOUCHPAD_MODE_STANDBY   0x00
 
#define TOUCHPAD_MODE_GESTURE   0x01
 
#define TOUCHPAD_MODE_TOUCH_ONLY   0x02
 
#define TOUCHPAD_MODE_FULL   0x03
 
#define TOUCHPAD_MODE_RAW_ADC   0x04
 
#define TOUCHPAD_RAWADC_TYPE_RES_1_2   0x00
 
#define TOUCHPAD_RAWADC_TYPE_RES_1   0x01
 
#define TOUCHPAD_RAWADC_TYPE_RES_2   0x02
 
#define TOUCHPAD_CMD_NV_STORAGE_WRITE   0x80
 
#define TOUCHPAD_CMD_RESTORE_DEF_CONFIG   0x40
 
#define TOUCHPAD_CMD_CONFIG_CTRL   0x20
 
#define TOUCHPAD_CMD_EXECUTE_MANU_TEST   0x08
 
#define TOUCHPAD_CMD_FORCE_BASELINE   0x01
 
#define TOUCHPAD_PERIOD_10ms   0x0142
 
#define TOUCHPAD_PERIOD_20ms   0x0284
 
#define TOUCHPAD_PERIOD_50ms   0x064C
 
#define TOUCHPAD_PERIOD_1000ms   0x0C99
 
#define TOUCHPAD_TOUCH_IS_PRESENT   0x01
 
#define TOUCHPAD_GESTURE_IS_PRESENT   0x02
 
#define TOUCHPAD_LARGE_ACT_IS_PRESENT   0x04
 
#define TOUCHPAD_GS_NO_GESTURE_PRESENT   0x00
 
#define TOUCHPAD_GS_SINGLE_CLICK   0x10
 
#define TOUCHPAD_GS_CLICK_AND_HOLD   0x11
 
#define TOUCHPAD_GS_DOUBLE_CLICK   0x20
 
#define TOUCHPAD_GS_DOWN_SWIPE   0x31
 
#define TOUCHPAD_GS_DOWN_SWIPE_AND_HOLD   0x32
 
#define TOUCHPAD_GS_RIGHT_SWIPE   0x41
 
#define TOUCHPAD_GS_RIGHT_SWIPE_AND_HOLD   0x42
 
#define TOUCHPAD_GS_UP_SWIPE   0x51
 
#define TOUCHPAD_GS_UP_SWIPE_AND_HOLD   0x52
 
#define TOUCHPAD_GS_LEFT_SWIPE   0x61
 
#define TOUCHPAD_GS_LEFT_SWIPE_AND_HOLD   0x62
 
#define TOUCHPAD_EVENT_TOUCH   1
 
#define TOUCHPAD_EVENT_GESTURE   2
 
#define TOUCHPAD_NO_EVENT   0
 
#define TOUCHPAD_GD_CLICK_TIMEOUT   0x01
 
#define TOUCHPAD_GD_SWIPE_TIMEOUT   0x02
 
#define TOUCHPAD_GD_GENERAL_TIMEOUT   0x03
 
#define TOUCHPAD_GD_CLICK_THR_EXCEEDED   0x04
 
#define TOUCHPAD_GD_SWIPE_THR_EXCEEDED   0x05
 
#define TOUCHPAD_GD_SWIPE_HOLD_THR   0x06
 
#define TOUCHPAD_GD_SWIPE_OPPOSITE_DIR_THR   0x07
 
#define TOUCHPAD_GD_SWIPE_HOLD_VALUE   0x09
 
#define TOUCHPAD_GD_OUTSIDE_SWIPE   0x0A
 

Functions

void touchpad_cfg_setup (touchpad_cfg_t *cfg)
 Config Object Initialization function.
 
TOUCHPAD_RETVAL touchpad_init (touchpad_t *ctx, touchpad_cfg_t *cfg)
 Initialization function.
 
void touchpad_default_cfg (touchpad_t *ctx)
 Click Default Configuration function.
 
void touchpad_generic_write (touchpad_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void touchpad_generic_read (touchpad_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void touchpad_get_touch_coordinate (touchpad_t *ctx, touchpad_cord_t *cord)
 Get touch coordinate.
 
uint8_t touchpad_get_interrupt_state (touchpad_t *ctx)
 Get interrupt state.
 
void touchpad_reset (touchpad_t *ctx)
 Hardware Reset.
 
uint8_t touchpad_get_event_state (touchpad_t *ctx)
 Get event state.
 
uint8_t touchpad_get_gesture_type (touchpad_t *ctx)
 Gesture type.
 

Detailed Description

This file contains API for Touchpad Click driver.