Merge remote-tracking branch 'upstream/master' into abo_RTH_sanity_fix
[inav.git] / src / main / drivers / irlock.h
blob04c6efcb1d137fc8ce124a8996ff25cf71c257ff
1 /*
2 * This file is part of iNav.
4 * iNav is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * iNav is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with iNav. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #include "drivers/sensor.h"
21 #include "drivers/io_types.h"
23 #if defined(USE_IRLOCK)
25 #define IRLOCK_RES_X 320
26 #define IRLOCK_RES_Y 200
28 typedef struct {
29 uint16_t cksum;
30 uint16_t signature;
31 uint16_t posX;
32 uint16_t posY;
33 uint16_t sizeX;
34 uint16_t sizeY;
35 } irlockData_t;
37 typedef struct irlockDev_s {
38 busDevice_t *busDev;
39 bool (*read)(struct irlockDev_s *irlockDev, irlockData_t *irlockData);
40 } irlockDev_t;
42 bool irlockDetect(irlockDev_t *irlockDev);
43 bool irlockIsHealthy(void);
45 #endif /* USE_IRLOCK */