Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
actuators.h
Go to the documentation of this file.
1 /*
2  * Original Code from:
3  * Copyright (C) 2011 Hugo Perquin - http://blog.perquin.com
4  *
5  * Adapated for Paparazzi by:
6  * Copyright (C) 2012 Dino Hensen <dino.hensen@gmail.com>
7  *
8  * This file is part of paparazzi.
9  *
10  * paparazzi is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2, or (at your option)
13  * any later version.
14  *
15  * paparazzi is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with paparazzi; see the file COPYING. If not, write to
22  * the Free Software Foundation, 59 Temple Place - Suite 330,
23  * Boston, MA 02111-1307, USA.
24  */
25 
31 #ifndef ACTUATORS_ARDRONE2_H_
32 #define ACTUATORS_ARDRONE2_H_
33 
34 #include <stdint.h>
35 
36 #ifndef ACTUATORS_ARDRONE_NB
37 #define ACTUATORS_ARDRONE_NB 4
38 #endif
39 
40 #define SERVOS_TICS_OF_USEC(_v) (_v)
41 
42 #define ActuatorArdroneSet(_i, _v) { actuators_pwm_values[_i] = _v; }
43 #define ActuatorsArdroneCommit() actuators_ardrone_commit();
44 #define ActuatorsArdroneInit() actuators_ardrone_init();
45 
46 #define MOT_LEDOFF 0
47 #define MOT_LEDRED 1
48 #define MOT_LEDGREEN 2
49 #define MOT_LEDORANGE 3
50 
52 
53 extern void actuators_ardrone_commit(void);
54 extern void actuators_ardrone_init(void);
55 
56 
57 int actuators_ardrone_cmd(uint8_t cmd, uint8_t *reply, int replylen);
58 void actuators_ardrone_set_pwm(uint16_t pwm0, uint16_t pwm1, uint16_t pwm2, uint16_t pwm3);
59 void actuators_ardrone_set_leds(uint8_t led0, uint8_t led1, uint8_t led2, uint8_t led3);
60 void actuators_ardrone_close(void);
61 
62 #endif /* ACTUATORS_ARDRONE2_H_ */
unsigned short uint16_t
Definition: types.h:16
void actuators_ardrone_close(void)
Definition: actuators.c:271
void actuators_ardrone_set_leds(uint8_t led0, uint8_t led1, uint8_t led2, uint8_t led3)
Write LED command cmd = 011rrrr0 000gggg0 (this is ardrone1 format, we need ardrone2 format) ...
Definition: actuators.c:254
int actuators_ardrone_cmd(uint8_t cmd, uint8_t *reply, int replylen)
Definition: actuators.c:158
void actuators_ardrone_set_pwm(uint16_t pwm0, uint16_t pwm1, uint16_t pwm2, uint16_t pwm3)
Write motor speed command cmd = 001aaaaa aaaabbbb bbbbbccc ccccccdd ddddddd0.
Definition: actuators.c:231
void actuators_ardrone_init(void)
Definition: actuators.c:81
unsigned char uint8_t
Definition: types.h:14
uint16_t actuators_pwm_values[ACTUATORS_ARDRONE_NB]
Definition: actuators.h:51
#define ACTUATORS_ARDRONE_NB
Definition: actuators.h:37
void actuators_ardrone_commit(void)
Definition: actuators.c:220