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
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
void hackhd_periodic(void)
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
uint32_t get_sys_time_msec(void)
Get the time in milliseconds since startup.
vector in East North Up coordinates Units: meters
Some architecture independent helper functions for GPIOs.
void hackhd_autoshoot(void)
struct HackHD hackhd
send report
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
void gpio_setup_output(ioportid_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as outputs.
struct EnuCoor_f last_shot_pos
#define HACKHD_RECORD_DELAY
time in seconds to start/stop recording or take a picture
int32_t hmsl
height above mean sea level (MSL) in mm
#define HACKHD_POWER_DELAY
time in seconds to press the button to power on/off
Architecture independent timing functions.
uint32_t tow
GPS time of week in ms.
Device independent GPS code (interface)
void hackhd_command(enum hackhd_status cmd)
enum hackhd_status status
static uint32_t port_of_gpio(uint32_t port, uint16_t pin)
#define HACKHD_AUTOSHOOT_TIMER_OF_DELAY(_delay)
#define HACKHD_LOG_DELAY
delay in milli-seconds before logging after a shot this has been estimated to 1s
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
#define HACKHD_AUTOSHOOT_DELAY
autoshoot timer delay based on periodic freq from modules.h
void hackhd_autoshoot_start(void)
Digital video/photo recorder HackHD control.
API to get/set the generic vehicle states.
Common code for AP and FBW telemetry.
#define HACKHD_TIMER_OF_DELAY(_delay)
get timer from delay based on periodic freq from modules.h
#define HACKHD_PUSH
Trigger button is active low.
static uint16_t pin_of_gpio(uint32_t port, uint16_t pin)
struct GpsState gps
global GPS state
static struct LlaCoor_i * stateGetPositionLla_i(void)
Get position in LLA coordinates (int).