Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rc_datalink.c
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Copyright (C) 2010 The Paparazzi Team
5  *
6  * This file is part of paparazzi.
7  *
8  * paparazzi is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * paparazzi is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with paparazzi; see the file COPYING. If not, write to
20  * the Free Software Foundation, 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
26 
28 volatile bool_t rc_dl_frame_available;
29 
30 
33 }
34 
35 
36 void parse_rc_3ch_datalink( uint8_t throttle_mode,
37  int8_t roll,
38  int8_t pitch)
39 {
40  uint8_t throttle = ((throttle_mode & 0xFC)>>2)*(128/64);
41  uint8_t mode = throttle_mode & 0x03;
42 
43  rc_dl_values[RADIO_ROLL] = roll;
44  rc_dl_values[RADIO_PITCH] = pitch;
45  rc_dl_values[RADIO_THROTTLE] = (int8_t)throttle;
48 
50 }
51 
53  uint8_t mode,
54  uint8_t throttle,
55  int8_t roll,
56  int8_t pitch,
57  int8_t yaw)
58 {
60  rc_dl_values[RADIO_THROTTLE] = (int8_t)throttle;
61  rc_dl_values[RADIO_ROLL] = roll;
62  rc_dl_values[RADIO_PITCH] = pitch;
63  rc_dl_values[RADIO_YAW] = yaw;
64 
66 }
67 
#define FALSE
Definition: imu_chimu.h:141
#define RADIO_PITCH
Definition: spektrum_arch.h:42
#define RADIO_YAW
Definition: spektrum_arch.h:43
#define TRUE
Definition: imu_chimu.h:144
#define RADIO_MODE
Definition: spektrum_arch.h:63
#define RADIO_THROTTLE
Definition: spektrum_arch.h:40
unsigned char uint8_t
Definition: types.h:14
#define RADIO_ROLL
Definition: spektrum_arch.h:41
signed char int8_t
Definition: types.h:15