summaryrefslogtreecommitdiff
path: root/src/ui/include/wheel_encoder.hpp
blob: d4975db92457083d9439d843a8d510090ccd935a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright 2023 jacqueline <me@jacqueline.id.au>
 *
 * SPDX-License-Identifier: GPL-3.0-only
 */

#pragma once

#include <memory>

#include "hal/lv_hal_indev.h"

#include "relative_wheel.hpp"

namespace ui {

class TouchWheelEncoder {
 public:
  explicit TouchWheelEncoder(std::weak_ptr<drivers::RelativeWheel> 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<drivers::RelativeWheel> wheel_;
};

}  // namespace ui