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
17#include <esp_lcd_touch.h>
18
23namespace idfxx::lcd {
24
32class stmpe610 : public touch {
33public:
42 [[nodiscard]] static result<std::unique_ptr<stmpe610>>
43 make(std::shared_ptr<idfxx::lcd::panel_io> panel_io, struct config config);
44
45#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
55 [[nodiscard]] explicit stmpe610(std::shared_ptr<idfxx::lcd::panel_io> panel_io, struct config config);
56#endif
57
59
60 stmpe610(const stmpe610&) = delete;
61 stmpe610& operator=(const stmpe610&) = delete;
62 stmpe610(stmpe610&&) = delete;
64
65 [[nodiscard]] esp_lcd_touch_handle_t idf_handle() const override;
66
67private:
68 explicit stmpe610() = default;
69
70 result<esp_lcd_touch_handle_t> make_handle(esp_lcd_panel_io_handle_t io_handle, const config& config);
71 static void process_coordinates(
73 uint16_t* x,
74 uint16_t* y,
75 uint16_t* strength,
76 uint8_t* point_num,
77 uint8_t max_point_num
78 );
79
80 std::shared_ptr<idfxx::lcd::panel_io> _panel_io;
82 process_coordinates_callback _process_coordinates;
83};
84
85} // namespace idfxx::lcd
SPI-based panel I/O interface.
Definition panel_io.hpp:42
STMPE610 resistive touch controller driver.
Definition stmpe610.hpp:32
stmpe610(stmpe610 &&)=delete
stmpe610 & operator=(const stmpe610 &)=delete
static result< std::unique_ptr< stmpe610 > > make(std::shared_ptr< idfxx::lcd::panel_io > panel_io, struct config config)
Creates a new stmpe610 touch controller.
stmpe610(const stmpe610 &)=delete
esp_lcd_touch_handle_t idf_handle() const override
Returns the underlying ESP-IDF handle.
stmpe610(std::shared_ptr< idfxx::lcd::panel_io > panel_io, struct config config)
Creates a new stmpe610 touch controller.
stmpe610 & operator=(stmpe610 &&)=delete
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:118
Configuration structure for touch controllers.
Definition touch.hpp:46
esp_lcd_touch_t * esp_lcd_touch_handle_t
Definition touch.hpp:20