Update cloud build defines (#14080)
[betaflight.git] / src / main / drivers / accgyro / accgyro_spi_lsm6dso.h
blobebcac8e7d66c5a94e192d11c0a200ad0ecf07c6d
1 /*
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)
8 * any later version.
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/>.
21 #pragma once
23 #include "drivers/bus.h"
24 #include "drivers/exti.h"
26 // LSM6DSO registers (not the complete list)
27 typedef enum {
28 LSM6DSO_REG_INT1_CTRL = 0x0D, // int pin 1 control
29 LSM6DSO_REG_INT2_CTRL = 0x0E, // int pin 2 control
30 LSM6DSO_REG_WHO_AM_I = 0x0F, // chip ID
31 LSM6DSO_REG_CTRL1_XL = 0x10, // accelerometer control
32 LSM6DSO_REG_CTRL2_G = 0x11, // gyro control
33 LSM6DSO_REG_CTRL3_C = 0x12, // control register 3
34 LSM6DSO_REG_CTRL4_C = 0x13, // control register 4
35 LSM6DSO_REG_CTRL5_C = 0x14, // control register 5
36 LSM6DSO_REG_CTRL6_C = 0x15, // control register 6
37 LSM6DSO_REG_CTRL7_G = 0x16, // control register 7
38 LSM6DSO_REG_CTRL8_XL = 0x17, // control register 8
39 LSM6DSO_REG_CTRL9_XL = 0x18, // control register 9
40 LSM6DSO_REG_CTRL10_C = 0x19, // control register 10
41 LSM6DSO_REG_STATUS = 0x1E, // status register
42 LSM6DSO_REG_OUT_TEMP_L = 0x20, // temperature LSB
43 LSM6DSO_REG_OUT_TEMP_H = 0x21, // temperature MSB
44 LSM6DSO_REG_OUTX_L_G = 0x22, // gyro X axis LSB
45 LSM6DSO_REG_OUTX_H_G = 0x23, // gyro X axis MSB
46 LSM6DSO_REG_OUTY_L_G = 0x24, // gyro Y axis LSB
47 LSM6DSO_REG_OUTY_H_G = 0x25, // gyro Y axis MSB
48 LSM6DSO_REG_OUTZ_L_G = 0x26, // gyro Z axis LSB
49 LSM6DSO_REG_OUTZ_H_G = 0x27, // gyro Z axis MSB
50 LSM6DSO_REG_OUTX_L_A = 0x28, // acc X axis LSB
51 LSM6DSO_REG_OUTX_H_A = 0x29, // acc X axis MSB
52 LSM6DSO_REG_OUTY_L_A = 0x2A, // acc Y axis LSB
53 LSM6DSO_REG_OUTY_H_A = 0x2B, // acc Y axis MSB
54 LSM6DSO_REG_OUTZ_L_A = 0x2C, // acc Z axis LSB
55 LSM6DSO_REG_OUTZ_H_A = 0x2D, // acc Z axis MSB
56 } lsm6dsoRegister_e;
58 // Contained in accgyro_spi_lsm6dso_init.c which is size-optimized
59 uint8_t lsm6dsoDetect(const extDevice_t *dev);
60 bool lsm6dsoSpiAccDetect(accDev_t *acc);
61 bool lsm6dsoSpiGyroDetect(gyroDev_t *gyro);
63 // Contained in accgyro_spi_lsm6dso.c which is speed-optimized
64 void lsm6dsoExtiHandler(extiCallbackRec_t *cb);
65 bool lsm6dsoAccRead(accDev_t *acc);
66 bool lsm6dsoGyroRead(gyroDev_t *gyro);