input_common: Implement SetLowPowerMode and TriggersElapsed for the joycon driver

This commit is contained in:
Narr the Reg 2023-01-26 11:21:04 -06:00
parent cc821bfae1
commit 49707916db
4 changed files with 21 additions and 0 deletions

View file

@ -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;