Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.
Dependencies: Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo
mavlink_msg_image_trigger_control.h
00001 // MESSAGE IMAGE_TRIGGER_CONTROL PACKING 00002 00003 #define MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL 102 00004 00005 typedef struct __mavlink_image_trigger_control_t 00006 { 00007 uint8_t enable; ///< 0 to disable, 1 to enable 00008 00009 } mavlink_image_trigger_control_t; 00010 00011 00012 00013 /** 00014 * @brief Pack a image_trigger_control message 00015 * @param system_id ID of this system 00016 * @param component_id ID of this component (e.g. 200 for IMU) 00017 * @param msg The MAVLink message to compress the data into 00018 * 00019 * @param enable 0 to disable, 1 to enable 00020 * @return length of the message in bytes (excluding serial stream start sign) 00021 */ 00022 static inline uint16_t mavlink_msg_image_trigger_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint8_t enable) 00023 { 00024 uint16_t i = 0; 00025 msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL; 00026 00027 i += put_uint8_t_by_index(enable, i, msg->payload); // 0 to disable, 1 to enable 00028 00029 return mavlink_finalize_message(msg, system_id, component_id, i); 00030 } 00031 00032 /** 00033 * @brief Pack a image_trigger_control message 00034 * @param system_id ID of this system 00035 * @param component_id ID of this component (e.g. 200 for IMU) 00036 * @param chan The MAVLink channel this message was sent over 00037 * @param msg The MAVLink message to compress the data into 00038 * @param enable 0 to disable, 1 to enable 00039 * @return length of the message in bytes (excluding serial stream start sign) 00040 */ 00041 static inline uint16_t mavlink_msg_image_trigger_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, uint8_t enable) 00042 { 00043 uint16_t i = 0; 00044 msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL; 00045 00046 i += put_uint8_t_by_index(enable, i, msg->payload); // 0 to disable, 1 to enable 00047 00048 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, i); 00049 } 00050 00051 /** 00052 * @brief Encode a image_trigger_control struct into a message 00053 * 00054 * @param system_id ID of this system 00055 * @param component_id ID of this component (e.g. 200 for IMU) 00056 * @param msg The MAVLink message to compress the data into 00057 * @param image_trigger_control C-struct to read the message contents from 00058 */ 00059 static inline uint16_t mavlink_msg_image_trigger_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_image_trigger_control_t* image_trigger_control) 00060 { 00061 return mavlink_msg_image_trigger_control_pack(system_id, component_id, msg, image_trigger_control->enable); 00062 } 00063 00064 /** 00065 * @brief Send a image_trigger_control message 00066 * @param chan MAVLink channel to send the message 00067 * 00068 * @param enable 0 to disable, 1 to enable 00069 */ 00070 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 00071 00072 static inline void mavlink_msg_image_trigger_control_send(mavlink_channel_t chan, uint8_t enable) 00073 { 00074 mavlink_message_t msg; 00075 mavlink_msg_image_trigger_control_pack_chan(mavlink_system.sysid, mavlink_system.compid, chan, &msg, enable); 00076 mavlink_send_uart(chan, &msg); 00077 } 00078 00079 #endif 00080 // MESSAGE IMAGE_TRIGGER_CONTROL UNPACKING 00081 00082 /** 00083 * @brief Get field enable from image_trigger_control message 00084 * 00085 * @return 0 to disable, 1 to enable 00086 */ 00087 static inline uint8_t mavlink_msg_image_trigger_control_get_enable(const mavlink_message_t* msg) 00088 { 00089 return (uint8_t)(msg->payload)[0]; 00090 } 00091 00092 /** 00093 * @brief Decode a image_trigger_control message into a struct 00094 * 00095 * @param msg The message to decode 00096 * @param image_trigger_control C-struct to decode the message contents into 00097 */ 00098 static inline void mavlink_msg_image_trigger_control_decode(const mavlink_message_t* msg, mavlink_image_trigger_control_t* image_trigger_control) 00099 { 00100 image_trigger_control->enable = mavlink_msg_image_trigger_control_get_enable(msg); 00101 }
Generated on Tue Jul 12 2022 14:09:26 by 1.7.2