4 #include <linux/ioctl.h>
6 #define MPU6515_I2C_SLAVE_ADDR 0xD0 // or 0xD1
9 /* MPU6515 Register Map (Please refer to MPU6515 Specifications) */
10 #define MPU6515_REG_DEVID 0x75
11 #define MPU6515_REG_BW_RATE 0x1A
12 #define MPU6515_REG_POWER_CTL 0x6B
13 #define MPU6515_REG_POWER_CTL2 0x6C
14 #define MPU6515_REG_INT_ENABLE 0x38
15 #define MPU6515_REG_DATA_FORMAT 0x1C
16 #define MPU6515_REG_DATAX0 0x3B
17 #define MPU6515_REG_DATAY0 0x3D
18 #define MPU6515_REG_DATAZ0 0x3F
19 #define MPU6515_REG_RESET 0x68
22 #define MPU6515_FIXED_DEVID 0x74
25 #define MPU6515_BW_460HZ 0x00 //1.94
26 #define MPU6515_BW_184HZ 0x01 //5.8
27 #define MPU6515_BW_92HZ 0x02 //7.8
28 #define MPU6515_BW_41HZ 0x03 //11.8
29 #define MPU6515_BW_20HZ 0x04 //19.8
30 #define MPU6515_BW_10HZ 0x05 //35.7
31 #define MPU6515_BW_5HZ 0x06 //66.96
33 #define MPU6515_DEV_RESET 0x80
35 //#define MPU6515_FULL_RES 0x08
36 #define MPU6515_RANGE_2G (0x00 << 3)
37 #define MPU6515_RANGE_4G (0x01 << 3)
38 #define MPU6515_RANGE_8G (0x02 << 3)
39 #define MPU6515_RANGE_16G (0x03 << 3)
40 //#define MPU6515_SELF_TEST 0x80
43 #define MPU6515_SLEEP 0x40 //enable low power sleep mode
47 // below do not modify
48 #define MPU6515_SUCCESS 0
49 #define MPU6515_ERR_I2C -1
50 #define MPU6515_ERR_STATUS -3
51 #define MPU6515_ERR_SETUP_FAILURE -4
52 #define MPU6515_ERR_GETGSENSORDATA -5
53 #define MPU6515_ERR_IDENTIFICATION -6
55 #define MPU6515_BUFSIZE 256
57 #define MPU6515_AXES_NUM 3
59 /*----------------------------------------------------------------------------*/
61 MPU6515_CUST_ACTION_SET_CUST
= 1,
62 MPU6515_CUST_ACTION_SET_CALI
,
63 MPU6515_CUST_ACTION_RESET_CALI
65 /*----------------------------------------------------------------------------*/
70 /*----------------------------------------------------------------------------*/
77 /*----------------------------------------------------------------------------*/
81 int32_t data
[MPU6515_AXES_NUM
];
83 /*----------------------------------------------------------------------------*/
84 typedef MPU6515_CUST MPU6515_RESET_CALI
;
85 /*----------------------------------------------------------------------------*/
90 MPU6515_SET_CUST setCust
;
91 MPU6515_SET_CALI setCali
;
92 MPU6515_RESET_CALI resetCali
;
94 /*----------------------------------------------------------------------------*/