mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-23 12:07:52 -05:00
input_common: Implement SetLowPowerMode and TriggersElapsed for the joycon driver
This commit is contained in:
@ -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;
|
||||
|
@ -25,6 +25,12 @@ public:
|
||||
/// Enables active mode. This mode will return the current status every 5-15ms
|
||||
DriverResult EnableActiveMode();
|
||||
|
||||
/// Enables or disables the low power mode
|
||||
DriverResult SetLowPowerMode(bool enable);
|
||||
|
||||
/// Unknown function used by the switch
|
||||
DriverResult TriggersElapsed();
|
||||
|
||||
/**
|
||||
* Sends a request to obtain the joycon firmware and mac from handle
|
||||
* @returns controller device info
|
||||
|
@ -129,6 +129,7 @@ enum class SubCommand : u8 {
|
||||
LOW_POWER_MODE = 0x08,
|
||||
SPI_FLASH_READ = 0x10,
|
||||
SPI_FLASH_WRITE = 0x11,
|
||||
SPI_SECTOR_ERASE = 0x12,
|
||||
RESET_MCU = 0x20,
|
||||
SET_MCU_CONFIG = 0x21,
|
||||
SET_MCU_STATE = 0x22,
|
||||
|
Reference in New Issue
Block a user