ESPHome
2026.12.0-dev
Loading...
Searching...
No Matches
esphome
components
cst3240
touchscreen
cst3240_touchscreen.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/components/cstxxx/cstxxx.h
"
4
#include "
esphome/core/component.h
"
5
#include "
esphome/core/hal.h
"
6
7
namespace
esphome::cst3240
{
8
9
static
constexpr
uint16_t CST3240_CHIP_ID = 0x3240;
10
static
constexpr
uint8_t CST3240_MAX_TOUCHES = 5;
11
static
constexpr
uint8_t CST3240_REPORT_SIZE =
cstxxx::report_size
(CST3240_MAX_TOUCHES);
12
static
constexpr
uint8_t TOUCH_EVENT_PRESSED = 0x06;
13
14
class
CST3240Touchscreen
:
public
cstxxx::CSTTouchscreen
{
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
esphome::cst3240::CST3240Touchscreen
Definition
cst3240_touchscreen.h:14
esphome::cst3240::CST3240Touchscreen::project_id_
uint16_t project_id_
Definition
cst3240_touchscreen.h:26
esphome::cst3240::CST3240Touchscreen::setup
void setup() override
Definition
cst3240_touchscreen.cpp:11
esphome::cst3240::CST3240Touchscreen::dump_config
void dump_config() override
Definition
cst3240_touchscreen.cpp:97
esphome::cst3240::CST3240Touchscreen::clear_report_
void clear_report_()
Zeroes the touch report block, which polling relies on to tell new reports from old.
Definition
cst3240_touchscreen.cpp:90
esphome::cst3240::CST3240Touchscreen::update_touches
void update_touches() override
Definition
cst3240_touchscreen.cpp:50
esphome::cst3240::CST3240Touchscreen::continue_setup_
void continue_setup_()
Definition
cst3240_touchscreen.cpp:20
esphome::cst3240::CST3240Touchscreen::fw_build_
uint16_t fw_build_
Definition
cst3240_touchscreen.h:28
esphome::cst3240::CST3240Touchscreen::fw_version_
uint16_t fw_version_
Definition
cst3240_touchscreen.h:27
esphome::cst3240::CST3240Touchscreen::chip_id_
uint16_t chip_id_
Definition
cst3240_touchscreen.h:25
esphome::cstxxx::CSTTouchscreen
Definition
cstxxx.h:54
component.h
hal.h
cstxxx.h
esphome::cst3240
Definition
cst3240_touchscreen.cpp:7
esphome::cstxxx::report_size
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
Generated by
1.12.0