ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
cst3240_touchscreen.h
Go to the documentation of this file.
1#pragma once
2
5#include "esphome/core/hal.h"
6
7namespace esphome::cst3240 {
8
9static constexpr uint16_t CST3240_CHIP_ID = 0x3240;
10static constexpr uint8_t CST3240_MAX_TOUCHES = 5;
11static constexpr uint8_t CST3240_REPORT_SIZE = cstxxx::report_size(CST3240_MAX_TOUCHES);
12static constexpr uint8_t TOUCH_EVENT_PRESSED = 0x06;
13
15 public:
16 void setup() override;
17 void dump_config() override;
18
19 protected:
20 void update_touches() override;
21 void continue_setup_();
23 void clear_report_();
24
25 uint16_t chip_id_{};
26 uint16_t project_id_{};
27 uint16_t fw_version_{};
28 uint16_t fw_build_{};
29};
30
31} // namespace esphome::cst3240
void clear_report_()
Zeroes the touch report block, which polling relies on to tell new reports from old.
constexpr size_t report_size(uint8_t points)
Bytes of a touch report holding points records; two status bytes follow the first record.
Definition cstxxx.h:30