Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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

#define HACKHD_AUTOSHOOT_DELAY   4.0

autoshoot timer delay based on periodic freq from modules.h

Definition at line 78 of file hackhd.c.

Referenced by hackhd_autoshoot().

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

Definition at line 80 of file hackhd.c.

Referenced by hackhd_autoshoot().

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

Referenced by hackhd_command().

#define HACKHD_POWER_DELAY   5.

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

Definition at line 59 of file hackhd.c.

Referenced by hackhd_command().

#define HACKHD_PUSH   gpio_clear

Trigger button is active low.

Definition at line 48 of file hackhd.c.

Referenced by hackhd_command().

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

Referenced by hackhd_command().

#define HACKHD_RELEASE   gpio_set

Definition at line 49 of file hackhd.c.

Referenced by hackhd_init(), and hackhd_periodic().

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

Referenced by hackhd_command().

Function Documentation

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_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:

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:

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:

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

struct HackHD hackhd

send report

Definition at line 143 of file hackhd.c.

Referenced by hackhd_autoshoot(), hackhd_autoshoot_start(), hackhd_command(), hackhd_init(), and hackhd_periodic().