summaryrefslogtreecommitdiffstats
path: root/src/input_common/helpers/joycon_protocol/generic_functions.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2023-01-26 19:56:31 +0100
committerGitHub <noreply@github.com>2023-01-26 19:56:31 +0100
commit7d0a77a825ff16fc3449cd32d436107507e19ae8 (patch)
tree96c6269e01338fe630d03af62ccbd983632bce0c /src/input_common/helpers/joycon_protocol/generic_functions.cpp
parentMerge pull request #9670 from merryhime/revert-af5ecb0b15d4449f58434e70eed835cf71fc5527 (diff)
parentinput_common: Implement SetLowPowerMode and TriggersElapsed for the joycon driver (diff)
downloadyuzu-7d0a77a825ff16fc3449cd32d436107507e19ae8.tar
yuzu-7d0a77a825ff16fc3449cd32d436107507e19ae8.tar.gz
yuzu-7d0a77a825ff16fc3449cd32d436107507e19ae8.tar.bz2
yuzu-7d0a77a825ff16fc3449cd32d436107507e19ae8.tar.lz
yuzu-7d0a77a825ff16fc3449cd32d436107507e19ae8.tar.xz
yuzu-7d0a77a825ff16fc3449cd32d436107507e19ae8.tar.zst
yuzu-7d0a77a825ff16fc3449cd32d436107507e19ae8.zip
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/generic_functions.cpp')
-rw-r--r--src/input_common/helpers/joycon_protocol/generic_functions.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/input_common/helpers/joycon_protocol/generic_functions.cpp b/src/input_common/helpers/joycon_protocol/generic_functions.cpp
index 52bb8b61a..63cfb1369 100644
--- a/src/input_common/helpers/joycon_protocol/generic_functions.cpp
+++ b/src/input_common/helpers/joycon_protocol/generic_functions.cpp
@@ -19,6 +19,17 @@ DriverResult GenericProtocol::EnableActiveMode() {
return SetReportMode(ReportMode::STANDARD_FULL_60HZ);
}
+DriverResult GenericProtocol::SetLowPowerMode(bool enable) {
+ ScopedSetBlocking sb(this);
+ const std::array<u8, 1> buffer{static_cast<u8>(enable ? 1 : 0)};
+ return SendSubCommand(SubCommand::LOW_POWER_MODE, buffer);
+}
+
+DriverResult GenericProtocol::TriggersElapsed() {
+ ScopedSetBlocking sb(this);
+ return SendSubCommand(SubCommand::TRIGGERS_ELAPSED, {});
+}
+
DriverResult GenericProtocol::GetDeviceInfo(DeviceInfo& device_info) {
ScopedSetBlocking sb(this);
std::vector<u8> output;