diff --git a/docs/development/msp/README.md b/docs/development/msp/README.md index 42634e951db..8d2146db5a1 100644 --- a/docs/development/msp/README.md +++ b/docs/development/msp/README.md @@ -471,6 +471,9 @@ When the MSP JSON specification changes, bump `msp_messages.json` version: [8744 - MSP2_INAV_TIMESYNC](#msp2_inav_timesync) [8752 - MSP2_INAV_SET_AUX_RC](#msp2_inav_set_aux_rc) [8753 - MSP2_INAV_WIND](#msp2_inav_wind) +[8754 - MSP2_INAV_MAG_UNALIGNED](#msp2_inav_mag_unaligned) +[8755 - MSP2_INAV_ESC_SRXL2_STATUS](#msp2_inav_esc_srxl2_status) +[8756 - MSP2_INAV_ESC_SRXL2_CALIBRATE](#msp2_inav_esc_srxl2_calibrate) [12288 - MSP2_BETAFLIGHT_BIND](#msp2_betaflight_bind) [12289 - MSP2_RX_BIND](#msp2_rx_bind) @@ -5002,6 +5005,48 @@ When the MSP JSON specification changes, bump `msp_messages.json` version: **Notes:** Requires `USE_WIND_ESTIMATOR`; returns zeroes when wind estimation is not compiled in or not yet valid. Check bit 0 of `flags` before using speed/angle values. +## `MSP2_INAV_MAG_UNALIGNED (8754 / 0x2232)` +**Description:** Retrieves the calibrated compass reading in the sensor's own frame, before the board and sensor alignment are applied. + +**Request Payload:** **None** + +**Reply Payload:** +|Field|C Type|Size (Bytes)|Units|Description| +|---|---|---|---|---| +| `magX` | `int16_t` | 2 | Raw units | Compass X reading with zero offset and gain calibration applied, before any alignment rotation (`mag.magADCUnaligned[X]`). 0 if `USE_MAG` is not defined | +| `magY` | `int16_t` | 2 | Raw units | Compass Y reading, as `magX` | +| `magZ` | `int16_t` | 2 | Raw units | Compass Z reading, as `magX` | + +**Notes:** Always answers with 6 bytes; they are zero on targets built without `USE_MAG`. + +## `MSP2_INAV_ESC_SRXL2_STATUS (8755 / 0x2233)` +**Description:** Reports the Spektrum Smart ESC (SRXL2) link and the state of its throttle range calibration. + +**Request Payload:** **None** + +**Reply Payload:** +|Field|C Type|Size (Bytes)|Units|Description| +|---|---|---|---|---| +| `calibrationPhase` | `uint8_t` | 1 | [srxl2CalPhase_e](https://github.com/iNavFlight/inav/wiki/Enums-reference#enum-srxl2calphase_e) | Where the throttle range calibration is (`srxl2MotorCalibrationPhase()`): 0 off, 1 full throttle waiting for the ESC to power up, 2 holding high while the ESC takes the endpoint, 3 low, 4 high driven by hand, 5 low driven by hand | +| `linked` | `uint8_t` | 1 | Boolean | 1 if every SRXL2 port has an ESC that completed its handshake and was heard within the link timeout (`srxl2MotorIsConnected()`), otherwise 0 | +| `lastCalibrationResult` | `uint8_t` | 1 | [srxl2CalResult_e](https://github.com/iNavFlight/inav/wiki/Enums-reference#enum-srxl2calresult_e) | Why the last request to start a calibration was refused, or 0 if it was not (`srxl2MotorCalibrationLastResult()`): 1 armed, 2 no SRXL2 port, 3 battery connected, 4 no battery voltage sensor | +| `portCount` | `uint8_t` | 1 | Count | SRXL2 ports opened (`srxl2MotorCount()`) | +| `motorCount` | `uint8_t` | 1 | Count | Motors the mixer wants (`getMotorCount()`). Arming is refused while this is more than `portCount` | + +**Notes:** Requires `USE_MOTOR_SRXL2`. `lastCalibrationResult` exists because `MSP2_INAV_ESC_SRXL2_CALIBRATE` has no reply to carry a refusal reason in. + +## `MSP2_INAV_ESC_SRXL2_CALIBRATE (8756 / 0x2234)` +**Description:** Starts, drives or aborts the SRXL2 throttle range calibration. + +**Request Payload:** +|Field|C Type|Size (Bytes)|Units|Description| +|---|---|---|---|---| +| `phase` | `uint8_t` | 1 | [srxl2CalPhase_e](https://github.com/iNavFlight/inav/wiki/Enums-reference#enum-srxl2calphase_e) | What to do (`srxl2CalPhase_e`): 0 abort, 1 start the unattended sequence, 4 drive high by hand, 5 drive low by hand. Other values are refused | + +**Reply Payload:** **None** + +**Notes:** Requires `USE_MOTOR_SRXL2`. Fails when the driver refuses: armed, no SRXL2 port, battery already connected for the unattended sequence, or no voltage sensor to detect the ESC powering up. `MSP2_INAV_ESC_SRXL2_STATUS` reports which. Phases 1 and 4 command full throttle with the aircraft disarmed; both end on a timeout, and arming cancels any phase. + ## `MSP2_BETAFLIGHT_BIND (12288 / 0x3000)` **Description:** Initiates the receiver binding procedure for supported serial protocols (CRSF, SRXL2). diff --git a/docs/development/msp/inav_enums.json b/docs/development/msp/inav_enums.json index 8535c86c69e..7040f511477 100644 --- a/docs/development/msp/inav_enums.json +++ b/docs/development/msp/inav_enums.json @@ -1,8 +1,8 @@ { "build": { "fc_version": { - "major": 9, - "minor": 1, + "major": 10, + "minor": 0, "patch": 0 } }, @@ -659,7 +659,8 @@ "BOXAUTOSPEED": "60", "BOXTERRAINAGLHOLD": "61", "BOXINFLIGHTMENU": "62", - "CHECKBOX_ITEM_COUNT": "63" + "BOXTHRUSTREVERSE": "63", + "CHECKBOX_ITEM_COUNT": "64" }, "busIndex_e": { "_source": "inav/src/main/drivers/bus.h", @@ -1346,10 +1347,14 @@ "FLIGHT_LOG_FIELD_CONDITION_RC_DATA": "56", "FLIGHT_LOG_FIELD_CONDITION_RC_COMMAND": "57", "FLIGHT_LOG_FIELD_CONDITION_GYRO_RAW": "58", - "FLIGHT_LOG_FIELD_CONDITION_GYRO_PEAKS_ROLL": "59", - "FLIGHT_LOG_FIELD_CONDITION_GYRO_PEAKS_PITCH": "60", - "FLIGHT_LOG_FIELD_CONDITION_GYRO_PEAKS_YAW": "61", - "FLIGHT_LOG_FIELD_CONDITION_NEVER": "62", + "FLIGHT_LOG_FIELD_CONDITION_GYRO_SECONDARY": [ + "(59)", + "USE_DUAL_GYRO" + ], + "FLIGHT_LOG_FIELD_CONDITION_GYRO_PEAKS_ROLL": "60", + "FLIGHT_LOG_FIELD_CONDITION_GYRO_PEAKS_PITCH": "61", + "FLIGHT_LOG_FIELD_CONDITION_GYRO_PEAKS_YAW": "62", + "FLIGHT_LOG_FIELD_CONDITION_NEVER": "63", "FLIGHT_LOG_FIELD_CONDITION_FIRST": "FLIGHT_LOG_FIELD_CONDITION_ALWAYS", "FLIGHT_LOG_FIELD_CONDITION_LAST": "FLIGHT_LOG_FIELD_CONDITION_NEVER" }, @@ -2160,7 +2165,8 @@ "LED_OVERLAY_LANDING_FLASH": "3", "LED_OVERLAY_INDICATOR": "4", "LED_OVERLAY_WARNING": "5", - "LED_OVERLAY_STROBE": "6" + "LED_OVERLAY_STROBE": "6", + "LED_OVERLAY_RAINBOW": "7" }, "ledSpecialColorIds_e": { "_source": "inav/src/main/io/ledstrip.h", @@ -2676,7 +2682,8 @@ "PWM_TYPE_BRUSHED": "3", "PWM_TYPE_DSHOT150": "4", "PWM_TYPE_DSHOT300": "5", - "PWM_TYPE_DSHOT600": "6" + "PWM_TYPE_DSHOT600": "6", + "PWM_TYPE_SRXL2": "7" }, "motorStatus_e": { "_source": "inav/src/main/flight/mixer.h", @@ -2799,6 +2806,13 @@ "FW_LAUNCH_ABORTED": "10", "FW_LAUNCH_FLYING": "11" }, + "navFwWpTurnMode_e": { + "_source": "inav/src/main/navigation/navigation.h", + "NAV_FW_WP_TURN_DIRECT": "0", + "NAV_FW_WP_TURN_COORD_FLY_BY": "1", + "NAV_FW_WP_TURN_COORD_FLY_OVER": "2", + "NAV_FW_WP_TURN_COORD_FLY_INTO": "3" + }, "navigationEstimateStatus_e": { "_source": "inav/src/main/navigation/navigation_private.h", "EST_NONE": "0", @@ -4270,7 +4284,8 @@ "FUNCTION_CRSF_SENSOR": "(1 << 24)", "FUNCTION_MSP_OSD": "(1 << 25)", "FUNCTION_GIMBAL": "(1 << 26)", - "FUNCTION_GIMBAL_HEADTRACKER": "(1 << 27)" + "FUNCTION_GIMBAL_HEADTRACKER": "(1 << 27)", + "FUNCTION_ESC_SRXL2": "(1 << 29)" }, "serialPortIdentifier_e": { "_source": "inav/src/main/io/serial.h", @@ -4467,6 +4482,23 @@ "DSMR_11ms_22ms": "226", "DSMR_5_5ms": "228" }, + "srxl2CalPhase_e": { + "_source": "inav/src/main/io/motor_srxl2.h", + "SRXL2_CAL_OFF": "0", + "SRXL2_CAL_WAIT_BATTERY": "1", + "SRXL2_CAL_SETTLE": "2", + "SRXL2_CAL_LOW": "3", + "SRXL2_CAL_HIGH_MANUAL": "4", + "SRXL2_CAL_LOW_MANUAL": "5" + }, + "srxl2CalResult_e": { + "_source": "inav/src/main/io/motor_srxl2.h", + "SRXL2_CAL_ACCEPTED": "0", + "SRXL2_CAL_REJECT_ARMED": "1", + "SRXL2_CAL_REJECT_NO_PORT": "2", + "SRXL2_CAL_REJECT_BATTERY_PRESENT": "3", + "SRXL2_CAL_REJECT_NO_VOLTAGE_SENSOR": "4" + }, "Srxl2ControlDataCommand": { "_source": "inav/src/main/rx/srxl2_types.h", "ChannelData": "0", @@ -4508,6 +4540,28 @@ "ListenForHandshake": "3", "Running": "4" }, + "srxl2State_e": { + "_source": "inav/src/main/io/motor_srxl2.c", + "SRXL2_DISABLED": "0", + "SRXL2_LISTENING": "1", + "SRXL2_POLLING": "2", + "SRXL2_FINALISING": "3", + "SRXL2_RUNNING": "4" + }, + "srxl2TelemetryField_e": { + "_source": "inav/src/main/io/motor_srxl2.h", + "SRXL2_TELEM_FIELD_RPM": "(1 << 0)", + "SRXL2_TELEM_FIELD_VOLTAGE": "(1 << 1)", + "SRXL2_TELEM_FIELD_CURRENT": "(1 << 2)", + "SRXL2_TELEM_FIELD_TEMP_FET": "(1 << 3)", + "SRXL2_TELEM_FIELD_TEMP_BEC": "(1 << 4)" + }, + "srxl2TelemetryRate_e": { + "_source": "inav/src/main/io/motor_srxl2.h", + "SRXL2_TELEM_1HZ": "0", + "SRXL2_TELEM_3HZ": "1", + "SRXL2_TELEM_2HZ": "2" + }, "stateFlags_t": { "_source": "inav/src/main/fc/runtime_config.h", "GPS_FIX_HOME": "(1 << 0)", @@ -4609,22 +4663,23 @@ }, "timId_e": { "_source": "inav/src/main/io/ledstrip.c", - "timBlink": "0", - "timLarson": "1", - "timBattery": "2", - "timRssi": "3", + "timRainbow": "0", + "timBlink": "1", + "timLarson": "2", + "timBattery": "3", + "timRssi": "4", "timGps": [ - "(4)", + "(5)", "USE_GPS" ], - "timWarning": "5", - "timIndicator": "6", + "timWarning": "6", + "timIndicator": "7", "timAnimation": [ - "(7)", + "(8)", "USE_LED_ANIMATION" ], - "timRing": "8", - "timTimerCount": "9" + "timRing": "9", + "timTimerCount": "10" }, "tristate_e": { "_source": "inav/src/main/common/tristate.h", @@ -4874,12 +4929,6 @@ "DISPLAY_WIDGET_SIDEBAR_OPTION_UNLABELED": "1 << 2", "DISPLAY_WIDGET_SIDEBAR_OPTION_STATIC": "1 << 3" }, - "wpFwTurnSmoothing_e": { - "_source": "inav/src/main/navigation/navigation.h", - "WP_TURN_SMOOTHING_OFF": "0", - "WP_TURN_SMOOTHING_ON": "1", - "WP_TURN_SMOOTHING_CUT": "2" - }, "wpMissionPlannerStatus_e": { "_source": "inav/src/main/navigation/navigation.h", "WP_PLAN_WAIT": "0", diff --git a/docs/development/msp/inav_enums_ref.md b/docs/development/msp/inav_enums_ref.md index dafb9e3afc8..dd32c1fc410 100644 --- a/docs/development/msp/inav_enums_ref.md +++ b/docs/development/msp/inav_enums_ref.md @@ -227,6 +227,7 @@ - [navDefaultAltitudeSensor_e](#enum-navdefaultaltitudesensor_e) - [navExtraArmingSafety_e](#enum-navextraarmingsafety_e) - [navFwLaunchStatus_e](#enum-navfwlaunchstatus_e) +- [navFwWpTurnMode_e](#enum-navfwwpturnmode_e) - [navigationEstimateStatus_e](#enum-navigationestimatestatus_e) - [navigationFSMEvent_t](#enum-navigationfsmevent_t) - [navigationFSMState_t](#enum-navigationfsmstate_t) @@ -362,11 +363,16 @@ - [SPIDevice](#enum-spidevice) - [Srxl2BindRequest](#enum-srxl2bindrequest) - [Srxl2BindType](#enum-srxl2bindtype) +- [srxl2CalPhase_e](#enum-srxl2calphase_e) +- [srxl2CalResult_e](#enum-srxl2calresult_e) - [Srxl2ControlDataCommand](#enum-srxl2controldatacommand) - [Srxl2DeviceId](#enum-srxl2deviceid) - [Srxl2DeviceType](#enum-srxl2devicetype) - [Srxl2PacketType](#enum-srxl2packettype) - [Srxl2State](#enum-srxl2state) +- [srxl2State_e](#enum-srxl2state_e) +- [srxl2TelemetryField_e](#enum-srxl2telemetryfield_e) +- [srxl2TelemetryRate_e](#enum-srxl2telemetryrate_e) - [stateFlags_t](#enum-stateflags_t) - [stickPositions_e](#enum-stickpositions_e) - [systemState_e](#enum-systemstate_e) @@ -407,7 +413,6 @@ - [widgetAHIOptions_t](#enum-widgetahioptions_t) - [widgetAHIStyle_e](#enum-widgetahistyle_e) - [widgetSidebarOptions_t](#enum-widgetsidebaroptions_t) -- [wpFwTurnSmoothing_e](#enum-wpfwturnsmoothing_e) - [wpMissionPlannerStatus_e](#enum-wpmissionplannerstatus_e) - [zeroCalibrationState_e](#enum-zerocalibrationstate_e) @@ -1246,7 +1251,8 @@ | `BOXAUTOSPEED` | 60 | | | `BOXTERRAINAGLHOLD` | 61 | | | `BOXINFLIGHTMENU` | 62 | | -| `CHECKBOX_ITEM_COUNT` | 63 | | +| `BOXTHRUSTREVERSE` | 63 | | +| `CHECKBOX_ITEM_COUNT` | 64 | | --- ## `busIndex_e` @@ -2238,10 +2244,11 @@ | `FLIGHT_LOG_FIELD_CONDITION_RC_DATA` | 56 | | | `FLIGHT_LOG_FIELD_CONDITION_RC_COMMAND` | 57 | | | `FLIGHT_LOG_FIELD_CONDITION_GYRO_RAW` | 58 | | -| `FLIGHT_LOG_FIELD_CONDITION_GYRO_PEAKS_ROLL` | 59 | | -| `FLIGHT_LOG_FIELD_CONDITION_GYRO_PEAKS_PITCH` | 60 | | -| `FLIGHT_LOG_FIELD_CONDITION_GYRO_PEAKS_YAW` | 61 | | -| `FLIGHT_LOG_FIELD_CONDITION_NEVER` | 62 | | +| `FLIGHT_LOG_FIELD_CONDITION_GYRO_SECONDARY` | (59) | USE_DUAL_GYRO | +| `FLIGHT_LOG_FIELD_CONDITION_GYRO_PEAKS_ROLL` | 60 | | +| `FLIGHT_LOG_FIELD_CONDITION_GYRO_PEAKS_PITCH` | 61 | | +| `FLIGHT_LOG_FIELD_CONDITION_GYRO_PEAKS_YAW` | 62 | | +| `FLIGHT_LOG_FIELD_CONDITION_NEVER` | 63 | | | `FLIGHT_LOG_FIELD_CONDITION_FIRST` | FLIGHT_LOG_FIELD_CONDITION_ALWAYS | | | `FLIGHT_LOG_FIELD_CONDITION_LAST` | FLIGHT_LOG_FIELD_CONDITION_NEVER | | @@ -3368,6 +3375,7 @@ | `LED_OVERLAY_INDICATOR` | 4 | | | `LED_OVERLAY_WARNING` | 5 | | | `LED_OVERLAY_STROBE` | 6 | | +| `LED_OVERLAY_RAINBOW` | 7 | | --- ## `ledSpecialColorIds_e` @@ -3979,6 +3987,7 @@ | `PWM_TYPE_DSHOT150` | 4 | | | `PWM_TYPE_DSHOT300` | 5 | | | `PWM_TYPE_DSHOT600` | 6 | | +| `PWM_TYPE_SRXL2` | 7 | | --- ## `motorStatus_e` @@ -4196,6 +4205,18 @@ | `FW_LAUNCH_ABORTED` | 10 | | | `FW_LAUNCH_FLYING` | 11 | | +--- +## `navFwWpTurnMode_e` + +> Source: src/main/navigation/navigation.h + +| Enumerator | Value | Condition | +|---|---:|---| +| `NAV_FW_WP_TURN_DIRECT` | 0 | | +| `NAV_FW_WP_TURN_COORD_FLY_BY` | 1 | | +| `NAV_FW_WP_TURN_COORD_FLY_OVER` | 2 | | +| `NAV_FW_WP_TURN_COORD_FLY_INTO` | 3 | | + --- ## `navigationEstimateStatus_e` @@ -6177,6 +6198,7 @@ | `FUNCTION_MSP_OSD` | (1 << 25) | | | `FUNCTION_GIMBAL` | (1 << 26) | | | `FUNCTION_GIMBAL_HEADTRACKER` | (1 << 27) | | +| `FUNCTION_ESC_SRXL2` | (1 << 29) | | --- ## `serialPortIdentifier_e` @@ -6488,6 +6510,33 @@ | `DSMR_11ms_22ms` | 226 | | | `DSMR_5_5ms` | 228 | | +--- +## `srxl2CalPhase_e` + +> Source: src/main/io/motor_srxl2.h + +| Enumerator | Value | Condition | +|---|---:|---| +| `SRXL2_CAL_OFF` | 0 | | +| `SRXL2_CAL_WAIT_BATTERY` | 1 | | +| `SRXL2_CAL_SETTLE` | 2 | | +| `SRXL2_CAL_LOW` | 3 | | +| `SRXL2_CAL_HIGH_MANUAL` | 4 | | +| `SRXL2_CAL_LOW_MANUAL` | 5 | | + +--- +## `srxl2CalResult_e` + +> Source: src/main/io/motor_srxl2.h + +| Enumerator | Value | Condition | +|---|---:|---| +| `SRXL2_CAL_ACCEPTED` | 0 | | +| `SRXL2_CAL_REJECT_ARMED` | 1 | | +| `SRXL2_CAL_REJECT_NO_PORT` | 2 | | +| `SRXL2_CAL_REJECT_BATTERY_PRESENT` | 3 | | +| `SRXL2_CAL_REJECT_NO_VOLTAGE_SENSOR` | 4 | | + --- ## `Srxl2ControlDataCommand` @@ -6554,6 +6603,43 @@ | `ListenForHandshake` | 3 | | | `Running` | 4 | | +--- +## `srxl2State_e` + +> Source: src/main/io/motor_srxl2.c + +| Enumerator | Value | Condition | +|---|---:|---| +| `SRXL2_DISABLED` | 0 | | +| `SRXL2_LISTENING` | 1 | | +| `SRXL2_POLLING` | 2 | | +| `SRXL2_FINALISING` | 3 | | +| `SRXL2_RUNNING` | 4 | | + +--- +## `srxl2TelemetryField_e` + +> Source: src/main/io/motor_srxl2.h + +| Enumerator | Value | Condition | +|---|---:|---| +| `SRXL2_TELEM_FIELD_RPM` | (1 << 0) | | +| `SRXL2_TELEM_FIELD_VOLTAGE` | (1 << 1) | | +| `SRXL2_TELEM_FIELD_CURRENT` | (1 << 2) | | +| `SRXL2_TELEM_FIELD_TEMP_FET` | (1 << 3) | | +| `SRXL2_TELEM_FIELD_TEMP_BEC` | (1 << 4) | | + +--- +## `srxl2TelemetryRate_e` + +> Source: src/main/io/motor_srxl2.h + +| Enumerator | Value | Condition | +|---|---:|---| +| `SRXL2_TELEM_1HZ` | 0 | | +| `SRXL2_TELEM_3HZ` | 1 | | +| `SRXL2_TELEM_2HZ` | 2 | | + --- ## `stateFlags_t` @@ -6716,16 +6802,17 @@ | Enumerator | Value | Condition | |---|---:|---| -| `timBlink` | 0 | | -| `timLarson` | 1 | | -| `timBattery` | 2 | | -| `timRssi` | 3 | | -| `timGps` | (4) | USE_GPS | -| `timWarning` | 5 | | -| `timIndicator` | 6 | | -| `timAnimation` | (7) | USE_LED_ANIMATION | -| `timRing` | 8 | | -| `timTimerCount` | 9 | | +| `timRainbow` | 0 | | +| `timBlink` | 1 | | +| `timLarson` | 2 | | +| `timBattery` | 3 | | +| `timRssi` | 4 | | +| `timGps` | (5) | USE_GPS | +| `timWarning` | 6 | | +| `timIndicator` | 7 | | +| `timAnimation` | (8) | USE_LED_ANIMATION | +| `timRing` | 9 | | +| `timTimerCount` | 10 | | --- ## `tristate_e` @@ -7120,17 +7207,6 @@ | `DISPLAY_WIDGET_SIDEBAR_OPTION_UNLABELED` | 1 << 2 | | | `DISPLAY_WIDGET_SIDEBAR_OPTION_STATIC` | 1 << 3 | | ---- -## `wpFwTurnSmoothing_e` - -> Source: src/main/navigation/navigation.h - -| Enumerator | Value | Condition | -|---|---:|---| -| `WP_TURN_SMOOTHING_OFF` | 0 | | -| `WP_TURN_SMOOTHING_ON` | 1 | | -| `WP_TURN_SMOOTHING_CUT` | 2 | | - --- ## `wpMissionPlannerStatus_e` diff --git a/docs/development/msp/msp_messages.json b/docs/development/msp/msp_messages.json index 97a8ab9f185..b7aec5e7aed 100644 --- a/docs/development/msp/msp_messages.json +++ b/docs/development/msp/msp_messages.json @@ -2,7 +2,7 @@ "version": { "major": 2, "minor": 1, - "patch": 1 + "patch": 2 }, "messages": { "MSP_API_VERSION": { @@ -11897,6 +11897,96 @@ "notes": "Requires `USE_WIND_ESTIMATOR`; returns zeroes when wind estimation is not compiled in or not yet valid. Check bit 0 of `flags` before using speed/angle values.", "description": "Retrieves the estimated horizontal wind speed and direction from the internal wind estimator." }, + "MSP2_INAV_MAG_UNALIGNED": { + "code": 8754, + "mspv": 2, + "request": null, + "reply": { + "payload": [ + { + "name": "magX", + "ctype": "int16_t", + "desc": "Compass X reading with zero offset and gain calibration applied, before any alignment rotation (`mag.magADCUnaligned[X]`). 0 if `USE_MAG` is not defined", + "units": "Raw units" + }, + { + "name": "magY", + "ctype": "int16_t", + "desc": "Compass Y reading, as `magX`", + "units": "Raw units" + }, + { + "name": "magZ", + "ctype": "int16_t", + "desc": "Compass Z reading, as `magX`", + "units": "Raw units" + } + ] + }, + "notes": "Always answers with 6 bytes; they are zero on targets built without `USE_MAG`.", + "description": "Retrieves the calibrated compass reading in the sensor's own frame, before the board and sensor alignment are applied." + }, + "MSP2_INAV_ESC_SRXL2_STATUS": { + "code": 8755, + "mspv": 2, + "request": null, + "reply": { + "payload": [ + { + "name": "calibrationPhase", + "ctype": "uint8_t", + "desc": "Where the throttle range calibration is (`srxl2MotorCalibrationPhase()`): 0 off, 1 full throttle waiting for the ESC to power up, 2 holding high while the ESC takes the endpoint, 3 low, 4 high driven by hand, 5 low driven by hand", + "units": "Enum", + "enum": "srxl2CalPhase_e" + }, + { + "name": "linked", + "ctype": "uint8_t", + "desc": "1 if every SRXL2 port has an ESC that completed its handshake and was heard within the link timeout (`srxl2MotorIsConnected()`), otherwise 0", + "units": "Boolean" + }, + { + "name": "lastCalibrationResult", + "ctype": "uint8_t", + "desc": "Why the last request to start a calibration was refused, or 0 if it was not (`srxl2MotorCalibrationLastResult()`): 1 armed, 2 no SRXL2 port, 3 battery connected, 4 no battery voltage sensor", + "units": "Enum", + "enum": "srxl2CalResult_e" + }, + { + "name": "portCount", + "ctype": "uint8_t", + "desc": "SRXL2 ports opened (`srxl2MotorCount()`)", + "units": "Count" + }, + { + "name": "motorCount", + "ctype": "uint8_t", + "desc": "Motors the mixer wants (`getMotorCount()`). Arming is refused while this is more than `portCount`", + "units": "Count" + } + ] + }, + "notes": "Requires `USE_MOTOR_SRXL2`. `lastCalibrationResult` exists because `MSP2_INAV_ESC_SRXL2_CALIBRATE` has no reply to carry a refusal reason in.", + "description": "Reports the Spektrum Smart ESC (SRXL2) link and the state of its throttle range calibration." + }, + "MSP2_INAV_ESC_SRXL2_CALIBRATE": { + "code": 8756, + "mspv": 2, + "request": { + "payload": [ + { + "name": "phase", + "ctype": "uint8_t", + "desc": "What to do (`srxl2CalPhase_e`): 0 abort, 1 start the unattended sequence, 4 drive high by hand, 5 drive low by hand. Other values are refused", + "units": "Enum", + "enum": "srxl2CalPhase_e" + } + ] + }, + "reply": null, + "notes": "Requires `USE_MOTOR_SRXL2`. Fails when the driver refuses: armed, no SRXL2 port, battery already connected for the unattended sequence, or no voltage sensor to detect the ESC powering up. `MSP2_INAV_ESC_SRXL2_STATUS` reports which. Phases 1 and 4 command full throttle with the aircraft disarmed; both end on a timeout, and arming cancels any phase.", + "description": "Starts, drives or aborts the SRXL2 throttle range calibration." + }, "MSP2_BETAFLIGHT_BIND": { "code": 12288, "mspv": 2,