Bump clang version to 18 (#14116)
[betaflight.git] / src / main / sensors / opticalflow.h
blobe715aeb3f0789e4080a555f977852350cce2bf54
1 /*
2 * This file is part of Betaflight.
4 * Betaflight is free software. You can redistribute this software
5 * and/or modify this software under the terms of the GNU General
6 * Public License as published by the Free Software Foundation,
7 * either version 3 of the License, or (at your option) any later
8 * version.
10 * Betaflight is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this software.
19 * If not, see <http://www.gnu.org/licenses/>.
21 #pragma once
23 #include <stdint.h>
24 #include <stdbool.h>
26 #include "drivers/opticalflow/opticalflow.h"
28 #include "pg/pg.h"
30 typedef enum {
31 OPTICALFLOW_NONE = 0,
32 OPTICALFLOW_MT = 1,
33 } opticalflowType_e;
35 typedef struct opticalflowConfig_s {
36 uint8_t opticalflow_hardware;
37 uint16_t rotation;
38 uint8_t flip_x;
39 uint16_t flow_lpf;
40 } opticalflowConfig_t;
42 PG_DECLARE(opticalflowConfig_t, opticalflowConfig);
44 typedef struct opticalflow_s {
45 opticalflowDev_t dev;
46 int16_t quality;
47 vector2_t rawFlowRates;
48 vector2_t processedFlowRates;
49 uint32_t timeStampUs;
50 } opticalflow_t;
52 bool opticalflowInit(void);
54 void opticalflowUpdate(void);
55 bool isOpticalflowHealthy(void);
56 void opticalflowProcess(void);