Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Data Structures
Data Structure Index
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
m
n
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
sim_i2c_cam_ctrl.c
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2010 The Paparazzi Team
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, write to
18
* the Free Software Foundation, 59 Temple Place - Suite 330,
19
* Boston, MA 02111-1307, USA.
20
*
21
*/
22
23
30
#include "
atmega_i2c_cam_ctrl.h
"
31
32
33
#include "
mcu_periph/uart.h
"
34
#include "pprzlink/messages.h"
35
#include "
subsystems/datalink/downlink.h
"
36
#include "
state.h
"
37
38
39
void
atmega_i2c_cam_ctrl_init
(
void
)
40
{
41
dc_init
();
42
}
43
44
void
atmega_i2c_cam_ctrl_periodic
(
void
)
45
{
46
dc_periodic
();
47
48
// Request Status
49
dc_send_command
(
DC_GET_STATUS
);
50
}
51
52
53
54
void
atmega_i2c_cam_ctrl_send
(
uint8_t
cmd)
55
{
56
static
uint8_t
zoom = 0;
57
static
uint8_t
mode
= 0;
58
unsigned
char
cam_ret[1];
59
60
if
(cmd ==
DC_SHOOT
) {
61
dc_send_shot_position
();
62
}
else
if
(cmd ==
DC_TALLER
) {
63
zoom = 1;
64
}
else
if
(cmd ==
DC_WIDER
) {
65
zoom = 0;
66
}
else
if
(cmd ==
DC_GET_STATUS
) {
67
mode
++;
68
if
(
mode
> 15) {
69
mode
= 0;
70
}
71
}
72
73
cam_ret[0] =
mode
+ zoom * 0x20;
74
RunOnceEvery(6, DOWNLINK_SEND_PAYLOAD(
DefaultChannel
,
DefaultDevice
, 1, cam_ret));
75
76
}
77
78
void
atmega_i2c_cam_ctrl_event
(
void
)
79
{
80
}
81
82
83
uart.h
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
dc_send_command
void dc_send_command(uint8_t cmd)
Send Command To Camera.
Definition:
atmega_i2c_cam_ctrl.c:41
DC_WIDER
@ DC_WIDER
Definition:
dc.h:102
uint8_t
unsigned char uint8_t
Definition:
types.h:14
DC_TALLER
@ DC_TALLER
Definition:
dc.h:103
dc_send_shot_position
void dc_send_shot_position(void)
Send Down the coordinates of where the photo was taken.
Definition:
dc.c:104
atmega_i2c_cam_ctrl_init
void atmega_i2c_cam_ctrl_init(void)
Definition:
sim_i2c_cam_ctrl.c:39
downlink.h
Common code for AP and FBW telemetry.
DC_GET_STATUS
@ DC_GET_STATUS
Definition:
dc.h:97
DC_SHOOT
@ DC_SHOOT
Definition:
dc.h:100
atmega_i2c_cam_ctrl_event
void atmega_i2c_cam_ctrl_event(void)
Definition:
sim_i2c_cam_ctrl.c:78
atmega_i2c_cam_ctrl.h
DefaultChannel
#define DefaultChannel
Definition:
downlink.h:42
mode
static uint8_t mode
mode holds the current sonar mode mode = 0 used at high altitude, uses 16 wave patterns mode = 1 used...
Definition:
sonar_bebop.c:69
state.h
DefaultDevice
#define DefaultDevice
Definition:
downlink.h:46
atmega_i2c_cam_ctrl_periodic
void atmega_i2c_cam_ctrl_periodic(void)
Definition:
sim_i2c_cam_ctrl.c:44
dc_init
void dc_init(void)
initialize settings
Definition:
dc.c:156
dc_periodic
void dc_periodic(void)
periodic function
Definition:
dc.c:273
atmega_i2c_cam_ctrl_send
void atmega_i2c_cam_ctrl_send(uint8_t cmd)
Definition:
sim_i2c_cam_ctrl.c:54
sw
airborne
modules
digital_cam
sim_i2c_cam_ctrl.c
Generated on Tue Feb 1 2022 13:51:15 for Paparazzi UAS by
1.8.17