Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Digital video/photo recorder HackHD control. More...
#include "modules/digital_cam/hackhd.h"
#include "generated/modules.h"
#include "generated/airframe.h"
#include "mcu_periph/gpio.h"
#include "mcu_periph/sys_time.h"
Go to the source code of this file.
Macros | |
#define | HACKHD_PUSH gpio_clear |
Trigger button is active low. More... | |
#define | HACKHD_RELEASE gpio_set |
#define | HACKHD_POWER_DELAY 5. |
time in seconds to press the button to power on/off More... | |
#define | HACKHD_RECORD_DELAY 0.2 |
time in seconds to start/stop recording or take a picture More... | |
#define | HACKHD_LOG_DELAY 1000 |
delay in milli-seconds before logging after a shot this has been estimated to 1s More... | |
#define | HACKHD_TIMER_OF_DELAY(_delay) ((uint32_t)(_delay * HACKHD_PERIODIC_FREQ)) |
get timer from delay based on periodic freq from modules.h More... | |
#define | HACKHD_AUTOSHOOT_DELAY 4.0 |
autoshoot timer delay based on periodic freq from modules.h More... | |
#define | HACKHD_AUTOSHOOT_TIMER_OF_DELAY(_delay) ((uint32_t)(_delay * HACKHD_AUTOSHOOT_FREQ)) |
Functions | |
static uint32_t | port_of_gpio (uint32_t port, uint16_t pin) |
static uint16_t | pin_of_gpio (uint32_t port, uint16_t pin) |
void | hackhd_init (void) |
void | hackhd_periodic (void) |
void | hackhd_command (enum hackhd_status cmd) |
void | hackhd_autoshoot (void) |
void | hackhd_autoshoot_start (void) |
Variables | |
struct HackHD | hackhd |
send report More... | |
Digital video/photo recorder HackHD control.
Provides the control of the HackHD power, start and stop of recording. If you are using firmware >= 1.1.15, it is also possible to take pictures according to the parameter in the config.txt file (on HackHD SD card). It is not possible to have both video and photo at the same time. This driver starts the HackHD in standby mode and trigger the start/stop of recording or take a picture. Minimum time between two pictures is 2 seconds.
It is mandatory to configure the control GPIO:
* <configure name="HACKHD_GPIO" value="GPIOC,GPIO5"/> *
Definition in file hackhd.c.
#define HACKHD_AUTOSHOOT_DELAY 4.0 |
#define HACKHD_AUTOSHOOT_TIMER_OF_DELAY | ( | _delay | ) | ((uint32_t)(_delay * HACKHD_AUTOSHOOT_FREQ)) |
#define HACKHD_LOG_DELAY 1000 |
#define HACKHD_POWER_DELAY 5. |
#define HACKHD_PUSH gpio_clear |
#define HACKHD_RECORD_DELAY 0.2 |
#define HACKHD_TIMER_OF_DELAY | ( | _delay | ) | ((uint32_t)(_delay * HACKHD_PERIODIC_FREQ)) |
void hackhd_autoshoot | ( | void | ) |
Definition at line 220 of file hackhd.c.
References HackHD::autoshoot, hackhd, HACKHD_AUTOSHOOT_DELAY, HACKHD_AUTOSHOOT_START, HACKHD_AUTOSHOOT_TIMER_OF_DELAY, hackhd_command(), HACKHD_SHOOT, HackHD::last_shot_pos, stateGetPositionEnu_f(), HackHD::status, VECT2_NORM2, FloatVect2::x, EnuCoor_f::x, FloatVect2::y, and EnuCoor_f::y.
void hackhd_autoshoot_start | ( | void | ) |
Definition at line 246 of file hackhd.c.
References HackHD::autoshoot, hackhd, HACKHD_AUTOSHOOT_START, and HackHD::status.
void hackhd_command | ( | enum hackhd_status | cmd | ) |
Definition at line 194 of file hackhd.c.
References get_sys_time_msec(), hackhd, HACKHD_AUTOSHOOT_START, HACKHD_LOG_DELAY, HACKHD_POWER_DELAY, HACKHD_POWER_OFF, HACKHD_POWER_ON, HACKHD_PUSH, HACKHD_RECORD_DELAY, HACKHD_SHOOT, HACKHD_START_RECORD, HACKHD_STOP_RECORD, HACKHD_TIMER_OF_DELAY, HackHD::last_shot_pos, HackHD::log_delay, stateGetPositionEnu_f(), HackHD::status, and HackHD::timer.
Referenced by hackhd_autoshoot().
void hackhd_init | ( | void | ) |
Definition at line 145 of file hackhd.c.
References HackHD::autoshoot, gpio_setup_output(), hackhd, HACKHD_NONE, HACKHD_RELEASE, HackHD::log_delay, HackHD::photo_nr, pin_of_gpio(), port_of_gpio(), HackHD::status, and HackHD::timer.
void hackhd_periodic | ( | void | ) |
Definition at line 165 of file hackhd.c.
References get_sys_time_msec(), hackhd, HACKHD_RELEASE, HackHD::log_delay, HackHD::photo_nr, and HackHD::timer.
Definition at line 56 of file hackhd.c.
Referenced by hackhd_init().
Definition at line 55 of file hackhd.c.
Referenced by hackhd_init().
struct HackHD hackhd |
send report
Definition at line 56 of file hackhd.c.
Referenced by hackhd_autoshoot(), hackhd_autoshoot_start(), hackhd_command(), hackhd_init(), and hackhd_periodic().