Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures 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 "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   2 /* 4Hz -> 0.5s */
 
#define DC_POWER_OFF_DELAY   3
 

Functions

void gpio_cam_ctrl_init (void)
 
void gpio_cam_ctrl_periodic (void)
 4Hz Periodic More...
 
void dc_send_command (uint8_t cmd)
 

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   3

Definition at line 57 of file gpio_cam_ctrl.c.

Referenced by dc_send_command().

#define DC_PUSH   gpio_set

Definition at line 61 of file servo_cam_ctrl.h.

Referenced by dc_send_command().

#define DC_RELEASE   gpio_clear
#define DC_SHUTTER_DELAY   2 /* 4Hz -> 0.5s */

Definition at line 65 of file servo_cam_ctrl.h.

Referenced by dc_send_command().

Function Documentation

void dc_send_command ( uint8_t  cmd)
void gpio_cam_ctrl_init ( void  )

Definition at line 71 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  )

4Hz Periodic

Definition at line 99 of file gpio_cam_ctrl.c.

References dc_periodic_4Hz(), 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 69 of file gpio_cam_ctrl.c.

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