Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
hackhd.c File Reference

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"
+ Include dependency graph for hackhd.c:

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...
 

Detailed Description

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.

Macro Definition Documentation

◆ HACKHD_AUTOSHOOT_DELAY

#define HACKHD_AUTOSHOOT_DELAY   4.0

autoshoot timer delay based on periodic freq from modules.h

Definition at line 78 of file hackhd.c.

◆ HACKHD_AUTOSHOOT_TIMER_OF_DELAY

#define HACKHD_AUTOSHOOT_TIMER_OF_DELAY (   _delay)    ((uint32_t)(_delay * HACKHD_AUTOSHOOT_FREQ))

Definition at line 80 of file hackhd.c.

◆ HACKHD_LOG_DELAY

#define HACKHD_LOG_DELAY   1000

delay in milli-seconds before logging after a shot this has been estimated to 1s

Definition at line 67 of file hackhd.c.

◆ HACKHD_POWER_DELAY

#define HACKHD_POWER_DELAY   5.

time in seconds to press the button to power on/off

Definition at line 59 of file hackhd.c.

◆ HACKHD_PUSH

#define HACKHD_PUSH   gpio_clear

Trigger button is active low.

Definition at line 48 of file hackhd.c.

◆ HACKHD_RECORD_DELAY

#define HACKHD_RECORD_DELAY   0.2

time in seconds to start/stop recording or take a picture

Definition at line 62 of file hackhd.c.

◆ HACKHD_RELEASE

#define HACKHD_RELEASE   gpio_set

Definition at line 49 of file hackhd.c.

◆ HACKHD_TIMER_OF_DELAY

#define HACKHD_TIMER_OF_DELAY (   _delay)    ((uint32_t)(_delay * HACKHD_PERIODIC_FREQ))

get timer from delay based on periodic freq from modules.h

Definition at line 72 of file hackhd.c.

Function Documentation

◆ hackhd_autoshoot()

◆ hackhd_autoshoot_start()

void hackhd_autoshoot_start ( void  )

Definition at line 246 of file hackhd.c.

References HackHD::autoshoot, hackhd, HACKHD_AUTOSHOOT_START, and HackHD::status.

◆ hackhd_command()

◆ hackhd_init()

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.

+ Here is the call graph for this function:

◆ hackhd_periodic()

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.

+ Here is the call graph for this function:

◆ pin_of_gpio()

static uint16_t pin_of_gpio ( uint32_t  port,
uint16_t  pin 
)
inlinestatic

Definition at line 56 of file hackhd.c.

Referenced by hackhd_init().

+ Here is the caller graph for this function:

◆ port_of_gpio()

static uint32_t port_of_gpio ( uint32_t  port,
uint16_t  pin 
)
inlinestatic

Definition at line 55 of file hackhd.c.

Referenced by hackhd_init().

+ Here is the caller graph for this function:

Variable Documentation

◆ hackhd

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().