15#define MPU6000_PRODUCT_ID 0x68
17#define MPU6000_SMPLRT_DIV 0x19
18#define MPU6000_GYRO_CONFIG 0x1B
19#define MPU6000_ACCEL_CONFIG 0x1C
20#define MPU6000_FIFO_EN 0x23
21#define MPU6000_INT_PIN_CFG 0x37
22#define MPU6000_INT_ENABLE 0x38
23#define MPU6000_INT_STATUS 0x3A
24#define MPU6000_ACCEL_XOUT_H 0x3B
25#define MPU6000_ACCEL_XOUT_L 0x3C
26#define MPU6000_ACCEL_YOUT_H 0x3D
27#define MPU6000_ACCEL_YOUT_L 0x3E
28#define MPU6000_ACCEL_ZOUT_H 0x3F
29#define MPU6000_ACCEL_ZOUT_L 0x40
30#define MPU6000_TEMP_OUT_H 0x41
31#define MPU6000_TEMP_OUT_L 0x42
32#define MPU6000_GYRO_XOUT_H 0x43
33#define MPU6000_GYRO_XOUT_L 0x44
34#define MPU6000_GYRO_YOUT_H 0x45
35#define MPU6000_GYRO_YOUT_L 0x46
36#define MPU6000_GYRO_ZOUT_H 0x47
37#define MPU6000_GYRO_ZOUT_L 0x48
38#define MPU6000_SIGNAL_PATH_RESET 0x68
39#define MPU6000_USER_CTRL 0x6A
40#define MPU6000_PWR_MGMT_1 0x6B
41#define MPU6000_PWR_MGMT_2 0x6C
42#define MPU6000_FIFO_COUNTH 0x72
43#define MPU6000_FIFO_COUNTL 0x73
44#define MPU6000_FIFO_R_W 0x74
45#define MPU6000_WHOAMI 0x75
50#define BIT_H_RESET 0x80
51#define BITS_CLKSEL 0x07
52#define MPU_CLK_SEL_PLLGYROX 0x01
53#define MPU_CLK_SEL_PLLGYROZ 0x03
54#define MPU_EXT_SYNC_GYROX 0x02
55#define BITS_FS_250DPS 0x00
56#define BITS_FS_500DPS 0x08
57#define BITS_FS_1000DPS 0x10
58#define BITS_FS_2000DPS 0x18
59#define BITS_FS_2G 0x00
60#define BITS_FS_4G 0x08
61#define BITS_FS_8G 0x10
62#define BITS_FS_16G 0x18
63#define BITS_FS_MASK 0x18
64#define BITS_DLPF_CFG_20HZ 0x04
65#define BITS_DLPF_CFG_10HZ 0x05
66#define BITS_DLPF_CFG_5HZ 0x06
67#define BITS_DLPF_CFG_2100HZ_NOLPF 0x07
68#define BITS_DLPF_CFG_MASK 0x07
69#define BIT_INT_ANYRD_2CLEAR 0x10
70#define BIT_RAW_RDY_EN 0x01
71#define BIT_I2C_IF_DIS 0x10
72#define BIT_INT_STATUS_DATA 0x01
76#define MPU6000_CONFIG 0x1A
78#define BITS_DLPF_CFG_256HZ 0x00
79#define BITS_DLPF_CFG_188HZ 0x01
80#define BITS_DLPF_CFG_98HZ 0x02
81#define BITS_DLPF_CFG_42HZ 0x03
83#define DISABLE_MPU6000 GPIOA->BSRR |= GPIO_BSRR_BS4
84#define ENABLE_MPU6000 GPIOA->BSRR |= GPIO_BSRR_BR4
86#define GYRO_SCALE_FACTOR 0.000532632f
87#define ACCEL_SCALE_FACTOR 0.004788403f
void computeMPU6000TCBias(void)
Calculates the IMU temperature bias.
Definition: mpu6000.c:221
int32_t accelSummedSamples100Hz[3]
int32_t gyroSummedSamples500Hz[3]
Definition: mpu6000.c:34
uint8_t accelCalibrating
Definition: mpu6000.c:44
float gyroRTBias[3]
Definition: mpu6000.c:30
int16andUint8_t rawMPU6000Temperature
Definition: mpu6000.c:52
int16andUint8_t rawAccel[3]
Definition: mpu6000.c:24
int32_t accelSummedSamples500Hz[3]
Definition: mpu6000.c:20
int32_t gyroSum500Hz[3]
Definition: mpu6000.c:32
float mpu6000Temperature
Definition: mpu6000.c:50
float gyroTCBias[3]
Definition: mpu6000.c:36
float accelOneG
Definition: mpu6000.c:13
void readMPU6000(void)
Reads MPU-6000 raw data and packs accel, gyro, temp data into variables.
Definition: mpu6000.c:140
bool mpu6000Init(void)
MPU-6000 initialization sequence.
Definition: mpu6000.c:64
int16andUint8_t rawGyro[3]
Definition: mpu6000.c:38
float nonRotatedGyroData[3]
Definition: mpu6000.c:40
void computeMPU6000RTData(void)
Computes IMU runtime data to find gyro bias.
Definition: mpu6000.c:176
uint8_t rawData[16]
Definition: mpu6000.c:15
float accelTCBias[3]
Definition: mpu6000.c:22
int32_t accelSum500Hz[3]
Definition: mpu6000.c:18
float nonRotatedAccelData[3]
Definition: mpu6000.c:26
uint8_t mpu6000Calibrating
Definition: mpu6000.c:46
Definition: autodrone32.h:57