2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
27 CAMERA_CONTROL_KEY_ENTER
,
28 CAMERA_CONTROL_KEY_LEFT
,
29 CAMERA_CONTROL_KEY_UP
,
30 CAMERA_CONTROL_KEY_RIGHT
,
31 CAMERA_CONTROL_KEY_DOWN
,
32 CAMERA_CONTROL_KEYS_COUNT
36 CAMERA_CONTROL_MODE_HARDWARE_PWM
,
37 CAMERA_CONTROL_MODE_SOFTWARE_PWM
,
38 CAMERA_CONTROL_MODE_DAC
,
39 CAMERA_CONTROL_MODES_COUNT
40 } cameraControlMode_e
;
42 typedef struct cameraControlConfig_s
{
43 cameraControlMode_e mode
;
44 // measured in 10 mV steps
47 // measured 100 Ohm steps
48 uint16_t internalResistance
;
52 uint16_t buttonResistanceValues
[CAMERA_CONTROL_KEYS_COUNT
]; // resistance in 100ohm steps
53 } cameraControlConfig_t
;
55 PG_DECLARE(cameraControlConfig_t
, cameraControlConfig
);
57 void cameraControlInit(void);
59 void cameraControlProcess(uint32_t currentTimeUs
);
60 void cameraControlKeyPress(cameraControlKey_e key
, uint32_t holdDurationMs
);