ChibiOS 21.11.4
lsm6ds0.h
Go to the documentation of this file.
1/*
2 ChibiOS - Copyright (C) 2016..2023 Rocco Marco Guglielmi
3
4 This file is part of ChibiOS.
5
6 ChibiOS is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 ChibiOS is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19*/
20
21/**
22 * @file lsm6ds0.h
23 * @brief LSM6DS0 MEMS interface module header.
24 *
25 * @addtogroup LSM6DS0
26 * @ingroup EX_ST
27 * @{
28 */
29#ifndef _LSM6DS0_H_
30#define _LSM6DS0_H_
31
32#include "ex_accelerometer.h"
33#include "ex_gyroscope.h"
34
35/*===========================================================================*/
36/* Driver constants. */
37/*===========================================================================*/
38
39/**
40 * @name Version identification
41 * @{
42 */
43/**
44 * @brief LSM6DS0 driver version string.
45 */
46#define EX_LSM6DS0_VERSION "1.1.3"
47
48/**
49 * @brief LSM6DS0 driver version major number.
50 */
51#define EX_LSM6DS0_MAJOR 1
52
53/**
54 * @brief LSM6DS0 driver version minor number.
55 */
56#define EX_LSM6DS0_MINOR 1
57
58/**
59 * @brief LSM6DS0 driver version patch number.
60 */
61#define EX_LSM6DS0_PATCH 3
62/** @} */
63
64/**
65 * @brief LSM6DS0 accelerometer subsystem characteristics.
66 * @note Sensitivity is expressed as milli-G/LSB whereas
67 * 1 milli-G = 0.00980665 m/s^2.
68 * @note Bias is expressed as milli-G.
69 *
70 * @{
71 */
72#define LSM6DS0_ACC_NUMBER_OF_AXES 3U
73
74#define LSM6DS0_ACC_2G 2.0f
75#define LSM6DS0_ACC_4G 4.0f
76#define LSM6DS0_ACC_8G 8.0f
77#define LSM6DS0_ACC_16G 16.0f
78
79#define LSM6DS0_ACC_SENS_2G 0.061f
80#define LSM6DS0_ACC_SENS_4G 0.122f
81#define LSM6DS0_ACC_SENS_8G 0.244f
82#define LSM6DS0_ACC_SENS_16G 0.732f
83
84#define LSM6DS0_ACC_BIAS 0.0f
85/** @} */
86
87/**
88 * @brief L3GD20 gyroscope system characteristics.
89 * @note Sensitivity is expressed as DPS/LSB whereas DPS stand for Degree
90 * per second [�/s].
91 * @note Bias is expressed as DPS.
92 *
93 * @{
94 */
95#define LSM6DS0_GYRO_NUMBER_OF_AXES 3U
96
97#define LSM6DS0_GYRO_245DPS 245.0f
98#define LSM6DS0_GYRO_500DPS 500.0f
99#define LSM6DS0_GYRO_2000DPS 2000.0f
100
101#define LSM6DS0_GYRO_SENS_245DPS 0.00875f
102#define LSM6DS0_GYRO_SENS_500DPS 0.01750f
103#define LSM6DS0_GYRO_SENS_2000DPS 0.07000f
104
105#define LSM6DS0_GYRO_BIAS 0.0f
106/** @} */
107
108/**
109 * @name LSM6DS0 communication interfaces related bit masks
110 * @{
111 */
112#define LSM6DS0_DI_MASK 0xFF
113#define LSM6DS0_DI(n) (1 << n)
114#define LSM6DS0_AD_MASK 0x7F
115#define LSM6DS0_AD(n) (1 << n)
116#define LSM6DS0_MS (1 << 7)
117/** @} */
118
119/**
120 * @name LSM6DS0 register addresses
121 * @{
122 */
123#define LSM6DS0_AD_ACT_THS 0x04
124#define LSM6DS0_AD_ACT_DUR 0x05
125#define LSM6DS0_AD_INT_GEN_CFG_XL 0x06
126#define LSM6DS0_AD_INT_GEN_THS_X_XL 0x07
127#define LSM6DS0_AD_INT_GEN_THS_Y_XL 0x08
128#define LSM6DS0_AD_INT_GEN_THS_Z_XL 0x09
129#define LSM6DS0_AD_INT_GEN_DUR_XL 0x0A
130#define LSM6DS0_AD_REFERENCE_G 0x0B
131#define LSM6DS0_AD_INT_CTRL 0x0C
132#define LSM6DS0_AD_WHO_AM_I 0x0F
133#define LSM6DS0_AD_CTRL_REG1_G 0x10
134#define LSM6DS0_AD_CTRL_REG2_G 0x11
135#define LSM6DS0_AD_CTRL_REG3_G 0x12
136#define LSM6DS0_AD_ORIENT_CFG_G 0x13
137#define LSM6DS0_AD_INT_GEN_SRC_G 0x14
138#define LSM6DS0_AD_OUT_TEMP_L 0x15
139#define LSM6DS0_AD_OUT_TEMP_H 0x16
140#define LSM6DS0_AD_STATUS_REG1 0x17
141#define LSM6DS0_AD_OUT_X_L_G 0x18
142#define LSM6DS0_AD_OUT_X_H_G 0x19
143#define LSM6DS0_AD_OUT_Y_L_G 0x1A
144#define LSM6DS0_AD_OUT_Y_H_G 0x1B
145#define LSM6DS0_AD_OUT_Z_L_G 0x1C
146#define LSM6DS0_AD_OUT_Z_H_G 0x1D
147#define LSM6DS0_AD_CTRL_REG4 0x1E
148#define LSM6DS0_AD_CTRL_REG5_XL 0x1F
149#define LSM6DS0_AD_CTRL_REG6_XL 0x20
150#define LSM6DS0_AD_CTRL_REG7_XL 0x21
151#define LSM6DS0_AD_CTRL_REG8 0x22
152#define LSM6DS0_AD_CTRL_REG9 0x23
153#define LSM6DS0_AD_CTRL_REG10 0x24
154#define LSM6DS0_AD_INT_GEN_SRC_XL 0x26
155#define LSM6DS0_AD_STATUS_REG2 0x27
156#define LSM6DS0_AD_OUT_X_L_XL 0x28
157#define LSM6DS0_AD_OUT_X_H_XL 0x29
158#define LSM6DS0_AD_OUT_Y_L_XL 0x2A
159#define LSM6DS0_AD_OUT_Y_H_XL 0x2B
160#define LSM6DS0_AD_OUT_Z_L_XL 0x2C
161#define LSM6DS0_AD_OUT_Z_H_XL 0x2D
162#define LSM6DS0_AD_FIFO_CTRL 0x2E
163#define LSM6DS0_AD_FIFO_SRC 0x2F
164#define LSM6DS0_AD_INT_GEN_CFG_G 0x30
165#define LSM6DS0_AD_INT_GEN_THS_XH_G 0x31
166#define LSM6DS0_AD_INT_GEN_THS_XL_G 0x32
167#define LSM6DS0_AD_INT_GEN_THS_YH_G 0x33
168#define LSM6DS0_AD_INT_GEN_THS_YL_G 0x34
169#define LSM6DS0_AD_INT_GEN_THS_ZH_G 0x35
170#define LSM6DS0_AD_INT_GEN_THS_ZL_G 0x36
171#define LSM6DS0_AD_INT_GEN_DUR_G 0x37
172/** @} */
173
174/**
175 * @name LSM6DS0_AD_CTRL_REG1_G register bits definitions
176 * @{
177 */
178#define LSM6DS0_CTRL_REG1_G 0xFA
179#define LSM6DS0_CTRL_REG1_G_BW_G0 (1 << 0)
180#define LSM6DS0_CTRL_REG1_G_BW_G1 (1 << 1)
181#define LSM6DS0_CTRL_REG1_G_FS_MASK 0x1F
182#define LSM6DS0_CTRL_REG1_G_FS_G0 (1 << 3)
183#define LSM6DS0_CTRL_REG1_G_FS_G1 (1 << 4)
184#define LSM6DS0_CTRL_REG1_G_ODR_G0 (1 << 5)
185#define LSM6DS0_CTRL_REG1_G_ODR_G1 (1 << 6)
186#define LSM6DS0_CTRL_REG1_G_ODR_G2 (1 << 7)
187/** @} */
188
189/**
190 * @name LSM6DS0_AD_CTRL_REG2_G register bits definitions
191 * @{
192 */
193#define LSM6DS0_CTRL_REG2_G 0x0F
194#define LSM6DS0_CTRL_REG2_G_OUT_SEL0 (1 << 0)
195#define LSM6DS0_CTRL_REG2_G_OUT_SEL1 (1 << 1)
196#define LSM6DS0_CTRL_REG2_G_INT_SEL0 (1 << 2)
197#define LSM6DS0_CTRL_REG2_G_INT_SEL1 (1 << 3)
198/** @} */
199
200/**
201 * @name LSM6DS0_AD_CTRL_REG3_G register bits definitions
202 * @{
203 */
204#define LSM6DS0_CTRL_REG3_G 0x64
205#define LSM6DS0_CTRL_REG3_G_HP_CF0_G (1 << 0)
206#define LSM6DS0_CTRL_REG3_G_HP_CF1_G (1 << 1)
207#define LSM6DS0_CTRL_REG3_G_HP_CF2_G (1 << 2)
208#define LSM6DS0_CTRL_REG3_G_HP_CF3_G (1 << 3)
209#define LSM6DS0_CTRL_REG3_G_HP_EN (1 << 6)
210#define LSM6DS0_CTRL_REG3_G_LP_MODE (1 << 7)
211/** @} */
212
213/**
214 * @name LSM6DS0_AD_CTRL_REG4 register bits definitions
215 * @{
216 */
217#define LSM6DS0_CTRL_REG4 0x3A
218#define LSM6DS0_CTRL_REG4_4D_XL1 (1 << 0)
219#define LSM6DS0_CTRL_REG4_LIR_XL1 (1 << 1)
220#define LSM6DS0_CTRL_REG4_XEN_G (1 << 3)
221#define LSM6DS0_CTRL_REG4_YEN_G (1 << 4)
222#define LSM6DS0_CTRL_REG4_ZEN_G (1 << 5)
223/** @} */
224
225/**
226 * @name LSM6DS0_AD_CTRL_REG5_XL register bits definitions
227 * @{
228 */
229#define LSM6DS0_CTRL_REG5_XL 0xF8
230#define LSM6DS0_CTRL_REG5_XL_XEN_XL (1 << 3)
231#define LSM6DS0_CTRL_REG5_XL_YEN_XL (1 << 4)
232#define LSM6DS0_CTRL_REG5_XL_ZEN_XL (1 << 5)
233#define LSM6DS0_CTRL_REG5_XL_DEC0 (1 << 6)
234#define LSM6DS0_CTRL_REG5_XL_DEC1 (1 << 7)
235/** @} */
236
237/**
238 * @name LSM6DS0_AD_CTRL_REG6_XL register bits definitions
239 * @{
240 */
241#define LSM6DS0_CTRL_REG6_XL 0xFF
242#define LSM6DS0_CTRL_REG6_XL_BW_XL0 (1 << 0)
243#define LSM6DS0_CTRL_REG6_XL_BW_XL1 (1 << 1)
244#define LSM6DS0_CTRL_REG6_XL_BW_SCAL_ODR (1 << 2)
245#define LSM6DS0_CTRL_REG6_XL_FS_MASK 0x1F
246#define LSM6DS0_CTRL_REG6_XL_FS0_XL (1 << 3)
247#define LSM6DS0_CTRL_REG6_XL_FS1_XL (1 << 4)
248#define LSM6DS0_CTRL_REG6_XL_ODR_XL0 (1 << 5)
249#define LSM6DS0_CTRL_REG6_XL_ODR_XL1 (1 << 6)
250#define LSM6DS0_CTRL_REG6_XL_ODR_XL2 (1 << 7)
251/** @} */
252
253/**
254 * @name LSM6DS0_AD_CTRL_REG7_XL register bits definitions
255 * @{
256 */
257#define LSM6DS0_CTRL_REG7_XL 0xE5
258#define LSM6DS0_CTRL_REG7_XL_HPIS1 (1 << 0)
259#define LSM6DS0_CTRL_REG7_XL_FDS (1 << 2)
260#define LSM6DS0_CTRL_REG7_XL_DCF0 (1 << 5)
261#define LSM6DS0_CTRL_REG7_XL_DCF1 (1 << 6)
262#define LSM6DS0_CTRL_REG7_XL_HR (1 << 7)
263/** @} */
264
265/**
266 * @name LSM6DS0_AD_CTRL_REG8 register bits definitions
267 * @{
268 */
269#define LSM6DS0_CTRL_REG8 0xFF
270#define LSM6DS0_CTRL_REG8_SW_RESET (1 << 0)
271#define LSM6DS0_CTRL_REG8_BLE (1 << 1)
272#define LSM6DS0_CTRL_REG8_IF_ADD_INC (1 << 2)
273#define LSM6DS0_CTRL_REG8_SIM (1 << 3)
274#define LSM6DS0_CTRL_REG8_PP_OD (1 << 4)
275#define LSM6DS0_CTRL_REG8_H_LACTIVE (1 << 5)
276#define LSM6DS0_CTRL_REG8_BDU (1 << 6)
277#define LSM6DS0_CTRL_REG8_BOOT (1 << 7)
278/** @} */
279
280/**
281 * @name LSM6DS0_AD_CTRL_REG9 register bits definitions
282 * @{
283 */
284#define LSM6DS0_CTRL_REG9 0x5F
285#define LSM6DS0_CTRL_REG9_STOP_ON_FTH (1 << 0)
286#define LSM6DS0_CTRL_REG9_FIFO_EN (1 << 1)
287#define LSM6DS0_CTRL_REG9_I2C_DISABLE (1 << 2)
288#define LSM6DS0_CTRL_REG9_DRDY_MASK_BIT (1 << 3)
289#define LSM6DS0_CTRL_REG9_FIFO_TEMP_EN (1 << 4)
290#define LSM6DS0_CTRL_REG9_SLEEP_G (1 << 6)
291/** @} */
292
293/**
294 * @name LSM6DS0_AD_CTRL_REG10 register bits definitions
295 * @{
296 */
297#define LSM6DS0_CTRL_REG10 0x05
298#define LSM6DS0_CTRL_REG10_ST_XL (1 << 0)
299#define LSM6DS0_CTRL_REG10_ST_G (1 << 2)
300/** @} */
301
302/*===========================================================================*/
303/* Driver pre-compile time settings. */
304/*===========================================================================*/
305
306/**
307 * @name Configuration options
308 * @{
309 */
310/**
311 * @brief LSM6DS0 SPI interface switch.
312 * @details If set to @p TRUE the support for SPI is included.
313 * @note The default is @p FALSE.
314 */
315#if !defined(LSM6DS0_USE_SPI) || defined(__DOXYGEN__)
316#define LSM6DS0_USE_SPI FALSE
317#endif
318
319/**
320 * @brief LSM6DS0 shared SPI switch.
321 * @details If set to @p TRUE the device acquires SPI bus ownership
322 * on each transaction.
323 * @note The default is @p FALSE. Requires SPI_USE_MUTUAL_EXCLUSION.
324 */
325#if !defined(LSM6DS0_SHARED_SPI) || defined(__DOXYGEN__)
326#define LSM6DS0_SHARED_SPI FALSE
327#endif
328
329/**
330 * @brief LSM6DS0 I2C interface switch.
331 * @details If set to @p TRUE the support for I2C is included.
332 * @note The default is @p TRUE.
333 */
334#if !defined(LSM6DS0_USE_I2C) || defined(__DOXYGEN__)
335#define LSM6DS0_USE_I2C TRUE
336#endif
337
338/**
339 * @brief LSM6DS0 shared I2C switch.
340 * @details If set to @p TRUE the device acquires I2C bus ownership
341 * on each transaction.
342 * @note The default is @p FALSE. Requires I2C_USE_MUTUAL_EXCLUSION.
343 */
344#if !defined(LSM6DS0_SHARED_I2C) || defined(__DOXYGEN__)
345#define LSM6DS0_SHARED_I2C FALSE
346#endif
347
348/**
349 * @brief LSM6DS0 advanced configurations switch.
350 * @details If set to @p TRUE more configurations are available.
351 * @note The default is @p FALSE.
352 */
353#if !defined(LSM6DS0_USE_ADVANCED) || defined(__DOXYGEN__)
354#define LSM6DS0_USE_ADVANCED FALSE
355#endif
356
357/**
358 * @brief Number of acquisitions for gyroscope bias removal.
359 * @details This is the number of acquisitions performed to compute the
360 * bias. A repetition is required in order to remove noise.
361 */
362#if !defined(LSM6DS0_GYRO_BIAS_ACQ_TIMES) || defined(__DOXYGEN__)
363#define LSM6DS0_GYRO_BIAS_ACQ_TIMES 50
364#endif
365
366/**
367 * @brief Settling time for gyroscope bias removal.
368 * @details This is the time between each bias acquisition.
369 */
370#if !defined(LSM6DS0_GYRO_BIAS_SETTLING_US) || defined(__DOXYGEN__)
371#define LSM6DS0_GYRO_BIAS_SETTLING_US 5000
372#endif
373/** @} */
374
375/*===========================================================================*/
376/* Derived constants and error checks. */
377/*===========================================================================*/
378
379#if !(LSM6DS0_USE_SPI ^ LSM6DS0_USE_I2C)
380#error "LSM6DS0_USE_SPI and LSM6DS0_USE_I2C cannot be both true or both false"
381#endif
382
383#if LSM6DS0_USE_SPI && !HAL_USE_SPI
384#error "LSM6DS0_USE_SPI requires HAL_USE_SPI"
385#endif
386
387#if LSM6DS0_SHARED_SPI && !SPI_USE_MUTUAL_EXCLUSION
388#error "LSM6DS0_SHARED_SPI requires SPI_USE_MUTUAL_EXCLUSION"
389#endif
390
391#if LSM6DS0_USE_I2C && !HAL_USE_I2C
392#error "LSM6DS0_USE_I2C requires HAL_USE_I2C"
393#endif
394
395#if LSM6DS0_SHARED_I2C && !I2C_USE_MUTUAL_EXCLUSION
396#error "LSM6DS0_SHARED_I2C requires I2C_USE_MUTUAL_EXCLUSION"
397#endif
398
399/*
400 * CHTODO: Add support for LSM6DS0 over SPI.
401 */
402#if LSM6DS0_USE_SPI
403#error "LSM6DS0 over SPI still not supported"
404#endif
405
406/*===========================================================================*/
407/* Driver data structures and types. */
408/*===========================================================================*/
409
410/**
411 * @name LSM6DS0 data structures and types.
412 * @{
413 */
414/**
415 * @brief Structure representing a LSM6DS0 driver.
416 */
418
419/**
420 * @brief Accelerometer and Gyroscope Slave Address.
421 */
422typedef enum {
423 LSM6DS0_SAD_GND = 0x6A, /**< SAD pin connected to GND. */
424 LSM6DS0_SAD_VCC = 0x6B /**< SAD pin connected to VCC. */
426
427/**
428 * @brief LSM6DS0 accelerometer subsystem full scale.
429 */
430typedef enum {
431 LSM6DS0_ACC_FS_2G = 0x00, /**< Full scale �2g. */
432 LSM6DS0_ACC_FS_4G = 0x10, /**< Full scale �4g. */
433 LSM6DS0_ACC_FS_8G = 0x18, /**< Full scale �8g. */
434 LSM6DS0_ACC_FS_16G = 0x08 /**< Full scale �16g. */
436
437/**
438 * @brief LSM6DS0 accelerometer subsystem output data rate.
439 */
440typedef enum {
441 LSM6DS0_ACC_ODR_PD = 0x00, /**< Power down */
442 LSM6DS0_ACC_ODR_10Hz = 0x20, /**< ODR 10 Hz */
443 LSM6DS0_ACC_ODR_50Hz = 0x40, /**< ODR 50 Hz */
444 LSM6DS0_ACC_ODR_119Hz = 0x60, /**< ODR 119 Hz */
445 LSM6DS0_ACC_ODR_238Hz = 0x80, /**< ODR 238 Hz */
446 LSM6DS0_ACC_ODR_476Hz = 0xA0, /**< ODR 476 Hz */
447 LSM6DS0_ACC_ODR_952Hz = 0xC0 /**< ODR 952 Hz */
449
450/**
451 * @brief LSM6DS0 accelerometer subsystem decimation mode.
452 */
453typedef enum {
454 LSM6DS0_ACC_DEC_DISABLED = 0x00, /**< Decimation disabled. */
455 LSM6DS0_ACC_DEC_X2 = 0x40, /**< Output updated every 2 samples. */
456 LSM6DS0_ACC_DEC_X4 = 0x80, /**< Output updated every 4 samples. */
457 LSM6DS0_ACC_DEC_X8 = 0xC0 /**< Output updated every 8 samples. */
459
460/**
461 * @brief LSM6DS0 gyroscope subsystem full scale.
462 */
463typedef enum {
464 LSM6DS0_GYRO_FS_245DPS = 0x00, /**< Full scale �245 degree per second */
465 LSM6DS0_GYRO_FS_500DPS = 0x08, /**< Full scale �500 degree per second */
466 LSM6DS0_GYRO_FS_2000DPS = 0x18 /**< Full scale �2000 degree per second */
468
469/**
470 * @brief LSM6DS0 gyroscope subsystem output data rate.
471 */
492
493/**
494 * @brief LSM6DS0 gyroscope subsystem low mode configuration.
495 */
496typedef enum {
497 LSM6DS0_GYRO_LP_DISABLED = 0x00, /**< Low power mode disabled. */
498 LSM6DS0_GYRO_LP_ENABLED = 0x80 /**< Low power mode enabled. */
500
501/**
502 * @brief LSM6DS0 gyroscope subsystem output selection.
503 */
504typedef enum {
505 LSM6DS0_GYRO_OUT_SEL_0 = 0x00, /**< Low pass filter 1. */
506 LSM6DS0_GYRO_OUT_SEL_1 = 0x01, /**< High pass filter 1 if enabled. */
507 LSM6DS0_GYRO_OUT_SEL_2 = 0x02 /**< Low pass filter 2. */
509
510/**
511 * @brief LSM6DS0 gyroscope subsystem high pass filter.
512 */
513typedef enum {
514 LSM6DS0_GYRO_HP_DISABLED = 0x00, /**< High pass filter disabled. */
515 LSM6DS0_GYRO_HP_ENABLED = 0x40 /**< High pass filter enabled. */
517
518/**
519 * @brief LSM6DS0 gyroscope subsystem high pass filter configuration.
520 */
533
534/**
535 * @brief LSM6DS0 block data update.
536 */
537typedef enum {
538 LSM6DS0_BDU_CONTINUOUS = 0x00, /**< Block data continuously updated. */
539 LSM6DS0_BDU_BLOCKED = 0x40 /**< Block data updated after reading. */
541
542/**
543 * @brief LSM6DS0 endianness.
544 */
545typedef enum {
546 LSM6DS0_END_LITTLE = 0x00, /**< Little endian. */
547 LSM6DS0_END_BIG = 0x20 /**< Big endian. */
549
550/**
551 * @brief Driver state machine possible states.
552 */
553typedef enum {
554 LSM6DS0_UNINIT = 0, /**< Not initialized. */
555 LSM6DS0_STOP = 1, /**< Stopped. */
556 LSM6DS0_READY = 2, /**< Ready. */
558
559/**
560 * @brief LSM6DS0 configuration structure.
561 */
562typedef struct {
563#if (LSM6DS0_USE_SPI) || defined(__DOXYGEN__)
564 /**
565 * @brief SPI driver associated to this LSM6DS0.
566 */
568 /**
569 * @brief SPI configuration associated to this LSM6DS0 accelerometer
570 * subsystem.
571 */
573#endif /* LSM6DS0_USE_SPI */
574#if (LSM6DS0_USE_I2C) || defined(__DOXYGEN__)
575 /**
576 * @brief I2C driver associated to this LSM6DS0.
577 */
579 /**
580 * @brief I2C configuration associated to this LSM6DS0 accelerometer
581 * subsystem.
582 */
584 /**
585 * @brief LSM6DS0 Slave Address
586 */
588#endif /* LSM6DS0_USE_I2C */
589 /**
590 * @brief LSM6DS0 accelerometer subsystem initial sensitivity.
591 */
593 /**
594 * @brief LSM6DS0 accelerometer subsystem initial bias.
595 */
596 float *accbias;
597 /**
598 * @brief LSM6DS0 accelerometer subsystem full scale.
599 */
601 /**
602 * @brief LSM6DS0 accelerometer subsystem output data rate.
603 */
605#if LSM6DS0_USE_ADVANCED || defined(__DOXYGEN__)
606 /**
607 * @brief LSM6DS0 accelerometer subsystem decimation mode.
608 */
610#endif /* LSM6DS0_USE_ADVANCED */
611 /**
612 * @brief LSM6DS0 gyroscope subsystem initial sensitivity.
613 */
615 /**
616 * @brief LSM6DS0 gyroscope subsystem initial bias.
617 */
618 float *gyrobias;
619 /**
620 * @brief LSM6DS0 gyroscope subsystem full scale.
621 */
623 /**
624 * @brief LSM6DS0 gyroscope subsystem output data rate.
625 */
627#if LSM6DS0_USE_ADVANCED || defined(__DOXYGEN__)
628 /**
629 * @brief LSM6DS0 gyroscope subsystem low mode configuration.
630 */
632 /**
633 * @brief LSM6DS0 gyroscope subsystem output selection.
634 */
636 /**
637 * @brief LSM6DS0 gyroscope subsystem high pass filter.
638 */
640 /**
641 * @brief LSM6DS0 gyroscope subsystem high pass filter configuration.
642 */
644 /**
645 * @brief LSM6DS0 block data update
646 */
648 /**
649 * @brief LSM6DS0 endianness
650 */
652#endif /* LSM6DS0_USE_ADVANCED */
654
655/**
656 * @brief @p LSM6DS0 specific methods.
657 */
658#define _lsm6ds0_methods_alone \
659 /* Change full scale value of LSM6DS0 accelerometer subsystem .*/ \
660 msg_t (*acc_set_full_scale)(LSM6DS0Driver *devp, lsm6ds0_acc_fs_t fs); \
661 /* Change full scale value of LSM6DS0 gyroscope subsystem .*/ \
662 msg_t (*gyro_set_full_scale)(LSM6DS0Driver *devp, lsm6ds0_gyro_fs_t fs);
663
664/**
665 * @brief @p LSM6DS0 specific methods with inherited ones.
666 */
667#define _lsm6ds0_methods \
668 _base_object_methods \
669 _lsm6ds0_methods_alone
670
671/**
672 * @extends BaseObjectVMT
673 *
674 * @brief @p LSM6DS0 virtual methods table.
675 */
678};
679
680/**
681 * @brief @p LSM6DS0Driver specific data.
682 */
683#define _lsm6ds0_data \
684 _base_sensor_data \
685 /* Driver state.*/ \
686 lsm6ds0_state_t state; \
687 /* Current configuration data.*/ \
688 const LSM6DS0Config *config; \
689 /* Accelerometer subsystem axes number.*/ \
690 size_t accaxes; \
691 /* Accelerometer subsystem current sensitivity.*/ \
692 float accsensitivity[LSM6DS0_ACC_NUMBER_OF_AXES]; \
693 /* Accelerometer subsystem current bias .*/ \
694 float accbias[LSM6DS0_ACC_NUMBER_OF_AXES]; \
695 /* Accelerometer subsystem current full scale value.*/ \
696 float accfullscale; \
697 /* Gyroscope subsystem axes number.*/ \
698 size_t gyroaxes; \
699 /* Gyroscope subsystem current sensitivity.*/ \
700 float gyrosensitivity[LSM6DS0_GYRO_NUMBER_OF_AXES]; \
701 /* Gyroscope subsystem current Bias.*/ \
702 float gyrobias[LSM6DS0_GYRO_NUMBER_OF_AXES]; \
703 /* Gyroscope subsystem current full scale value.*/ \
704 float gyrofullscale;
705
706/**
707 * @brief LSM6DS0 6-axis accelerometer/gyroscope class.
708 */
710 /** @brief Virtual Methods Table.*/
711 const struct LSM6DS0VMT *vmt;
712 /** @brief Base accelerometer interface.*/
714 /** @brief Base gyroscope interface.*/
717};
718/** @} */
719
720/*===========================================================================*/
721/* Driver macros. */
722/*===========================================================================*/
723
724/**
725 * @brief Return the number of axes of the BaseAccelerometer.
726 *
727 * @param[in] devp pointer to @p LSM6DS0Driver.
728 *
729 * @return the number of axes.
730 *
731 * @api
732 */
733#define lsm6ds0AccelerometerGetAxesNumber(devp) \
734 accelerometerGetAxesNumber(&((devp)->acc_if))
735
736/**
737 * @brief Retrieves raw data from the BaseAccelerometer.
738 * @note This data is retrieved from MEMS register without any algebraical
739 * manipulation.
740 * @note The axes array must be at least the same size of the
741 * BaseAccelerometer axes number.
742 *
743 * @param[in] devp pointer to @p LSM6DS0Driver.
744 * @param[out] axes a buffer which would be filled with raw data.
745 *
746 * @return The operation status.
747 * @retval MSG_OK if the function succeeded.
748 * @retval MSG_RESET if one or more I2C errors occurred, the errors can
749 * be retrieved using @p i2cGetErrors().
750 * @retval MSG_TIMEOUT if a timeout occurred before operation end.
751 *
752 * @api
753 */
754#define lsm6ds0AccelerometerReadRaw(devp, axes) \
755 accelerometerReadRaw(&((devp)->acc_if), axes)
756
757/**
758 * @brief Retrieves cooked data from the BaseAccelerometer.
759 * @note This data is manipulated according to the formula
760 * cooked = (raw * sensitivity) - bias.
761 * @note Final data is expressed as milli-G.
762 * @note The axes array must be at least the same size of the
763 * BaseAccelerometer axes number.
764 *
765 * @param[in] devp pointer to @p LSM6DS0Driver.
766 * @param[out] axes a buffer which would be filled with cooked data.
767 *
768 * @return The operation status.
769 * @retval MSG_OK if the function succeeded.
770 * @retval MSG_RESET if one or more I2C errors occurred, the errors can
771 * be retrieved using @p i2cGetErrors().
772 * @retval MSG_TIMEOUT if a timeout occurred before operation end.
773 *
774 * @api
775 */
776#define lsm6ds0AccelerometerReadCooked(devp, axes) \
777 accelerometerReadCooked(&((devp)->acc_if), axes)
778
779/**
780 * @brief Set bias values for the BaseAccelerometer.
781 * @note Bias must be expressed as milli-G.
782 * @note The bias buffer must be at least the same size of the
783 * BaseAccelerometer axes number.
784 *
785 * @param[in] devp pointer to @p LSM6DS0Driver.
786 * @param[in] bp a buffer which contains biases.
787 *
788 * @return The operation status.
789 * @retval MSG_OK if the function succeeded.
790 *
791 * @api
792 */
793#define lsm6ds0AccelerometerSetBias(devp, bp) \
794 accelerometerSetBias(&((devp)->acc_if), bp)
795
796/**
797 * @brief Reset bias values for the BaseAccelerometer.
798 * @note Default biases value are obtained from device datasheet when
799 * available otherwise they are considered zero.
800 *
801 * @param[in] devp pointer to @p LSM6DS0Driver.
802 *
803 * @return The operation status.
804 * @retval MSG_OK if the function succeeded.
805 *
806 * @api
807 */
808#define lsm6ds0AccelerometerResetBias(devp) \
809 accelerometerResetBias(&((devp)->acc_if))
810
811/**
812 * @brief Set sensitivity values for the BaseAccelerometer.
813 * @note Sensitivity must be expressed as milli-G/LSB.
814 * @note The sensitivity buffer must be at least the same size of the
815 * BaseAccelerometer axes number.
816 *
817 * @param[in] devp pointer to @p LSM6DS0Driver.
818 * @param[in] sp a buffer which contains sensitivities.
819 *
820 * @return The operation status.
821 * @retval MSG_OK if the function succeeded.
822 *
823 * @api
824 */
825#define lsm6ds0AccelerometerSetSensitivity(devp, sp) \
826 accelerometerSetSensitivity(&((devp)->acc_if), sp)
827
828/**
829 * @brief Reset sensitivity values for the BaseAccelerometer.
830 * @note Default sensitivities value are obtained from device datasheet.
831 *
832 * @param[in] devp pointer to @p LSM6DS0Driver.
833 *
834 * @return The operation status.
835 * @retval MSG_OK if the function succeeded.
836 * @retval MSG_RESET otherwise.
837 *
838 * @api
839 */
840#define lsm6ds0AccelerometerResetSensitivity(devp) \
841 accelerometerResetSensitivity(&((devp)->acc_if))
842
843/**
844 * @brief Changes the LSM6DS0Driver accelerometer fullscale value.
845 * @note This function also rescale sensitivities and biases based on
846 * previous and next fullscale value.
847 * @note A recalibration is highly suggested after calling this function.
848 *
849 * @param[in] devp pointer to @p LSM6DS0Driver.
850 * @param[in] fs new fullscale value.
851 *
852 * @return The operation status.
853 * @retval MSG_OK if the function succeeded.
854 * @retval MSG_RESET otherwise.
855 *
856 * @api
857 */
858#define lsm6ds0AccelerometerSetFullScale(devp, fs) \
859 (devp)->vmt->acc_set_full_scale(devp, fs)
860
861/**
862 * @brief Return the number of axes of the BaseGyroscope.
863 *
864 * @param[in] devp pointer to @p LSM6DS0Driver.
865 *
866 * @return the number of axes.
867 *
868 * @api
869 */
870#define lsm6ds0GyroscopeGetAxesNumber(devp) \
871 gyroscopeGetAxesNumber(&((devp)->gyro_if))
872
873/**
874 * @brief Retrieves raw data from the BaseGyroscope.
875 * @note This data is retrieved from MEMS register without any algebraical
876 * manipulation.
877 * @note The axes array must be at least the same size of the
878 * BaseGyroscope axes number.
879 *
880 * @param[in] devp pointer to @p LSM6DS0Driver.
881 * @param[out] axes a buffer which would be filled with raw data.
882 *
883 * @return The operation status.
884 * @retval MSG_OK if the function succeeded.
885 * @retval MSG_RESET if one or more I2C errors occurred, the errors can
886 * be retrieved using @p i2cGetErrors().
887 * @retval MSG_TIMEOUT if a timeout occurred before operation end.
888 *
889 * @api
890 */
891#define lsm6ds0GyroscopeReadRaw(devp, axes) \
892 gyroscopeReadRaw(&((devp)->gyro_if), axes)
893
894/**
895 * @brief Retrieves cooked data from the BaseGyroscope.
896 * @note This data is manipulated according to the formula
897 * cooked = (raw * sensitivity) - bias.
898 * @note Final data is expressed as DPS.
899 * @note The axes array must be at least the same size of the
900 * BaseGyroscope axes number.
901 *
902 * @param[in] devp pointer to @p LSM6DS0Driver.
903 * @param[out] axes a buffer which would be filled with cooked data.
904 *
905 * @return The operation status.
906 * @retval MSG_OK if the function succeeded.
907 * @retval MSG_RESET if one or more I2C errors occurred, the errors can
908 * be retrieved using @p i2cGetErrors().
909 * @retval MSG_TIMEOUT if a timeout occurred before operation end.
910 *
911 * @api
912 */
913#define lsm6ds0GyroscopeReadCooked(devp, axes) \
914 gyroscopeReadCooked(&((devp)->gyro_if), axes)
915
916/**
917 * @brief Samples bias values for the BaseGyroscope.
918 * @note The LSM6DS0 shall not be moved during the whole procedure.
919 * @note After this function internal bias is automatically updated.
920 * @note The behavior of this function depends on @p LSM6DS0_BIAS_ACQ_TIMES
921 * and @p LSM6DS0_BIAS_SETTLING_US.
922 *
923 * @param[in] devp pointer to @p LSM6DS0Driver.
924 *
925 * @return The operation status.
926 * @retval MSG_OK if the function succeeded.
927 * @retval MSG_RESET if one or more I2C errors occurred, the errors can
928 * be retrieved using @p i2cGetErrors().
929 * @retval MSG_TIMEOUT if a timeout occurred before operation end.
930 *
931 * @api
932 */
933#define lsm6ds0GyroscopeSampleBias(devp) \
934 gyroscopeSampleBias(&((devp)->gyro_if))
935
936/**
937 * @brief Set bias values for the BaseGyroscope.
938 * @note Bias must be expressed as DPS.
939 * @note The bias buffer must be at least the same size of the BaseGyroscope
940 * axes number.
941 *
942 * @param[in] devp pointer to @p LSM6DS0Driver.
943 * @param[in] bp a buffer which contains biases.
944 *
945 * @return The operation status.
946 * @retval MSG_OK if the function succeeded.
947 *
948 * @api
949 */
950#define lsm6ds0GyroscopeSetBias(devp, bp) \
951 gyroscopeSetBias(&((devp)->gyro_if), bp)
952
953/**
954 * @brief Reset bias values for the BaseGyroscope.
955 * @note Default biases value are obtained from device datasheet when
956 * available otherwise they are considered zero.
957 *
958 * @param[in] devp pointer to @p LSM6DS0Driver.
959 *
960 * @return The operation status.
961 * @retval MSG_OK if the function succeeded.
962 *
963 * @api
964 */
965#define lsm6ds0GyroscopeResetBias(devp) \
966 gyroscopeResetBias(&((devp)->gyro_if))
967
968/**
969 * @brief Set sensitivity values for the BaseGyroscope.
970 * @note Sensitivity must be expressed as DPS/LSB.
971 * @note The sensitivity buffer must be at least the same size of the
972 * BaseGyroscope axes number.
973 *
974 * @param[in] devp pointer to @p LSM6DS0Driver.
975 * @param[in] sp a buffer which contains sensitivities.
976 *
977 * @return The operation status.
978 * @retval MSG_OK if the function succeeded.
979 *
980 * @api
981 */
982#define lsm6ds0GyroscopeSetSensitivity(devp, sp) \
983 gyroscopeSetSensitivity(&((devp)->gyro_if), sp)
984
985/**
986 * @brief Reset sensitivity values for the BaseGyroscope.
987 * @note Default sensitivities value are obtained from device datasheet.
988 *
989 * @param[in] devp pointer to @p LSM6DS0Driver.
990 *
991 * @return The operation status.
992 * @retval MSG_OK if the function succeeded.
993 * @retval MSG_RESET otherwise.
994 *
995 * @api
996 */
997#define lsm6ds0GyroscopeResetSensitivity(devp) \
998 gyroscopeResetSensitivity(&((devp)->gyro_if))
999
1000/**
1001 * @brief Changes the LSM6DS0Driver gyroscope fullscale value.
1002 * @note This function also rescale sensitivities and biases based on
1003 * previous and next fullscale value.
1004 * @note A recalibration is highly suggested after calling this function.
1005 *
1006 * @param[in] devp pointer to @p LSM6DS0Driver.
1007 * @param[in] fs new fullscale value.
1008 *
1009 * @return The operation status.
1010 * @retval MSG_OK if the function succeeded.
1011 * @retval MSG_RESET otherwise.
1012 *
1013 * @api
1014 */
1015#define lsm6ds0GyroscopeSetFullScale(devp, fs) \
1016 (devp)->vmt->acc_set_full_scale(devp, fs)
1017
1018/*===========================================================================*/
1019/* External declarations. */
1020/*===========================================================================*/
1021
1022#ifdef __cplusplus
1023extern "C" {
1024#endif
1025 void lsm6ds0ObjectInit(LSM6DS0Driver *devp);
1026 void lsm6ds0Start(LSM6DS0Driver *devp, const LSM6DS0Config *config);
1027 void lsm6ds0Stop(LSM6DS0Driver *devp);
1028#ifdef __cplusplus
1029}
1030#endif
1031
1032#endif /* _LSM6DS0_H_ */
1033
1034/** @} */
Generic accelerometer interface header.
Generic gyroscope interface header.
struct hal_i2c_config I2CConfig
Type of a structure representing an I2C configuration.
Definition hal_i2c_lld.h:83
struct hal_i2c_driver I2CDriver
Type of a structure representing an I2C driver.
Definition hal_i2c_lld.h:88
lsm6ds0_gyro_hp_t
LSM6DS0 gyroscope subsystem high pass filter.
Definition lsm6ds0.h:513
lsm6ds0_gyro_hpcf_t
LSM6DS0 gyroscope subsystem high pass filter configuration.
Definition lsm6ds0.h:521
void lsm6ds0Stop(LSM6DS0Driver *devp)
Deactivates the LSM6DS0 Complex Driver peripheral.
Definition lsm6ds0.c:1077
lsm6ds0_end_t
LSM6DS0 endianness.
Definition lsm6ds0.h:545
void lsm6ds0Start(LSM6DS0Driver *devp, const LSM6DS0Config *config)
Configures and activates LSM6DS0 Complex Driver peripheral.
Definition lsm6ds0.c:845
lsm6ds0_acc_dec_t
LSM6DS0 accelerometer subsystem decimation mode.
Definition lsm6ds0.h:453
lsm6ds0_state_t
Driver state machine possible states.
Definition lsm6ds0.h:553
lsm6ds0_sad_t
Accelerometer and Gyroscope Slave Address.
Definition lsm6ds0.h:422
lsm6ds0_gyro_out_sel_t
LSM6DS0 gyroscope subsystem output selection.
Definition lsm6ds0.h:504
lsm6ds0_acc_odr_t
LSM6DS0 accelerometer subsystem output data rate.
Definition lsm6ds0.h:440
lsm6ds0_bdu_t
LSM6DS0 block data update.
Definition lsm6ds0.h:537
void lsm6ds0ObjectInit(LSM6DS0Driver *devp)
Initializes an instance.
Definition lsm6ds0.c:824
lsm6ds0_gyro_odr_t
LSM6DS0 gyroscope subsystem output data rate.
Definition lsm6ds0.h:472
lsm6ds0_gyro_lp_t
LSM6DS0 gyroscope subsystem low mode configuration.
Definition lsm6ds0.h:496
lsm6ds0_acc_fs_t
LSM6DS0 accelerometer subsystem full scale.
Definition lsm6ds0.h:430
#define _lsm6ds0_data
LSM6DS0Driver specific data.
Definition lsm6ds0.h:683
#define _lsm6ds0_methods
LSM6DS0 specific methods with inherited ones.
Definition lsm6ds0.h:667
lsm6ds0_gyro_fs_t
LSM6DS0 gyroscope subsystem full scale.
Definition lsm6ds0.h:463
@ LSM6DS0_GYRO_HP_DISABLED
Definition lsm6ds0.h:514
@ LSM6DS0_GYRO_HP_ENABLED
Definition lsm6ds0.h:515
@ LSM6DS0_GYRO_HPCF_0
Definition lsm6ds0.h:522
@ LSM6DS0_GYRO_HPCF_1
Definition lsm6ds0.h:523
@ LSM6DS0_GYRO_HPCF_6
Definition lsm6ds0.h:528
@ LSM6DS0_GYRO_HPCF_8
Definition lsm6ds0.h:530
@ LSM6DS0_GYRO_HPCF_7
Definition lsm6ds0.h:529
@ LSM6DS0_GYRO_HPCF_3
Definition lsm6ds0.h:525
@ LSM6DS0_GYRO_HPCF_4
Definition lsm6ds0.h:526
@ LSM6DS0_GYRO_HPCF_9
Definition lsm6ds0.h:531
@ LSM6DS0_GYRO_HPCF_2
Definition lsm6ds0.h:524
@ LSM6DS0_GYRO_HPCF_5
Definition lsm6ds0.h:527
@ LSM6DS0_END_BIG
Definition lsm6ds0.h:547
@ LSM6DS0_END_LITTLE
Definition lsm6ds0.h:546
@ LSM6DS0_ACC_DEC_DISABLED
Definition lsm6ds0.h:454
@ LSM6DS0_ACC_DEC_X4
Definition lsm6ds0.h:456
@ LSM6DS0_ACC_DEC_X2
Definition lsm6ds0.h:455
@ LSM6DS0_ACC_DEC_X8
Definition lsm6ds0.h:457
@ LSM6DS0_READY
Definition lsm6ds0.h:556
@ LSM6DS0_UNINIT
Definition lsm6ds0.h:554
@ LSM6DS0_STOP
Definition lsm6ds0.h:555
@ LSM6DS0_SAD_VCC
Definition lsm6ds0.h:424
@ LSM6DS0_SAD_GND
Definition lsm6ds0.h:423
@ LSM6DS0_GYRO_OUT_SEL_0
Definition lsm6ds0.h:505
@ LSM6DS0_GYRO_OUT_SEL_1
Definition lsm6ds0.h:506
@ LSM6DS0_GYRO_OUT_SEL_2
Definition lsm6ds0.h:507
@ LSM6DS0_ACC_ODR_50Hz
Definition lsm6ds0.h:443
@ LSM6DS0_ACC_ODR_10Hz
Definition lsm6ds0.h:442
@ LSM6DS0_ACC_ODR_PD
Definition lsm6ds0.h:441
@ LSM6DS0_ACC_ODR_476Hz
Definition lsm6ds0.h:446
@ LSM6DS0_ACC_ODR_952Hz
Definition lsm6ds0.h:447
@ LSM6DS0_ACC_ODR_119Hz
Definition lsm6ds0.h:444
@ LSM6DS0_ACC_ODR_238Hz
Definition lsm6ds0.h:445
@ LSM6DS0_BDU_CONTINUOUS
Definition lsm6ds0.h:538
@ LSM6DS0_BDU_BLOCKED
Definition lsm6ds0.h:539
@ LSM6DS0_GYRO_ODR_952HZ_FC_40
Definition lsm6ds0.h:488
@ LSM6DS0_GYRO_ODR_238HZ_FC_63
Definition lsm6ds0.h:481
@ LSM6DS0_GYRO_ODR_952HZ_FC_58
Definition lsm6ds0.h:489
@ LSM6DS0_GYRO_ODR_238HZ_FC_14
Definition lsm6ds0.h:479
@ LSM6DS0_GYRO_ODR_476HZ_FC_100
Definition lsm6ds0.h:486
@ LSM6DS0_GYRO_ODR_476HZ_FC_57
Definition lsm6ds0.h:485
@ LSM6DS0_GYRO_ODR_119HZ_FC_14
Definition lsm6ds0.h:477
@ LSM6DS0_GYRO_ODR_PD
Definition lsm6ds0.h:473
@ LSM6DS0_GYRO_ODR_952HZ_FC_100
Definition lsm6ds0.h:490
@ LSM6DS0_GYRO_ODR_238HZ_FC_78
Definition lsm6ds0.h:482
@ LSM6DS0_GYRO_ODR_59_5HZ_FC_16
Definition lsm6ds0.h:476
@ LSM6DS0_GYRO_ODR_476HZ_FC_21
Definition lsm6ds0.h:483
@ LSM6DS0_GYRO_ODR_476HZ_FC_28
Definition lsm6ds0.h:484
@ LSM6DS0_GYRO_ODR_14_9HZ_FC_5
Definition lsm6ds0.h:475
@ LSM6DS0_GYRO_ODR_952HZ_FC_33
Definition lsm6ds0.h:487
@ LSM6DS0_GYRO_ODR_119HZ_FC_31
Definition lsm6ds0.h:478
@ LSM6DS0_GYRO_ODR_95HZ_FC_25
Definition lsm6ds0.h:474
@ LSM6DS0_GYRO_ODR_238HZ_FC_29
Definition lsm6ds0.h:480
@ LSM6DS0_GYRO_LP_ENABLED
Definition lsm6ds0.h:498
@ LSM6DS0_GYRO_LP_DISABLED
Definition lsm6ds0.h:497
@ LSM6DS0_ACC_FS_8G
Definition lsm6ds0.h:433
@ LSM6DS0_ACC_FS_2G
Definition lsm6ds0.h:431
@ LSM6DS0_ACC_FS_4G
Definition lsm6ds0.h:432
@ LSM6DS0_ACC_FS_16G
Definition lsm6ds0.h:434
@ LSM6DS0_GYRO_FS_245DPS
Definition lsm6ds0.h:464
@ LSM6DS0_GYRO_FS_500DPS
Definition lsm6ds0.h:465
@ LSM6DS0_GYRO_FS_2000DPS
Definition lsm6ds0.h:466
struct hal_spi_config SPIConfig
Type of a SPI driver configuration structure.
Definition hal_spi_v1.h:121
struct hal_spi_driver SPIDriver
Type of a structure representing an SPI driver.
Definition hal_spi_v1.h:117
Base accelerometer class.
Base gyroscope class.
LSM6DS0 configuration structure.
Definition lsm6ds0.h:562
lsm6ds0_gyro_out_sel_t gyrooutsel
LSM6DS0 gyroscope subsystem output selection.
Definition lsm6ds0.h:635
float * accbias
LSM6DS0 accelerometer subsystem initial bias.
Definition lsm6ds0.h:596
float * gyrosensitivity
LSM6DS0 gyroscope subsystem initial sensitivity.
Definition lsm6ds0.h:614
lsm6ds0_gyro_hp_t gyrohpfenable
LSM6DS0 gyroscope subsystem high pass filter.
Definition lsm6ds0.h:639
SPIDriver * spip
SPI driver associated to this LSM6DS0.
Definition lsm6ds0.h:567
lsm6ds0_gyro_lp_t gyrolowmodecfg
LSM6DS0 gyroscope subsystem low mode configuration.
Definition lsm6ds0.h:631
float * accsensitivity
LSM6DS0 accelerometer subsystem initial sensitivity.
Definition lsm6ds0.h:592
lsm6ds0_acc_odr_t accodr
LSM6DS0 accelerometer subsystem output data rate.
Definition lsm6ds0.h:604
const I2CConfig * i2ccfg
I2C configuration associated to this LSM6DS0 accelerometer subsystem.
Definition lsm6ds0.h:583
lsm6ds0_acc_fs_t accfullscale
LSM6DS0 accelerometer subsystem full scale.
Definition lsm6ds0.h:600
float * gyrobias
LSM6DS0 gyroscope subsystem initial bias.
Definition lsm6ds0.h:618
lsm6ds0_gyro_hpcf_t gyrohpcfg
LSM6DS0 gyroscope subsystem high pass filter configuration.
Definition lsm6ds0.h:643
lsm6ds0_gyro_fs_t gyrofullscale
LSM6DS0 gyroscope subsystem full scale.
Definition lsm6ds0.h:622
lsm6ds0_sad_t slaveaddress
LSM6DS0 Slave Address.
Definition lsm6ds0.h:587
I2CDriver * i2cp
I2C driver associated to this LSM6DS0.
Definition lsm6ds0.h:578
lsm6ds0_bdu_t bdu
LSM6DS0 block data update.
Definition lsm6ds0.h:647
lsm6ds0_acc_dec_t accdecmode
LSM6DS0 accelerometer subsystem decimation mode.
Definition lsm6ds0.h:609
lsm6ds0_gyro_odr_t gyroodr
LSM6DS0 gyroscope subsystem output data rate.
Definition lsm6ds0.h:626
const SPIConfig * accspicfg
SPI configuration associated to this LSM6DS0 accelerometer subsystem.
Definition lsm6ds0.h:572
lsm6ds0_end_t endianness
LSM6DS0 endianness.
Definition lsm6ds0.h:651
LSM6DS0 6-axis accelerometer/gyroscope class.
Definition lsm6ds0.h:709
BaseGyroscope gyro_if
Base gyroscope interface.
Definition lsm6ds0.h:715
const struct LSM6DS0VMT * vmt
Virtual Methods Table.
Definition lsm6ds0.h:711
BaseAccelerometer acc_if
Base accelerometer interface.
Definition lsm6ds0.h:713
LSM6DS0 virtual methods table.
Definition lsm6ds0.h:676