[GYRO] Refactor gyro driver for dual-gyro support
[inav.git] / lib / main / MAVLink / common / mavlink_msg_servo_output_raw.h
blob0bf3936cdc7e3d96b35082cfa0672760fcf0af4e
1 #pragma once
2 // MESSAGE SERVO_OUTPUT_RAW PACKING
4 #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW 36
6 MAVPACKED(
7 typedef struct __mavlink_servo_output_raw_t {
8 uint32_t time_usec; /*< Timestamp (microseconds since system boot)*/
9 uint16_t servo1_raw; /*< Servo output 1 value, in microseconds*/
10 uint16_t servo2_raw; /*< Servo output 2 value, in microseconds*/
11 uint16_t servo3_raw; /*< Servo output 3 value, in microseconds*/
12 uint16_t servo4_raw; /*< Servo output 4 value, in microseconds*/
13 uint16_t servo5_raw; /*< Servo output 5 value, in microseconds*/
14 uint16_t servo6_raw; /*< Servo output 6 value, in microseconds*/
15 uint16_t servo7_raw; /*< Servo output 7 value, in microseconds*/
16 uint16_t servo8_raw; /*< Servo output 8 value, in microseconds*/
17 uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.*/
18 }) mavlink_servo_output_raw_t;
20 #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN 21
21 #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN 21
22 #define MAVLINK_MSG_ID_36_LEN 21
23 #define MAVLINK_MSG_ID_36_MIN_LEN 21
25 #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC 222
26 #define MAVLINK_MSG_ID_36_CRC 222
30 #if MAVLINK_COMMAND_24BIT
31 #define MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW { \
32 36, \
33 "SERVO_OUTPUT_RAW", \
34 10, \
35 { { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_servo_output_raw_t, time_usec) }, \
36 { "servo1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_servo_output_raw_t, servo1_raw) }, \
37 { "servo2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_servo_output_raw_t, servo2_raw) }, \
38 { "servo3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_servo_output_raw_t, servo3_raw) }, \
39 { "servo4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_servo_output_raw_t, servo4_raw) }, \
40 { "servo5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_servo_output_raw_t, servo5_raw) }, \
41 { "servo6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_servo_output_raw_t, servo6_raw) }, \
42 { "servo7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_servo_output_raw_t, servo7_raw) }, \
43 { "servo8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_servo_output_raw_t, servo8_raw) }, \
44 { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_servo_output_raw_t, port) }, \
45 } \
47 #else
48 #define MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW { \
49 "SERVO_OUTPUT_RAW", \
50 10, \
51 { { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_servo_output_raw_t, time_usec) }, \
52 { "servo1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_servo_output_raw_t, servo1_raw) }, \
53 { "servo2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_servo_output_raw_t, servo2_raw) }, \
54 { "servo3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_servo_output_raw_t, servo3_raw) }, \
55 { "servo4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_servo_output_raw_t, servo4_raw) }, \
56 { "servo5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_servo_output_raw_t, servo5_raw) }, \
57 { "servo6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_servo_output_raw_t, servo6_raw) }, \
58 { "servo7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_servo_output_raw_t, servo7_raw) }, \
59 { "servo8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_servo_output_raw_t, servo8_raw) }, \
60 { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_servo_output_raw_t, port) }, \
61 } \
63 #endif
65 /**
66 * @brief Pack a servo_output_raw message
67 * @param system_id ID of this system
68 * @param component_id ID of this component (e.g. 200 for IMU)
69 * @param msg The MAVLink message to compress the data into
71 * @param time_usec Timestamp (microseconds since system boot)
72 * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
73 * @param servo1_raw Servo output 1 value, in microseconds
74 * @param servo2_raw Servo output 2 value, in microseconds
75 * @param servo3_raw Servo output 3 value, in microseconds
76 * @param servo4_raw Servo output 4 value, in microseconds
77 * @param servo5_raw Servo output 5 value, in microseconds
78 * @param servo6_raw Servo output 6 value, in microseconds
79 * @param servo7_raw Servo output 7 value, in microseconds
80 * @param servo8_raw Servo output 8 value, in microseconds
81 * @return length of the message in bytes (excluding serial stream start sign)
83 static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
84 uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw)
86 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
87 char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN];
88 _mav_put_uint32_t(buf, 0, time_usec);
89 _mav_put_uint16_t(buf, 4, servo1_raw);
90 _mav_put_uint16_t(buf, 6, servo2_raw);
91 _mav_put_uint16_t(buf, 8, servo3_raw);
92 _mav_put_uint16_t(buf, 10, servo4_raw);
93 _mav_put_uint16_t(buf, 12, servo5_raw);
94 _mav_put_uint16_t(buf, 14, servo6_raw);
95 _mav_put_uint16_t(buf, 16, servo7_raw);
96 _mav_put_uint16_t(buf, 18, servo8_raw);
97 _mav_put_uint8_t(buf, 20, port);
99 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
100 #else
101 mavlink_servo_output_raw_t packet;
102 packet.time_usec = time_usec;
103 packet.servo1_raw = servo1_raw;
104 packet.servo2_raw = servo2_raw;
105 packet.servo3_raw = servo3_raw;
106 packet.servo4_raw = servo4_raw;
107 packet.servo5_raw = servo5_raw;
108 packet.servo6_raw = servo6_raw;
109 packet.servo7_raw = servo7_raw;
110 packet.servo8_raw = servo8_raw;
111 packet.port = port;
113 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
114 #endif
116 msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW;
117 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
121 * @brief Pack a servo_output_raw message on a channel
122 * @param system_id ID of this system
123 * @param component_id ID of this component (e.g. 200 for IMU)
124 * @param chan The MAVLink channel this message will be sent over
125 * @param msg The MAVLink message to compress the data into
126 * @param time_usec Timestamp (microseconds since system boot)
127 * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
128 * @param servo1_raw Servo output 1 value, in microseconds
129 * @param servo2_raw Servo output 2 value, in microseconds
130 * @param servo3_raw Servo output 3 value, in microseconds
131 * @param servo4_raw Servo output 4 value, in microseconds
132 * @param servo5_raw Servo output 5 value, in microseconds
133 * @param servo6_raw Servo output 6 value, in microseconds
134 * @param servo7_raw Servo output 7 value, in microseconds
135 * @param servo8_raw Servo output 8 value, in microseconds
136 * @return length of the message in bytes (excluding serial stream start sign)
138 static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
139 mavlink_message_t* msg,
140 uint32_t time_usec,uint8_t port,uint16_t servo1_raw,uint16_t servo2_raw,uint16_t servo3_raw,uint16_t servo4_raw,uint16_t servo5_raw,uint16_t servo6_raw,uint16_t servo7_raw,uint16_t servo8_raw)
142 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
143 char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN];
144 _mav_put_uint32_t(buf, 0, time_usec);
145 _mav_put_uint16_t(buf, 4, servo1_raw);
146 _mav_put_uint16_t(buf, 6, servo2_raw);
147 _mav_put_uint16_t(buf, 8, servo3_raw);
148 _mav_put_uint16_t(buf, 10, servo4_raw);
149 _mav_put_uint16_t(buf, 12, servo5_raw);
150 _mav_put_uint16_t(buf, 14, servo6_raw);
151 _mav_put_uint16_t(buf, 16, servo7_raw);
152 _mav_put_uint16_t(buf, 18, servo8_raw);
153 _mav_put_uint8_t(buf, 20, port);
155 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
156 #else
157 mavlink_servo_output_raw_t packet;
158 packet.time_usec = time_usec;
159 packet.servo1_raw = servo1_raw;
160 packet.servo2_raw = servo2_raw;
161 packet.servo3_raw = servo3_raw;
162 packet.servo4_raw = servo4_raw;
163 packet.servo5_raw = servo5_raw;
164 packet.servo6_raw = servo6_raw;
165 packet.servo7_raw = servo7_raw;
166 packet.servo8_raw = servo8_raw;
167 packet.port = port;
169 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
170 #endif
172 msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW;
173 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
177 * @brief Encode a servo_output_raw struct
179 * @param system_id ID of this system
180 * @param component_id ID of this component (e.g. 200 for IMU)
181 * @param msg The MAVLink message to compress the data into
182 * @param servo_output_raw C-struct to read the message contents from
184 static inline uint16_t mavlink_msg_servo_output_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_servo_output_raw_t* servo_output_raw)
186 return mavlink_msg_servo_output_raw_pack(system_id, component_id, msg, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw);
190 * @brief Encode a servo_output_raw struct on a channel
192 * @param system_id ID of this system
193 * @param component_id ID of this component (e.g. 200 for IMU)
194 * @param chan The MAVLink channel this message will be sent over
195 * @param msg The MAVLink message to compress the data into
196 * @param servo_output_raw C-struct to read the message contents from
198 static inline uint16_t mavlink_msg_servo_output_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_servo_output_raw_t* servo_output_raw)
200 return mavlink_msg_servo_output_raw_pack_chan(system_id, component_id, chan, msg, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw);
204 * @brief Send a servo_output_raw message
205 * @param chan MAVLink channel to send the message
207 * @param time_usec Timestamp (microseconds since system boot)
208 * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
209 * @param servo1_raw Servo output 1 value, in microseconds
210 * @param servo2_raw Servo output 2 value, in microseconds
211 * @param servo3_raw Servo output 3 value, in microseconds
212 * @param servo4_raw Servo output 4 value, in microseconds
213 * @param servo5_raw Servo output 5 value, in microseconds
214 * @param servo6_raw Servo output 6 value, in microseconds
215 * @param servo7_raw Servo output 7 value, in microseconds
216 * @param servo8_raw Servo output 8 value, in microseconds
218 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
220 static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw)
222 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
223 char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN];
224 _mav_put_uint32_t(buf, 0, time_usec);
225 _mav_put_uint16_t(buf, 4, servo1_raw);
226 _mav_put_uint16_t(buf, 6, servo2_raw);
227 _mav_put_uint16_t(buf, 8, servo3_raw);
228 _mav_put_uint16_t(buf, 10, servo4_raw);
229 _mav_put_uint16_t(buf, 12, servo5_raw);
230 _mav_put_uint16_t(buf, 14, servo6_raw);
231 _mav_put_uint16_t(buf, 16, servo7_raw);
232 _mav_put_uint16_t(buf, 18, servo8_raw);
233 _mav_put_uint8_t(buf, 20, port);
235 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
236 #else
237 mavlink_servo_output_raw_t packet;
238 packet.time_usec = time_usec;
239 packet.servo1_raw = servo1_raw;
240 packet.servo2_raw = servo2_raw;
241 packet.servo3_raw = servo3_raw;
242 packet.servo4_raw = servo4_raw;
243 packet.servo5_raw = servo5_raw;
244 packet.servo6_raw = servo6_raw;
245 packet.servo7_raw = servo7_raw;
246 packet.servo8_raw = servo8_raw;
247 packet.port = port;
249 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)&packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
250 #endif
254 * @brief Send a servo_output_raw message
255 * @param chan MAVLink channel to send the message
256 * @param struct The MAVLink struct to serialize
258 static inline void mavlink_msg_servo_output_raw_send_struct(mavlink_channel_t chan, const mavlink_servo_output_raw_t* servo_output_raw)
260 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
261 mavlink_msg_servo_output_raw_send(chan, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw);
262 #else
263 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)servo_output_raw, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
264 #endif
267 #if MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
269 This varient of _send() can be used to save stack space by re-using
270 memory from the receive buffer. The caller provides a
271 mavlink_message_t which is the size of a full mavlink message. This
272 is usually the receive buffer for the channel, and allows a reply to an
273 incoming message with minimum stack space usage.
275 static inline void mavlink_msg_servo_output_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw)
277 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
278 char *buf = (char *)msgbuf;
279 _mav_put_uint32_t(buf, 0, time_usec);
280 _mav_put_uint16_t(buf, 4, servo1_raw);
281 _mav_put_uint16_t(buf, 6, servo2_raw);
282 _mav_put_uint16_t(buf, 8, servo3_raw);
283 _mav_put_uint16_t(buf, 10, servo4_raw);
284 _mav_put_uint16_t(buf, 12, servo5_raw);
285 _mav_put_uint16_t(buf, 14, servo6_raw);
286 _mav_put_uint16_t(buf, 16, servo7_raw);
287 _mav_put_uint16_t(buf, 18, servo8_raw);
288 _mav_put_uint8_t(buf, 20, port);
290 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
291 #else
292 mavlink_servo_output_raw_t *packet = (mavlink_servo_output_raw_t *)msgbuf;
293 packet->time_usec = time_usec;
294 packet->servo1_raw = servo1_raw;
295 packet->servo2_raw = servo2_raw;
296 packet->servo3_raw = servo3_raw;
297 packet->servo4_raw = servo4_raw;
298 packet->servo5_raw = servo5_raw;
299 packet->servo6_raw = servo6_raw;
300 packet->servo7_raw = servo7_raw;
301 packet->servo8_raw = servo8_raw;
302 packet->port = port;
304 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
305 #endif
307 #endif
309 #endif
311 // MESSAGE SERVO_OUTPUT_RAW UNPACKING
315 * @brief Get field time_usec from servo_output_raw message
317 * @return Timestamp (microseconds since system boot)
319 static inline uint32_t mavlink_msg_servo_output_raw_get_time_usec(const mavlink_message_t* msg)
321 return _MAV_RETURN_uint32_t(msg, 0);
325 * @brief Get field port from servo_output_raw message
327 * @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
329 static inline uint8_t mavlink_msg_servo_output_raw_get_port(const mavlink_message_t* msg)
331 return _MAV_RETURN_uint8_t(msg, 20);
335 * @brief Get field servo1_raw from servo_output_raw message
337 * @return Servo output 1 value, in microseconds
339 static inline uint16_t mavlink_msg_servo_output_raw_get_servo1_raw(const mavlink_message_t* msg)
341 return _MAV_RETURN_uint16_t(msg, 4);
345 * @brief Get field servo2_raw from servo_output_raw message
347 * @return Servo output 2 value, in microseconds
349 static inline uint16_t mavlink_msg_servo_output_raw_get_servo2_raw(const mavlink_message_t* msg)
351 return _MAV_RETURN_uint16_t(msg, 6);
355 * @brief Get field servo3_raw from servo_output_raw message
357 * @return Servo output 3 value, in microseconds
359 static inline uint16_t mavlink_msg_servo_output_raw_get_servo3_raw(const mavlink_message_t* msg)
361 return _MAV_RETURN_uint16_t(msg, 8);
365 * @brief Get field servo4_raw from servo_output_raw message
367 * @return Servo output 4 value, in microseconds
369 static inline uint16_t mavlink_msg_servo_output_raw_get_servo4_raw(const mavlink_message_t* msg)
371 return _MAV_RETURN_uint16_t(msg, 10);
375 * @brief Get field servo5_raw from servo_output_raw message
377 * @return Servo output 5 value, in microseconds
379 static inline uint16_t mavlink_msg_servo_output_raw_get_servo5_raw(const mavlink_message_t* msg)
381 return _MAV_RETURN_uint16_t(msg, 12);
385 * @brief Get field servo6_raw from servo_output_raw message
387 * @return Servo output 6 value, in microseconds
389 static inline uint16_t mavlink_msg_servo_output_raw_get_servo6_raw(const mavlink_message_t* msg)
391 return _MAV_RETURN_uint16_t(msg, 14);
395 * @brief Get field servo7_raw from servo_output_raw message
397 * @return Servo output 7 value, in microseconds
399 static inline uint16_t mavlink_msg_servo_output_raw_get_servo7_raw(const mavlink_message_t* msg)
401 return _MAV_RETURN_uint16_t(msg, 16);
405 * @brief Get field servo8_raw from servo_output_raw message
407 * @return Servo output 8 value, in microseconds
409 static inline uint16_t mavlink_msg_servo_output_raw_get_servo8_raw(const mavlink_message_t* msg)
411 return _MAV_RETURN_uint16_t(msg, 18);
415 * @brief Decode a servo_output_raw message into a struct
417 * @param msg The message to decode
418 * @param servo_output_raw C-struct to decode the message contents into
420 static inline void mavlink_msg_servo_output_raw_decode(const mavlink_message_t* msg, mavlink_servo_output_raw_t* servo_output_raw)
422 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
423 servo_output_raw->time_usec = mavlink_msg_servo_output_raw_get_time_usec(msg);
424 servo_output_raw->servo1_raw = mavlink_msg_servo_output_raw_get_servo1_raw(msg);
425 servo_output_raw->servo2_raw = mavlink_msg_servo_output_raw_get_servo2_raw(msg);
426 servo_output_raw->servo3_raw = mavlink_msg_servo_output_raw_get_servo3_raw(msg);
427 servo_output_raw->servo4_raw = mavlink_msg_servo_output_raw_get_servo4_raw(msg);
428 servo_output_raw->servo5_raw = mavlink_msg_servo_output_raw_get_servo5_raw(msg);
429 servo_output_raw->servo6_raw = mavlink_msg_servo_output_raw_get_servo6_raw(msg);
430 servo_output_raw->servo7_raw = mavlink_msg_servo_output_raw_get_servo7_raw(msg);
431 servo_output_raw->servo8_raw = mavlink_msg_servo_output_raw_get_servo8_raw(msg);
432 servo_output_raw->port = mavlink_msg_servo_output_raw_get_port(msg);
433 #else
434 uint8_t len = msg->len < MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN? msg->len : MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN;
435 memset(servo_output_raw, 0, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
436 memcpy(servo_output_raw, _MAV_PAYLOAD(msg), len);
437 #endif