2 * This file is part of Cleanflight.
4 * Cleanflight 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 * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
23 #include "drivers/io_types.h"
24 #include "drivers/bus.h"
27 ALIGN_DEFAULT
= 0, // driver-provided alignment
38 typedef bool (*sensorInitFuncPtr
)(void); // sensor init prototype
39 typedef bool (*sensorReadFuncPtr
)(int16_t *data
); // sensor read and align prototype
40 typedef bool (*sensorInterruptFuncPtr
)(void);
42 typedef void (*sensorAccInitFuncPtr
)(struct accDev_s
*acc
);
43 typedef bool (*sensorAccReadFuncPtr
)(struct accDev_s
*acc
);
45 typedef void (*sensorGyroInitFuncPtr
)(struct gyroDev_s
*gyro
);
46 typedef bool (*sensorGyroReadFuncPtr
)(struct gyroDev_s
*gyro
);
47 typedef bool (*sensorGyroUpdateFuncPtr
)(struct gyroDev_s
*gyro
);
48 typedef bool (*sensorGyroReadDataFuncPtr
)(struct gyroDev_s
*gyro
, int16_t *data
);
49 typedef bool (*sensorGyroInterruptStatusFuncPtr
)(struct gyroDev_s
*gyro
);
51 typedef bool (*sensorMagInitFuncPtr
)(struct magDev_s
*mag
);
52 typedef bool (*sensorMagReadFuncPtr
)(struct magDev_s
*mag
);
53 struct temperatureDev_s
;
54 typedef bool (*sensorTempReadFuncPtr
)(struct temperatureDev_s
*tempDev
, int16_t *temperature
);
56 typedef bool (*sensorOpflowInitFuncPtr
)(struct opflowDev_s
*mag
);
57 typedef bool (*sensorOpflowUpdateFuncPtr
)(struct opflowDev_s
*mag
);