hid_firmware_settings.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-3.0-or-later
  3. #pragma once
  4. #include "common/common_types.h"
  5. #include "core/hle/service/set/settings_types.h"
  6. namespace Core {
  7. class System;
  8. }
  9. namespace Service::Set {
  10. class ISystemSettingsServer;
  11. }
  12. namespace Service::HID {
  13. /// Loads firmware config from nn::settings::fwdbg
  14. class HidFirmwareSettings {
  15. public:
  16. using FirmwareSetting = std::array<u8, 4>;
  17. using FeaturesPerId = std::array<bool, 0xA8>;
  18. HidFirmwareSettings(Core::System& system);
  19. void Reload();
  20. void LoadSettings(bool reload_config);
  21. bool IsDebugPadEnabled();
  22. bool IsDeviceManaged();
  23. bool IsEmulateFutureDevice();
  24. bool IsTouchI2cManaged();
  25. bool IsHandheldForced();
  26. bool IsRailEnabled();
  27. bool IsHardwareErrorEmulated();
  28. bool IsBleDisabled();
  29. bool IsDscaleDisabled();
  30. bool IsTouchAutoUpdateDisabled();
  31. FirmwareSetting GetFirmwareUpdateFailure();
  32. FeaturesPerId FeaturesDisabledPerId();
  33. Set::PlatformConfig GetPlatformConfig();
  34. private:
  35. bool is_initialized{};
  36. // Debug settings
  37. bool is_debug_pad_enabled{};
  38. bool is_device_managed{};
  39. bool is_touch_i2c_managed{};
  40. bool is_future_devices_emulated{};
  41. bool is_mcu_hardware_error_emulated{};
  42. bool is_rail_enabled{};
  43. bool is_firmware_update_failure_emulated{};
  44. bool is_ble_disabled{};
  45. bool is_dscale_disabled{};
  46. bool is_handheld_forced{};
  47. bool is_touch_firmware_auto_update_disabled{};
  48. FirmwareSetting is_firmware_update_failure{};
  49. FeaturesPerId features_per_id_disabled{};
  50. Set::PlatformConfig platform_config{};
  51. std::shared_ptr<Service::Set::ISystemSettingsServer> m_set_sys;
  52. };
  53. } // namespace Service::HID