Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
joby.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009 Pascal Brisset <pascal.brisset@gmail.com>,
3  * Antoine Drouin <poinix@gmail.com>
4  *
5  * This file is part of paparazzi.
6  *
7  * paparazzi is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * paparazzi is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with paparazzi; see the file COPYING. If not, write to
19  * the Free Software Foundation, 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22 
23 #ifndef RADIO_CONTROL_JOBY_H
24 #define RADIO_CONTROL_JOBY_H
25 
26 #include "std.h"
27 #include "mcu_periph/uart.h"
28 
29 #define RC_JOBY_MAGIC_START 13999
30 
31 #include RADIO_CONTROL_JOBY_MODEL_H
32 
33 typedef enum {
37 
38 typedef enum {
42 
44 {
48 
53 
55 };
56 
57 void rc_joby_parse(int8_t c, void (* callback)(void));
58 
59 #define __RcLink(dev, _x) dev##_x
60 #define _RcLink(dev, _x) __RcLink(dev, _x)
61 #define RcLink(_x) _RcLink(RADIO_CONTROL_LINK, _x)
62 
63 #define RcLinkChAvailable() RcLink(ChAvailable())
64 #define RcLinkGetCh() RcLink(Getch())
65 
66 #define RadioControlEvent(_received_frame_handler) { \
67  while (RcLinkChAvailable()) { \
68  rc_joby_parse(RcLinkGetCh(), _received_frame_handler); \
69  } \
70  }
71 
72 
73 #endif /* RADIO_CONTROL_JOBY_H */
parser_byte_t current_byte
Definition: joby.h:45
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
int16_t parser_inverted_buf
Definition: joby.h:49
uint8_t high_byte_buf
Definition: joby.h:51
parser_inverted_t
Definition: joby.h:38
int current_channel
Definition: joby.h:47
void rc_joby_parse(int8_t c, void(*callback)(void))
Definition: joby.c:74
unsigned long uint32_t
Definition: types.h:18
signed short int16_t
Definition: types.h:17
uint32_t error_counter
Definition: joby.h:54
unsigned char uint8_t
Definition: types.h:14
uint8_t low_byte_buf
Definition: joby.h:52
signed char int8_t
Definition: types.h:15
parser_byte_t
Definition: joby.h:33
parser_inverted_t current_inverted
Definition: joby.h:46
int16_t parser_normal_buf
Definition: joby.h:50