42 #include "generated/modules.h"
43 #include "generated/airframe.h"
48 #define HACKHD_PUSH gpio_clear
49 #define HACKHD_RELEASE gpio_set
52 #error HACKHD: Please specify at least a HACKHD_GPIO (e.g. <define name="HACKHD_GPIO" value="GPIOC,GPIO5"/>)
59 #define HACKHD_POWER_DELAY 5.
62 #define HACKHD_RECORD_DELAY 0.2
67 #define HACKHD_LOG_DELAY 1000
72 #define HACKHD_TIMER_OF_DELAY(_delay) ((uint32_t)(_delay * HACKHD_PERIODIC_FREQ))
77 #ifndef HACKHD_AUTOSHOOT_DELAY
78 #define HACKHD_AUTOSHOOT_DELAY 4.0
80 #define HACKHD_AUTOSHOOT_TIMER_OF_DELAY(_delay) ((uint32_t)(_delay * HACKHD_AUTOSHOOT_FREQ))
86 #include "pprzlink/messages.h"
91 static inline void hackhd_send_shot_position(
void)
122 static inline void hackhd_log_shot_position(
void)
130 sdLogWriteLog(
pprzLogFile,
"%d %d %d %d %d %d %d %u\n",
156 gpio_set_output_options(
178 hackhd_log_shot_position();
181 hackhd_send_shot_position();
228 #ifdef HACKHD_AUTOSHOOT_DIST
233 if (
VECT2_NORM2(d_pos) > (HACKHD_AUTOSHOOT_DIST * HACKHD_AUTOSHOOT_DIST)
240 #ifdef HACKHD_AUTOSHOOT_DIST
void gpio_setup_output(ioportid_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as outputs.
uint32_t get_sys_time_msec(void)
Get the time in milliseconds since startup.
Common code for AP and FBW telemetry.
Some architecture independent helper functions for GPIOs.
struct GpsState gps
global GPS state
Device independent GPS code (interface)
uint32_t tow
GPS time of week in ms.
int32_t hmsl
height above mean sea level (MSL) in mm
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static struct LlaCoor_i * stateGetPositionLla_i(void)
Get position in LLA coordinates (int).
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
#define HACKHD_TIMER_OF_DELAY(_delay)
get timer from delay based on periodic freq from modules.h
#define HACKHD_AUTOSHOOT_DELAY
autoshoot timer delay based on periodic freq from modules.h
static uint32_t port_of_gpio(uint32_t port, uint16_t pin)
void hackhd_autoshoot_start(void)
#define HACKHD_PUSH
Trigger button is active low.
struct HackHD hackhd
send report
void hackhd_autoshoot(void)
static uint16_t pin_of_gpio(uint32_t port, uint16_t pin)
#define HACKHD_LOG_DELAY
delay in milli-seconds before logging after a shot this has been estimated to 1s
void hackhd_periodic(void)
#define HACKHD_POWER_DELAY
time in seconds to press the button to power on/off
#define HACKHD_RECORD_DELAY
time in seconds to start/stop recording or take a picture
#define HACKHD_AUTOSHOOT_TIMER_OF_DELAY(_delay)
void hackhd_command(enum hackhd_status cmd)
Digital video/photo recorder HackHD control.
enum hackhd_status status
struct EnuCoor_f last_shot_pos
vector in East North Up coordinates Units: meters
API to get/set the generic vehicle states.
Architecture independent timing functions.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.