diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2022-12-21 02:10:42 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-01-20 01:05:21 +0100 |
commit | 751d36e7392b0b1637f17988cfc1ef0d7cd95753 (patch) | |
tree | 8ba772846be04719e41f82ef059ee81491a7c0e9 /src/input_common/helpers/joycon_protocol/ringcon.h | |
parent | input_common: Add support for joycon input reports (diff) | |
download | yuzu-751d36e7392b0b1637f17988cfc1ef0d7cd95753.tar yuzu-751d36e7392b0b1637f17988cfc1ef0d7cd95753.tar.gz yuzu-751d36e7392b0b1637f17988cfc1ef0d7cd95753.tar.bz2 yuzu-751d36e7392b0b1637f17988cfc1ef0d7cd95753.tar.lz yuzu-751d36e7392b0b1637f17988cfc1ef0d7cd95753.tar.xz yuzu-751d36e7392b0b1637f17988cfc1ef0d7cd95753.tar.zst yuzu-751d36e7392b0b1637f17988cfc1ef0d7cd95753.zip |
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 000000000..0c25de23e --- /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 |