Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
digital_cam_i2c module

Digital Photo Camera Triggering (using a I2C channel)

This module controls triggering of an attached device via an I2C command. Typically a remote microcontroller (atmega/arduino) will then use the triggering/zoom/power commands. Using the PAYLOAD_COMMAND, all functions of the camera can be controlled. It can trigger photos based on GPS distance, time or circle radius in both fixedwings and rotorcraft.

Example for airframe file

Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!

1 <module name="digital_cam_i2c">
2  <define name="DC_SHOOT_ON_BUTTON_RELEASE" />
3  <define name="DC_SHOT_SYNC_SEND" value="TRUE|FALSE" />
4  <configure name="ATMEGA_I2C_DEV" value="i2cX" />
5 </module>

Module configuration options

Configure Options

  • name: ATMEGA_I2C_DEV value: i2cX
    Description: select which i2c peripheral to use (default i2c0)

Define Options

  • name: DC_SHOOT_ON_BUTTON_RELEASE value: None
  • name: DC_SHOT_SYNC_SEND value: TRUE|FALSE
    Description: send DC_SHOT message when photo was taken (default: TRUE)

Conflicts

Module functions

Init Functions

These initialization functions are called once on startup.

Event Functions

These event functions are called in each cycle of the module event loop.

Periodic Functions

These functions are called periodically at the specified frequency from the module periodic loop.

Datalink Functions

Whenever the specified datalink message is received, the corresponing handler function is called.

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw digital_cam_i2c.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="atmega_i2c_cam_ctrl" dir="digital_cam">
<doc>
<description>
Digital Photo Camera Triggering (using a I2C channel)
This module controls triggering of an attached device via an I2C command.
Typically a remote microcontroller (atmega/arduino) will then use the triggering/zoom/power commands.
Using the PAYLOAD_COMMAND, all functions of the camera can be controlled.
It can trigger photos based on GPS distance, time or circle radius in both fixedwings and rotorcraft.
</description>
<configure name="ATMEGA_I2C_DEV" value="i2cX" description="select which i2c peripheral to use (default i2c0)"/>
<define name="DC_SHOOT_ON_BUTTON_RELEASE" />
<define name="DC_SHOT_SYNC_SEND" value="TRUE|FALSE" description="send DC_SHOT message when photo was taken (default: TRUE)"/>
</doc>
<conflicts>digital_cam,digital_cam_servo,digital_cam_uart,digital_cam_video</conflicts>
<header>
<file name="atmega_i2c_cam_ctrl.h"/>
<file name="dc.h"/>
</header>
<init fun="atmega_i2c_cam_ctrl_init()"/>
<periodic fun="atmega_i2c_cam_ctrl_periodic()" autorun="TRUE" freq="10"/>
<event fun="atmega_i2c_cam_ctrl_event()"/>
<datalink message="PAYLOAD_COMMAND" fun="ParseCameraCommand()"/>
<makefile target="ap">
<configure name="ATMEGA_I2C_DEV" default="i2c0" case="upper|lower"/>
<define name="USE_$(ATMEGA_I2C_DEV_UPPER)"/>
<define name="ATMEGA_I2C_DEV" value="$(ATMEGA_I2C_DEV_LOWER)"/>
<file name="atmega_i2c_cam_ctrl.c"/>
<file name="dc.c"/>
</makefile>
<makefile target="sim">
<file name="sim_i2c_cam_ctrl.c"/>
<file name="dc.c"/>
</makefile>
</module>