summaryrefslogtreecommitdiff
path: root/src/input_common/helpers/joycon_protocol/ringcon.h
diff options
context:
space:
mode:
authorGravatar Narr the Reg2022-12-20 19:10:42 -0600
committerGravatar Narr the Reg2023-01-19 18:05:21 -0600
commit751d36e7392b0b1637f17988cfc1ef0d7cd95753 (patch)
tree8ba772846be04719e41f82ef059ee81491a7c0e9 /src/input_common/helpers/joycon_protocol/ringcon.h
parentinput_common: Add support for joycon input reports (diff)
downloadyuzu-751d36e7392b0b1637f17988cfc1ef0d7cd95753.tar.gz
yuzu-751d36e7392b0b1637f17988cfc1ef0d7cd95753.tar.xz
yuzu-751d36e7392b0b1637f17988cfc1ef0d7cd95753.zip
input_common: Add support for joycon ring controller
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/ringcon.h')
-rw-r--r--src/input_common/helpers/joycon_protocol/ringcon.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/input_common/helpers/joycon_protocol/ringcon.h b/src/input_common/helpers/joycon_protocol/ringcon.h
new file mode 100644
index 000000000..0c25de23e
--- /dev/null
+++ b/src/input_common/helpers/joycon_protocol/ringcon.h
@@ -0,0 +1,38 @@
1// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4// Based on dkms-hid-nintendo implementation, CTCaer joycon toolkit and dekuNukem reverse
5// engineering https://github.com/nicman23/dkms-hid-nintendo/blob/master/src/hid-nintendo.c
6// https://github.com/CTCaer/jc_toolkit
7// https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering
8
9#pragma once
10
11#include <vector>
12
13#include "input_common/helpers/joycon_protocol/common_protocol.h"
14#include "input_common/helpers/joycon_protocol/joycon_types.h"
15
16namespace InputCommon::Joycon {
17
18class RingConProtocol final : private JoyconCommonProtocol {
19public:
20 RingConProtocol(std::shared_ptr<JoyconHandle> handle);
21
22 DriverResult EnableRingCon();
23
24 DriverResult DisableRingCon();
25
26 DriverResult StartRingconPolling();
27
28 bool IsEnabled();
29
30private:
31 DriverResult IsRingConnected(bool& is_connected);
32
33 DriverResult ConfigureRing();
34
35 bool is_enabled{};
36};
37
38} // namespace InputCommon::Joycon