Paparazzi UAS  v5.15_devel-110-g5cf27ee
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
uart_cam_ctrl.c File Reference

Control the camera via uart to chdk-ptp. More...

#include "uart_cam_ctrl.h"
#include "generated/airframe.h"
#include "modules/digital_cam/dc.h"
#include "subsystems/datalink/telemetry.h"
#include <BOARD_CONFIG>
#include "modules/digital_cam/catia/protocol.h"
#include "state.h"
+ Include dependency graph for uart_cam_ctrl.c:

Go to the source code of this file.

Macros

#define CameraLinkDev   (&((CAMERA_LINK).device))
 
#define CameraLinkTransmit(c)   CameraLinkDev->put_byte(CameraLinkDev->periph, 0, c)
 
#define CameraLinkChAvailable()   CameraLinkDev->char_available(CameraLinkDev->periph)
 
#define CameraLinkGetch()   CameraLinkDev->get_byte(CameraLinkDev->periph)
 
#define THUMB_MSG_SIZE   MORA_PAYLOAD_MSG_SIZE
 
#define THUMB_COUNT   10
 

Functions

void digital_cam_uart_event (void)
 
static void send_thumbnails (struct transport_tx *trans, struct link_device *dev)
 
void digital_cam_uart_init (void)
 
void digital_cam_uart_periodic (void)
 
void dc_send_command (uint8_t cmd)
 Send Command To Camera. More...
 

Variables

union dc_shot_union dc_shot_msg
 
union mora_status_union mora_status_msg
 
int digital_cam_uart_status = 0
 
int digital_cam_uart_thumbnails = 0
 
static uint8_t thumbs [THUMB_COUNT][THUMB_MSG_SIZE]
 
static uint8_t thumb_pointer = 0
 

Detailed Description

Control the camera via uart to chdk-ptp.

Retrieve thumbnails

Definition in file uart_cam_ctrl.c.

Macro Definition Documentation

#define CameraLinkChAvailable ( )    CameraLinkDev->char_available(CameraLinkDev->periph)

Definition at line 51 of file uart_cam_ctrl.c.

Referenced by digital_cam_uart_event().

#define CameraLinkDev   (&((CAMERA_LINK).device))

Definition at line 49 of file uart_cam_ctrl.c.

#define CameraLinkGetch ( )    CameraLinkDev->get_byte(CameraLinkDev->periph)

Definition at line 52 of file uart_cam_ctrl.c.

Referenced by digital_cam_uart_event().

#define CameraLinkTransmit (   c)    CameraLinkDev->put_byte(CameraLinkDev->periph, 0, c)

Definition at line 50 of file uart_cam_ctrl.c.

#define THUMB_COUNT   10

Definition at line 60 of file uart_cam_ctrl.c.

Referenced by digital_cam_uart_init(), and send_thumbnails().

#define THUMB_MSG_SIZE   MORA_PAYLOAD_MSG_SIZE

Definition at line 59 of file uart_cam_ctrl.c.

Referenced by digital_cam_uart_init(), and send_thumbnails().

Function Documentation

void digital_cam_uart_init ( void  )

Definition at line 116 of file uart_cam_ctrl.c.

References dc_init(), DefaultPeriodic, digital_cam_uart_thumbnails, register_periodic_telemetry(), send_thumbnails(), serial_init(), THUMB_COUNT, THUMB_MSG_SIZE, and thumbs.

+ Here is the call graph for this function:

void digital_cam_uart_periodic ( void  )

Definition at line 135 of file uart_cam_ctrl.c.

References dc_periodic().

+ Here is the call graph for this function:

static void send_thumbnails ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 91 of file uart_cam_ctrl.c.

References digital_cam_uart_thumbnails, MORA_BUFFER_EMPTY, MoraHeader, MoraTrailer, THUMB_COUNT, THUMB_MSG_SIZE, thumb_pointer, and thumbs.

Referenced by digital_cam_uart_init().

+ Here is the caller graph for this function:

Variable Documentation

union dc_shot_union dc_shot_msg

Definition at line 54 of file uart_cam_ctrl.c.

Referenced by dc_send_command().

int digital_cam_uart_status = 0

Definition at line 56 of file uart_cam_ctrl.c.

Referenced by digital_cam_uart_event().

int digital_cam_uart_thumbnails = 0

Definition at line 58 of file uart_cam_ctrl.c.

Referenced by digital_cam_uart_init(), and send_thumbnails().

union mora_status_union mora_status_msg

Definition at line 55 of file uart_cam_ctrl.c.

Referenced by digital_cam_uart_event().

uint8_t thumb_pointer = 0
static

Definition at line 62 of file uart_cam_ctrl.c.

Referenced by digital_cam_uart_event(), and send_thumbnails().