Move telemetry displayport init and cms device registering
[betaflight.git] / lib / main / MAVLink / common / mavlink_msg_set_actuator_control_target.h
blob50d68a7c28511fc495d11004c209c4ab135f94a8
1 // MESSAGE SET_ACTUATOR_CONTROL_TARGET PACKING
3 #define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET 139
5 typedef struct __mavlink_set_actuator_control_target_t
7 uint64_t time_usec; ///< Timestamp (micros since boot or Unix epoch)
8 float controls[8]; ///< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
9 uint8_t group_mlx; ///< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
10 uint8_t target_system; ///< System ID
11 uint8_t target_component; ///< Component ID
12 } mavlink_set_actuator_control_target_t;
14 #define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN 43
15 #define MAVLINK_MSG_ID_139_LEN 43
17 #define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC 168
18 #define MAVLINK_MSG_ID_139_CRC 168
20 #define MAVLINK_MSG_SET_ACTUATOR_CONTROL_TARGET_FIELD_CONTROLS_LEN 8
22 #define MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET { \
23 "SET_ACTUATOR_CONTROL_TARGET", \
24 5, \
25 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_set_actuator_control_target_t, time_usec) }, \
26 { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_set_actuator_control_target_t, controls) }, \
27 { "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_set_actuator_control_target_t, group_mlx) }, \
28 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_set_actuator_control_target_t, target_system) }, \
29 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_set_actuator_control_target_t, target_component) }, \
30 } \
34 /**
35 * @brief Pack a set_actuator_control_target message
36 * @param system_id ID of this system
37 * @param component_id ID of this component (e.g. 200 for IMU)
38 * @param msg The MAVLink message to compress the data into
40 * @param time_usec Timestamp (micros since boot or Unix epoch)
41 * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
42 * @param target_system System ID
43 * @param target_component Component ID
44 * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
45 * @return length of the message in bytes (excluding serial stream start sign)
47 static inline uint16_t mavlink_msg_set_actuator_control_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
48 uint64_t time_usec, uint8_t group_mlx, uint8_t target_system, uint8_t target_component, const float *controls)
50 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
51 char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN];
52 _mav_put_uint64_t(buf, 0, time_usec);
53 _mav_put_uint8_t(buf, 40, group_mlx);
54 _mav_put_uint8_t(buf, 41, target_system);
55 _mav_put_uint8_t(buf, 42, target_component);
56 _mav_put_float_array(buf, 8, controls, 8);
57 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
58 #else
59 mavlink_set_actuator_control_target_t packet;
60 packet.time_usec = time_usec;
61 packet.group_mlx = group_mlx;
62 packet.target_system = target_system;
63 packet.target_component = target_component;
64 mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
65 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
66 #endif
68 msg->msgid = MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET;
69 #if MAVLINK_CRC_EXTRA
70 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
71 #else
72 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
73 #endif
76 /**
77 * @brief Pack a set_actuator_control_target message on a channel
78 * @param system_id ID of this system
79 * @param component_id ID of this component (e.g. 200 for IMU)
80 * @param chan The MAVLink channel this message will be sent over
81 * @param msg The MAVLink message to compress the data into
82 * @param time_usec Timestamp (micros since boot or Unix epoch)
83 * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
84 * @param target_system System ID
85 * @param target_component Component ID
86 * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
87 * @return length of the message in bytes (excluding serial stream start sign)
89 static inline uint16_t mavlink_msg_set_actuator_control_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
90 mavlink_message_t* msg,
91 uint64_t time_usec,uint8_t group_mlx,uint8_t target_system,uint8_t target_component,const float *controls)
93 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
94 char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN];
95 _mav_put_uint64_t(buf, 0, time_usec);
96 _mav_put_uint8_t(buf, 40, group_mlx);
97 _mav_put_uint8_t(buf, 41, target_system);
98 _mav_put_uint8_t(buf, 42, target_component);
99 _mav_put_float_array(buf, 8, controls, 8);
100 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
101 #else
102 mavlink_set_actuator_control_target_t packet;
103 packet.time_usec = time_usec;
104 packet.group_mlx = group_mlx;
105 packet.target_system = target_system;
106 packet.target_component = target_component;
107 mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
108 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
109 #endif
111 msg->msgid = MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET;
112 #if MAVLINK_CRC_EXTRA
113 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
114 #else
115 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
116 #endif
120 * @brief Encode a set_actuator_control_target struct
122 * @param system_id ID of this system
123 * @param component_id ID of this component (e.g. 200 for IMU)
124 * @param msg The MAVLink message to compress the data into
125 * @param set_actuator_control_target C-struct to read the message contents from
127 static inline uint16_t mavlink_msg_set_actuator_control_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_actuator_control_target_t* set_actuator_control_target)
129 return mavlink_msg_set_actuator_control_target_pack(system_id, component_id, msg, set_actuator_control_target->time_usec, set_actuator_control_target->group_mlx, set_actuator_control_target->target_system, set_actuator_control_target->target_component, set_actuator_control_target->controls);
133 * @brief Encode a set_actuator_control_target struct on a channel
135 * @param system_id ID of this system
136 * @param component_id ID of this component (e.g. 200 for IMU)
137 * @param chan The MAVLink channel this message will be sent over
138 * @param msg The MAVLink message to compress the data into
139 * @param set_actuator_control_target C-struct to read the message contents from
141 static inline uint16_t mavlink_msg_set_actuator_control_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_actuator_control_target_t* set_actuator_control_target)
143 return mavlink_msg_set_actuator_control_target_pack_chan(system_id, component_id, chan, msg, set_actuator_control_target->time_usec, set_actuator_control_target->group_mlx, set_actuator_control_target->target_system, set_actuator_control_target->target_component, set_actuator_control_target->controls);
147 * @brief Send a set_actuator_control_target message
148 * @param chan MAVLink channel to send the message
150 * @param time_usec Timestamp (micros since boot or Unix epoch)
151 * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
152 * @param target_system System ID
153 * @param target_component Component ID
154 * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
156 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
158 static inline void mavlink_msg_set_actuator_control_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, uint8_t target_system, uint8_t target_component, const float *controls)
160 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
161 char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN];
162 _mav_put_uint64_t(buf, 0, time_usec);
163 _mav_put_uint8_t(buf, 40, group_mlx);
164 _mav_put_uint8_t(buf, 41, target_system);
165 _mav_put_uint8_t(buf, 42, target_component);
166 _mav_put_float_array(buf, 8, controls, 8);
167 #if MAVLINK_CRC_EXTRA
168 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
169 #else
170 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
171 #endif
172 #else
173 mavlink_set_actuator_control_target_t packet;
174 packet.time_usec = time_usec;
175 packet.group_mlx = group_mlx;
176 packet.target_system = target_system;
177 packet.target_component = target_component;
178 mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
179 #if MAVLINK_CRC_EXTRA
180 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
181 #else
182 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
183 #endif
184 #endif
187 #if MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
189 This varient of _send() can be used to save stack space by re-using
190 memory from the receive buffer. The caller provides a
191 mavlink_message_t which is the size of a full mavlink message. This
192 is usually the receive buffer for the channel, and allows a reply to an
193 incoming message with minimum stack space usage.
195 static inline void mavlink_msg_set_actuator_control_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, uint8_t target_system, uint8_t target_component, const float *controls)
197 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
198 char *buf = (char *)msgbuf;
199 _mav_put_uint64_t(buf, 0, time_usec);
200 _mav_put_uint8_t(buf, 40, group_mlx);
201 _mav_put_uint8_t(buf, 41, target_system);
202 _mav_put_uint8_t(buf, 42, target_component);
203 _mav_put_float_array(buf, 8, controls, 8);
204 #if MAVLINK_CRC_EXTRA
205 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
206 #else
207 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
208 #endif
209 #else
210 mavlink_set_actuator_control_target_t *packet = (mavlink_set_actuator_control_target_t *)msgbuf;
211 packet->time_usec = time_usec;
212 packet->group_mlx = group_mlx;
213 packet->target_system = target_system;
214 packet->target_component = target_component;
215 mav_array_memcpy(packet->controls, controls, sizeof(float)*8);
216 #if MAVLINK_CRC_EXTRA
217 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC);
218 #else
219 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
220 #endif
221 #endif
223 #endif
225 #endif
227 // MESSAGE SET_ACTUATOR_CONTROL_TARGET UNPACKING
231 * @brief Get field time_usec from set_actuator_control_target message
233 * @return Timestamp (micros since boot or Unix epoch)
235 static inline uint64_t mavlink_msg_set_actuator_control_target_get_time_usec(const mavlink_message_t* msg)
237 return _MAV_RETURN_uint64_t(msg, 0);
241 * @brief Get field group_mlx from set_actuator_control_target message
243 * @return Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
245 static inline uint8_t mavlink_msg_set_actuator_control_target_get_group_mlx(const mavlink_message_t* msg)
247 return _MAV_RETURN_uint8_t(msg, 40);
251 * @brief Get field target_system from set_actuator_control_target message
253 * @return System ID
255 static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_system(const mavlink_message_t* msg)
257 return _MAV_RETURN_uint8_t(msg, 41);
261 * @brief Get field target_component from set_actuator_control_target message
263 * @return Component ID
265 static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_component(const mavlink_message_t* msg)
267 return _MAV_RETURN_uint8_t(msg, 42);
271 * @brief Get field controls from set_actuator_control_target message
273 * @return Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
275 static inline uint16_t mavlink_msg_set_actuator_control_target_get_controls(const mavlink_message_t* msg, float *controls)
277 return _MAV_RETURN_float_array(msg, controls, 8, 8);
281 * @brief Decode a set_actuator_control_target message into a struct
283 * @param msg The message to decode
284 * @param set_actuator_control_target C-struct to decode the message contents into
286 static inline void mavlink_msg_set_actuator_control_target_decode(const mavlink_message_t* msg, mavlink_set_actuator_control_target_t* set_actuator_control_target)
288 #if MAVLINK_NEED_BYTE_SWAP
289 set_actuator_control_target->time_usec = mavlink_msg_set_actuator_control_target_get_time_usec(msg);
290 mavlink_msg_set_actuator_control_target_get_controls(msg, set_actuator_control_target->controls);
291 set_actuator_control_target->group_mlx = mavlink_msg_set_actuator_control_target_get_group_mlx(msg);
292 set_actuator_control_target->target_system = mavlink_msg_set_actuator_control_target_get_target_system(msg);
293 set_actuator_control_target->target_component = mavlink_msg_set_actuator_control_target_get_target_component(msg);
294 #else
295 memcpy(set_actuator_control_target, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN);
296 #endif