summaryrefslogtreecommitdiffstats
path: root/src/hid_core/resources/touch_screen/touch_screen_driver.h
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2024-01-16 19:17:18 +0100
committergerman77 <juangerman-13@hotmail.com>2024-01-29 01:27:25 +0100
commit575183d6dcd8da9b10ee41e47be4b7d4f8631783 (patch)
treed2898bdefae5be2fb68e7df97465422c0fae3991 /src/hid_core/resources/touch_screen/touch_screen_driver.h
parentMerge pull request #12555 from flodavid/fix-gamemode-setting (diff)
downloadyuzu-575183d6dcd8da9b10ee41e47be4b7d4f8631783.tar
yuzu-575183d6dcd8da9b10ee41e47be4b7d4f8631783.tar.gz
yuzu-575183d6dcd8da9b10ee41e47be4b7d4f8631783.tar.bz2
yuzu-575183d6dcd8da9b10ee41e47be4b7d4f8631783.tar.lz
yuzu-575183d6dcd8da9b10ee41e47be4b7d4f8631783.tar.xz
yuzu-575183d6dcd8da9b10ee41e47be4b7d4f8631783.tar.zst
yuzu-575183d6dcd8da9b10ee41e47be4b7d4f8631783.zip
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