Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.
Dependencies: Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo
MAVlink/include/mavlink_bridge.h@0:826c6171fc1b, 2012-06-20 (annotated)
- Committer:
- shimniok
- Date:
- Wed Jun 20 14:57:48 2012 +0000
- Revision:
- 0:826c6171fc1b
Updated documentation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shimniok | 0:826c6171fc1b | 1 | /* MAVLink adapter header */ |
shimniok | 0:826c6171fc1b | 2 | #ifndef __MAVLINK_BRIDGE_HEADER_H |
shimniok | 0:826c6171fc1b | 3 | #define __MAVLINK_BRIDGE_HEADER_H |
shimniok | 0:826c6171fc1b | 4 | |
shimniok | 0:826c6171fc1b | 5 | #define MAVLINK_USE_CONVENIENCE_FUNCTIONS |
shimniok | 0:826c6171fc1b | 6 | |
shimniok | 0:826c6171fc1b | 7 | #include "mavlink_types.h" |
shimniok | 0:826c6171fc1b | 8 | |
shimniok | 0:826c6171fc1b | 9 | /* Struct that stores the communication settings of this system. |
shimniok | 0:826c6171fc1b | 10 | you can also define / alter these settings elsewhere, as long |
shimniok | 0:826c6171fc1b | 11 | as they're included BEFORE mavlink.h. |
shimniok | 0:826c6171fc1b | 12 | So you can set the |
shimniok | 0:826c6171fc1b | 13 | |
shimniok | 0:826c6171fc1b | 14 | mavlink_system.sysid = 100; // System ID, 1-255 |
shimniok | 0:826c6171fc1b | 15 | mavlink_system.compid = 50; // Component/Subsystem ID, 1-255 |
shimniok | 0:826c6171fc1b | 16 | |
shimniok | 0:826c6171fc1b | 17 | Lines also in your main.c, e.g. by reading these parameter from EEPROM. |
shimniok | 0:826c6171fc1b | 18 | */ |
shimniok | 0:826c6171fc1b | 19 | mavlink_system_t mavlink_system; |
shimniok | 0:826c6171fc1b | 20 | |
shimniok | 0:826c6171fc1b | 21 | /** |
shimniok | 0:826c6171fc1b | 22 | * @brief Send one char (uint8_t) over a comm channel |
shimniok | 0:826c6171fc1b | 23 | * |
shimniok | 0:826c6171fc1b | 24 | * @param chan MAVLink channel to use, usually MAVLINK_COMM_0 = UART0 |
shimniok | 0:826c6171fc1b | 25 | * @param ch Character to send |
shimniok | 0:826c6171fc1b | 26 | */ |
shimniok | 0:826c6171fc1b | 27 | static inline void comm_send_ch(mavlink_channel_t chan, uint8_t ch) { |
shimniok | 0:826c6171fc1b | 28 | extern Serial pc; |
shimniok | 0:826c6171fc1b | 29 | |
shimniok | 0:826c6171fc1b | 30 | if (chan == MAVLINK_COMM_0) { |
shimniok | 0:826c6171fc1b | 31 | pc.putc(ch); |
shimniok | 0:826c6171fc1b | 32 | } |
shimniok | 0:826c6171fc1b | 33 | if (chan == MAVLINK_COMM_1) { |
shimniok | 0:826c6171fc1b | 34 | // write to mavlink logfile |
shimniok | 0:826c6171fc1b | 35 | } |
shimniok | 0:826c6171fc1b | 36 | } |
shimniok | 0:826c6171fc1b | 37 | |
shimniok | 0:826c6171fc1b | 38 | #include "protocol.h" |
shimniok | 0:826c6171fc1b | 39 | #include "common/common.h" |
shimniok | 0:826c6171fc1b | 40 | |
shimniok | 0:826c6171fc1b | 41 | #endif /* YOUR_MAVLINK_BRIDGE_HEADER_H *//* MAVLink adapter header */ |