|  | Paparazzi UAS v7.0_unstable
    Paparazzi is a free software Unmanned Aircraft System. | 
Actuator driver for ardrone2 version. More...
#include "modules/actuators/actuators.h"#include "actuators.h"#include "mcu_periph/gpio.h"#include "led_hw.h"#include "mcu_periph/sys_time.h"#include "navdata.h"#include <stdio.h>#include <string.h>#include <unistd.h>#include <fcntl.h>#include <errno.h>#include <termios.h>#include <stdint.h>#include "autopilot.h" Include dependency graph for actuators.c:
 Include dependency graph for actuators.c:Go to the source code of this file.
| Macros | |
| #define | ARDRONE_GPIO_PORT 0x32524 | 
| #define | ARDRONE_GPIO_PIN_MOTOR1 171 | 
| #define | ARDRONE_GPIO_PIN_MOTOR2 172 | 
| #define | ARDRONE_GPIO_PIN_MOTOR3 173 | 
| #define | ARDRONE_GPIO_PIN_MOTOR4 174 | 
| #define | ARDRONE_GPIO_PIN_IRQ_FLIPFLOP 175 | 
| #define | ARDRONE_GPIO_PIN_IRQ_INPUT 176 | 
| #define | BIT_NUMBER(VAL, BIT) (((VAL)>>BIT)&0x03) | 
| Functions | |
| static void | actuators_ardrone_reset_flipflop (void) | 
| void | actuators_ardrone_init (void) | 
| int | actuators_ardrone_cmd (uint8_t cmd, uint8_t *reply, int replylen) | 
| void | actuators_ardrone_motor_status (void) | 
| void | actuators_ardrone_led_run (void) | 
| void | actuators_ardrone_commit (void) | 
| 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. | |
| 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) | |
| void | actuators_ardrone_close (void) | 
| Variables | |
| int | actuator_ardrone2_fd | 
| Power consumption @ 11V all 4 motors running PWM A 0 0.2 80 1.3 100 1.5 150 2.0 190 2.5 130 3.0. | |
| uint32_t | led_hw_values | 
| uint16_t | actuators_pwm_values [ACTUATORS_ARDRONE_NB] | 
Actuator driver for ardrone2 version.
Definition in file actuators.c.
| #define ARDRONE_GPIO_PIN_IRQ_FLIPFLOP 175 | 
Definition at line 65 of file actuators.c.
| #define ARDRONE_GPIO_PIN_IRQ_INPUT 176 | 
Definition at line 66 of file actuators.c.
| #define ARDRONE_GPIO_PIN_MOTOR1 171 | 
Definition at line 60 of file actuators.c.
| #define ARDRONE_GPIO_PIN_MOTOR2 172 | 
Definition at line 61 of file actuators.c.
| #define ARDRONE_GPIO_PIN_MOTOR3 173 | 
Definition at line 62 of file actuators.c.
| #define ARDRONE_GPIO_PIN_MOTOR4 174 | 
Definition at line 63 of file actuators.c.
| #define ARDRONE_GPIO_PORT 0x32524 | 
Definition at line 58 of file actuators.c.
Definition at line 272 of file actuators.c.
References actuator_ardrone2_fd, and foo.
Definition at line 159 of file actuators.c.
References actuator_ardrone2_fd, foo, full_read(), and full_write().
Referenced by actuators_ardrone_init().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Definition at line 221 of file actuators.c.
References actuators_ardrone_motor_status(), actuators_ardrone_set_pwm(), actuators_pwm_values, and foo.
 Here is the call graph for this function:
 Here is the call graph for this function:Definition at line 82 of file actuators.c.
References actuator_ardrone2_fd, actuators_ardrone_cmd(), actuators_ardrone_reset_flipflop(), actuators_ardrone_set_leds(), ARDRONE_GPIO_PIN_IRQ_FLIPFLOP, ARDRONE_GPIO_PIN_IRQ_INPUT, ARDRONE_GPIO_PIN_MOTOR1, ARDRONE_GPIO_PIN_MOTOR2, ARDRONE_GPIO_PIN_MOTOR3, ARDRONE_GPIO_PIN_MOTOR4, ARDRONE_GPIO_PORT, B115200, foo, gpio_clear(), gpio_set(), gpio_setup_input(), gpio_setup_output(), led_hw_values, MOT_LEDGREEN, and MOT_LEDRED.
 Here is the call graph for this function:
 Here is the call graph for this function:Definition at line 211 of file actuators.c.
References actuators_ardrone_set_leds(), BIT_NUMBER, foo, and led_hw_values.
Referenced by actuators_ardrone_set_pwm().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Definition at line 171 of file actuators.c.
References ARDRONE_GPIO_PIN_IRQ_FLIPFLOP, ARDRONE_GPIO_PIN_IRQ_INPUT, ARDRONE_GPIO_PORT, autopilot_get_motors_on(), autopilot_set_motors_on(), foo, gpio_clear(), gpio_get(), gpio_set(), and gpio_setup_output().
Referenced by actuators_ardrone_commit().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Definition at line 71 of file actuators.c.
References ARDRONE_GPIO_PIN_IRQ_FLIPFLOP, ARDRONE_GPIO_PORT, foo, gpio_clear(), gpio_set(), gpio_setup_output(), and sys_time::nb_sec.
Referenced by actuators_ardrone_init().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Write LED command cmd = 011rrrr0 000gggg0 (this is ardrone1 format, we need ardrone2 format)
led0 = RearLeft led1 = RearRight led2 = FrontRight led3 = FrontLeft
Definition at line 255 of file actuators.c.
References actuator_ardrone2_fd, foo, and full_write().
Referenced by actuators_ardrone_init(), and actuators_ardrone_led_run().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Write motor speed command cmd = 001aaaaa aaaabbbb bbbbbccc ccccccdd ddddddd0.
Definition at line 232 of file actuators.c.
References actuator_ardrone2_fd, actuators_ardrone_led_run(), foo, and full_write().
Referenced by actuators_ardrone_commit().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| int actuator_ardrone2_fd | 
Power consumption @ 11V all 4 motors running PWM A 0 0.2 80 1.3 100 1.5 150 2.0 190 2.5 130 3.0.
File descriptor for the port
Definition at line 56 of file actuators.c.
Referenced by actuators_ardrone_close(), actuators_ardrone_cmd(), actuators_ardrone_init(), actuators_ardrone_set_leds(), and actuators_ardrone_set_pwm().
| uint16_t actuators_pwm_values[ACTUATORS_ARDRONE_NB] | 
Definition at line 69 of file actuators.c.
Referenced by actuators_ardrone_commit().
| uint32_t led_hw_values | 
Definition at line 68 of file actuators.c.
Referenced by actuators_ardrone_init(), actuators_ardrone_led_run(), and actuators_bebop_commit().