From 6fd588e970470b15936187980829916d0dbe77bb Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 1 Jun 2023 15:28:32 +1000 Subject: Add touchwheel -> encoder adapter --- src/ui/include/wheel_encoder.hpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/ui/include/wheel_encoder.hpp (limited to 'src/ui/include/wheel_encoder.hpp') diff --git a/src/ui/include/wheel_encoder.hpp b/src/ui/include/wheel_encoder.hpp new file mode 100644 index 00000000..0651ce0b --- /dev/null +++ b/src/ui/include/wheel_encoder.hpp @@ -0,0 +1,30 @@ +/* + * Copyright 2023 jacqueline + * + * SPDX-License-Identifier: GPL-3.0-only + */ + +#pragma once + +#include + +#include "hal/lv_hal_indev.h" + +#include "relative_wheel.hpp" + +namespace ui { + +class TouchWheelEncoder { + public: + explicit TouchWheelEncoder(std::weak_ptr wheel); + + auto Read(lv_indev_data_t *data) -> void; + auto registration() -> lv_indev_t* { return registration_; } + + private: + lv_indev_drv_t driver_; + lv_indev_t *registration_; + std::weak_ptr wheel_; +}; + +} // namespace ui -- cgit v1.2.3