21 #ifndef _ADAFRUIT_STMPE610H_ 22 #define _ADAFRUIT_STMPE610H_ 30 #define STMPE_ADDR 0x41 33 #define STMPE_SYS_CTRL1 0x03 34 #define STMPE_SYS_CTRL1_RESET 0x02 37 #define STMPE_SYS_CTRL2 0x04 40 #define STMPE_TSC_CTRL 0x40 41 #define STMPE_TSC_CTRL_EN 0x01 42 #define STMPE_TSC_CTRL_XYZ 0x00 43 #define STMPE_TSC_CTRL_XY 0x02 46 #define STMPE_INT_CTRL 0x09 47 #define STMPE_INT_CTRL_POL_HIGH 0x04 48 #define STMPE_INT_CTRL_POL_LOW 0x00 49 #define STMPE_INT_CTRL_EDGE 0x02 50 #define STMPE_INT_CTRL_LEVEL 0x00 51 #define STMPE_INT_CTRL_ENABLE 0x01 52 #define STMPE_INT_CTRL_DISABLE 0x00 55 #define STMPE_INT_EN 0x0A 56 #define STMPE_INT_EN_TOUCHDET 0x01 57 #define STMPE_INT_EN_FIFOTH 0x02 58 #define STMPE_INT_EN_FIFOOF 0x04 59 #define STMPE_INT_EN_FIFOFULL 0x08 60 #define STMPE_INT_EN_FIFOEMPTY 0x10 61 #define STMPE_INT_EN_ADC 0x40 62 #define STMPE_INT_EN_GPIO 0x80 65 #define STMPE_INT_STA 0x0B 66 #define STMPE_INT_STA_TOUCHDET 0x01 69 #define STMPE_ADC_CTRL1 0x20 70 #define STMPE_ADC_CTRL1_12BIT 0x08 71 #define STMPE_ADC_CTRL1_10BIT 0x00 74 #define STMPE_ADC_CTRL2 0x21 75 #define STMPE_ADC_CTRL2_1_625MHZ 0x00 76 #define STMPE_ADC_CTRL2_3_25MHZ 0x01 77 #define STMPE_ADC_CTRL2_6_5MHZ 0x02 80 #define STMPE_TSC_CFG 0x41 81 #define STMPE_TSC_CFG_1SAMPLE 0x00 82 #define STMPE_TSC_CFG_2SAMPLE 0x40 83 #define STMPE_TSC_CFG_4SAMPLE 0x80 84 #define STMPE_TSC_CFG_8SAMPLE 0xC0 85 #define STMPE_TSC_CFG_DELAY_10US 0x00 86 #define STMPE_TSC_CFG_DELAY_50US 0x08 87 #define STMPE_TSC_CFG_DELAY_100US 0x10 88 #define STMPE_TSC_CFG_DELAY_500US 0x18 89 #define STMPE_TSC_CFG_DELAY_1MS 0x20 90 #define STMPE_TSC_CFG_DELAY_5MS 0x28 91 #define STMPE_TSC_CFG_DELAY_10MS 0x30 92 #define STMPE_TSC_CFG_DELAY_50MS 0x38 93 #define STMPE_TSC_CFG_SETTLE_10US 0x00 94 #define STMPE_TSC_CFG_SETTLE_100US 0x01 95 #define STMPE_TSC_CFG_SETTLE_500US 0x02 96 #define STMPE_TSC_CFG_SETTLE_1MS 0x03 97 #define STMPE_TSC_CFG_SETTLE_5MS 0x04 98 #define STMPE_TSC_CFG_SETTLE_10MS 0x05 99 #define STMPE_TSC_CFG_SETTLE_50MS 0x06 100 #define STMPE_TSC_CFG_SETTLE_100MS 0x07 103 #define STMPE_FIFO_TH 0x4A 106 #define STMPE_FIFO_SIZE 0x4C 109 #define STMPE_FIFO_STA 0x4B 110 #define STMPE_FIFO_STA_RESET 0x01 111 #define STMPE_FIFO_STA_OFLOW 0x80 112 #define STMPE_FIFO_STA_FULL 0x40 113 #define STMPE_FIFO_STA_EMPTY 0x20 114 #define STMPE_FIFO_STA_THTRIG 0x10 117 #define STMPE_TSC_I_DRIVE 0x58 118 #define STMPE_TSC_I_DRIVE_20MA 0x00 119 #define STMPE_TSC_I_DRIVE_50MA 0x01 122 #define STMPE_TSC_DATA_X 0x4D 123 #define STMPE_TSC_DATA_Y 0x4F 124 #define STMPE_TSC_FRACTION_Z 0x56 127 #define STMPE_GPIO_SET_PIN 0x10 128 #define STMPE_GPIO_CLR_PIN 0x11 129 #define STMPE_GPIO_DIR 0x13 130 #define STMPE_GPIO_ALT_FUNCT 0x17 159 boolean begin(uint8_t i2caddr = STMPE_ADDR);
161 void writeRegister8(uint8_t reg, uint8_t val);
162 uint16_t readRegister16(uint8_t reg);
163 uint8_t readRegister8(uint8_t reg);
164 void readData(uint16_t *
x, uint16_t *
y, uint8_t *
z);
165 uint16_t getVersion();
167 boolean bufferEmpty();
168 uint8_t bufferSize();
173 void spiOut(uint8_t x);
177 int8_t _CS, _MOSI, _MISO, _CLK;
bool operator==(TS_Point)
Equality operator for TS_Point.
Definition: Adafruit_STMPE610.cpp:378
bool operator!=(TS_Point)
Non-equality operator for TS_Point.
Definition: Adafruit_STMPE610.cpp:386
Class that stores state and functions for interacting with STMPE610.
Definition: Adafruit_STMPE610.h:152
int16_t z
Definition: Adafruit_STMPE610.h:145
Class for working with points.
Definition: Adafruit_STMPE610.h:135
int16_t y
Definition: Adafruit_STMPE610.h:144
TS_Point()
TS_Point constructor.
Definition: Adafruit_STMPE610.cpp:357
int16_t x
Definition: Adafruit_STMPE610.h:143