Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
rc_datalink.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 The Paparazzi Team
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, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
24 
26 volatile bool_t rc_dl_frame_available;
27 
28 
31 }
32 
33 
34 void parse_rc_3ch_datalink( uint8_t throttle_mode,
35  int8_t roll,
36  int8_t pitch)
37 {
38  uint8_t throttle = ((throttle_mode & 0xFC)>>2)*(128/64);
39  uint8_t mode = throttle_mode & 0x03;
40 
41  rc_dl_values[RADIO_ROLL] = roll;
42  rc_dl_values[RADIO_PITCH] = pitch;
43  rc_dl_values[RADIO_THROTTLE] = (int8_t)throttle;
46 
48 }
49 
51  uint8_t mode,
52  uint8_t throttle,
53  int8_t roll,
54  int8_t pitch,
55  int8_t yaw)
56 {
58  rc_dl_values[RADIO_THROTTLE] = (int8_t)throttle;
59  rc_dl_values[RADIO_ROLL] = roll;
60  rc_dl_values[RADIO_PITCH] = pitch;
61  rc_dl_values[RADIO_YAW] = yaw;
62 
64 }
65 
#define FALSE
Definition: imu_chimu.h:141
#define RADIO_PITCH
Definition: spektrum_arch.h:40
#define RADIO_YAW
Definition: spektrum_arch.h:41
#define TRUE
Definition: imu_chimu.h:144
#define RADIO_MODE
Definition: spektrum_arch.h:61
#define RADIO_THROTTLE
Definition: spektrum_arch.h:38
unsigned char uint8_t
Definition: types.h:14
#define RADIO_ROLL
Definition: spektrum_arch.h:39
signed char int8_t
Definition: types.h:15