ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
cst9220_touchscreen.h
Go to the documentation of this file.
1#pragma once
2
5#include "esphome/core/hal.h"
6#include "esphome/core/log.h"
7
8namespace esphome::cst9220 {
9
10ESPHOME_LOG_TAG(TAG, "cst9220.touchscreen");
11
12static constexpr uint8_t TOUCH_EVENT_DOWN = 0x06;
13
14static constexpr uint16_t CST9220_CHIP_ID = 0x9220;
15static constexpr uint16_t CST9217_CHIP_ID = 0x9217;
16
17static constexpr uint8_t CST9220_MAX_TOUCHES = 5;
18// Report layout: 5 bytes per touch point plus 5 bytes of status/ack overhead.
19static constexpr size_t CST9220_DATA_LENGTH = CST9220_MAX_TOUCHES * 5 + 5;
20
22 public:
23 void setup() override;
24 void dump_config() override;
25
26 protected:
27 void update_touches() override;
28 void continue_setup_();
29
30 uint16_t chip_id_{};
31 uint16_t project_id_{};
32};
33
34} // namespace esphome::cst9220
ESPHOME_LOG_TAG(TAG, "cst9220.touchscreen")