idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
stmpe610.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 Chris Leishman
3
4#pragma once
5
13#include <idfxx/error>
14#include <idfxx/lcd/panel_io>
15#include <idfxx/lcd/touch>
16
21namespace idfxx::lcd {
22
30class stmpe610 : public touch {
31public:
32#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
46#endif
47
60
62
63 stmpe610(const stmpe610&) = delete;
64 stmpe610& operator=(const stmpe610&) = delete;
65 stmpe610(stmpe610&& other) noexcept;
66 stmpe610& operator=(stmpe610&& other) noexcept;
67
70
71private:
72 stmpe610() = default;
73
74 struct callback_state {
75 process_coordinates_callback process_coordinates;
76 };
77
78 stmpe610(esp_lcd_touch_handle_t handle, std::unique_ptr<callback_state> callbacks);
79
80 static void process_coordinates(
82 uint16_t* x,
83 uint16_t* y,
87 );
88
89 esp_lcd_touch_handle_t _handle = nullptr;
90 std::unique_ptr<callback_state> _callbacks; // heap-stable state for ESP-IDF callbacks
91};
92
93} // namespace idfxx::lcd
SPI-based panel I/O interface.
Definition panel_io.hpp:44
STMPE610 resistive touch controller driver.
Definition stmpe610.hpp:30
stmpe610 & operator=(const stmpe610 &)=delete
stmpe610(stmpe610 &&other) noexcept
stmpe610 & operator=(stmpe610 &&other) noexcept
stmpe610(const stmpe610 &)=delete
esp_lcd_touch_handle_t idf_handle() const override
Returns the underlying ESP-IDF handle.
static result< stmpe610 > make(idfxx::lcd::panel_io &panel_io, config config)
Creates a new stmpe610 touch controller.
stmpe610(idfxx::lcd::panel_io &panel_io, config config)
Creates a new stmpe610 touch controller.
Abstract base class for touch controllers.
Definition touch.hpp:32
std::move_only_function< void(uint16_t *x, uint16_t *y, uint16_t *strength, uint8_t *point_num, uint8_t max_point_num)> process_coordinates_callback
Callback type for processing touch coordinates.
Definition touch.hpp:40
LCD driver classes.
Definition color.hpp:19
std::expected< T, std::error_code > result
result type wrapping a value or error code.
Definition error.hpp:120
Configuration structure for touch controllers.
Definition touch.hpp:48
esp_lcd_touch_t * esp_lcd_touch_handle_t
Definition touch.hpp:20