Revision a2a65dbc

View differences:

Adafruit_BNO055.h
40 40
    typedef enum
41 41
    {
42 42
      /* Page id register definition */
43
      BNO055_PAGE_ID_ADDR				                  = 0X07,
43
      BNO055_PAGE_ID_ADDR                                     = 0X07,
44 44

  
45 45
      /* PAGE0 REGISTER DEFINITION START*/
46
      BNO055_CHIP_ID_ADDR                         = 0x00,
47
      BNO055_ACCEL_REV_ID_ADDR			              = 0x01,
48
      BNO055_MAG_REV_ID_ADDR                      = 0x02,
49
      BNO055_GYRO_REV_ID_ADDR                     = 0x03,
50
      BNO055_SW_REV_ID_LSB_ADDR			              = 0x04,
51
      BNO055_SW_REV_ID_MSB_ADDR			              = 0x05,
52
      BNO055_BL_REV_ID_ADDR				                = 0X06,
46
      BNO055_CHIP_ID_ADDR                                     = 0x00,
47
      BNO055_ACCEL_REV_ID_ADDR                                = 0x01,
48
      BNO055_MAG_REV_ID_ADDR                                  = 0x02,
49
      BNO055_GYRO_REV_ID_ADDR                                 = 0x03,
50
      BNO055_SW_REV_ID_LSB_ADDR                               = 0x04,
51
      BNO055_SW_REV_ID_MSB_ADDR                               = 0x05,
52
      BNO055_BL_REV_ID_ADDR                                   = 0X06,
53 53

  
54 54
      /* Accel data register */
55
      BNO055_ACCEL_DATA_X_LSB_ADDR			          = 0X08,
56
      BNO055_ACCEL_DATA_X_MSB_ADDR			          = 0X09,
57
      BNO055_ACCEL_DATA_Y_LSB_ADDR			          = 0X0A,
58
      BNO055_ACCEL_DATA_Y_MSB_ADDR			          = 0X0B,
59
      BNO055_ACCEL_DATA_Z_LSB_ADDR			          = 0X0C,
60
      BNO055_ACCEL_DATA_Z_MSB_ADDR			          = 0X0D,
55
      BNO055_ACCEL_DATA_X_LSB_ADDR                            = 0X08,
56
      BNO055_ACCEL_DATA_X_MSB_ADDR                            = 0X09,
57
      BNO055_ACCEL_DATA_Y_LSB_ADDR                            = 0X0A,
58
      BNO055_ACCEL_DATA_Y_MSB_ADDR                            = 0X0B,
59
      BNO055_ACCEL_DATA_Z_LSB_ADDR                            = 0X0C,
60
      BNO055_ACCEL_DATA_Z_MSB_ADDR                            = 0X0D,
61 61

  
62 62
      /* Mag data register */
63
      BNO055_MAG_DATA_X_LSB_ADDR			            = 0X0E,
64
      BNO055_MAG_DATA_X_MSB_ADDR			            = 0X0F,
65
      BNO055_MAG_DATA_Y_LSB_ADDR			            = 0X10,
66
      BNO055_MAG_DATA_Y_MSB_ADDR			            = 0X11,
67
      BNO055_MAG_DATA_Z_LSB_ADDR			            = 0X12,
68
      BNO055_MAG_DATA_Z_MSB_ADDR			            = 0X13,
63
      BNO055_MAG_DATA_X_LSB_ADDR                              = 0X0E,
64
      BNO055_MAG_DATA_X_MSB_ADDR                              = 0X0F,
65
      BNO055_MAG_DATA_Y_LSB_ADDR                              = 0X10,
66
      BNO055_MAG_DATA_Y_MSB_ADDR                              = 0X11,
67
      BNO055_MAG_DATA_Z_LSB_ADDR                              = 0X12,
68
      BNO055_MAG_DATA_Z_MSB_ADDR                              = 0X13,
69 69

  
70 70
      /* Gyro data registers */
71
      BNO055_GYRO_DATA_X_LSB_ADDR			            = 0X14,
72
      BNO055_GYRO_DATA_X_MSB_ADDR			            = 0X15,
73
      BNO055_GYRO_DATA_Y_LSB_ADDR			            = 0X16,
74
      BNO055_GYRO_DATA_Y_MSB_ADDR			            = 0X17,
75
      BNO055_GYRO_DATA_Z_LSB_ADDR			            = 0X18,
76
      BNO055_GYRO_DATA_Z_MSB_ADDR			            = 0X19,
71
      BNO055_GYRO_DATA_X_LSB_ADDR                             = 0X14,
72
      BNO055_GYRO_DATA_X_MSB_ADDR                             = 0X15,
73
      BNO055_GYRO_DATA_Y_LSB_ADDR                             = 0X16,
74
      BNO055_GYRO_DATA_Y_MSB_ADDR                             = 0X17,
75
      BNO055_GYRO_DATA_Z_LSB_ADDR                             = 0X18,
76
      BNO055_GYRO_DATA_Z_MSB_ADDR                             = 0X19,
77 77

  
78 78
      /* Euler data registers */
79
      BNO055_EULER_H_LSB_ADDR			                = 0X1A,
80
      BNO055_EULER_H_MSB_ADDR			                = 0X1B,
81
      BNO055_EULER_R_LSB_ADDR			                = 0X1C,
82
      BNO055_EULER_R_MSB_ADDR			                = 0X1D,
83
      BNO055_EULER_P_LSB_ADDR			                = 0X1E,
84
      BNO055_EULER_P_MSB_ADDR			                = 0X1F,
79
      BNO055_EULER_H_LSB_ADDR                                 = 0X1A,
80
      BNO055_EULER_H_MSB_ADDR                                 = 0X1B,
81
      BNO055_EULER_R_LSB_ADDR                                 = 0X1C,
82
      BNO055_EULER_R_MSB_ADDR                                 = 0X1D,
83
      BNO055_EULER_P_LSB_ADDR                                 = 0X1E,
84
      BNO055_EULER_P_MSB_ADDR                                 = 0X1F,
85 85

  
86 86
      /* Quaternion data registers */
87
      BNO055_QUATERNION_DATA_W_LSB_ADDR	          = 0X20,
88
      BNO055_QUATERNION_DATA_W_MSB_ADDR	          = 0X21,
89
      BNO055_QUATERNION_DATA_X_LSB_ADDR	          = 0X22,
90
      BNO055_QUATERNION_DATA_X_MSB_ADDR	          = 0X23,
91
      BNO055_QUATERNION_DATA_Y_LSB_ADDR	          = 0X24,
92
      BNO055_QUATERNION_DATA_Y_MSB_ADDR	          = 0X25,
93
      BNO055_QUATERNION_DATA_Z_LSB_ADDR	          = 0X26,
94
      BNO055_QUATERNION_DATA_Z_MSB_ADDR	          = 0X27,
87
      BNO055_QUATERNION_DATA_W_LSB_ADDR                       = 0X20,
88
      BNO055_QUATERNION_DATA_W_MSB_ADDR                       = 0X21,
89
      BNO055_QUATERNION_DATA_X_LSB_ADDR                       = 0X22,
90
      BNO055_QUATERNION_DATA_X_MSB_ADDR                       = 0X23,
91
      BNO055_QUATERNION_DATA_Y_LSB_ADDR                       = 0X24,
92
      BNO055_QUATERNION_DATA_Y_MSB_ADDR                       = 0X25,
93
      BNO055_QUATERNION_DATA_Z_LSB_ADDR                       = 0X26,
94
      BNO055_QUATERNION_DATA_Z_MSB_ADDR                       = 0X27,
95 95

  
96 96
      /* Linear acceleration data registers */
97
      BNO055_LINEAR_ACCEL_DATA_X_LSB_ADDR			    = 0X28,
98
      BNO055_LINEAR_ACCEL_DATA_X_MSB_ADDR			    = 0X29,
99
      BNO055_LINEAR_ACCEL_DATA_Y_LSB_ADDR			    = 0X2A,
100
      BNO055_LINEAR_ACCEL_DATA_Y_MSB_ADDR			    = 0X2B,
101
      BNO055_LINEAR_ACCEL_DATA_Z_LSB_ADDR			    = 0X2C,
102
      BNO055_LINEAR_ACCEL_DATA_Z_MSB_ADDR			    = 0X2D,
97
      BNO055_LINEAR_ACCEL_DATA_X_LSB_ADDR                     = 0X28,
98
      BNO055_LINEAR_ACCEL_DATA_X_MSB_ADDR                     = 0X29,
99
      BNO055_LINEAR_ACCEL_DATA_Y_LSB_ADDR                     = 0X2A,
100
      BNO055_LINEAR_ACCEL_DATA_Y_MSB_ADDR                     = 0X2B,
101
      BNO055_LINEAR_ACCEL_DATA_Z_LSB_ADDR                     = 0X2C,
102
      BNO055_LINEAR_ACCEL_DATA_Z_MSB_ADDR                     = 0X2D,
103 103

  
104 104
      /* Gravity data registers */
105
      BNO055_GRAVITY_DATA_X_LSB_ADDR			        = 0X2E,
106
      BNO055_GRAVITY_DATA_X_MSB_ADDR			        = 0X2F,
107
      BNO055_GRAVITY_DATA_Y_LSB_ADDR			        = 0X30,
108
      BNO055_GRAVITY_DATA_Y_MSB_ADDR			        = 0X31,
109
      BNO055_GRAVITY_DATA_Z_LSB_ADDR			        = 0X32,
110
      BNO055_GRAVITY_DATA_Z_MSB_ADDR			        = 0X33,
105
      BNO055_GRAVITY_DATA_X_LSB_ADDR                          = 0X2E,
106
      BNO055_GRAVITY_DATA_X_MSB_ADDR                          = 0X2F,
107
      BNO055_GRAVITY_DATA_Y_LSB_ADDR                          = 0X30,
108
      BNO055_GRAVITY_DATA_Y_MSB_ADDR                          = 0X31,
109
      BNO055_GRAVITY_DATA_Z_LSB_ADDR                          = 0X32,
110
      BNO055_GRAVITY_DATA_Z_MSB_ADDR                          = 0X33,
111 111

  
112 112
      /* Temperature data register */
113
      BNO055_TEMP_ADDR					                  = 0X34,
113
      BNO055_TEMP_ADDR                                        = 0X34,
114 114

  
115 115
      /* Status registers */
116
      BNO055_CALIB_STAT_ADDR				              = 0X35,
117
      BNO055_SELFTEST_RESULT_ADDR			            = 0X36,
118
      BNO055_INTR_STAT_ADDR				                = 0X37,
116
      BNO055_CALIB_STAT_ADDR                                  = 0X35,
117
      BNO055_SELFTEST_RESULT_ADDR                             = 0X36,
118
      BNO055_INTR_STAT_ADDR                                   = 0X37,
119 119

  
120
      BNO055_SYS_CLK_STAT_ADDR			              = 0X38,
121
      BNO055_SYS_STAT_ADDR				                = 0X39,
122
      BNO055_SYS_ERR_ADDR					                = 0X3A,
120
      BNO055_SYS_CLK_STAT_ADDR                                = 0X38,
121
      BNO055_SYS_STAT_ADDR                                    = 0X39,
122
      BNO055_SYS_ERR_ADDR                                     = 0X3A,
123 123

  
124 124
      /* Unit selection register */
125
      BNO055_UNIT_SEL_ADDR				                = 0X3B,
126
      BNO055_DATA_SELECT_ADDR				              = 0X3C,
125
      BNO055_UNIT_SEL_ADDR                                    = 0X3B,
126
      BNO055_DATA_SELECT_ADDR                                 = 0X3C,
127 127

  
128 128
      /* Mode registers */
129
      BNO055_OPR_MODE_ADDR				                = 0X3D,
130
      BNO055_PWR_MODE_ADDR				                = 0X3E,
129
      BNO055_OPR_MODE_ADDR                                    = 0X3D,
130
      BNO055_PWR_MODE_ADDR                                    = 0X3E,
131

  
132
      BNO055_SYS_TRIGGER_ADDR                                 = 0X3F,
133
      BNO055_TEMP_SOURCE_ADDR                                 = 0X40,
131 134

  
132
      BNO055_SYS_TRIGGER_ADDR				              = 0X3F,
133
      BNO055_TEMP_SOURCE_ADDR				              = 0X40,
134
      
135 135
      /* Axis remap registers */
136
      BNO055_AXIS_MAP_CONFIG_ADDR			            = 0X41,
137
      BNO055_AXIS_MAP_SIGN_ADDR			              = 0X42,
136
      BNO055_AXIS_MAP_CONFIG_ADDR                             = 0X41,
137
      BNO055_AXIS_MAP_SIGN_ADDR                               = 0X42,
138 138

  
139 139
      /* SIC registers */
140
      BNO055_SIC_MATRIX_0_LSB_ADDR		            = 0X43,
141
      BNO055_SIC_MATRIX_0_MSB_ADDR		            = 0X44,
142
      BNO055_SIC_MATRIX_1_LSB_ADDR		            = 0X45,
143
      BNO055_SIC_MATRIX_1_MSB_ADDR		            = 0X46,
144
      BNO055_SIC_MATRIX_2_LSB_ADDR		            = 0X47,
145
      BNO055_SIC_MATRIX_2_MSB_ADDR		            = 0X48,
146
      BNO055_SIC_MATRIX_3_LSB_ADDR		            = 0X49,
147
      BNO055_SIC_MATRIX_3_MSB_ADDR		            = 0X4A,
148
      BNO055_SIC_MATRIX_4_LSB_ADDR		            = 0X4B,
149
      BNO055_SIC_MATRIX_4_MSB_ADDR		            = 0X4C,
150
      BNO055_SIC_MATRIX_5_LSB_ADDR		            = 0X4D,
151
      BNO055_SIC_MATRIX_5_MSB_ADDR		            = 0X4E,
152
      BNO055_SIC_MATRIX_6_LSB_ADDR		            = 0X4F,
153
      BNO055_SIC_MATRIX_6_MSB_ADDR		            = 0X50,
154
      BNO055_SIC_MATRIX_7_LSB_ADDR		            = 0X51,
155
      BNO055_SIC_MATRIX_7_MSB_ADDR		            = 0X52,
156
      BNO055_SIC_MATRIX_8_LSB_ADDR		            = 0X53,
157
      BNO055_SIC_MATRIX_8_MSB_ADDR		            = 0X54,
140
      BNO055_SIC_MATRIX_0_LSB_ADDR                            = 0X43,
141
      BNO055_SIC_MATRIX_0_MSB_ADDR                            = 0X44,
142
      BNO055_SIC_MATRIX_1_LSB_ADDR                            = 0X45,
143
      BNO055_SIC_MATRIX_1_MSB_ADDR                            = 0X46,
144
      BNO055_SIC_MATRIX_2_LSB_ADDR                            = 0X47,
145
      BNO055_SIC_MATRIX_2_MSB_ADDR                            = 0X48,
146
      BNO055_SIC_MATRIX_3_LSB_ADDR                            = 0X49,
147
      BNO055_SIC_MATRIX_3_MSB_ADDR                            = 0X4A,
148
      BNO055_SIC_MATRIX_4_LSB_ADDR                            = 0X4B,
149
      BNO055_SIC_MATRIX_4_MSB_ADDR                            = 0X4C,
150
      BNO055_SIC_MATRIX_5_LSB_ADDR                            = 0X4D,
151
      BNO055_SIC_MATRIX_5_MSB_ADDR                            = 0X4E,
152
      BNO055_SIC_MATRIX_6_LSB_ADDR                            = 0X4F,
153
      BNO055_SIC_MATRIX_6_MSB_ADDR                            = 0X50,
154
      BNO055_SIC_MATRIX_7_LSB_ADDR                            = 0X51,
155
      BNO055_SIC_MATRIX_7_MSB_ADDR                            = 0X52,
156
      BNO055_SIC_MATRIX_8_LSB_ADDR                            = 0X53,
157
      BNO055_SIC_MATRIX_8_MSB_ADDR                            = 0X54,
158 158

  
159 159
      /* Accelerometer Offset registers */
160
      ACCEL_OFFSET_X_LSB_ADDR				              = 0X55,
161
      ACCEL_OFFSET_X_MSB_ADDR				              = 0X56,
162
      ACCEL_OFFSET_Y_LSB_ADDR				              = 0X57,
163
      ACCEL_OFFSET_Y_MSB_ADDR				              = 0X58,
164
      ACCEL_OFFSET_Z_LSB_ADDR				              = 0X59,
165
      ACCEL_OFFSET_Z_MSB_ADDR				              = 0X5A,
160
      ACCEL_OFFSET_X_LSB_ADDR                                 = 0X55,
161
      ACCEL_OFFSET_X_MSB_ADDR                                 = 0X56,
162
      ACCEL_OFFSET_Y_LSB_ADDR                                 = 0X57,
163
      ACCEL_OFFSET_Y_MSB_ADDR                                 = 0X58,
164
      ACCEL_OFFSET_Z_LSB_ADDR                                 = 0X59,
165
      ACCEL_OFFSET_Z_MSB_ADDR                                 = 0X5A,
166 166

  
167 167
      /* Magnetometer Offset registers */
168
      MAG_OFFSET_X_LSB_ADDR				                = 0X5B,
169
      MAG_OFFSET_X_MSB_ADDR				                = 0X5C,
170
      MAG_OFFSET_Y_LSB_ADDR				                = 0X5D,
171
      MAG_OFFSET_Y_MSB_ADDR				                = 0X5E,
172
      MAG_OFFSET_Z_LSB_ADDR				                = 0X5F,
173
      MAG_OFFSET_Z_MSB_ADDR				                = 0X60,
168
      MAG_OFFSET_X_LSB_ADDR                                   = 0X5B,
169
      MAG_OFFSET_X_MSB_ADDR                                   = 0X5C,
170
      MAG_OFFSET_Y_LSB_ADDR                                   = 0X5D,
171
      MAG_OFFSET_Y_MSB_ADDR                                   = 0X5E,
172
      MAG_OFFSET_Z_LSB_ADDR                                   = 0X5F,
173
      MAG_OFFSET_Z_MSB_ADDR                                   = 0X60,
174 174

  
175 175
      /* Gyroscope Offset register s*/
176
      GYRO_OFFSET_X_LSB_ADDR				              = 0X61,
177
      GYRO_OFFSET_X_MSB_ADDR				              = 0X62,
178
      GYRO_OFFSET_Y_LSB_ADDR				              = 0X63,
179
      GYRO_OFFSET_Y_MSB_ADDR				              = 0X64,
180
      GYRO_OFFSET_Z_LSB_ADDR				              = 0X65,
181
      GYRO_OFFSET_Z_MSB_ADDR				              = 0X66,
176
      GYRO_OFFSET_X_LSB_ADDR                                  = 0X61,
177
      GYRO_OFFSET_X_MSB_ADDR                                  = 0X62,
178
      GYRO_OFFSET_Y_LSB_ADDR                                  = 0X63,
179
      GYRO_OFFSET_Y_MSB_ADDR                                  = 0X64,
180
      GYRO_OFFSET_Z_LSB_ADDR                                  = 0X65,
181
      GYRO_OFFSET_Z_MSB_ADDR                                  = 0X66,
182 182

  
183 183
      /* Radius registers */
184
      ACCEL_RADIUS_LSB_ADDR				                = 0X67,
185
      ACCEL_RADIUS_MSB_ADDR				                = 0X68,
186
      MAG_RADIUS_LSB_ADDR					                = 0X69,
187
      MAG_RADIUS_MSB_ADDR					                = 0X6A
184
      ACCEL_RADIUS_LSB_ADDR                                   = 0X67,
185
      ACCEL_RADIUS_MSB_ADDR                                   = 0X68,
186
      MAG_RADIUS_LSB_ADDR                                     = 0X69,
187
      MAG_RADIUS_MSB_ADDR                                     = 0X6A
188 188
    } adafruit_bno055_reg_t;
189
    
189

  
190 190
    typedef enum
191 191
    {
192
      POWER_MODE_NORMAL	                          = 0X00,
193
      POWER_MODE_LOWPOWER	                        = 0X01,
194
      POWER_MODE_SUSPEND	                        = 0X02
192
      POWER_MODE_NORMAL                                       = 0X00,
193
      POWER_MODE_LOWPOWER                                     = 0X01,
194
      POWER_MODE_SUSPEND                                      = 0X02
195 195
    } adafruit_bno055_powermode_t;
196
    
196

  
197 197
    typedef enum
198 198
    {
199 199
      /* Operation mode settings*/
200
      OPERATION_MODE_CONFIG			                  = 0X00,
201
      OPERATION_MODE_ACCONLY			                = 0X01,
202
      OPERATION_MODE_MAGONLY			                = 0X02,
203
      OPERATION_MODE_GYRONLY			                = 0X03,
204
      OPERATION_MODE_ACCMAG			                  = 0X04,
205
      OPERATION_MODE_ACCGYRO			                = 0X05,
206
      OPERATION_MODE_MAGGYRO			                = 0X06,
207
      OPERATION_MODE_AMG				                  = 0X07,
208
      OPERATION_MODE_IMUPLUS			                = 0X08,
209
      OPERATION_MODE_COMPASS			                = 0X09,
210
      OPERATION_MODE_M4G				                  = 0X0A,
211
      OPERATION_MODE_NDOF_FMC_OFF		              = 0X0B,
212
      OPERATION_MODE_NDOF				                  = 0X0C
200
      OPERATION_MODE_CONFIG                                   = 0X00,
201
      OPERATION_MODE_ACCONLY                                  = 0X01,
202
      OPERATION_MODE_MAGONLY                                  = 0X02,
203
      OPERATION_MODE_GYRONLY                                  = 0X03,
204
      OPERATION_MODE_ACCMAG                                   = 0X04,
205
      OPERATION_MODE_ACCGYRO                                  = 0X05,
206
      OPERATION_MODE_MAGGYRO                                  = 0X06,
207
      OPERATION_MODE_AMG                                      = 0X07,
208
      OPERATION_MODE_IMUPLUS                                  = 0X08,
209
      OPERATION_MODE_COMPASS                                  = 0X09,
210
      OPERATION_MODE_M4G                                      = 0X0A,
211
      OPERATION_MODE_NDOF_FMC_OFF                             = 0X0B,
212
      OPERATION_MODE_NDOF                                     = 0X0C
213 213
    } adafruit_bno055_opmode_t;
214
    
214

  
215 215
    typedef struct
216 216
    {
217 217
      uint8_t  accel_rev;
......
220 220
      uint16_t sw_rev;
221 221
      uint8_t  bl_rev;
222 222
    } adafruit_bno055_rev_info_t;
223
    
223

  
224 224
    typedef enum
225 225
    {
226 226
      VECTOR_ACCELEROMETER = BNO055_ACCEL_DATA_X_LSB_ADDR,
......
238 238
    void  getRevInfo          ( adafruit_bno055_rev_info_t* );
239 239
    void  displayRevInfo      ( void );
240 240
    void  setExtCrystalUse    ( boolean usextal );
241
    void  getSystemStatus     ( uint8_t *system_status, 
242
                                uint8_t *self_test_result, 
241
    void  getSystemStatus     ( uint8_t *system_status,
242
                                uint8_t *self_test_result,
243 243
                                uint8_t *system_error);
244 244
    void  displaySystemStatus ( void );
245
    
245

  
246 246
    imu::Vector<3>  getVector ( adafruit_vector_type_t vector_type );
247 247
    imu::Quaternion getQuat   ( void );
248 248
    int8_t          getTemp   ( void );

Also available in: Unified diff