Revision 5d67f4db

View differences:

include/BNO055/alld_BNO055.h
1
/*
2
AMiRo-LLD is a compilation of low-level hardware drivers for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2019  Thomas Schöpping et al.
4

  
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU Lesser General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9

  
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU Lesser General Public License for more details.
14

  
15
You should have received a copy of the GNU Lesser General Public License
16
along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
*/
18

  
19
/**
20
 * @file    alld_BNO055.h
21
 *
22
 * @addtogroup lld_accel
23
 * @{
24
 */
25

  
26
#ifndef AMIROLLD_BNO055_H
27
#define AMIROLLD_BNO055_H
28

  
29
#include <amiro-lld.h>
30

  
31
#if defined(AMIROLLD_CFG_BNO055)
32

  
33
#if (AMIROLLD_CFG_BNO055 == 1)
34
  #include "v1/alld_BNO055_v1.h"
35
#else
36
  #error "invalid value assigned to AMIROLLD_CFG_BNO055 in alldconf.h"
37
#endif
38

  
39
#endif /* defined(AMIROLLD_CFG_BNO055) */
40

  
41
#endif /* AMIROLLD_BNO055_H */
42

  
43
/** @} */
include/BNO055/bno055_reg.h
1
/** \mainpage
2
 *
3
 ****************************************************************************
4
 * Copyright (C) 2015 - 2016 Bosch Sensortec GmbH
5
 *
6
 * File : bno055.h
7
 *
8
 * Date : 2016/03/14
9
 *
10
 * Revision : 2.0.3 $
11
 *
12
 * Usage: Sensor Driver file for BNO055 sensor
13
 *
14
 ****************************************************************************
15
 * \section License
16
 *
17
 * Redistribution and use in source and binary forms, with or without
18
 * modification, are permitted provided that the following conditions are met:
19
 *
20
 *   Redistributions of source code must retain the above copyright
21
 *   notice, this list of conditions and the following disclaimer.
22
 *
23
 *   Redistributions in binary form must reproduce the above copyright
24
 *   notice, this list of conditions and the following disclaimer in the
25
 *   documentation and/or other materials provided with the distribution.
26
 *
27
 *   Neither the name of the copyright holder nor the names of the
28
 *   contributors may be used to endorse or promote products derived from
29
 *   this software without specific prior written permission.
30
 *
31
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
32
 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
33
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35
 * DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
36
 * OR CONTRIBUTORS BE LIABLE FOR ANY
37
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
38
 * OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO,
39
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
41
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
42
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
44
 * ANY WAY OUT OF THE USE OF THIS
45
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
46
 *
47
 * The information provided is believed to be accurate and reliable.
48
 * The copyright holder assumes no responsibility
49
 * for the consequences of use
50
 * of such information nor for any infringement of patents or
51
 * other rights of third parties which may result from its use.
52
 * No license is granted by implication or otherwise under any patent or
53
 * patent rights of the copyright holder.
54
 **************************************************************************/
55
/*! \file bno055.h
56
 \brief BNO055 Sensor Driver Support Header File */
57

  
58
#ifndef __BNO055_H__
59
#define __BNO055_H__
60

  
61
#define MACHINE_16_BIT
62
/****************************************************************/
63
/**\name    DATA TYPES INCLUDES     */
64
/************************************************************/
65
/*!
66
 * @brief The following definition uses for define the data types
67
 *
68
 * @note While porting the API please consider the following
69
 * @note Please check the version of C standard
70
 * @note Are you using Linux platform
71
 */
72

  
73
/*!
74
 * @brief For the Linux platform support
75
 * Please use the types.h for your data types definitions
76
 */
77
#ifdef  __KERNEL__
78

  
79
#include <linux/types.h>
80
/* singed integer type*/
81
typedef int8_t s8;/**< used for signed 8bit */
82
typedef int16_t s16;/**< used for signed 16bit */
83
typedef int32_t s32;/**< used for signed 32bit */
84
typedef int64_t s64;/**< used for signed 64bit */
85

  
86
typedef u_int8_t u8;/**< used for unsigned 8bit */
87
typedef u_int16_t u16;/**< used for unsigned 16bit */
88
typedef u_int32_t u32;/**< used for unsigned 32bit */
89
typedef u_int64_t u64;/**< used for unsigned 64bit */
90

  
91
#else /* ! __KERNEL__ */
92
/**********************************************************
93
 * These definition uses for define the C
94
 * standard version data types
95
 ***********************************************************/
96
# if !defined(__STDC_VERSION__)
97

  
98
/************************************************
99
 * compiler is C11 C standard
100
 ************************************************/
101
#if (__STDC_VERSION__ == 201112L)
102

  
103
/************************************************/
104
#include <stdint.h>
105
/************************************************/
106

  
107
/*unsigned integer types*/
108
typedef uint8_t u8;/**< used for unsigned 8bit */
109
typedef uint16_t u16;/**< used for unsigned 16bit */
110
typedef uint32_t u32;/**< used for unsigned 32bit */
111
typedef uint64_t u64;/**< used for unsigned 64bit */
112

  
113
/*signed integer types*/
114
typedef int8_t s8;/**< used for signed 8bit */
115
typedef int16_t s16;/**< used for signed 16bit */
116
typedef int32_t s32;/**< used for signed 32bit */
117
typedef int64_t s64;/**< used for signed 64bit */
118
/************************************************
119
 * compiler is C99 C standard
120
 ************************************************/
121

  
122
#elif (__STDC_VERSION__ == 199901L)
123

  
124
/* stdint.h is a C99 supported c library.
125
 which is used to fixed the integer size*/
126
/************************************************/
127
#include <stdint.h>
128
/************************************************/
129

  
130
/*unsigned integer types*/
131
typedef uint8_t u8;/**< used for unsigned 8bit */
132
typedef uint16_t u16;/**< used for unsigned 16bit */
133
typedef uint32_t u32;/**< used for unsigned 32bit */
134
typedef uint64_t u64;/**< used for unsigned 64bit */
135

  
136
/*signed integer types*/
137
typedef int8_t s8;/**< used for signed 8bit */
138
typedef int16_t s16;/**< used for signed 16bit */
139
typedef int32_t s32;/**< used for signed 32bit */
140
typedef int64_t s64;/**< used for signed 64bit */
141
/************************************************
142
 * compiler is C89 or other C standard
143
 ************************************************/
144

  
145
#else /*  !defined(__STDC_VERSION__) */
146
/*!
147
 * @brief By default it is defined as 32 bit machine configuration
148
 *   define your data types based on your
149
 *   machine/compiler/controller configuration
150
 */
151
#define  MACHINE_32_BIT
152

  
153
/*! @brief
154
 *  If your machine support 16 bit
155
 *  define the MACHINE_16_BIT
156
 */
157
#ifdef MACHINE_16_BIT
158
#include <limits.h>
159
/*signed integer types*/
160
typedef signed char s8;/**< used for signed 8bit */
161
typedef signed short int s16;/**< used for signed 16bit */
162
typedef signed long int s32;/**< used for signed 32bit */
163

  
164
#if defined(LONG_MAX) && LONG_MAX == 0x7fffffffffffffffL
165
typedef long int s64;/**< used for signed 64bit */
166
typedef unsigned long int u64;/**< used for unsigned 64bit */
167
#elif defined(LLONG_MAX) && (LLONG_MAX == 0x7fffffffffffffffLL)
168
typedef long long int s64;/**< used for signed 64bit */
169
typedef unsigned long long int u64;/**< used for unsigned 64bit */
170
#else
171
#warning Either the correct data type for signed 64 bit integer \
172
could not be found, or 64 bit integers are not supported in your environment.
173
#warning If 64 bit integers are supported on your platform, \
174
please set s64 manually.
175
#endif
176

  
177
/*unsigned integer types*/
178
typedef unsigned char u8;/**< used for unsigned 8bit */
179
typedef unsigned short int u16;/**< used for unsigned 16bit */
180
typedef unsigned long int u32;/**< used for unsigned 32bit */
181

  
182
/* If your machine support 32 bit
183
 define the MACHINE_32_BIT*/
184
#elif defined MACHINE_32_BIT
185
/*signed integer types*/
186
typedef signed char s8;/**< used for signed 8bit */
187
typedef signed short int s16;/**< used for signed 16bit */
188
typedef signed int s32;/**< used for signed 32bit */
189
typedef signed long long int s64;/**< used for signed 64bit */
190

  
191
/*unsigned integer types*/
192
typedef unsigned char u8;/**< used for unsigned 8bit */
193
typedef unsigned short int u16;/**< used for unsigned 16bit */
194
typedef unsigned int u32;/**< used for unsigned 32bit */
195
typedef unsigned long long int u64;/**< used for unsigned 64bit */
196

  
197
/* If your machine support 64 bit
198
 define the MACHINE_64_BIT*/
199
#elif defined MACHINE_64_BIT
200
/*signed integer types*/
201
typedef signed char s8;/**< used for signed 8bit */
202
typedef signed short int s16;/**< used for signed 16bit */
203
typedef signed int s32;/**< used for signed 32bit */
204
typedef signed long int s64;/**< used for signed 64bit */
205

  
206
/*unsigned integer types*/
207
typedef unsigned char u8;/**< used for unsigned 8bit */
208
typedef unsigned short int u16;/**< used for unsigned 16bit */
209
typedef unsigned int u32;/**< used for unsigned 32bit */
210
typedef unsigned long int u64;/**< used for unsigned 64bit */
211

  
212
#else
213
#warning The data types defined above which not supported \
214
define the data types manually
215
#endif
216
#endif
217

  
218
/*** This else will execute for the compilers
219
 *  which are not supported the C standards
220
 *  Like C89/C99/C11***/
221
#else
222
/*!
223
 * @brief By default it is defined as 32 bit machine configuration
224
 *   define your data types based on your
225
 *   machine/compiler/controller configuration
226
 */
227
#define  MACHINE_32_BIT
228

  
229
/* If your machine support 16 bit
230
 define the MACHINE_16_BIT*/
231
#ifdef MACHINE_16_BIT
232
#include <limits.h>
233
/*signed integer types*/
234
typedef signed char s8;/**< used for signed 8bit */
235
typedef signed short int s16;/**< used for signed 16bit */
236
typedef signed long int s32;/**< used for signed 32bit */
237

  
238
#if defined(LONG_MAX) && LONG_MAX == 0x7fffffffffffffffL
239
typedef long int s64;/**< used for signed 64bit */
240
typedef unsigned long int u64;/**< used for unsigned 64bit */
241
#elif defined(LLONG_MAX) && (LLONG_MAX == 0x7fffffffffffffffLL)
242
typedef long long int s64;/**< used for signed 64bit */
243
typedef unsigned long long int u64;/**< used for unsigned 64bit */
244
#else
245
#warning Either the correct data type for signed 64 bit integer \
246
could not be found, or 64 bit integers are not supported in your environment.
247
#warning If 64 bit integers are supported on your platform, \
248
please set s64 manually.
249
#endif
250

  
251
/*unsigned integer types*/
252
typedef unsigned char u8;/**< used for unsigned 8bit */
253
typedef unsigned short int u16;/**< used for unsigned 16bit */
254
typedef unsigned long int u32;/**< used for unsigned 32bit */
255

  
256
/*! @brief If your machine support 32 bit
257
 define the MACHINE_32_BIT*/
258
#elif defined MACHINE_32_BIT
259
/*signed integer types*/
260
typedef signed char s8;/**< used for signed 8bit */
261
typedef signed short int s16;/**< used for signed 16bit */
262
typedef signed int s32;/**< used for signed 32bit */
263
typedef signed long long int s64;/**< used for signed 64bit */
264

  
265
/*unsigned integer types*/
266
typedef unsigned char u8;/**< used for unsigned 8bit */
267
typedef unsigned short int u16;/**< used for unsigned 16bit */
268
typedef unsigned int u32;/**< used for unsigned 32bit */
269
typedef unsigned long long int u64;/**< used for unsigned 64bit */
270

  
271
/* If your machine support 64 bit
272
 define the MACHINE_64_BIT*/
273
#elif defined MACHINE_64_BIT
274
/*signed integer types*/
275
typedef signed char s8;/**< used for signed 8bit */
276
typedef signed short int s16;/**< used for signed 16bit */
277
typedef signed int s32;/**< used for signed 32bit */
278
typedef signed long int s64;/**< used for signed 64bit */
279

  
280
/*unsigned integer types*/
281
typedef unsigned char u8;/**< used for unsigned 8bit */
282
typedef unsigned short int u16;/**< used for unsigned 16bit */
283
typedef unsigned int u32;/**< used for unsigned 32bit */
284
typedef unsigned long int u64;/**< used for unsigned 64bit */
285

  
286
#else
287
#warning The data types defined above which not supported \
288
define the data types manually
289
#endif
290
#endif
291
#endif
292
/***************************************************************/
293
/**\name    BUS READ AND WRITE FUNCTIONS           */
294
/***************************************************************/
295
#define BNO055_WR_FUNC_PTR s8 (*bus_write)\
296
(u8, u8, u8 *, u8)
297

  
298
#define BNO055_BUS_WRITE_FUNC(dev_addr, reg_addr, reg_data, wr_len)\
299
    bus_write(dev_addr, reg_addr, reg_data, wr_len)
300

  
301
#define BNO055_RD_FUNC_PTR s8 \
302
(*bus_read)(u8, u8, u8 *, u8)
303

  
304
#define BNO055_BUS_READ_FUNC(dev_addr, reg_addr, reg_data, r_len)\
305
bus_read(dev_addr, reg_addr, reg_data, r_len)
306

  
307
#define BNO055_DELAY_RETURN_TYPE void
308

  
309
#define BNO055_DELAY_PARAM_TYPES u32
310

  
311
#define BNO055_DELAY_FUNC(delay_in_msec)\
312
    delay_func(delay_in_msec)
313

  
314
/********************************************************/
315
/**\name    I2C ADDRESS DEFINITION FOR BNO055           */
316
/********************************************************/
317
/* bno055 I2C Address */
318
#define BNO055_I2C_ADDR1                (0x28)
319
#define BNO055_I2C_ADDR2                (0x29)
320

  
321
/***************************************************/
322
/**\name    REGISTER ADDRESS DEFINITION  */
323
/***************************************************/
324
/* Page id register definition*/
325
#define BNO055_PAGE_ID_ADDR                 (0X07)
326

  
327
/* PAGE0 REGISTER DEFINITION START*/
328
#define BNO055_CHIP_ID_ADDR                 (0x00)
329
#define BNO055_ACCEL_REV_ID_ADDR            (0x01)
330
#define BNO055_MAG_REV_ID_ADDR              (0x02)
331
#define BNO055_GYRO_REV_ID_ADDR             (0x03)
332
#define BNO055_SW_REV_ID_LSB_ADDR           (0x04)
333
#define BNO055_SW_REV_ID_MSB_ADDR           (0x05)
334
#define BNO055_BL_REV_ID_ADDR               (0X06)
335

  
336
/* Accel data register*/
337
#define BNO055_ACCEL_DATA_X_LSB_ADDR            (0X08)
338
#define BNO055_ACCEL_DATA_X_MSB_ADDR            (0X09)
339
#define BNO055_ACCEL_DATA_Y_LSB_ADDR            (0X0A)
340
#define BNO055_ACCEL_DATA_Y_MSB_ADDR            (0X0B)
341
#define BNO055_ACCEL_DATA_Z_LSB_ADDR            (0X0C)
342
#define BNO055_ACCEL_DATA_Z_MSB_ADDR            (0X0D)
343

  
344
/*Mag data register*/
345
#define BNO055_MAG_DATA_X_LSB_ADDR          (0X0E)
346
#define BNO055_MAG_DATA_X_MSB_ADDR          (0X0F)
347
#define BNO055_MAG_DATA_Y_LSB_ADDR          (0X10)
348
#define BNO055_MAG_DATA_Y_MSB_ADDR          (0X11)
349
#define BNO055_MAG_DATA_Z_LSB_ADDR          (0X12)
350
#define BNO055_MAG_DATA_Z_MSB_ADDR          (0X13)
351

  
352
/*Gyro data registers*/
353
#define BNO055_GYRO_DATA_X_LSB_ADDR         (0X14)
354
#define BNO055_GYRO_DATA_X_MSB_ADDR         (0X15)
355
#define BNO055_GYRO_DATA_Y_LSB_ADDR         (0X16)
356
#define BNO055_GYRO_DATA_Y_MSB_ADDR         (0X17)
357
#define BNO055_GYRO_DATA_Z_LSB_ADDR         (0X18)
358
#define BNO055_GYRO_DATA_Z_MSB_ADDR         (0X19)
359

  
360
/*Euler data registers*/
361
#define BNO055_EULER_H_LSB_ADDR         (0X1A)
362
#define BNO055_EULER_H_MSB_ADDR         (0X1B)
363

  
364
#define BNO055_EULER_R_LSB_ADDR         (0X1C)
365
#define BNO055_EULER_R_MSB_ADDR         (0X1D)
366

  
367
#define BNO055_EULER_P_LSB_ADDR         (0X1E)
368
#define BNO055_EULER_P_MSB_ADDR         (0X1F)
369

  
370
/*Quaternion data registers*/
371
#define BNO055_QUATERNION_DATA_W_LSB_ADDR   (0X20)
372
#define BNO055_QUATERNION_DATA_W_MSB_ADDR   (0X21)
373
#define BNO055_QUATERNION_DATA_X_LSB_ADDR   (0X22)
374
#define BNO055_QUATERNION_DATA_X_MSB_ADDR   (0X23)
375
#define BNO055_QUATERNION_DATA_Y_LSB_ADDR   (0X24)
376
#define BNO055_QUATERNION_DATA_Y_MSB_ADDR   (0X25)
377
#define BNO055_QUATERNION_DATA_Z_LSB_ADDR   (0X26)
378
#define BNO055_QUATERNION_DATA_Z_MSB_ADDR   (0X27)
379

  
380
/* Linear acceleration data registers*/
381
#define BNO055_LINEAR_ACCEL_DATA_X_LSB_ADDR         (0X28)
382
#define BNO055_LINEAR_ACCEL_DATA_X_MSB_ADDR         (0X29)
383
#define BNO055_LINEAR_ACCEL_DATA_Y_LSB_ADDR         (0X2A)
384
#define BNO055_LINEAR_ACCEL_DATA_Y_MSB_ADDR         (0X2B)
385
#define BNO055_LINEAR_ACCEL_DATA_Z_LSB_ADDR         (0X2C)
386
#define BNO055_LINEAR_ACCEL_DATA_Z_MSB_ADDR         (0X2D)
387

  
388
/*Gravity data registers*/
389
#define BNO055_GRAVITY_DATA_X_LSB_ADDR          (0X2E)
390
#define BNO055_GRAVITY_DATA_X_MSB_ADDR          (0X2F)
391
#define BNO055_GRAVITY_DATA_Y_LSB_ADDR          (0X30)
392
#define BNO055_GRAVITY_DATA_Y_MSB_ADDR          (0X31)
393
#define BNO055_GRAVITY_DATA_Z_LSB_ADDR          (0X32)
394
#define BNO055_GRAVITY_DATA_Z_MSB_ADDR          (0X33)
395

  
396
/* Temperature data register*/
397
#define BNO055_TEMP_ADDR                    (0X34)
398

  
399
/* Status registers*/
400
#define BNO055_CALIB_STAT_ADDR              (0X35)
401
#define BNO055_SELFTEST_RESULT_ADDR         (0X36)
402
#define BNO055_INTR_STAT_ADDR               (0X37)
403
#define BNO055_SYS_CLK_STAT_ADDR            (0X38)
404
#define BNO055_SYS_STAT_ADDR                (0X39)
405
#define BNO055_SYS_ERR_ADDR                 (0X3A)
406

  
407
/* Unit selection register*/
408
#define BNO055_UNIT_SEL_ADDR                (0X3B)
409
#define BNO055_DATA_SELECT_ADDR             (0X3C)
410

  
411
/* Mode registers*/
412
#define BNO055_OPR_MODE_ADDR                (0X3D)
413
#define BNO055_PWR_MODE_ADDR                (0X3E)
414

  
415
#define BNO055_SYS_TRIGGER_ADDR             (0X3F)
416
#define BNO055_TEMP_SOURCE_ADDR             (0X40)
417
/* Axis remap registers*/
418
#define BNO055_AXIS_MAP_CONFIG_ADDR         (0X41)
419
#define BNO055_AXIS_MAP_SIGN_ADDR           (0X42)
420

  
421
/* SIC registers*/
422
#define BNO055_SIC_MATRIX_0_LSB_ADDR        (0X43)
423
#define BNO055_SIC_MATRIX_0_MSB_ADDR        (0X44)
424
#define BNO055_SIC_MATRIX_1_LSB_ADDR        (0X45)
425
#define BNO055_SIC_MATRIX_1_MSB_ADDR        (0X46)
426
#define BNO055_SIC_MATRIX_2_LSB_ADDR        (0X47)
427
#define BNO055_SIC_MATRIX_2_MSB_ADDR        (0X48)
428
#define BNO055_SIC_MATRIX_3_LSB_ADDR        (0X49)
429
#define BNO055_SIC_MATRIX_3_MSB_ADDR        (0X4A)
430
#define BNO055_SIC_MATRIX_4_LSB_ADDR        (0X4B)
431
#define BNO055_SIC_MATRIX_4_MSB_ADDR        (0X4C)
432
#define BNO055_SIC_MATRIX_5_LSB_ADDR        (0X4D)
433
#define BNO055_SIC_MATRIX_5_MSB_ADDR        (0X4E)
434
#define BNO055_SIC_MATRIX_6_LSB_ADDR        (0X4F)
435
#define BNO055_SIC_MATRIX_6_MSB_ADDR        (0X50)
436
#define BNO055_SIC_MATRIX_7_LSB_ADDR        (0X51)
437
#define BNO055_SIC_MATRIX_7_MSB_ADDR        (0X52)
438
#define BNO055_SIC_MATRIX_8_LSB_ADDR        (0X53)
439
#define BNO055_SIC_MATRIX_8_MSB_ADDR        (0X54)
440

  
441
/* Accelerometer Offset registers*/
442
#define BNO055_ACCEL_OFFSET_X_LSB_ADDR              (0X55)
443
#define BNO055_ACCEL_OFFSET_X_MSB_ADDR              (0X56)
444
#define BNO055_ACCEL_OFFSET_Y_LSB_ADDR              (0X57)
445
#define BNO055_ACCEL_OFFSET_Y_MSB_ADDR              (0X58)
446
#define BNO055_ACCEL_OFFSET_Z_LSB_ADDR              (0X59)
447
#define BNO055_ACCEL_OFFSET_Z_MSB_ADDR              (0X5A)
448

  
449
/* Magnetometer Offset registers*/
450
#define BNO055_MAG_OFFSET_X_LSB_ADDR                (0X5B)
451
#define BNO055_MAG_OFFSET_X_MSB_ADDR                (0X5C)
452
#define BNO055_MAG_OFFSET_Y_LSB_ADDR                (0X5D)
453
#define BNO055_MAG_OFFSET_Y_MSB_ADDR                (0X5E)
454
#define BNO055_MAG_OFFSET_Z_LSB_ADDR                (0X5F)
455
#define BNO055_MAG_OFFSET_Z_MSB_ADDR                (0X60)
456

  
457
/* Gyroscope Offset registers*/
458
#define BNO055_GYRO_OFFSET_X_LSB_ADDR               (0X61)
459
#define BNO055_GYRO_OFFSET_X_MSB_ADDR               (0X62)
460
#define BNO055_GYRO_OFFSET_Y_LSB_ADDR               (0X63)
461
#define BNO055_GYRO_OFFSET_Y_MSB_ADDR               (0X64)
462
#define BNO055_GYRO_OFFSET_Z_LSB_ADDR               (0X65)
463
#define BNO055_GYRO_OFFSET_Z_MSB_ADDR               (0X66)
464

  
465
/* Radius registers*/
466
#define BNO055_ACCEL_RADIUS_LSB_ADDR                (0X67)
467
#define BNO055_ACCEL_RADIUS_MSB_ADDR                (0X68)
468
#define BNO055_MAG_RADIUS_LSB_ADDR                  (0X69)
469
#define BNO055_MAG_RADIUS_MSB_ADDR                  (0X6A)
470
/* PAGE0 REGISTERS DEFINITION END*/
471

  
472
/* PAGE1 REGISTERS DEFINITION START*/
473
/* Configuration registers*/
474
#define BNO055_ACCEL_CONFIG_ADDR                (0X08)
475
#define BNO055_MAG_CONFIG_ADDR                  (0X09)
476
#define BNO055_GYRO_CONFIG_ADDR                 (0X0A)
477
#define BNO055_GYRO_MODE_CONFIG_ADDR            (0X0B)
478
#define BNO055_ACCEL_SLEEP_CONFIG_ADDR          (0X0C)
479
#define BNO055_GYRO_SLEEP_CONFIG_ADDR           (0X0D)
480
#define BNO055_MAG_SLEEP_CONFIG_ADDR            (0x0E)
481

  
482
/* Interrupt registers*/
483
#define BNO055_INT_MASK_ADDR                    (0X0F)
484
#define BNO055_INT_ADDR                         (0X10)
485
#define BNO055_ACCEL_ANY_MOTION_THRES_ADDR      (0X11)
486
#define BNO055_ACCEL_INTR_SETTINGS_ADDR         (0X12)
487
#define BNO055_ACCEL_HIGH_G_DURN_ADDR           (0X13)
488
#define BNO055_ACCEL_HIGH_G_THRES_ADDR          (0X14)
489
#define BNO055_ACCEL_NO_MOTION_THRES_ADDR       (0X15)
490
#define BNO055_ACCEL_NO_MOTION_SET_ADDR         (0X16)
491
#define BNO055_GYRO_INTR_SETING_ADDR            (0X17)
492
#define BNO055_GYRO_HIGHRATE_X_SET_ADDR         (0X18)
493
#define BNO055_GYRO_DURN_X_ADDR                 (0X19)
494
#define BNO055_GYRO_HIGHRATE_Y_SET_ADDR         (0X1A)
495
#define BNO055_GYRO_DURN_Y_ADDR                 (0X1B)
496
#define BNO055_GYRO_HIGHRATE_Z_SET_ADDR         (0X1C)
497
#define BNO055_GYRO_DURN_Z_ADDR                 (0X1D)
498
#define BNO055_GYRO_ANY_MOTION_THRES_ADDR       (0X1E)
499
#define BNO055_GYRO_ANY_MOTION_SET_ADDR         (0X1F)
500
/* PAGE1 REGISTERS DEFINITION END*/
501

  
502
#define BNO055_MDELAY_DATA_TYPE     u32
503

  
504
/*< This refers BNO055 return type as s8 */
505
#define BNO055_RETURN_FUNCTION_TYPE s8
506

  
507
/* Compile switch definition for Float and double*/
508
#define BNO055_FLOAT_ENABLE
509
#define BNO055_DOUBLE_ENABLE
510
/**************************************************************/
511
/**\name    STRUCTURE DEFINITIONS                         */
512
/**************************************************************/
513
/*!
514
 *   @brief bno055 struct
515
 */
516
struct bno055_t {
517
    u8 chip_id;/**< chip_id of bno055 */
518
    u16 sw_rev_id;/**< software revision id of bno055 */
519
    u8 page_id;/**< page_id of bno055 */
520
    u8 accel_rev_id;/**< accel revision id of bno055 */
521
    u8 mag_rev_id;/**< mag revision id of bno055 */
522
    u8 gyro_rev_id;/**< gyro revision id of bno055 */
523
    u8 bl_rev_id;/**< boot loader revision id of bno055 */
524
    u8 dev_addr;/**< i2c device address of bno055 */
525
    BNO055_WR_FUNC_PTR;/**< bus write function pointer */
526
    BNO055_RD_FUNC_PTR;/**<bus read function pointer */
527
    void (*delay_msec)(BNO055_MDELAY_DATA_TYPE);/**< delay function pointer */
528
};
529
/*!
530
 * @brief struct for accel data read from registers
531
 */
532
struct bno055_accel_t {
533
    s16 x;/**< accel x data */
534
    s16 y;/**< accel y data */
535
    s16 z;/**< accel z data */
536
};
537
/*!
538
 * @brief struct for Mag data read from registers
539
 */
540
struct bno055_mag_t {
541
    s16 x;/**< mag x data */
542
    s16 y;/**< mag y data */
543
    s16 z;/**< mag z data */
544
};
545
/*!
546
 * @brief struct for Gyro data read from registers
547
 */
548
struct bno055_gyro_t {
549
    s16 x;/**< gyro x data */
550
    s16 y;/**< gyro y data */
551
    s16 z;/**< gyro z data */
552
};
553
/*!
554
 * @brief struct for Euler data read from registers
555
 */
556
struct bno055_euler_t {
557
    s16 h;/**< Euler h data */
558
    s16 r;/**< Euler r data */
559
    s16 p;/**< Euler p data */
560
};
561
/*!
562
 * @brief struct for Quaternion data read from registers
563
 */
564
struct bno055_quaternion_t {
565
    s16 w;/**< Quaternion w data */
566
    s16 x;/**< Quaternion x data */
567
    s16 y;/**< Quaternion y data */
568
    s16 z;/**< Quaternion z data */
569
};
570
/*!
571
 * @brief struct for Linear Accel data read from registers
572
 */
573
struct bno055_linear_accel_t {
574
    s16 x; /**< Linear Accel x data */
575
    s16 y; /**< Linear Accel y data */
576
    s16 z; /**< Linear Accel z data */
577
};
578
/*!
579
 * @brief struct for Gravity data read from registers
580
 */
581
struct bno055_gravity_t {
582
    s16 x;/**< Gravity x data */
583
    s16 y;/**< Gravity y data */
584
    s16 z;/**< Gravity z data */
585
};
586
#ifdef  BNO055_DOUBLE_ENABLE
587
/*!
588
 * @brief struct for Accel-output data of precision double
589
 */
590
struct bno055_accel_double_t {
591
    double x;/**< Accel x double data */
592
    double y;/**< Accel y double data */
593
    double z;/**< Accel z double data */
594
};
595
/*!
596
 * @brief struct for Mag-output data of precision double
597
 */
598
struct bno055_mag_double_t {
599
    double x;/**< Mag x double data */
600
    double y;/**< Mag y double data */
601
    double z;/**< Mag z double data */
602
};
603
/*!
604
 * @brief struct for Gyro-output data of precision double
605
 */
606
struct bno055_gyro_double_t {
607
    double x;/**< Gyro x double data */
608
    double y;/**< Gyro y double data */
609
    double z;/**< Gyro z double data */
610
};
611
/*!
612
 * @brief struct for Euler-output data of precision double
613
 */
614
struct bno055_euler_double_t {
615
    double h;/**< Euler h double data */
616
    double r;/**< Euler r double data */
617
    double p;/**< Euler p double data */
618
};
619
/*!
620
 * @brief struct for Linear Accel-output data of precision double
621
 */
622
struct bno055_linear_accel_double_t {
623
    double x;/**< linear accel x double data */
624
    double y;/**< linear accel y double data */
625
    double z;/**< linear accel z double data */
626
};
627
/*!
628
 * @brief struct for Gravity-output data of precision double
629
 */
630
struct bno055_gravity_double_t {
631
    double x;/**< Gravity x double data */
632
    double y;/**< Gravity y double data */
633
    double z;/**< Gravity z double data */
634
};
635
#endif
636
#ifdef  BNO055_FLOAT_ENABLE
637
/*!
638
 * @brief struct for Accel-output data of precision float
639
 */
640
struct bno055_accel_float_t {
641
    float x;/**< accel x float data */
642
    float y;/**< accel y float data */
643
    float z;/**< accel z float data */
644
};
645
/*!
646
 * @brief struct for Mag-output data of precision float
647
 */
648
struct bno055_mag_float_t {
649
    float x;/**< Mag x float data */
650
    float y;/**< Mag y float data */
651
    float z;/**< Mag z float data */
652
};
653
/*!
654
 * @brief struct for Gyro-output data of precision float
655
 */
656
struct bno055_gyro_float_t {
657
    float x;/**< Gyro x float data */
658
    float y;/**< Gyro y float data */
659
    float z;/**< Gyro z float data */
660
};
661
/*!
662
 * @brief struct for Euler-output data of precision float
663
 */
664
struct bno055_euler_float_t {
665
    float h;/**< Euler h float data */
666
    float r;/**< Euler r float data */
667
    float p;/**< Euler p float data */
668
};
669
/*!
670
 * @brief struct for Linear accel-output data of precision float
671
 */
672
struct bno055_linear_accel_float_t {
673
    float x;/**< Linear accel x float data */
674
    float y;/**< Linear accel y float data */
675
    float z;/**< Linear accel z float data */
676
};
677
/*!
678
 * @brief struct for Gravity-output data of precision float
679
 */
680
struct bno055_gravity_float_t {
681
    float x;/**< Gravity x float data */
682
    float y;/**< Gravity y float data */
683
    float z;/**< Gravity z float data */
684
};
685
#endif
686
/*!
687
 * @brief struct for Accel offset
688
 */
689
struct bno055_accel_offset_t {
690
    s16 x;/**< Accel offset x data */
691
    s16 y;/**< Accel offset y data */
692
    s16 z;/**< Accel offset z data */
693
    s16 r;/**< Accel radius r data */
694
};
695
/*!
696
 * @brief struct for Gyro offset
697
 */
698
struct bno055_gyro_offset_t {
699
    s16 x;/**< Gyro offset x data */
700
    s16 y;/**< Gyro offset y data */
701
    s16 z;/**< Gyro offset z data */
702
};
703
/*!
704
 * @brief struct for Mag offset
705
 */
706
struct bno055_mag_offset_t {
707
    s16 x;/**< Mag offset x data */
708
    s16 y;/**< Mag offset y data */
709
    s16 z;/**< Mag offset z data */
710
    s16 r;/**< Mag radius x data */
711
};
712
/*!
713
 * @brief struct for soft iron calibration matrix
714
 */
715
struct bno055_sic_matrix_t {
716
    s16 sic_0;/**< soft iron calibration matrix 0 data */
717
    s16 sic_1;/**< soft iron calibration matrix 1 data */
718
    s16 sic_2;/**< soft iron calibration matrix 2 data */
719
    s16 sic_3;/**< soft iron calibration matrix 3 data */
720
    s16 sic_4;/**< soft iron calibration matrix 4 data */
721
    s16 sic_5;/**< soft iron calibration matrix 5 data */
722
    s16 sic_6;/**< soft iron calibration matrix 6 data */
723
    s16 sic_7;/**< soft iron calibration matrix 7 data */
724
    s16 sic_8;/**< soft iron calibration matrix 8 data */
725
};
726
/***************************************************/
727
/**\name    CONSTANT DEFINITIONS                   */
728
/***************************************************/
729
#define  BNO055_INIT_VALUE                      ((u8)0)
730
#define  BNO055_GEN_READ_WRITE_LENGTH           ((u8)1)
731
#define  BNO055_LSB_MSB_READ_LENGTH             ((u8)2)
732
#define  BNO055_MAG_POWER_MODE_RANGE            ((u8)4)
733
#define  BNO055_MAG_OPR_MODE_RANGE              ((u8)5)
734
#define  BNO055_ACCEL_POWER_MODE_RANGE          ((u8)6)
735
#define  BNO055_ACCEL_SLEEP_DURATION_RANGE      ((u8)16)
736
#define  BNO055_GYRO_AUTO_SLEEP_DURATION_RANGE  ((u8)8)
737
#define  BNO055_ACCEL_GYRO_BW_RANGE     ((u8)8)
738
#define  BNO055_MAG_OUTPUT_RANGE        ((u8)8)
739
#define  BNO055_ACCEL_RANGE             ((u8)5)
740
#define  BNO055_SHIFT_EIGHT_BITS        ((u8)8)
741
#define  BNO055_GYRO_RANGE              ((u8)5)
742
#define  BNO055_ACCEL_SLEEP_MODE_RANGE  ((u8)2)
743
/*  BNO055 API BNO055_ERROR codes */
744
#define BNO055_E_NULL_PTR   ((s8)-127)
745
#define BNO055_OUT_OF_RANGE ((s8)-2)
746
#define BNO055_SUCCESS      ((u8)0)
747
#define BNO055_ERROR        ((s8)-1)
748

  
749
/* Selection for bit enable and disable */
750
#define BNO055_BIT_ENABLE       (0x01)
751
#define BNO055_BIT_DISABLE      (0x00)
752

  
753
/* Page ID */
754
#define BNO055_PAGE_ZERO        (0X00)
755
#define BNO055_PAGE_ONE         (0X01)
756

  
757
/* Enable the temperature source */
758
#define BNO055_ACCEL_TEMP_EN    (0x00)
759
#define BNO055_GYRO_TEMP_EN     (0x01)
760
#define BNO055_MCU_TEMP_EN      (0x03)
761

  
762
/*Accel unit*/
763
#define BNO055_ACCEL_UNIT_MSQ   (0x00)
764
#define BNO055_ACCEL_UNIT_MG    (0x01)
765

  
766
/*Gyro unit*/
767
#define BNO055_GYRO_UNIT_DPS    (0x00)
768
#define BNO055_GYRO_UNIT_RPS    (0x01)
769

  
770
/* Euler unit*/
771
#define BNO055_EULER_UNIT_DEG   (0x00)
772
#define BNO055_EULER_UNIT_RAD   (0x01)
773

  
774
/*Temperature unit*/
775
#define BNO055_TEMP_UNIT_CELSIUS        (0x00)
776
#define BNO055_TEMP_UNIT_FAHRENHEIT     (0x01)
777

  
778
/*Accel division factor*/
779
#define BNO055_ACCEL_DIV_MSQ    (100.0)
780
#define BNO055_ACCEL_DIV_MG     (1)
781

  
782
/*Mag division factor*/
783
#define BNO055_MAG_DIV_UT   (16.0)
784

  
785
/*Gyro division factor*/
786
#define BNO055_GYRO_DIV_DPS     (16.0)
787
#define BNO055_GYRO_DIV_RPS     (900.0)
788

  
789
/*Euler division factor*/
790
#define BNO055_EULER_DIV_DEG        (16.0)
791
#define BNO055_EULER_DIV_RAD        (900.0)
792

  
793
/*Linear accel division factor*/
794
#define BNO055_LINEAR_ACCEL_DIV_MSQ (100.0)
795

  
796
/*Gravity accel division factor*/
797
#define BNO055_GRAVITY_DIV_MSQ  (100.0)
798

  
799
/* Temperature division factor*/
800
#define BNO055_TEMP_DIV_FAHRENHEIT  (0.5)
801
#define BNO055_TEMP_DIV_CELSIUS     (1)
802

  
803
#define BNO055_MODE_SWITCHING_DELAY        (600)
804
#define BNO055_CONFIG_MODE_SWITCHING_DELAY ((u8)20)
805

  
806
/* Operation mode settings*/
807
#define BNO055_OPERATION_MODE_CONFIG            (0X00)
808
#define BNO055_OPERATION_MODE_ACCONLY           (0X01)
809
#define BNO055_OPERATION_MODE_MAGONLY           (0X02)
810
#define BNO055_OPERATION_MODE_GYRONLY           (0X03)
811
#define BNO055_OPERATION_MODE_ACCMAG            (0X04)
812
#define BNO055_OPERATION_MODE_ACCGYRO           (0X05)
813
#define BNO055_OPERATION_MODE_MAGGYRO           (0X06)
814
#define BNO055_OPERATION_MODE_AMG               (0X07)
815
#define BNO055_OPERATION_MODE_IMUPLUS           (0X08)
816
#define BNO055_OPERATION_MODE_COMPASS           (0X09)
817
#define BNO055_OPERATION_MODE_M4G               (0X0A)
818
#define BNO055_OPERATION_MODE_NDOF_FMC_OFF      (0X0B)
819
#define BNO055_OPERATION_MODE_NDOF              (0X0C)
820

  
821
/* Power mode*/
822
#define BNO055_POWER_MODE_NORMAL    (0X00)
823
#define BNO055_POWER_MODE_LOWPOWER  (0X01)
824
#define BNO055_POWER_MODE_SUSPEND   (0X02)
825

  
826
/* PAGE-1 definitions*/
827
/* Accel Range */
828

  
829
#define BNO055_ACCEL_RANGE_2G       (0X00)
830
#define BNO055_ACCEL_RANGE_4G       (0X01)
831
#define BNO055_ACCEL_RANGE_8G       (0X02)
832
#define BNO055_ACCEL_RANGE_16G      (0X03)
833

  
834
/* Accel Bandwidth*/
835
#define BNO055_ACCEL_BW_7_81HZ      (0x00)
836
#define BNO055_ACCEL_BW_15_63HZ     (0x01)
837
#define BNO055_ACCEL_BW_31_25HZ     (0x02)
838
#define BNO055_ACCEL_BW_62_5HZ      (0X03)
839
#define BNO055_ACCEL_BW_125HZ       (0X04)
840
#define BNO055_ACCEL_BW_250HZ       (0X05)
841
#define BNO055_ACCEL_BW_500HZ       (0X06)
842
#define BNO055_ACCEL_BW_1000HZ      (0X07)
843

  
844
/* Accel Power mode*/
845
#define BNO055_ACCEL_NORMAL         (0X00)
846
#define BNO055_ACCEL_SUSPEND        (0X01)
847
#define BNO055_ACCEL_LOWPOWER_1     (0X02)
848
#define BNO055_ACCEL_STANDBY        (0X03)
849
#define BNO055_ACCEL_LOWPOWER_2     (0X04)
850
#define BNO055_ACCEL_DEEPSUSPEND    (0X05)
851

  
852
/* Mag data output rate*/
853
#define BNO055_MAG_DATA_OUTRATE_2HZ         (0X00)
854
#define BNO055_MAG_DATA_OUTRATE_6HZ         (0X01)
855
#define BNO055_MAG_DATA_OUTRATE_8HZ         (0X02)
856
#define BNO055_MAG_DATA_OUTRATE_10HZ        (0X03)
857
#define BNO055_MAG_DATA_OUTRATE_15HZ        (0X04)
858
#define BNO055_MAG_DATA_OUTRATE_20HZ        (0X05)
859
#define BNO055_MAG_DATA_OUTRATE_25HZ        (0X06)
860
#define BNO055_MAG_DATA_OUTRATE_30HZ        (0X07)
861

  
862
/* Mag Operation mode*/
863
#define BNO055_MAG_OPERATION_MODE_LOWPOWER              (0X00)
864
#define BNO055_MAG_OPERATION_MODE_REGULAR               (0X01)
865
#define BNO055_MAG_OPERATION_MODE_ENHANCED_REGULAR      (0X02)
866
#define BNO055_MAG_OPERATION_MODE_HIGH_ACCURACY         (0X03)
867

  
868
/* Mag power mode*/
869
#define BNO055_MAG_POWER_MODE_NORMAL            (0X00)
870
#define BNO055_MAG_POWER_MODE_SLEEP             (0X01)
871
#define BNO055_MAG_POWER_MODE_SUSPEND           (0X02)
872
#define BNO055_MAG_POWER_MODE_FORCE_MODE        (0X03)
873

  
874
/* Gyro range*/
875
#define BNO055_GYRO_RANGE_2000DPS       (0x00)
876
#define BNO055_GYRO_RANGE_1000DPS       (0x01)
877
#define BNO055_GYRO_RANGE_500DPS        (0x02)
878
#define BNO055_GYRO_RANGE_250DPS        (0x03)
879
#define BNO055_GYRO_RANGE_125DPS        (0x04)
880

  
881
/* Gyro Bandwidth*/
882
#define BNO055_GYRO_BW_523HZ    (0x00)
883
#define BNO055_GYRO_BW_230HZ    (0x01)
884
#define BNO055_GYRO_BW_116HZ    (0x02)
885
#define BNO055_GYRO_BW_47HZ     (0x03)
886
#define BNO055_GYRO_BW_23HZ     (0x04)
887
#define BNO055_GYRO_BW_12HZ     (0x05)
888
#define BNO055_GYRO_BW_64HZ     (0x06)
889
#define BNO055_GYRO_BW_32HZ     (0x07)
890

  
891
/* Gyro power mode*/
892
#define BNO055_GYRO_POWER_MODE_NORMAL               (0X00)
893
#define BNO055_GYRO_POWER_MODE_FASTPOWERUP          (0X01)
894
#define BNO055_GYRO_POWER_MODE_DEEPSUSPEND          (0X02)
895
#define BNO055_GYRO_POWER_MODE_SUSPEND              (0X03)
896
#define BNO055_GYRO_POWER_MODE_ADVANCE_POWERSAVE    (0X04)
897

  
898
/* Accel Sleep Duration */
899
#define BNO055_ACCEL_SLEEP_DURN_0_5MS        (0x05)
900
/* sets sleep duration to 0.5 ms  */
901
#define BNO055_ACCEL_SLEEP_DURN_1MS          (0x06)
902
/* sets sleep duration to 1 ms */
903
#define BNO055_ACCEL_SLEEP_DURN_2MS          (0x07)
904
/* sets sleep duration to 2 ms */
905
#define BNO055_ACCEL_SLEEP_DURN_4MS          (0x08)
906
/* sets sleep duration to 4 ms */
907
#define BNO055_ACCEL_SLEEP_DURN_6MS          (0x09)
908
/* sets sleep duration to 6 ms*/
909
#define BNO055_ACCEL_SLEEP_DURN_10MS         (0x0A)
910
/* sets sleep duration to 10 ms */
911
#define BNO055_ACCEL_SLEEP_DURN_25MS         (0x0B)
912
/* sets sleep duration to 25 ms */
913
#define BNO055_ACCEL_SLEEP_DURN_50MS         (0x0C)
914
/* sets sleep duration to 50 ms */
915
#define BNO055_ACCEL_SLEEP_DURN_100MS        (0x0D)
916
/* sets sleep duration to 100 ms */
917
#define BNO055_ACCEL_SLEEP_DURN_500MS        (0x0E)
918
/* sets sleep duration to 500 ms */
919
#define BNO055_ACCEL_SLEEP_DURN_1S           (0x0F)
920
/* sets sleep duration to 1 s */
921

  
922
/* Gyro Auto sleep duration*/
923
#define BNO055_GYRO_No_AUTOSLPDUR       (0x00)
924
#define BNO055_GYRO_4MS_AUTOSLPDUR      (0x01)
925
#define BNO055_GYRO_5MS_AUTOSLPDUR      (0x02)
926
#define BNO055_GYRO_8MS_AUTOSLPDUR      (0x03)
927
#define BNO055_GYRO_10MS_AUTOSLPDUR     (0x04)
928
#define BNO055_GYRO_15MS_AUTOSLPDUR     (0x05)
929
#define BNO055_GYRO_20MS_AUTOSLPDUR     (0x06)
930
#define BNO055_GYRO_40MS_AUTOSLPDUR     (0x07)
931

  
932
/* Accel Any/No motion axis selection*/
933
#define BNO055_ACCEL_ANY_MOTION_NO_MOTION_X_AXIS        (0)
934
#define BNO055_ACCEL_ANY_MOTION_NO_MOTION_Y_AXIS        (1)
935
#define BNO055_ACCEL_ANY_MOTION_NO_MOTION_Z_AXIS        (2)
936

  
937
/* Accel High g axis selection*/
938
#define BNO055_ACCEL_HIGH_G_X_AXIS      (0)
939
#define BNO055_ACCEL_HIGH_G_Y_AXIS      (1)
940
#define BNO055_ACCEL_HIGH_G_Z_AXIS      (2)
941

  
942
/* Gyro Any motion axis selection*/
943
#define BNO055_GYRO_ANY_MOTION_X_AXIS       (0)
944
#define BNO055_GYRO_ANY_MOTION_Y_AXIS       (1)
945
#define BNO055_GYRO_ANY_MOTION_Z_AXIS       (2)
946

  
947
/* Gyro High rate axis selection*/
948
#define BNO055_GYRO_HIGHRATE_X_AXIS     (0)
949
#define BNO055_GYRO_HIGHRATE_Y_AXIS     (1)
950
#define BNO055_GYRO_HIGHRATE_Z_AXIS     (2)
951

  
952
/* Axis remap values*/
953
#define BNO055_REMAP_X_Y            (0X21)
954
#define BNO055_REMAP_Y_Z            (0X18)
955
#define BNO055_REMAP_Z_X            (0X06)
956
#define BNO055_REMAP_X_Y_Z_TYPE0    (0X12)
957
#define BNO055_REMAP_X_Y_Z_TYPE1    (0X09)
958
#define BNO055_DEFAULT_AXIS         (0X24)
959

  
960
/* Axis remap sign */
961
#define BNO055_REMAP_AXIS_POSITIVE  (0X00)
962
#define BNO055_REMAP_AXIS_NEGATIVE  (0X01)
963

  
964
/* Gyro anymotion and high rate filter configuration */
965
#define BNO055_GYRO_FILTERED_CONFIG     (0x00)
966
#define BNO055_GYRO_UNFILTERED_CONFIG   (0x01)
967

  
968
/* mask definitions*/
969
#define BNO055_SIC_HEX_0_0_F_F_DATA     (0x00FF)
970
/****************************************************/
971
/**\name    ARRAY SIZE DEFINITIONS      */
972
/***************************************************/
973
#define BNO055_REV_ID_SIZE                      (2)
974
#define BNO055_ACCEL_DATA_SIZE                  (2)
975
#define BNO055_ACCEL_XYZ_DATA_SIZE              (6)
976
#define BNO055_MAG_DATA_SIZE                    (2)
977
#define BNO055_MAG_XYZ_DATA_SIZE                (6)
978
#define BNO055_GYRO_DATA_SIZE                   (2)
979
#define BNO055_GYRO_XYZ_DATA_SIZE               (6)
980
#define BNO055_EULER_DATA_SIZE                  (2)
981
#define BNO055_EULER_HRP_DATA_SIZE              (6)
982
#define BNO055_QUATERNION_DATA_SIZE             (2)
983
#define BNO055_QUATERNION_WXYZ_DATA_SIZE        (8)
984
#define BNO055_GRAVITY_DATA_SIZE                (2)
985
#define BNO055_GRAVITY_XYZ_DATA_SIZE            (6)
986
#define BNO055_ACCEL_OFFSET_ARRAY               (6)
987
#define BNO055_MAG_OFFSET_ARRAY                 (6)
988
#define BNO055_GYRO_OFFSET_ARRAY                (6)
989
#define BNO055_SOFT_IRON_CALIBRATION_MATRIX_SIZE        (18)
990

  
991
/*ARRAY INDEX DEFINITIONS*/
992
#define BNO055_SW_ID_LSB                        (0)
993
#define BNO055_SW_ID_MSB                        (1)
994
#define BNO055_SENSOR_DATA_LSB                  (0)
995
#define BNO055_SENSOR_DATA_MSB                  (1)
996
#define BNO055_SENSOR_DATA_EULER_LSB            (0)
997
#define BNO055_SENSOR_DATA_EULER_MSB            (1)
998
#define BNO055_SENSOR_DATA_QUATERNION_LSB       (0)
999
#define BNO055_SENSOR_DATA_QUATERNION_MSB       (1)
1000

  
1001
#define BNO055_SENSOR_DATA_QUATERNION_WXYZ_W_LSB            (0)
1002
#define BNO055_SENSOR_DATA_QUATERNION_WXYZ_W_MSB            (1)
1003
#define BNO055_SENSOR_DATA_QUATERNION_WXYZ_X_LSB            (2)
1004
#define BNO055_SENSOR_DATA_QUATERNION_WXYZ_X_MSB            (3)
1005
#define BNO055_SENSOR_DATA_QUATERNION_WXYZ_Y_LSB            (4)
1006
#define BNO055_SENSOR_DATA_QUATERNION_WXYZ_Y_MSB            (5)
1007
#define BNO055_SENSOR_DATA_QUATERNION_WXYZ_Z_LSB            (6)
1008
#define BNO055_SENSOR_DATA_QUATERNION_WXYZ_Z_MSB            (7)
1009

  
1010
#define BNO055_SENSOR_DATA_XYZ_X_LSB                (0)
1011
#define BNO055_SENSOR_DATA_XYZ_X_MSB                (1)
1012
#define BNO055_SENSOR_DATA_XYZ_Y_LSB                (2)
1013
#define BNO055_SENSOR_DATA_XYZ_Y_MSB                (3)
1014
#define BNO055_SENSOR_DATA_XYZ_Z_LSB                (4)
1015
#define BNO055_SENSOR_DATA_XYZ_Z_MSB                (5)
1016

  
1017
#define BNO055_SENSOR_DATA_EULER_HRP_H_LSB          (0)
1018
#define BNO055_SENSOR_DATA_EULER_HRP_H_MSB          (1)
1019
#define BNO055_SENSOR_DATA_EULER_HRP_R_LSB          (2)
1020
#define BNO055_SENSOR_DATA_EULER_HRP_R_MSB          (3)
1021
#define BNO055_SENSOR_DATA_EULER_HRP_P_LSB          (4)
1022
#define BNO055_SENSOR_DATA_EULER_HRP_P_MSB          (5)
1023

  
1024
#define BNO055_SOFT_IRON_CALIB_0_LSB    (0)
1025
#define BNO055_SOFT_IRON_CALIB_0_MSB    (1)
1026
#define BNO055_SOFT_IRON_CALIB_1_LSB    (2)
1027
#define BNO055_SOFT_IRON_CALIB_1_MSB    (3)
1028
#define BNO055_SOFT_IRON_CALIB_2_LSB    (4)
1029
#define BNO055_SOFT_IRON_CALIB_2_MSB    (5)
1030
#define BNO055_SOFT_IRON_CALIB_3_LSB    (6)
1031
#define BNO055_SOFT_IRON_CALIB_3_MSB    (7)
1032
#define BNO055_SOFT_IRON_CALIB_4_LSB    (8)
1033
#define BNO055_SOFT_IRON_CALIB_4_MSB    (9)
1034
#define BNO055_SOFT_IRON_CALIB_5_LSB    (10)
1035
#define BNO055_SOFT_IRON_CALIB_5_MSB    (11)
1036
#define BNO055_SOFT_IRON_CALIB_6_LSB    (12)
1037
#define BNO055_SOFT_IRON_CALIB_6_MSB    (13)
1038
#define BNO055_SOFT_IRON_CALIB_7_LSB    (14)
1039
#define BNO055_SOFT_IRON_CALIB_7_MSB    (15)
1040
#define BNO055_SOFT_IRON_CALIB_8_LSB    (16)
1041
#define BNO055_SOFT_IRON_CALIB_8_MSB    (17)
1042

  
1043
#define BNO055_SENSOR_OFFSET_DATA_X_LSB (0)
1044
#define BNO055_SENSOR_OFFSET_DATA_X_MSB (1)
1045
#define BNO055_SENSOR_OFFSET_DATA_Y_LSB (2)
1046
#define BNO055_SENSOR_OFFSET_DATA_Y_MSB (3)
1047
#define BNO055_SENSOR_OFFSET_DATA_Z_LSB (4)
1048
#define BNO055_SENSOR_OFFSET_DATA_Z_MSB (5)
1049

  
1050
#define BNO055_OFFSET_RADIUS_LSB (0)
1051
#define BNO055_OFFSET_RADIUS_MSB (1)
1052
/*********************************************************/
1053
/**\name PAGE0 DATA REGISTERS DEFINITION */
1054
/*********************************************************/
1055
/* Chip ID */
1056
#define BNO055_CHIP_ID_POS             (0)
1057
#define BNO055_CHIP_ID_MSK             (0xFF)
1058
#define BNO055_CHIP_ID_LEN             (8)
1059
#define BNO055_CHIP_ID_REG             BNO055_CHIP_ID_ADDR
1060

  
1061
/* Accel revision id*/
1062
#define BNO055_ACCEL_REV_ID_POS             (0)
1063
#define BNO055_ACCEL_REV_ID_MSK             (0xFF)
1064
#define BNO055_ACCEL_REV_ID_LEN             (8)
1065
#define BNO055_ACCEL_REV_ID_REG             BNO055_ACCEL_REV_ID_ADDR
1066

  
1067
/* Mag revision id*/
1068
#define BNO055_MAG_REV_ID_POS             (0)
1069
#define BNO055_MAG_REV_ID_MSK             (0xFF)
1070
#define BNO055_MAG_REV_ID_LEN             (8)
1071
#define BNO055_MAG_REV_ID_REG             BNO055_MAG_REV_ID_ADDR
1072

  
1073
/* Gyro revision id*/
1074
#define BNO055_GYRO_REV_ID_POS             (0)
1075
#define BNO055_GYRO_REV_ID_MSK             (0xFF)
1076
#define BNO055_GYRO_REV_ID_LEN             (8)
1077
#define BNO055_GYRO_REV_ID_REG             BNO055_GYRO_REV_ID_ADDR
1078

  
1079
/*Software revision id LSB*/
1080
#define BNO055_SW_REV_ID_LSB_POS             (0)
1081
#define BNO055_SW_REV_ID_LSB_MSK             (0xFF)
1082
#define BNO055_SW_REV_ID_LSB_LEN             (8)
1083
#define BNO055_SW_REV_ID_LSB_REG             BNO055_SW_REV_ID_LSB_ADDR
1084

  
1085
/*Software revision id MSB*/
1086
#define BNO055_SW_REV_ID_MSB_POS             (0)
1087
#define BNO055_SW_REV_ID_MSB_MSK             (0xFF)
1088
#define BNO055_SW_REV_ID_MSB_LEN             (8)
1089
#define BNO055_SW_REV_ID_MSB_REG             BNO055_SW_REV_ID_MSB_ADDR
1090

  
1091
/* BOOTLODER revision id*/
1092
#define BNO055_BL_REV_ID_POS             (0)
1093
#define BNO055_BL_REV_ID_MSK             (0xFF)
1094
#define BNO055_BL_REV_ID_LEN             (8)
1095
#define BNO055_BL_REV_ID_REG             BNO055_BL_REV_ID_ADDR
1096

  
1097
/*Page id*/
1098
#define BNO055_PAGE_ID_POS             (0)
1099
#define BNO055_PAGE_ID_MSK             (0xFF)
1100
#define BNO055_PAGE_ID_LEN             (8)
1101
#define BNO055_PAGE_ID_REG             BNO055_PAGE_ID_ADDR
1102

  
1103
/* Accel data X-LSB register*/
1104
#define BNO055_ACCEL_DATA_X_LSB_VALUEX_POS             (0)
1105
#define BNO055_ACCEL_DATA_X_LSB_VALUEX_MSK             (0xFF)
1106
#define BNO055_ACCEL_DATA_X_LSB_VALUEX_LEN             (8)
1107
#define BNO055_ACCEL_DATA_X_LSB_VALUEX_REG             \
1108
BNO055_ACCEL_DATA_X_LSB_ADDR
1109

  
1110
/* Accel data X-MSB register*/
1111
#define BNO055_ACCEL_DATA_X_MSB_VALUEX_POS             (0)
1112
#define BNO055_ACCEL_DATA_X_MSB_VALUEX_MSK             (0xFF)
1113
#define BNO055_ACCEL_DATA_X_MSB_VALUEX_LEN             (8)
1114
#define BNO055_ACCEL_DATA_X_MSB_VALUEX_REG             \
1115
BNO055_ACCEL_DATA_X_MSB_ADDR
1116

  
1117
/* Accel data Y-LSB register*/
1118
#define BNO055_ACCEL_DATA_Y_LSB_VALUEY_POS             (0)
1119
#define BNO055_ACCEL_DATA_Y_LSB_VALUEY_MSK             (0xFF)
1120
#define BNO055_ACCEL_DATA_Y_LSB_VALUEY_LEN             (8)
1121
#define BNO055_ACCEL_DATA_Y_LSB_VALUEY_REG             \
1122
BNO055_ACCEL_DATA_Y_LSB_ADDR
1123

  
1124
/* Accel data Y-MSB register*/
1125
#define BNO055_ACCEL_DATA_Y_MSB_VALUEY_POS             (0)
1126
#define BNO055_ACCEL_DATA_Y_MSB_VALUEY_MSK             (0xFF)
1127
#define BNO055_ACCEL_DATA_Y_MSB_VALUEY_LEN             (8)
1128
#define BNO055_ACCEL_DATA_Y_MSB_VALUEY_REG             \
1129
BNO055_ACCEL_DATA_Y_MSB_ADDR
1130

  
1131
/* Accel data Z-LSB register*/
1132
#define BNO055_ACCEL_DATA_Z_LSB_VALUEZ_POS      (0)
1133
#define BNO055_ACCEL_DATA_Z_LSB_VALUEZ_MSK      (0xFF)
1134
#define BNO055_ACCEL_DATA_Z_LSB_VALUEZ_LEN      (8)
1135
#define BNO055_ACCEL_DATA_Z_LSB_VALUEZ_REG     \
1136
BNO055_ACCEL_DATA_Z_LSB_ADDR
1137

  
1138
/* Accel data Z-MSB register*/
1139
#define BNO055_ACCEL_DATA_Z_MSB_VALUEZ_POS      (0)
1140
#define BNO055_ACCEL_DATA_Z_MSB_VALUEZ_MSK      (0xFF)
1141
#define BNO055_ACCEL_DATA_Z_MSB_VALUEZ_LEN      (8)
1142
#define BNO055_ACCEL_DATA_Z_MSB_VALUEZ_REG     \
1143
BNO055_ACCEL_DATA_Z_MSB_ADDR
1144

  
1145
/* Mag data X-LSB register*/
1146
#define BNO055_MAG_DATA_X_LSB_VALUEX_POS             (0)
1147
#define BNO055_MAG_DATA_X_LSB_VALUEX_MSK             (0xFF)
1148
#define BNO055_MAG_DATA_X_LSB_VALUEX_LEN             (8)
1149
#define BNO055_MAG_DATA_X_LSB_VALUEX_REG             \
1150
BNO055_MAG_DATA_X_LSB_ADDR
1151

  
1152
/* Mag data X-MSB register*/
1153
#define BNO055_MAG_DATA_X_MSB_VALUEX_POS             (0)
1154
#define BNO055_MAG_DATA_X_MSB_VALUEX_MSK             (0xFF)
1155
#define BNO055_MAG_DATA_X_MSB_VALUEX_LEN             (8)
1156
#define BNO055_MAG_DATA_X_MSB_VALUEX_REG             BNO055_MAG_DATA_X_MSB_ADDR
1157

  
1158
/* Mag data Y-LSB register*/
1159
#define BNO055_MAG_DATA_Y_LSB_VALUEY_POS             (0)
1160
#define BNO055_MAG_DATA_Y_LSB_VALUEY_MSK             (0xFF)
1161
#define BNO055_MAG_DATA_Y_LSB_VALUEY_LEN             (8)
1162
#define BNO055_MAG_DATA_Y_LSB_VALUEY_REG             BNO055_MAG_DATA_Y_LSB_ADDR
1163

  
1164
/* Mag data Y-MSB register*/
1165
#define BNO055_MAG_DATA_Y_MSB_VALUEY_POS             (0)
1166
#define BNO055_MAG_DATA_Y_MSB_VALUEY_MSK             (0xFF)
1167
#define BNO055_MAG_DATA_Y_MSB_VALUEY_LEN             (8)
1168
#define BNO055_MAG_DATA_Y_MSB_VALUEY_REG             BNO055_MAG_DATA_Y_MSB_ADDR
1169

  
1170
/* Mag data Z-LSB register*/
1171
#define BNO055_MAG_DATA_Z_LSB_VALUEZ_POS             (0)
1172
#define BNO055_MAG_DATA_Z_LSB_VALUEZ_MSK             (0xFF)
1173
#define BNO055_MAG_DATA_Z_LSB_VALUEZ_LEN             (8)
1174
#define BNO055_MAG_DATA_Z_LSB_VALUEZ_REG             BNO055_MAG_DATA_Z_LSB_ADDR
1175

  
1176
/* Mag data Z-MSB register*/
1177
#define BNO055_MAG_DATA_Z_MSB_VALUEZ_POS             (0)
1178
#define BNO055_MAG_DATA_Z_MSB_VALUEZ_MSK             (0xFF)
1179
#define BNO055_MAG_DATA_Z_MSB_VALUEZ_LEN             (8)
1180
#define BNO055_MAG_DATA_Z_MSB_VALUEZ_REG             BNO055_MAG_DATA_Z_MSB_ADDR
1181

  
1182
/* Gyro data X-LSB register*/
1183
#define BNO055_GYRO_DATA_X_LSB_VALUEX_POS   (0)
1184
#define BNO055_GYRO_DATA_X_LSB_VALUEX_MSK   (0xFF)
1185
#define BNO055_GYRO_DATA_X_LSB_VALUEX_LEN   (8)
1186
#define BNO055_GYRO_DATA_X_LSB_VALUEX_REG   BNO055_GYRO_DATA_X_LSB_ADDR
1187

  
1188
/* Gyro data X-MSB register*/
1189
#define BNO055_GYRO_DATA_X_MSB_VALUEX_POS   (0)
1190
#define BNO055_GYRO_DATA_X_MSB_VALUEX_MSK   (0xFF)
1191
#define BNO055_GYRO_DATA_X_MSB_VALUEX_LEN   (8)
1192
#define BNO055_GYRO_DATA_X_MSB_VALUEX_REG   BNO055_GYRO_DATA_X_MSB_ADDR
1193

  
1194
/* Gyro data Y-LSB register*/
1195
#define BNO055_GYRO_DATA_Y_LSB_VALUEY_POS   (0)
1196
#define BNO055_GYRO_DATA_Y_LSB_VALUEY_MSK   (0xFF)
1197
#define BNO055_GYRO_DATA_Y_LSB_VALUEY_LEN   (8)
1198
#define BNO055_GYRO_DATA_Y_LSB_VALUEY_REG   BNO055_GYRO_DATA_Y_LSB_ADDR
1199

  
1200
/* Gyro data Y-MSB register*/
1201
#define BNO055_GYRO_DATA_Y_MSB_VALUEY_POS   (0)
1202
#define BNO055_GYRO_DATA_Y_MSB_VALUEY_MSK   (0xFF)
1203
#define BNO055_GYRO_DATA_Y_MSB_VALUEY_LEN   (8)
1204
#define BNO055_GYRO_DATA_Y_MSB_VALUEY_REG   BNO055_GYRO_DATA_Y_MSB_ADDR
1205

  
1206
/* Gyro data Z-LSB register*/
1207
#define BNO055_GYRO_DATA_Z_LSB_VALUEZ_POS   (0)
1208
#define BNO055_GYRO_DATA_Z_LSB_VALUEZ_MSK   (0xFF)
1209
#define BNO055_GYRO_DATA_Z_LSB_VALUEZ_LEN   (8)
1210
#define BNO055_GYRO_DATA_Z_LSB_VALUEZ_REG   BNO055_GYRO_DATA_Z_LSB_ADDR
1211

  
1212
/* Gyro data Z-MSB register*/
1213
#define BNO055_GYRO_DATA_Z_MSB_VALUEZ_POS   (0)
1214
#define BNO055_GYRO_DATA_Z_MSB_VALUEZ_MSK   (0xFF)
1215
#define BNO055_GYRO_DATA_Z_MSB_VALUEZ_LEN   (8)
1216
#define BNO055_GYRO_DATA_Z_MSB_VALUEZ_REG   BNO055_GYRO_DATA_Z_MSB_ADDR
1217

  
1218
/* Euler data HEADING-LSB register*/
1219
#define BNO055_EULER_H_LSB_VALUEH_POS   (0)
1220
#define BNO055_EULER_H_LSB_VALUEH_MSK   (0xFF)
1221
#define BNO055_EULER_H_LSB_VALUEH_LEN   (8)
1222
#define BNO055_EULER_H_LSB_VALUEH_REG  BNO055_EULER_H_LSB_ADDR
1223

  
1224
/* Euler data HEADING-MSB register*/
1225
#define BNO055_EULER_H_MSB_VALUEH_POS  (0)
1226
#define BNO055_EULER_H_MSB_VALUEH_MSK  (0xFF)
1227
#define BNO055_EULER_H_MSB_VALUEH_LEN  (8)
1228
#define BNO055_EULER_H_MSB_VALUEH_REG  BNO055_EULER_H_MSB_ADDR
1229

  
1230
/* Euler data ROLL-LSB register*/
1231
#define BNO055_EULER_R_LSB_VALUER_POS  (0)
1232
#define BNO055_EULER_R_LSB_VALUER_MSK  (0xFF)
1233
#define BNO055_EULER_R_LSB_VALUER_LEN  (8)
1234
#define BNO055_EULER_R_LSB_VALUER_REG  BNO055_EULER_R_LSB_ADDR
1235

  
1236
/* Euler data ROLL-MSB register*/
1237
#define BNO055_EULER_R_MSB_VALUER_POS  (0)
1238
#define BNO055_EULER_R_MSB_VALUER_MSK  (0xFF)
1239
#define BNO055_EULER_R_MSB_VALUER_LEN  (8)
1240
#define BNO055_EULER_R_MSB_VALUER_REG  BNO055_EULER_R_MSB_ADDR
1241

  
1242
/* Euler data PITCH-LSB register*/
1243
#define BNO055_EULER_P_LSB_VALUEP_POS  (0)
1244
#define BNO055_EULER_P_LSB_VALUEP_MSK  (0xFF)
1245
#define BNO055_EULER_P_LSB_VALUEP_LEN  (8)
1246
#define BNO055_EULER_P_LSB_VALUEP_REG  BNO055_EULER_P_LSB_ADDR
1247

  
1248
/* Euler data HEADING-MSB register*/
1249
#define BNO055_EULER_P_MSB_VALUEP_POS  (0)
1250
#define BNO055_EULER_P_MSB_VALUEP_MSK  (0xFF)
1251
#define BNO055_EULER_P_MSB_VALUEP_LEN  (8)
1252
#define BNO055_EULER_P_MSB_VALUEP_REG  BNO055_EULER_P_MSB_ADDR
1253

  
1254
/* Quaternion data W-LSB register*/
1255
#define BNO055_QUATERNION_DATA_W_LSB_VALUEW_POS  (0)
1256
#define BNO055_QUATERNION_DATA_W_LSB_VALUEW_MSK  (0xFF)
1257
#define BNO055_QUATERNION_DATA_W_LSB_VALUEW_LEN  (8)
1258
#define BNO055_QUATERNION_DATA_W_LSB_VALUEW_REG  \
1259
BNO055_QUATERNION_DATA_W_LSB_ADDR
1260

  
1261
/* Quaternion data W-MSB register*/
1262
#define BNO055_QUATERNION_DATA_W_MSB_VALUEW_POS  (0)
1263
#define BNO055_QUATERNION_DATA_W_MSB_VALUEW_MSK  (0xFF)
1264
#define BNO055_QUATERNION_DATA_W_MSB_VALUEW_LEN  (8)
1265
#define BNO055_QUATERNION_DATA_W_MSB_VALUEW_REG  \
1266
BNO055_QUATERNION_DATA_W_MSB_ADDR
1267

  
1268
/* Quaternion data X-LSB register*/
1269
#define BNO055_QUATERNION_DATA_X_LSB_VALUEX_POS  (0)
1270
#define BNO055_QUATERNION_DATA_X_LSB_VALUEX_MSK  (0xFF)
1271
#define BNO055_QUATERNION_DATA_X_LSB_VALUEX_LEN  (8)
1272
#define BNO055_QUATERNION_DATA_X_LSB_VALUEX_REG  \
1273
BNO055_QUATERNION_DATA_X_LSB_ADDR
1274

  
1275
/* Quaternion data X-MSB register*/
1276
#define BNO055_QUATERNION_DATA_X_MSB_VALUEX_POS  (0)
1277
#define BNO055_QUATERNION_DATA_X_MSB_VALUEX_MSK  (0xFF)
1278
#define BNO055_QUATERNION_DATA_X_MSB_VALUEX_LEN  (8)
1279
#define BNO055_QUATERNION_DATA_X_MSB_VALUEX_REG \
1280
BNO055_QUATERNION_DATA_X_MSB_ADDR
1281

  
1282
/* Quaternion data Y-LSB register*/
1283
#define BNO055_QUATERNION_DATA_Y_LSB_VALUEY_POS  (0)
1284
#define BNO055_QUATERNION_DATA_Y_LSB_VALUEY_MSK  (0xFF)
1285
#define BNO055_QUATERNION_DATA_Y_LSB_VALUEY_LEN  (8)
1286
#define BNO055_QUATERNION_DATA_Y_LSB_VALUEY_REG \
1287
BNO055_QUATERNION_DATA_Y_LSB_ADDR
1288

  
1289
/* Quaternion data Y-MSB register*/
1290
#define BNO055_QUATERNION_DATA_Y_MSB_VALUEY_POS  (0)
1291
#define BNO055_QUATERNION_DATA_Y_MSB_VALUEY_MSK  (0xFF)
1292
#define BNO055_QUATERNION_DATA_Y_MSB_VALUEY_LEN  (8)
1293
#define BNO055_QUATERNION_DATA_Y_MSB_VALUEY_REG  \
1294
BNO055_QUATERNION_DATA_Y_MSB_ADDR
1295

  
1296
/* Quaternion data Z-LSB register*/
1297
#define BNO055_QUATERNION_DATA_Z_LSB_VALUEZ_POS  (0)
1298
#define BNO055_QUATERNION_DATA_Z_LSB_VALUEZ_MSK  (0xFF)
1299
#define BNO055_QUATERNION_DATA_Z_LSB_VALUEZ_LEN  (8)
1300
#define BNO055_QUATERNION_DATA_Z_LSB_VALUEZ_REG \
1301
BNO055_QUATERNION_DATA_Z_LSB_ADDR
1302

  
1303
/* Quaternion data Z-MSB register*/
1304
#define BNO055_QUATERNION_DATA_Z_MSB_VALUEZ_POS  (0)
1305
#define BNO055_QUATERNION_DATA_Z_MSB_VALUEZ_MSK  (0xFF)
1306
#define BNO055_QUATERNION_DATA_Z_MSB_VALUEZ_LEN  (8)
1307
#define BNO055_QUATERNION_DATA_Z_MSB_VALUEZ_REG  \
1308
BNO055_QUATERNION_DATA_Z_MSB_ADDR
1309

  
1310
/* Linear acceleration data X-LSB register*/
1311
#define BNO055_LINEAR_ACCEL_DATA_X_LSB_VALUEX_POS  (0)
1312
#define BNO055_LINEAR_ACCEL_DATA_X_LSB_VALUEX_MSK  (0xFF)
1313
#define BNO055_LINEAR_ACCEL_DATA_X_LSB_VALUEX_LEN  (8)
1314
#define BNO055_LINEAR_ACCEL_DATA_X_LSB_VALUEX_REG  \
1315
BNO055_LINEAR_ACCEL_DATA_X_LSB_ADDR
1316

  
1317
/* Linear acceleration data X-MSB register*/
1318
#define BNO055_LINEAR_ACCEL_DATA_X_MSB_VALUEX_POS  (0)
1319
#define BNO055_LINEAR_ACCEL_DATA_X_MSB_VALUEX_MSK  (0xFF)
1320
#define BNO055_LINEAR_ACCEL_DATA_X_MSB_VALUEX_LEN  (8)
1321
#define BNO055_LINEAR_ACCEL_DATA_X_MSB_VALUEX_REG  \
1322
BNO055_LINEAR_ACCEL_DATA_X_MSB_ADDR
1323

  
1324
/* Linear acceleration data Y-LSB register*/
1325
#define BNO055_LINEAR_ACCEL_DATA_Y_LSB_VALUEY_POS  (0)
1326
#define BNO055_LINEAR_ACCEL_DATA_Y_LSB_VALUEY_MSK  (0xFF)
1327
#define BNO055_LINEAR_ACCEL_DATA_Y_LSB_VALUEY_LEN  (8)
1328
#define BNO055_LINEAR_ACCEL_DATA_Y_LSB_VALUEY_REG  \
1329
BNO055_LINEAR_ACCEL_DATA_Y_LSB_ADDR
1330

  
1331
/* Linear acceleration data Y-MSB register*/
1332
#define BNO055_LINEAR_ACCEL_DATA_Y_MSB_VALUEY_POS  (0)
1333
#define BNO055_LINEAR_ACCEL_DATA_Y_MSB_VALUEY_MSK  (0xFF)
1334
#define BNO055_LINEAR_ACCEL_DATA_Y_MSB_VALUEY_LEN  (8)
1335
#define BNO055_LINEAR_ACCEL_DATA_Y_MSB_VALUEY_REG  \
1336
BNO055_LINEAR_ACCEL_DATA_Y_MSB_ADDR
1337

  
1338
/* Linear acceleration data Z-LSB register*/
1339
#define BNO055_LINEAR_ACCEL_DATA_Z_LSB_VALUEZ_POS  (0)
1340
#define BNO055_LINEAR_ACCEL_DATA_Z_LSB_VALUEZ_MSK  (0xFF)
1341
#define BNO055_LINEAR_ACCEL_DATA_Z_LSB_VALUEZ_LEN  (8)
1342
#define BNO055_LINEAR_ACCEL_DATA_Z_LSB_VALUEZ_REG \
1343
BNO055_LINEAR_ACCEL_DATA_Z_LSB_ADDR
1344

  
1345
/* Linear acceleration data Z-MSB register*/
1346
#define BNO055_LINEAR_ACCEL_DATA_Z_MSB_VALUEZ_POS  (0)
1347
#define BNO055_LINEAR_ACCEL_DATA_Z_MSB_VALUEZ_MSK  (0xFF)
1348
#define BNO055_LINEAR_ACCEL_DATA_Z_MSB_VALUEZ_LEN  (8)
1349
#define BNO055_LINEAR_ACCEL_DATA_Z_MSB_VALUEZ_REG  \
1350
BNO055_LINEAR_ACCEL_DATA_Z_MSB_ADDR
1351

  
1352
/* Gravity data X-LSB register*/
1353
#define BNO055_GRAVITY_DATA_X_LSB_VALUEX_POS  (0)
1354
#define BNO055_GRAVITY_DATA_X_LSB_VALUEX_MSK  (0xFF)
1355
#define BNO055_GRAVITY_DATA_X_LSB_VALUEX_LEN  (8)
1356
#define BNO055_GRAVITY_DATA_X_LSB_VALUEX_REG  \
1357
BNO055_GRAVITY_DATA_X_LSB_ADDR
1358

  
1359
/* Gravity data X-MSB register*/
1360
#define BNO055_GRAVITY_DATA_X_MSB_VALUEX_POS  (0)
1361
#define BNO055_GRAVITY_DATA_X_MSB_VALUEX_MSK  (0xFF)
1362
#define BNO055_GRAVITY_DATA_X_MSB_VALUEX_LEN  (8)
1363
#define BNO055_GRAVITY_DATA_X_MSB_VALUEX_REG  \
1364
BNO055_GRAVITY_DATA_X_MSB_ADDR
1365

  
1366
/* Gravity data Y-LSB register*/
1367
#define BNO055_GRAVITY_DATA_Y_LSB_VALUEY_POS  (0)
1368
#define BNO055_GRAVITY_DATA_Y_LSB_VALUEY_MSK  (0xFF)
1369
#define BNO055_GRAVITY_DATA_Y_LSB_VALUEY_LEN  (8)
1370
#define BNO055_GRAVITY_DATA_Y_LSB_VALUEY_REG  \
1371
BNO055_GRAVITY_DATA_Y_LSB_ADDR
1372

  
1373
/* Gravity data Y-MSB register*/
1374
#define BNO055_GRAVITY_DATA_Y_MSB_VALUEY_POS  (0)
1375
#define BNO055_GRAVITY_DATA_Y_MSB_VALUEY_MSK  (0xFF)
1376
#define BNO055_GRAVITY_DATA_Y_MSB_VALUEY_LEN  (8)
1377
#define BNO055_GRAVITY_DATA_Y_MSB_VALUEY_REG  \
1378
BNO055_GRAVITY_DATA_Y_MSB_ADDR
1379

  
1380
/* Gravity data Z-LSB register*/
1381
#define BNO055_GRAVITY_DATA_Z_LSB_VALUEZ_POS  (0)
1382
#define BNO055_GRAVITY_DATA_Z_LSB_VALUEZ_MSK  (0xFF)
1383
#define BNO055_GRAVITY_DATA_Z_LSB_VALUEZ_LEN  (8)
1384
#define BNO055_GRAVITY_DATA_Z_LSB_VALUEZ_REG  \
1385
BNO055_GRAVITY_DATA_Z_LSB_ADDR
1386

  
1387
/* Gravity data Z-MSB register*/
1388
#define BNO055_GRAVITY_DATA_Z_MSB_VALUEZ_POS  (0)
1389
#define BNO055_GRAVITY_DATA_Z_MSB_VALUEZ_MSK  (0xFF)
1390
#define BNO055_GRAVITY_DATA_Z_MSB_VALUEZ_LEN  (8)
1391
#define BNO055_GRAVITY_DATA_Z_MSB_VALUEZ_REG  \
1392
BNO055_GRAVITY_DATA_Z_MSB_ADDR
1393

  
1394
/* Temperature register*/
1395
#define BNO055_TEMP_POS             (0)
1396
#define BNO055_TEMP_MSK             (0xFF)
1397
#define BNO055_TEMP_LEN             (8)
1398
#define BNO055_TEMP_REG             BNO055_TEMP_ADDR
1399

  
1400
/*Mag_Calib status register*/
1401
#define BNO055_MAG_CALIB_STAT_POS             (0)
1402
#define BNO055_MAG_CALIB_STAT_MSK             (0X03)
1403
#define BNO055_MAG_CALIB_STAT_LEN             (2)
1404
#define BNO055_MAG_CALIB_STAT_REG             BNO055_CALIB_STAT_ADDR
1405

  
1406
/*Acc_Calib status register*/
1407
#define BNO055_ACCEL_CALIB_STAT_POS             (2)
1408
#define BNO055_ACCEL_CALIB_STAT_MSK             (0X0C)
1409
#define BNO055_ACCEL_CALIB_STAT_LEN             (2)
1410
#define BNO055_ACCEL_CALIB_STAT_REG             BNO055_CALIB_STAT_ADDR
1411

  
1412
/*Gyro_Calib status register*/
1413
#define BNO055_GYRO_CALIB_STAT_POS             (4)
1414
#define BNO055_GYRO_CALIB_STAT_MSK             (0X30)
1415
#define BNO055_GYRO_CALIB_STAT_LEN             (2)
1416
#define BNO055_GYRO_CALIB_STAT_REG             BNO055_CALIB_STAT_ADDR
1417

  
1418
/*Sys_Calib status register*/
1419
#define BNO055_SYS_CALIB_STAT_POS             (6)
1420
#define BNO055_SYS_CALIB_STAT_MSK             (0XC0)
1421
#define BNO055_SYS_CALIB_STAT_LEN             (2)
1422
#define BNO055_SYS_CALIB_STAT_REG             BNO055_CALIB_STAT_ADDR
1423

  
1424
/*ST_ACCEL register*/
1425
#define BNO055_SELFTEST_ACCEL_POS             (0)
1426
#define BNO055_SELFTEST_ACCEL_MSK             (0X01)
1427
#define BNO055_SELFTEST_ACCEL_LEN             (1)
1428
#define BNO055_SELFTEST_ACCEL_REG             BNO055_SELFTEST_RESULT_ADDR
1429

  
1430
/*ST_MAG register*/
1431
#define BNO055_SELFTEST_MAG_POS             (1)
1432
#define BNO055_SELFTEST_MAG_MSK             (0X02)
1433
#define BNO055_SELFTEST_MAG_LEN             (1)
1434
#define BNO055_SELFTEST_MAG_REG             BNO055_SELFTEST_RESULT_ADDR
1435

  
1436
/*ST_GYRO register*/
1437
#define BNO055_SELFTEST_GYRO_POS             (2)
1438
#define BNO055_SELFTEST_GYRO_MSK             (0X04)
1439
#define BNO055_SELFTEST_GYRO_LEN             (1)
1440
#define BNO055_SELFTEST_GYRO_REG             BNO055_SELFTEST_RESULT_ADDR
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff