Paparazzi UAS  v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
gpio_cam_ctrl.c File Reference
#include "gpio_cam_ctrl.h"
#include "generated/airframe.h"
#include "generated/modules.h"
#include "dc.h"
#include "mcu_periph/gpio.h"
+ Include dependency graph for gpio_cam_ctrl.c:

Go to the source code of this file.


#define DC_PUSH   gpio_set
#define DC_RELEASE   gpio_clear
#define DC_SHUTTER_DELAY   0.5
 how long to push shutter in seconds More...
#define DC_POWER_OFF_DELAY   0.75
 how long to send power off in seconds More...


void gpio_cam_ctrl_init (void)
void gpio_cam_ctrl_periodic (void)
 Periodic. More...
void dc_send_command (uint8_t cmd)
 Send Command To Camera. More...


uint8_t dc_timer

Detailed Description

Control the camera via GPIO pins.

Configuration (DC_SHUTTER is mandatory, others optional):

<define name="DC_SHUTTER_GPIO" value="GPIOC,GPIO12"/>
<define name="DC_ZOOM_IN_GPIO" value="GPIOC,GPIO2"/>
<define name="DC_ZOOM_OUT_GPIO" value="GPIOC,GPIO5"/>
<define name="DC_POWER_GPIO" value="GPIOB,GPIO1"/>
<define name="DC_POWER_OFF_GPIO" value="GPIOC,GPIO1"/>

Definition in file gpio_cam_ctrl.c.

Macro Definition Documentation


#define DC_POWER_OFF_DELAY   0.75

how long to send power off in seconds

Definition at line 60 of file gpio_cam_ctrl.c.


#define DC_PUSH   gpio_set

Definition at line 46 of file gpio_cam_ctrl.c.


#define DC_RELEASE   gpio_clear

Definition at line 50 of file gpio_cam_ctrl.c.


#define DC_SHUTTER_DELAY   0.5

how long to push shutter in seconds

Definition at line 55 of file gpio_cam_ctrl.c.

Function Documentation

◆ dc_send_command()

void dc_send_command ( uint8_t  cmd)

Send Command To Camera.

Definition at line 133 of file gpio_cam_ctrl.c.

References DC_OFF, DC_ON, DC_POWER_OFF_DELAY, DC_PUSH, dc_send_command_common(), dc_send_shot_position(), DC_SHOOT, DC_SHUTTER_DELAY, DC_TALLER, dc_timer, and DC_WIDER.

+ Here is the call graph for this function:

◆ gpio_cam_ctrl_init()

void gpio_cam_ctrl_init ( void  )

Definition at line 74 of file gpio_cam_ctrl.c.

References dc_init(), DC_RELEASE, dc_timer, and gpio_setup_output().

+ Here is the call graph for this function:

◆ gpio_cam_ctrl_periodic()

void gpio_cam_ctrl_periodic ( void  )


Definition at line 102 of file gpio_cam_ctrl.c.

References dc_periodic(), DC_RELEASE, dc_send_shot_position(), and dc_timer.

+ Here is the call graph for this function:

Variable Documentation

◆ dc_timer

uint8_t dc_timer

Definition at line 72 of file gpio_cam_ctrl.c.

Referenced by dc_send_command(), gpio_cam_ctrl_init(), and gpio_cam_ctrl_periodic().