Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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 "modules/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

◆ CameraLinkChAvailable

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

Definition at line 51 of file uart_cam_ctrl.c.

◆ CameraLinkDev

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

Definition at line 49 of file uart_cam_ctrl.c.

◆ CameraLinkGetch

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

Definition at line 52 of file uart_cam_ctrl.c.

◆ CameraLinkTransmit

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

Definition at line 50 of file uart_cam_ctrl.c.

◆ THUMB_COUNT

#define THUMB_COUNT   10

Definition at line 60 of file uart_cam_ctrl.c.

◆ THUMB_MSG_SIZE

#define THUMB_MSG_SIZE   MORA_PAYLOAD_MSG_SIZE

Definition at line 59 of file uart_cam_ctrl.c.

Function Documentation

◆ dc_send_command()

◆ digital_cam_uart_event()

◆ digital_cam_uart_init()

void digital_cam_uart_init ( void  )

Definition at line 116 of file uart_cam_ctrl.c.

References 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:

◆ digital_cam_uart_periodic()

void digital_cam_uart_periodic ( void  )

Definition at line 133 of file uart_cam_ctrl.c.

References dc_periodic().

+ Here is the call graph for this function:

◆ send_thumbnails()

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

Definition at line 91 of file uart_cam_ctrl.c.

References dev, 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

◆ dc_shot_msg

union dc_shot_union dc_shot_msg

Definition at line 1 of file uart_cam_ctrl.c.

Referenced by dc_send_command().

◆ digital_cam_uart_status

int digital_cam_uart_status = 0

Definition at line 56 of file uart_cam_ctrl.c.

Referenced by digital_cam_uart_event().

◆ digital_cam_uart_thumbnails

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

◆ mora_status_msg

union mora_status_union mora_status_msg

Definition at line 1 of file uart_cam_ctrl.c.

Referenced by digital_cam_uart_event().

◆ thumb_pointer

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

◆ thumbs