diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2022-12-20 19:10:42 -0600 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-01-19 18:05:21 -0600 |
commit | 751d36e7392b0b1637f17988cfc1ef0d7cd95753 (patch) | |
tree | 8ba772846be04719e41f82ef059ee81491a7c0e9 /src/input_common/helpers/joycon_protocol/ringcon.h | |
parent | f09a023292e659af46d551b9b134d94d000a57c7 (diff) |
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.h | 38 |
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 0000000000..0c25de23ee --- /dev/null +++ b/src/input_common/helpers/joycon_protocol/ringcon.h @@ -0,0 +1,38 @@ +// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +// Based on dkms-hid-nintendo implementation, CTCaer joycon toolkit and dekuNukem reverse +// engineering https://github.com/nicman23/dkms-hid-nintendo/blob/master/src/hid-nintendo.c +// https://github.com/CTCaer/jc_toolkit +// https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering + +#pragma once + +#include <vector> + +#include "input_common/helpers/joycon_protocol/common_protocol.h" +#include "input_common/helpers/joycon_protocol/joycon_types.h" + +namespace InputCommon::Joycon { + +class RingConProtocol final : private JoyconCommonProtocol { +public: + RingConProtocol(std::shared_ptr<JoyconHandle> handle); + + DriverResult EnableRingCon(); + + DriverResult DisableRingCon(); + + DriverResult StartRingconPolling(); + + bool IsEnabled(); + +private: + DriverResult IsRingConnected(bool& is_connected); + + DriverResult ConfigureRing(); + + bool is_enabled{}; +}; + +} // namespace InputCommon::Joycon |