diff options
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/calibration.h')
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/calibration.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/input_common/helpers/joycon_protocol/calibration.h b/src/input_common/helpers/joycon_protocol/calibration.h index c6fd0f729..82d94b366 100644 --- a/src/input_common/helpers/joycon_protocol/calibration.h +++ b/src/input_common/helpers/joycon_protocol/calibration.h | |||
| @@ -12,8 +12,11 @@ | |||
| 12 | 12 | ||
| 13 | #include "input_common/helpers/joycon_protocol/common_protocol.h" | 13 | #include "input_common/helpers/joycon_protocol/common_protocol.h" |
| 14 | 14 | ||
| 15 | namespace InputCommon::Joycon { | 15 | namespace Common::Input { |
| 16 | enum class DriverResult; | 16 | enum class DriverResult; |
| 17 | } | ||
| 18 | |||
| 19 | namespace InputCommon::Joycon { | ||
| 17 | struct JoyStickCalibration; | 20 | struct JoyStickCalibration; |
| 18 | struct IMUCalibration; | 21 | struct IMUCalibration; |
| 19 | struct JoyconHandle; | 22 | struct JoyconHandle; |
| @@ -31,30 +34,30 @@ public: | |||
| 31 | * @param is_factory_calibration if true factory values will be returned | 34 | * @param is_factory_calibration if true factory values will be returned |
| 32 | * @returns JoyStickCalibration of the left joystick | 35 | * @returns JoyStickCalibration of the left joystick |
| 33 | */ | 36 | */ |
| 34 | DriverResult GetLeftJoyStickCalibration(JoyStickCalibration& calibration); | 37 | Common::Input::DriverResult GetLeftJoyStickCalibration(JoyStickCalibration& calibration); |
| 35 | 38 | ||
| 36 | /** | 39 | /** |
| 37 | * Sends a request to obtain the right stick calibration from memory | 40 | * Sends a request to obtain the right stick calibration from memory |
| 38 | * @param is_factory_calibration if true factory values will be returned | 41 | * @param is_factory_calibration if true factory values will be returned |
| 39 | * @returns JoyStickCalibration of the right joystick | 42 | * @returns JoyStickCalibration of the right joystick |
| 40 | */ | 43 | */ |
| 41 | DriverResult GetRightJoyStickCalibration(JoyStickCalibration& calibration); | 44 | Common::Input::DriverResult GetRightJoyStickCalibration(JoyStickCalibration& calibration); |
| 42 | 45 | ||
| 43 | /** | 46 | /** |
| 44 | * Sends a request to obtain the motion calibration from memory | 47 | * Sends a request to obtain the motion calibration from memory |
| 45 | * @returns ImuCalibration of the motion sensor | 48 | * @returns ImuCalibration of the motion sensor |
| 46 | */ | 49 | */ |
| 47 | DriverResult GetImuCalibration(MotionCalibration& calibration); | 50 | Common::Input::DriverResult GetImuCalibration(MotionCalibration& calibration); |
| 48 | 51 | ||
| 49 | /** | 52 | /** |
| 50 | * Calculates on run time the proper calibration of the ring controller | 53 | * Calculates on run time the proper calibration of the ring controller |
| 51 | * @returns RingCalibration of the ring sensor | 54 | * @returns RingCalibration of the ring sensor |
| 52 | */ | 55 | */ |
| 53 | DriverResult GetRingCalibration(RingCalibration& calibration, s16 current_value); | 56 | Common::Input::DriverResult GetRingCalibration(RingCalibration& calibration, s16 current_value); |
| 54 | 57 | ||
| 55 | private: | 58 | private: |
| 56 | /// Returns true if the specified address corresponds to the magic value of user calibration | 59 | /// Returns true if the specified address corresponds to the magic value of user calibration |
| 57 | DriverResult HasUserCalibration(SpiAddress address, bool& has_user_calibration); | 60 | Common::Input::DriverResult HasUserCalibration(SpiAddress address, bool& has_user_calibration); |
| 58 | 61 | ||
| 59 | /// Converts a raw calibration block to an u16 value containing the x axis value | 62 | /// Converts a raw calibration block to an u16 value containing the x axis value |
| 60 | u16 GetXAxisCalibrationValue(std::span<u8> block) const; | 63 | u16 GetXAxisCalibrationValue(std::span<u8> block) const; |