7 ESP_LOGCONFIG(TAG,
"Setting up CHSC6X Touchscreen...");
19 ESP_LOGCONFIG(TAG,
"CHSC6X Touchscreen setup complete");
23 uint8_t data[CHSC6X_REG_STATUS_LEN];
24 if (!this->
read_bytes(CHSC6X_REG_STATUS, data,
sizeof(data))) {
28 uint8_t num_of_touches = data[CHSC6X_REG_STATUS_TOUCH];
30 if (num_of_touches == 1) {
31 uint16_t
x = data[CHSC6X_REG_STATUS_X_COR];
32 uint16_t
y = data[CHSC6X_REG_STATUS_Y_COR];
38 ESP_LOGCONFIG(TAG,
"CHSC6X Touchscreen:");
42 ESP_LOGCONFIG(TAG,
" x_raw_max_: %d", this->
x_raw_max_);
43 ESP_LOGCONFIG(TAG,
" y_raw_max_: %d", this->
y_raw_max_);
InternalGPIOPin * interrupt_pin_
void dump_config() override
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 update_touches() override
int get_native_width()
Get the native (original) width of the display in pixels.
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)
Implementation of SPI Controller mode.