Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
jevois_mavlink.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) MAVLab
3  *
4  * This file is part of paparazzi
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
26 #ifndef JEVOIS_MAVLINK_H
27 #define JEVOIS_MAVLINK_H
28 
29 
30 
31 
32 /*
33  * Paparazzi UART over USB
34  */
35 
36 #include "mcu_periph/uart.h"
37 
38 #ifndef JEVOIS_DEV
39 #define JEVOIS_DEV uart2
40 #endif
41 
42 #define MAVLinkDev (&(JEVOIS_DEV).device)
43 #define MAVLinkTransmit(c) MAVLinkDev->put_byte(MAVLinkDev->periph, 0, c)
44 #define MAVLinkChAvailable() MAVLinkDev->char_available(MAVLinkDev->periph)
45 #define MAVLinkGetch() MAVLinkDev->get_byte(MAVLinkDev->periph)
46 #define MAVLinkSendMessage() MAVLinkDev->send_message(MAVLinkDev->periph, 0)
47 
48 
49 
50 
51 /*
52  * MavLink protocol
53  */
54 
55 #include <mavlink/mavlink_types.h>
56 
57 
58 #define MAVLINK_USE_CONVENIENCE_FUNCTIONS
59 #define MAVLINK_ALIGNED_FIELDS 0
60 
61 extern mavlink_system_t mavlink_system;
62 
63 static inline void comm_send_ch(mavlink_channel_t chan __attribute__((unused)), uint8_t ch)
64 {
65  // Send bytes
66  MAVLinkTransmit(ch);
67 }
68 
69 
70 
71 
72 
73 /*
74  * Paparazzi Module functions
75  */
76 
77 
78 extern void jevois_mavlink_init(void);
79 extern void jevois_mavlink_periodic(void);
80 extern void jevois_mavlink_filter_periodic(void);
81 extern void jevois_mavlink_event(void);
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 #endif
93 
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned char uint8_t
Definition: types.h:14