multiwii_serial_protocol_v2/
commands.rs

1#[derive(PrimitiveEnum, Debug, Copy, Clone, PartialEq)]
2#[allow(non_camel_case_types)]
3
4/// MSP command values, used for command encapsulation
5pub enum MspCommandCode {
6    MSP_API_VERSION = 1,
7    MSP_FC_VARIANT = 2,
8    MSP_FC_VERSION = 3,
9    MSP_BOARD_INFO = 4,
10    MSP_BUILD_INFO = 5,
11
12    // MSP commands for Cleanflight original features
13    MSP_BATTERY_CONFIG = 32,
14    MSP_SET_BATTERY_CONFIG = 33,
15    MSP_MODE_RANGES = 34,
16    MSP_SET_MODE_RANGE = 35,
17    MSP_FEATURE = 36,
18    MSP_SET_FEATURE = 37,
19    MSP_BOARD_ALIGNMENT = 38,
20    MSP_SET_BOARD_ALIGNMENT = 39,
21    MSP_AMPERAGE_METER_CONFIG = 40,
22    MSP_SET_AMPERAGE_METER_CONFIG = 41,
23    MSP_MIXER = 42,
24    MSP_SET_MIXER = 43,
25    MSP_RX_CONFIG = 44,
26    MSP_SET_RX_CONFIG = 45,
27    MSP_LED_COLORS = 46,
28    MSP_SET_LED_COLORS = 47,
29    MSP_LED_STRIP_CONFIG = 48,
30    MSP_SET_LED_STRIP_CONFIG = 49,
31    MSP_RSSI_CONFIG = 50,
32    MSP_SET_RSSI_CONFIG = 51,
33    MSP_ADJUSTMENT_RANGES = 52,
34    MSP_SET_ADJUSTMENT_RANGE = 53,
35    MSP_CF_SERIAL_CONFIG = 54,
36    MSP_SET_CF_SERIAL_CONFIG = 55,
37    MSP_VOLTAGE_METER_CONFIG = 56,
38    MSP_SET_VOLTAGE_METER_CONFIG = 57,
39    MSP_SONAR = 58,
40    MSP_PID_CONTROLLER = 59,
41    MSP_SET_PID_CONTROLLER = 60,
42    MSP_ARMING_CONFIG = 61,
43    MSP_SET_ARMING_CONFIG = 62,
44    MSP_DATAFLASH_SUMMARY = 70,
45    MSP_DATAFLASH_READ = 71,
46    MSP_DATAFLASH_ERASE = 72,
47    MSP_LOOP_TIME = 73,
48    MSP_SET_LOOP_TIME = 74,
49    MSP_FAILSAFE_CONFIG = 75,
50    MSP_SET_FAILSAFE_CONFIG = 76,
51    MSP_RXFAIL_CONFIG = 77,
52    MSP_SET_RXFAIL_CONFIG = 78,
53    MSP_SDCARD_SUMMARY = 79,
54    MSP_BLACKBOX_CONFIG = 80,
55    MSP_SET_BLACKBOX_CONFIG = 81,
56    MSP_TRANSPONDER_CONFIG = 82,
57    MSP_SET_TRANSPONDER_CONFIG = 83,
58
59    MSP_OSD_CONFIG = 84,     //out message         Get osd settings - baseflight
60    MSP_SET_OSD_CONFIG = 85, //in message          Set osd settings - baseflight
61
62    MSP_OSD_CHAR_READ = 86, //out message         Get osd settings - betaflight
63    MSP_OSD_CHAR_WRITE = 87, //in message          Set osd settings - betaflight
64
65    MSP_LED_STRIP_MODECOLOR = 127,
66    MSP_SET_LED_STRIP_MODECOLOR = 221,
67
68    MSP_VOLTAGE_METERS = 128,
69    MSP_AMPERAGE_METERS = 129,
70    MSP_BATTERY_STATE = 130,
71
72    MSP_MOTOR_CONFIG = 131,
73
74    // OSD commands
75    MSP_OSD_VIDEO_CONFIG = 180,
76    MSP_SET_OSD_VIDEO_CONFIG = 181,
77    MSP_OSD_VIDEO_STATUS = 182,
78    MSP_OSD_ELEMENT_SUMMARY = 183,
79    MSP_OSD_LAYOUT_CONFIG = 184,
80    MSP_SET_OSD_LAYOUT_CONFIG = 185,
81
82    // Multiwii MSP commands
83    MSP_IDENT = 100,
84    MSP_STATUS = 101,
85    MSP_RAW_IMU = 102,
86    MSP_SERVO = 103,
87    MSP_MOTOR = 104,
88    MSP_RC = 105,
89    MSP_RAW_GPS = 106,
90    MSP_COMP_GPS = 107,
91    MSP_ATTITUDE = 108,
92    MSP_ALTITUDE = 109,
93    MSP_ANALOG = 110,
94    MSP_RC_TUNING = 111,
95    MSP_PID = 112,
96    MSP_BOX = 113,
97    MSP_MISC = 114,
98    MSP_MOTOR_PINS = 115,
99    MSP_BOXNAMES = 116,
100    MSP_PIDNAMES = 117,
101    MSP_WP = 118,
102    MSP_BOXIDS = 119,
103    MSP_SERVO_CONFIGURATIONS = 120,
104    MSP_MOTOR_3D_CONFIG = 124,
105    MSP_RC_DEADBAND = 125,
106    MSP_SENSOR_ALIGNMENT = 126,
107
108    MSP_SET_RAW_RC = 200,
109    MSP_SET_RAW_GPS = 201,
110    MSP_SET_PID = 202,
111    MSP_SET_BOX = 203,
112    MSP_SET_RC_TUNING = 204,
113    MSP_ACC_CALIBRATION = 205,
114    MSP_MAG_CALIBRATION = 206,
115    MSP_SET_MISC = 207,
116    MSP_RESET_CONF = 208,
117    MSP_SET_WP = 209,
118    MSP_SELECT_SETTING = 210,
119    MSP_SET_HEAD = 211,
120    MSP_SET_SERVO_CONFIGURATION = 212,
121    MSP_SET_MOTOR = 214,
122    MSP_SET_3D = 217,
123    MSP_SET_RC_DEADBAND = 218,
124    MSP_SET_RESET_CURR_PID = 219,
125    MSP_SET_SENSOR_ALIGNMENT = 220,
126
127    // MSP_BIND =               240,
128    MSP_SERVO_MIX_RULES = 241,
129    MSP_SET_SERVO_MIX_RULE = 242,
130
131    MSP_EEPROM_WRITE = 250,
132
133    MSP_DEBUGMSG = 253,
134    MSP_DEBUG = 254,
135
136    MSP_BF_CONFIG = 66,
137
138    // Additional baseflight commands that are not compatible with MultiWii
139    MSP_UID = 160,          // Unique device ID
140    MSP_STATUS_EX = 150,    // cycletime, errors_count, CPU load, sensor present etc
141    MSP_ACC_TRIM = 240,     // get acc angle trim values
142    MSP_SET_ACC_TRIM = 239, // set acc angle trim values
143    MSP_GPS_SV_INFO = 164,  // get Signal Strength
144
145    // Additional private MSP for baseflight configurator
146    MSP_RX_MAP = 64,     // get channel map (also returns number of channels total)
147    MSP_SET_RX_MAP = 65, // set rc map, numchannels to set comes from MSP_RX_MAP
148
149    MSP_SET_REBOOT = 68,    // reboot settings
150    MSP_BF_BUILD_INFO = 69, // build date as well as some space for future expansion,
151
152    // Betaflight
153    MSP_ADVANCED_CONFIG = 90,
154    MSP_SET_ADVANCED_CONFIG = 91,
155
156    MSP_FILTER_CONFIG = 92,
157    MSP_SET_FILTER_CONFIG = 93,
158
159    MSP_PID_ADVANCED = 94,
160    MSP_SET_PID_ADVANCED = 95,
161
162    MSP_SENSOR_CONFIG = 96,
163    MSP_SET_SENSOR_CONFIG = 97,
164
165    // Inav
166    MSP2_COMMON_SETTING = 0x1003, //in/out message    Returns the value for a setting
167    MSP2_COMMON_SET_SETTING = 0x1004, //in message        Sets the value for a setting
168
169    MSP2_MOTOR_MIXER = 0x1005,
170    MSP2_SET_MOTOR_MIXER = 0x1006,
171
172    MSP2_COMMON_SETTING_INFO = 0x1007,
173    MSP2_COMMON_PG_LIST = 0x1008,
174
175    MSP2_SERIAL_CONFIG = 0x1009,
176    MSP2_SET_SERIAL_CONFIG = 0x100A,
177
178    MSP2_INAV_OSD_LAYOUTS = 0x2012,
179    MSP2_INAV_OSD_SET_LAYOUT_ITEM = 0x2013,
180    MSP2_INAV_OSD_ALARMS = 0x2014,
181    MSP2_INAV_OSD_SET_ALARMS = 0x2015,
182    MSP2_INAV_OSD_PREFERENCES = 0x2016,
183    MSP2_INAV_OSD_SET_PREFERENCES = 0x2017,
184
185    MSP2_INAV_SERVO_MIXER = 0x2020,
186    MSP2_INAV_SET_SERVO_MIXER = 0x2021,
187}