32#include "../SensorBuildOpt.h"
33#if !SENSORLIB_EXCLUDE_TOUCH_GT911
41#if defined(ARDUINO_ARCH_NRF52)
43#warning "NRF Platform I2C Buffer expansion is not implemented , GT911 requires at least 188 bytes to read all configurations"
46static constexpr uint8_t GT911_SLAVE_ADDRESS_H = (0x14);
47static constexpr uint8_t GT911_SLAVE_ADDRESS_L = (0x5D);
48static constexpr uint8_t GT911_SLAVE_ADDRESS_UNKNOWN = (0xFF);
81 void sleep()
override;
166#ifdef ENABLE_GT911_CONFIG
174 bool writeConfig(
const uint8_t *config_buffer,
size_t buffer_size);
185 uint8_t *
loadConfig(
size_t *output_size,
bool print_out =
false);
210 uint8_t readGT911(uint16_t
cmd);
218 int writeGT911(uint16_t
cmd, uint8_t value);
226 void writeCommand(uint8_t command);
242 bool initImpl(uint8_t)
override;
248 static constexpr uint8_t MAX_FINGER_NUM = (5);
249 static constexpr uint8_t BYTES_PER_POINT = (8);
static constexpr uint16_t GT911_X_OUTPUT_MAX_LOW
static constexpr uint16_t GT911_Y_RESOLUTION
static constexpr uint16_t GT911_LARGE_TOUCH
static constexpr uint16_t GT911_DRV_GROUPB_NUM
static constexpr uint16_t GT911_LOW_POWER_CONTROL
bool setInterruptMode(InterruptMode mode)
Set the interrupt mode.
static constexpr uint16_t GT911_CONFIG_FRESH
static constexpr uint16_t GT911_GESTURE_REFRESH_RATE
static constexpr uint16_t GT911_HOPPING_SEG6_NORMALIZE
static constexpr uint16_t GT911_HOPPING_SEG3_FACTOR
static constexpr uint16_t GT911_MAIN_CLOCK_ADJUST
static constexpr uint16_t GT911_SENSOR_CH0
static constexpr uint16_t GT911_DRV_FRAME_CONTROL
static constexpr uint16_t GT911_FIRMWARE_VERSION
void wakeup() override
Wake up the touch driver.
static constexpr uint16_t GT911_FREQ_GAIN0
static constexpr uint16_t GT911_PANEL_RX_GAIN
static constexpr uint16_t GT911_KEY_SENS_1_2
static constexpr uint16_t GT911_NOISE_MIN_THRESHOLD
static constexpr uint16_t GT911_PANEL_BIT_FREQ_L
static constexpr uint16_t GT911_MODULE_SWITCH_2
static constexpr uint16_t GT911_STRETCH_RM
static constexpr uint16_t GT911_SENSOR_NUM
uint32_t getChipID() override
Get the chip ID.
static constexpr uint16_t GT911_DRIVER_CH0
static constexpr uint16_t GT911_SCREEN_TOUCH_LEVEL
static constexpr uint16_t GT911_GESTURE_LARGE_TOUCH
bool reloadConfig()
Reload the configuration data.
static constexpr uint16_t GT911_STRETCH_R0
TouchDrvGT911()=default
Constructor for the touch driver.
static constexpr uint16_t GT911_COMMAND
static constexpr uint16_t GT911_HOPPING_SEG3_NORMALIZE
void setMaxTouchPoint(uint8_t num)
Set the maximum touch points.
static constexpr uint16_t GT911_X_RESOLUTION
static constexpr uint16_t GT911_PRODUCT_ID
static constexpr uint16_t GT911_GESTURE_DIS
static constexpr uint16_t GT911_KEY_RESTRAIN
static constexpr uint16_t GT911_POINT_INFO
static constexpr uint16_t GT911_PANEL_BIT_FREQ_H
static constexpr uint16_t GT911_KEY_AREA
static constexpr uint16_t GT911_HOPPING_SENSOR_GROUP
static constexpr uint16_t GT911_KEY_1
static constexpr uint16_t GT911_Y_OUTPUT_MAX_LOW
static constexpr uint16_t GT911_CONFIG_START
static constexpr uint16_t GT911_HOPPING_THRESHOLD
uint8_t * loadConfig(size_t *output_size, bool print_out=false)
Load the configuration data.
static constexpr uint16_t GT911_NOISE_DETECT_TIMES
static constexpr uint16_t COMMAND_SIZE
static constexpr uint16_t GT911_FREQ_HOPPING_START
static constexpr uint16_t GT911_X_Y_SLOPE_ADJUST
static constexpr uint16_t GT911_PANEL_SENSOR_TIME_L
static constexpr uint16_t GT911_COMMAND_CHECK
static constexpr uint8_t IRQ_TRIGGER_MASK
static constexpr uint8_t GT911_BASE_REF_RATE
void sleep() override
Puts the touch driver to sleep.
InterruptMode getInterruptMode()
Get the interrupt mode.
static constexpr uint16_t GT911_MODULE_SWITCH3
static constexpr uint16_t GT911_ESD_CHECK
static constexpr uint16_t GT911_NEWGREENWAKEUPLEVEL
static constexpr uint16_t GT911_HOPPING_SEG1_NORMALIZE
static constexpr uint16_t GT911_COMBINE_DIS
static constexpr uint16_t GT911_FREQ_GAIN2
static constexpr uint16_t GT911_SCREEN_RELEASE_LEVEL
static constexpr uint16_t GT911_Y_THRESHOLD
static constexpr uint16_t GT911_KEY_SENS_3_4
static constexpr uint16_t GT911_POINT_2
static constexpr uint16_t GT911_DRV_GROUPA_NUM
static constexpr uint16_t GT911_LINK_THRESHOLD
static constexpr uint16_t GT911_FREQ_HOPPING_END
static constexpr uint16_t GT911_HOTKNOT_NOISE_MAP
static constexpr uint16_t GT911_CHARGING_LEVEL_UP
static constexpr uint16_t GT911_KEY_3
static constexpr uint16_t GT911_KEY_4
static constexpr uint16_t GT911_GESTURE_LONG_PRESS_TIME
static constexpr uint16_t GT911_VENDOR_ID
uint8_t getConfigVersion()
Get the configuration version.
uint8_t getRefreshRate()
Get the refresh rate.
static constexpr uint16_t GT911_REFRESH_RATE
static constexpr uint16_t GT911_PANEL_TX_GAIN
static constexpr uint16_t GT911_X_OUTPUT_MAX_HIGH
static constexpr uint16_t GT911_MODULE_SWITCH_1
static constexpr uint16_t GT911_KEY_RESTRAIN_TIME
static constexpr uint16_t GT911_KEY_TOUCH_LEVEL
static constexpr uint16_t GT911_MINI_FILTER
static constexpr uint16_t GT911_HOPPING_SEG5_NORMALIZE
static constexpr uint16_t GT911_KEY_2
static constexpr uint16_t GT911_Y_OUTPUT_MAX_HIGH
static constexpr uint16_t GT911_SPACE_LEFT_RIGHT
~TouchDrvGT911()=default
Destructor for the touch driver.
static constexpr uint16_t GT911_HOPPING_SEG4_FACTOR
static constexpr uint16_t GT911_PXY_THRESHOLD
uint16_t getFwVersion()
Get the firmware version.
static constexpr uint16_t GT911_FREQ_B_FACTOR
static constexpr uint16_t GT911_CONFIG_VERSION
static constexpr uint16_t GT911_GESTURE_CONTROL
static constexpr uint16_t GT911_HOPPING_SEG2_NORMALIZE
static constexpr uint16_t GT911_STRETCH_R1
static constexpr uint16_t GT911_STRETCH_R2
static constexpr uint16_t GT911_NOISE_REDUCTION
static constexpr uint16_t GT911_HOPPING_SEG2_FACTOR
static constexpr uint16_t GT911_SPLIT_SET
static constexpr uint16_t GT911_GHOT_DUMP_SHIFT
static constexpr uint16_t GT911_GESTURE_SWITCH2
static constexpr uint16_t GT911_POINT_1
static constexpr uint8_t GT911_REG_LENGTH
static constexpr uint16_t GT911_HOPPING_SEG1_FACTOR
static constexpr uint16_t GT911_GESTURE_SWITCH1
static constexpr uint16_t GT911_SHAKE_COUNT
static constexpr uint16_t GT911_FREQ_GAIN1
static constexpr uint16_t GT911_NOISE_THRESHOLD
static constexpr uint16_t GT911_PANEL_DUMP_SHIFT
static constexpr uint16_t GT911_POINT_3
static constexpr uint16_t GT911_X_SPEED_LIMIT
static constexpr uint16_t GT911_HOPPING_FLAG
static constexpr uint16_t GT911_CONFIG_SIZE
static constexpr uint16_t GT911_CONFIG_CHKSUM
static constexpr uint16_t GT911_HOPPING_SEG5_FACTOR
const char * getModelName() override
Get the model name.
static constexpr uint16_t GT911_X_THRESHOLD
static constexpr uint16_t GT911_HOPPING_SEG4_NORMALIZE
static constexpr uint16_t GT911_DEV_ID
static constexpr uint16_t GT911_POINT_4
static constexpr uint16_t GT911_PANEL_SENSOR_TIME_H
static constexpr uint16_t GT911_INFORMATION
static constexpr uint16_t GT911_GESTURE_TOUCH_LEVEL
static constexpr uint16_t GT911_POINT_5
static constexpr uint16_t GT911_GHOT_RX_GAIN
static constexpr uint16_t GT911_SPACE_TOP_BOTTOM
static constexpr uint16_t GT911_FREQ_A_FACTOR
static constexpr uint16_t GT911_TOUCH_NUMBER
static constexpr uint16_t GT911_FILTER
int getVendorID()
Get the vendor ID.
static constexpr uint16_t GT911_KEY_LEAVE_LEVEL
static constexpr uint16_t GT911_Y_SPEED_LIMIT
const TouchPoints & getTouchPoints() override
Get the touch points.
static constexpr uint16_t GT911_FREQ_GAIN3
void updateRefreshRate(uint8_t rate_ms)
Get the refresh rate.
Abstract base class for touch screen drivers.
virtual uint8_t getPoint(int16_t *x_array, int16_t *y_array, uint8_t get_point=1) __attribute__((deprecated("use getTouchPoints instead of getPoint")))
Retrieve touch point coordinates (deprecated).
Container for touch point data and optional gesture information.
const uint16_t buffer_size