summaryrefslogtreecommitdiffstats
path: root/src/hid_core/resources/touch_screen/touch_screen_driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/hid_core/resources/touch_screen/touch_screen_driver.h')
-rw-r--r--src/hid_core/resources/touch_screen/touch_screen_driver.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/hid_core/resources/touch_screen/touch_screen_driver.h b/src/hid_core/resources/touch_screen/touch_screen_driver.h
new file mode 100644
index 000000000..ca7e4970e
--- /dev/null
+++ b/src/hid_core/resources/touch_screen/touch_screen_driver.h
@@ -0,0 +1,47 @@
+// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#pragma once
+
+#include "common/common_types.h"
+#include "core/hle/result.h"
+#include "hid_core/frontend/emulated_console.h"
+#include "hid_core/hid_types.h"
+#include "hid_core/resources/touch_screen/touch_types.h"
+
+namespace Core::HID {
+class HIDCore;
+} // namespace Core::HID
+
+namespace Service::HID {
+
+/// This handles all request to Ftm3bd56(TouchPanel) hardware
+class TouchDriver {
+public:
+ explicit TouchDriver(Core::HID::HIDCore& hid_core);
+ ~TouchDriver();
+
+ Result StartTouchSensor();
+ Result StopTouchSensor();
+ bool IsRunning() const;
+
+ void ProcessTouchScreenAutoTune() const;
+
+ Result WaitForDummyInput();
+ Result WaitForInput();
+
+ void GetNextTouchState(TouchScreenState& out_state) const;
+
+ void SetTouchMode(Core::HID::TouchScreenModeForNx mode);
+ Core::HID::TouchScreenModeForNx GetTouchMode() const;
+
+private:
+ bool is_running{};
+ TouchScreenState touch_status{};
+ Core::HID::TouchFingerState fingers{};
+ Core::HID::TouchScreenModeForNx touch_mode{};
+
+ Core::HID::EmulatedConsole* console = nullptr;
+};
+
+} // namespace Service::HID