Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
dc_shoot_pwm.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 Jean-Baptiste Forestier <jean-baptiste.forestier@enac.fr>
3 *
4 * This file is part of paparazzi
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 */
68
69// Include Standard Camera Control Interface
70#include "dc.h"
71
72#include "generated/airframe.h"
73#include "generated/modules.h"
75
76
78#ifndef DC_CAM_PWM_SHUTTER_DELAY
79#define DC_CAM_PWM_SHUTTER_DELAY 0.1
80#endif
81
83#ifndef DC_CAM_PWM_ON_VALUE
84#define DC_CAM_PWM_ON_VALUE MAX_PPRZ
85#endif
86
88#ifndef DC_CAM_PWM_OFF_VALUE
89#define DC_CAM_PWM_OFF_VALUE MIN_PPRZ
90#endif
91
93#ifndef DC_CAM_PWM_SERVO
94#define DC_CAM_PWM_SERVO DC_CAM_TRIGGER
95#endif
96
97#define CamActuatorSet(_a, _v) ActuatorSet(_a, _v)
98
103
112
117{
118 // Manage the shutter opening time each DC_CAM_PWM_SHUTTER_DELAY seconds
119 if (shutter_timer == 0) {
121 } else {
123 }
124
125 // Common DC Periodic task
126 dc_periodic();
127}
128
129/* Command The Camera */
131{
132 if (cmd == DC_SHOOT) {
136 }
137
138 // call command send_command function
140}
141
void dc_periodic(void)
periodic function
Definition dc.c:279
void dc_send_command_common(uint8_t cmd)
Command sending function.
Definition dc.c:192
void dc_send_shot_position(void)
Send Down the coordinates of where the photo was taken.
Definition dc.c:153
Standard Digital Camera Control Interface.
@ DC_SHOOT
Definition dc.h:102
void dc_shoot_pwm_init(void)
Initialization function.
#define DC_CAM_PWM_SERVO
Servo destination.
#define CamActuatorSet(_a, _v)
#define DC_CAM_PWM_ON_VALUE
Max PWM Value.
#define DC_CAM_PWM_SHUTTER_DELAY
how long to push shutter in seconds
void dc_send_command(uint8_t cmd)
Send Command To Camera.
static uint8_t shutter_timer
Timer used for Shutter delay control.
#define DC_CAM_PWM_OFF_VALUE
Min PWM Value.
void dc_shoot_pwm_periodic(void)
Periodic function to send data.
uint16_t foo
Definition main_demo5.c:58
Hardware independent API for actuators (servos, motor controllers).
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.