PX4 Firmware
PX4 Autopilot Software http://px4.io
camera_interface.h
Go to the documentation of this file.
1 /**
2  * @file camera_interface.h
3  */
4 
5 #pragma once
6 
7 #include <parameters/param.h>
8 #include <px4_platform_common/log.h>
9 
10 #define arraySize(a) (sizeof((a))/sizeof(((a)[0])))
11 
13 {
14 public:
15 
16  /**
17  * Constructor
18  */
20 
21  /**
22  * Destructor.
23  */
24  virtual ~CameraInterface() = default;
25 
26  /**
27  * trigger the camera
28  * @param enable
29  */
30  virtual void trigger(bool trigger_on_true) {}
31 
32  /**
33  * send command to turn the camera on/off
34  * @param enable
35  */
36  virtual void send_toggle_power(bool enable) {}
37 
38  /**
39  * send command to prevent the camera from sleeping
40  * @param enable
41  */
42  virtual void send_keep_alive(bool enable) {}
43 
44  /**
45  * Display info.
46  */
47  virtual void info() {}
48 
49  /**
50  * Checks if the interface has support for
51  * camera power control
52  * @return true if power control is supported
53  */
54  virtual bool has_power_control() { return false; }
55 
56  /**
57  * Checks if the camera connected to the interface
58  * is turned on.
59  * @return true if camera is on
60  */
61  virtual bool is_powered_on() { return true; }
62 
63 protected:
64 
65  /**
66  * setup the interface
67  */
68  virtual void setup() {}
69 
70  /**
71  * get the hardware configuration
72  */
73  void get_pins();
74 
76 
77  int _pins[6];
78 
79 };
CameraInterface()
Constructor.
virtual void send_toggle_power(bool enable)
send command to turn the camera on/off
virtual ~CameraInterface()=default
Destructor.
virtual bool is_powered_on()
Checks if the camera connected to the interface is turned on.
void get_pins()
get the hardware configuration
Global flash based parameter store.
virtual void send_keep_alive(bool enable)
send command to prevent the camera from sleeping
virtual void info()
Display info.
virtual void trigger(bool trigger_on_true)
trigger the camera
virtual bool has_power_control()
Checks if the interface has support for camera power control.
virtual void setup()
setup the interface
uint32_t param_t
Parameter handle.
Definition: param.h:98