19 uint8_t data[CHSC6X_REG_STATUS_LEN];
20 if (!this->
read_bytes(CHSC6X_REG_STATUS, data,
sizeof(data))) {
24 uint8_t num_of_touches = data[CHSC6X_REG_STATUS_TOUCH];
26 if (num_of_touches == 1) {
27 uint16_t
x = data[CHSC6X_REG_STATUS_X_COR];
28 uint16_t
y = data[CHSC6X_REG_STATUS_Y_COR];
35 "CHSC6X Touchscreen:\n"
36 " Touch timeout: %d\n"
InternalGPIOPin * interrupt_pin_
void update_touches() override
void dump_config() override
int get_native_width()
Get the native (original) width of the display in pixels.
int get_native_height()
Get the native (original) height of the display in pixels.
bool read_bytes(uint8_t a_register, uint8_t *data, uint8_t len)
Compat APIs All methods below have been added for compatibility reasons.
void attach_interrupt_(InternalGPIOPin *irq_pin, esphome::gpio::InterruptType type)
Call this function to send touch points to the on_touch listener and the binary_sensors.
display::Display * display_
void add_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_raw, int16_t z_raw=0)