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
gpio_cam_ctrl.c File Reference

Control the camera via GPIO pins. More...

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

Macros

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

Functions

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

Variables

uint8_t dc_timer
 

Detailed Description

Control the camera via GPIO pins.

Configuration (DC_SHUTTER is mandatory, others optional):

1 <define name="DC_SHUTTER_GPIO" value="GPIOC,GPIO12"/>
2 <define name="DC_ZOOM_IN_GPIO" value="GPIOC,GPIO2"/>
3 <define name="DC_ZOOM_OUT_GPIO" value="GPIOC,GPIO5"/>
4 <define name="DC_POWER_GPIO" value="GPIOB,GPIO1"/>
5 <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.

Referenced by dc_send_command().

#define DC_PUSH   gpio_set

Definition at line 46 of file gpio_cam_ctrl.c.

Referenced by dc_send_command().

#define DC_RELEASE   gpio_clear

Definition at line 50 of file gpio_cam_ctrl.c.

Referenced by gpio_cam_ctrl_init(), and gpio_cam_ctrl_periodic().

#define DC_SHUTTER_DELAY   0.5

how long to push shutter in seconds

Definition at line 55 of file gpio_cam_ctrl.c.

Referenced by dc_send_command().

Function Documentation

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:

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:

void gpio_cam_ctrl_periodic ( void  )

Periodic.

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

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