-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathMPU9250.h
70 lines (56 loc) · 1.54 KB
/
MPU9250.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* MPU925.h
*
* Created on: 23 ìàÿ 2018 ã.
* Author: Max
*/
#ifndef MPU925_H_
#define MPU925_H_
#include "main.h"
#include "MPU9250_Config.h"
typedef enum GyroRange_ {
GYRO_RANGE_250DPS = 0,
GYRO_RANGE_500DPS,
GYRO_RANGE_1000DPS,
GYRO_RANGE_2000DPS
} GyroRange;
typedef enum AccelRange_ {
ACCEL_RANGE_2G = 0,
ACCEL_RANGE_4G,
ACCEL_RANGE_8G,
ACCEL_RANGE_16G
} AccelRange;
typedef enum DLPFBandwidth_ {
DLPF_BANDWIDTH_184HZ = 0,
DLPF_BANDWIDTH_92HZ,
DLPF_BANDWIDTH_41HZ,
DLPF_BANDWIDTH_20HZ,
DLPF_BANDWIDTH_10HZ,
DLPF_BANDWIDTH_5HZ
} DLPFBandwidth;
typedef enum SampleRateDivider_ {
LP_ACCEL_ODR_0_24HZ = 0,
LP_ACCEL_ODR_0_49HZ,
LP_ACCEL_ODR_0_98HZ,
LP_ACCEL_ODR_1_95HZ,
LP_ACCEL_ODR_3_91HZ,
LP_ACCEL_ODR_7_81HZ,
LP_ACCEL_ODR_15_63HZ,
LP_ACCEL_ODR_31_25HZ,
LP_ACCEL_ODR_62_50HZ,
LP_ACCEL_ODR_125HZ,
LP_ACCEL_ODR_250HZ,
LP_ACCEL_ODR_500HZ
} SampleRateDivider;
uint8_t MPU9250_Init();
/* read the data, each argiment should point to a array for x, y, and x */
void MPU9250_GetData(int16_t* AccData, int16_t* MagData, int16_t* GyroData);
/* sets the sample rate divider to values other than default */
void MPU9250_SetSampleRateDivider(SampleRateDivider srd);
/* sets the DLPF bandwidth to values other than default */
void MPU9250_SetDLPFBandwidth(DLPFBandwidth bandwidth);
/* sets the gyro full scale range to values other than default */
void MPU9250_SetGyroRange(GyroRange range);
/* sets the accelerometer full scale range to values other than default */
void MPU9250_SetAccelRange(AccelRange range);
#endif /* MPU925_H_ */