Added runtime setting of gyro SPI pin
[betaflight.git] / src / main / drivers / accgyro_spi_mpu6000.h
blob9536d6ee3a6228f7f9776b67e70157b049fa8d6a
2 #pragma once
4 #include "sensor.h"
6 #define MPU6000_CONFIG 0x1A
8 #define BITS_DLPF_CFG_256HZ 0x00
9 #define BITS_DLPF_CFG_188HZ 0x01
10 #define BITS_DLPF_CFG_98HZ 0x02
11 #define BITS_DLPF_CFG_42HZ 0x03
13 #define GYRO_SCALE_FACTOR 0.00053292f // (4/131) * pi/180 (32.75 LSB = 1 DPS)
15 #define MPU6000_WHO_AM_I_CONST (0x68)
17 // RF = Register Flag
18 #define MPU_RF_DATA_RDY_EN (1 << 0)
20 bool mpu6000SpiDetect(const busDevice_t *bus);
22 bool mpu6000SpiAccDetect(accDev_t *acc);
23 bool mpu6000SpiGyroDetect(gyroDev_t *gyro);
25 bool mpu6000SpiWriteRegister(const busDevice_t *bus, uint8_t reg, uint8_t data);
26 bool mpu6000SpiReadRegister(const busDevice_t *bus, uint8_t reg, uint8_t length, uint8_t *data);