ESPHome
2026.12.0-dev
Loading...
Searching...
No Matches
esphome
components
cst9220
touchscreen
cst9220_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
#include "
esphome/core/log.h
"
7
8
namespace
esphome::cst9220
{
9
10
ESPHOME_LOG_TAG
(TAG,
"cst9220.touchscreen"
);
11
12
static
constexpr
uint8_t TOUCH_EVENT_DOWN = 0x06;
13
14
static
constexpr
uint16_t CST9220_CHIP_ID = 0x9220;
15
static
constexpr
uint16_t CST9217_CHIP_ID = 0x9217;
16
17
static
constexpr
uint8_t CST9220_MAX_TOUCHES = 5;
18
// Report layout: 5 bytes per touch point plus 5 bytes of status/ack overhead.
19
static
constexpr
size_t
CST9220_DATA_LENGTH = CST9220_MAX_TOUCHES * 5 + 5;
20
21
class
CST9220Touchscreen
:
public
cstxxx::CSTTouchscreen
{
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::cst9220::CST9220Touchscreen
Definition
cst9220_touchscreen.h:21
esphome::cst9220::CST9220Touchscreen::update_touches
void update_touches() override
Definition
cst9220_touchscreen.cpp:51
esphome::cst9220::CST9220Touchscreen::project_id_
uint16_t project_id_
Definition
cst9220_touchscreen.h:31
esphome::cst9220::CST9220Touchscreen::continue_setup_
void continue_setup_()
Definition
cst9220_touchscreen.cpp:15
esphome::cst9220::CST9220Touchscreen::setup
void setup() override
Definition
cst9220_touchscreen.cpp:9
esphome::cst9220::CST9220Touchscreen::chip_id_
uint16_t chip_id_
Definition
cst9220_touchscreen.h:30
esphome::cst9220::CST9220Touchscreen::dump_config
void dump_config() override
Definition
cst9220_touchscreen.cpp:86
esphome::cstxxx::CSTTouchscreen
Definition
cstxxx.h:54
component.h
hal.h
cstxxx.h
log.h
esphome::cst9220
Definition
cst9220_touchscreen.cpp:3
esphome::cst9220::ESPHOME_LOG_TAG
ESPHOME_LOG_TAG(TAG, "cst9220.touchscreen")
Generated by
1.12.0