ICARUS OS (Intelligent Cooperative Architecture for Real-time Unified Systems) 0.1.0
Preemptive Real-Time Operating System for ARM Cortex-M7
Loading...
Searching...
No Matches
lsm9ds1_reg.h
Go to the documentation of this file.
1
21/* Define to prevent recursive inclusion -------------------------------------*/
22#ifndef LSM9DS1_REGS_H
23#define LSM9DS1_REGS_H
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/* Includes ------------------------------------------------------------------*/
30#include <stdint.h>
31#include <stddef.h>
32#include <math.h>
33
44#ifndef DRV_BYTE_ORDER
45#ifndef __BYTE_ORDER__
46
47#define DRV_LITTLE_ENDIAN 1234
48#define DRV_BIG_ENDIAN 4321
49
53//#define DRV_BYTE_ORDER DRV_BIG_ENDIAN
54#define DRV_BYTE_ORDER DRV_LITTLE_ENDIAN
55
56#else /* defined __BYTE_ORDER__ */
57
58#define DRV_LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
59#define DRV_BIG_ENDIAN __ORDER_BIG_ENDIAN__
60#define DRV_BYTE_ORDER __BYTE_ORDER__
61
62#endif /* __BYTE_ORDER__*/
63#endif /* DRV_BYTE_ORDER */
64
75#ifndef MEMS_SHARED_TYPES
76#define MEMS_SHARED_TYPES
77
78typedef struct
79{
80#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
81 uint8_t bit0 : 1;
82 uint8_t bit1 : 1;
83 uint8_t bit2 : 1;
84 uint8_t bit3 : 1;
85 uint8_t bit4 : 1;
86 uint8_t bit5 : 1;
87 uint8_t bit6 : 1;
88 uint8_t bit7 : 1;
89#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
90 uint8_t bit7 : 1;
91 uint8_t bit6 : 1;
92 uint8_t bit5 : 1;
93 uint8_t bit4 : 1;
94 uint8_t bit3 : 1;
95 uint8_t bit2 : 1;
96 uint8_t bit1 : 1;
97 uint8_t bit0 : 1;
98#endif /* DRV_BYTE_ORDER */
99} bitwise_t;
100
101#define PROPERTY_DISABLE (0U)
102#define PROPERTY_ENABLE (1U)
103
112typedef int32_t (*stmdev_write_ptr)(void *, uint8_t, const uint8_t *, uint16_t);
113typedef int32_t (*stmdev_read_ptr)(void *, uint8_t, uint8_t *, uint16_t);
114typedef void (*stmdev_mdelay_ptr)(uint32_t millisec);
115
126
132#endif /* MEMS_SHARED_TYPES */
133
134#ifndef MEMS_UCF_SHARED_TYPES
135#define MEMS_UCF_SHARED_TYPES
136
148typedef struct
149{
150 uint8_t address;
151 uint8_t data;
152} ucf_line_t;
153
159#endif /* MEMS_UCF_SHARED_TYPES */
160
172#define LSM9DS1_IMU_I2C_ADD_L 0xD5U
173#define LSM9DS1_IMU_I2C_ADD_H 0xD7U
174
176#define LSM9DS1_MAG_I2C_ADD_L 0x39U
177#define LSM9DS1_MAG_I2C_ADD_H 0x3DU
178
180#define LSM9DS1_IMU_ID 0x68U
181
183#define LSM9DS1_MAG_ID 0x3DU
184
190#define LSM9DS1_ACT_THS 0x04U
191typedef struct
192{
193#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
194 uint8_t act_ths : 7;
195 uint8_t sleep_on_inact_en : 1;
196#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
197 uint8_t sleep_on_inact_en : 1;
198 uint8_t act_ths : 7;
199#endif /* DRV_BYTE_ORDER */
201
202#define LSM9DS1_ACT_DUR 0x05U
203#define LSM9DS1_INT_GEN_CFG_XL 0x06U
204typedef struct
205{
206#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
207 uint8_t xlie_xl : 1;
208 uint8_t xhie_xl : 1;
209 uint8_t ylie_xl : 1;
210 uint8_t yhie_xl : 1;
211 uint8_t zlie_xl : 1;
212 uint8_t zhie_xl : 1;
213 uint8_t _6d : 1;
214 uint8_t aoi_xl : 1;
215#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
216 uint8_t aoi_xl : 1;
217 uint8_t _6d : 1;
218 uint8_t zhie_xl : 1;
219 uint8_t zlie_xl : 1;
220 uint8_t yhie_xl : 1;
221 uint8_t ylie_xl : 1;
222 uint8_t xhie_xl : 1;
223 uint8_t xlie_xl : 1;
224#endif /* DRV_BYTE_ORDER */
226
227#define LSM9DS1_INT_GEN_THS_X_XL 0x07U
228#define LSM9DS1_INT_GEN_THS_Y_XL 0x08U
229#define LSM9DS1_INT_GEN_THS_Z_XL 0x09U
230#define LSM9DS1_INT_GEN_DUR_XL 0x0AU
231typedef struct
232{
233#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
234 uint8_t dur_xl : 7;
235 uint8_t wait_xl : 1;
236#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
237 uint8_t wait_xl : 1;
238 uint8_t dur_xl : 7;
239#endif /* DRV_BYTE_ORDER */
241
242#define LSM9DS1_REFERENCE_G 0x0BU
243#define LSM9DS1_INT1_CTRL 0x0CU
244typedef struct
245{
246#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
247 uint8_t int1_drdy_xl : 1;
248 uint8_t int1_drdy_g : 1;
249 uint8_t int1_boot : 1;
250 uint8_t int1_fth : 1;
251 uint8_t int1_ovr : 1;
252 uint8_t int1_fss5 : 1;
253 uint8_t int1_ig_xl : 1;
254 uint8_t int1_ig_g : 1;
255#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
256 uint8_t int1_ig_g : 1;
257 uint8_t int1_ig_xl : 1;
258 uint8_t int1_fss5 : 1;
259 uint8_t int1_ovr : 1;
260 uint8_t int1_fth : 1;
261 uint8_t int1_boot : 1;
262 uint8_t int1_drdy_g : 1;
263 uint8_t int1_drdy_xl : 1;
264#endif /* DRV_BYTE_ORDER */
266
267#define LSM9DS1_INT2_CTRL 0x0DU
268typedef struct
269{
270#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
271 uint8_t int2_drdy_xl : 1;
272 uint8_t int2_drdy_g : 1;
273 uint8_t int2_drdy_temp : 1;
274 uint8_t int2_fth : 1;
275 uint8_t int2_ovr : 1;
276 uint8_t int2_fss5 : 1;
277 uint8_t not_used_01 : 1;
278 uint8_t int2_inact : 1;
279#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
280 uint8_t int2_inact : 1;
281 uint8_t not_used_01 : 1;
282 uint8_t int2_fss5 : 1;
283 uint8_t int2_ovr : 1;
284 uint8_t int2_fth : 1;
285 uint8_t int2_drdy_temp : 1;
286 uint8_t int2_drdy_g : 1;
287 uint8_t int2_drdy_xl : 1;
288#endif /* DRV_BYTE_ORDER */
290
291#define LSM9DS1_WHO_AM_I 0x0FU
292#define LSM9DS1_CTRL_REG1_G 0x10U
293typedef struct
294{
295#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
296 uint8_t bw_g : 2;
297 uint8_t not_used_01 : 1;
298 uint8_t fs_g : 2;
299 uint8_t odr_g : 3;
300#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
301 uint8_t odr_g : 3;
302 uint8_t fs_g : 2;
303 uint8_t not_used_01 : 1;
304 uint8_t bw_g : 2;
305#endif /* DRV_BYTE_ORDER */
307
308#define LSM9DS1_CTRL_REG2_G 0x11U
309typedef struct
310{
311#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
312 uint8_t out_sel : 2;
313 uint8_t int_sel : 2;
314 uint8_t not_used_01 : 4;
315#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
316 uint8_t not_used_01 : 4;
317 uint8_t int_sel : 2;
318 uint8_t out_sel : 2;
319#endif /* DRV_BYTE_ORDER */
321
322#define LSM9DS1_CTRL_REG3_G 0x12U
323typedef struct
324{
325#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
326 uint8_t hpcf_g : 4;
327 uint8_t not_used_01 : 2;
328 uint8_t hp_en : 1;
329 uint8_t lp_mode : 1;
330#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
331 uint8_t lp_mode : 1;
332 uint8_t hp_en : 1;
333 uint8_t not_used_01 : 2;
334 uint8_t hpcf_g : 4;
335#endif /* DRV_BYTE_ORDER */
337
338#define LSM9DS1_ORIENT_CFG_G 0x13U
339typedef struct
340{
341#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
342 uint8_t orient : 3;
343 uint8_t signz_g : 1;
344 uint8_t signy_g : 1;
345 uint8_t signx_g : 1;
346 uint8_t not_used_01 : 2;
347#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
348 uint8_t not_used_01 : 2;
349 uint8_t signx_g : 1;
350 uint8_t signy_g : 1;
351 uint8_t signz_g : 1;
352 uint8_t orient : 3;
353#endif /* DRV_BYTE_ORDER */
355
356#define LSM9DS1_INT_GEN_SRC_G 0x14U
357typedef struct
358{
359#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
360 uint8_t xl_g : 1;
361 uint8_t xh_g : 1;
362 uint8_t yl_g : 1;
363 uint8_t yh_g : 1;
364 uint8_t zl_g : 1;
365 uint8_t zh_g : 1;
366 uint8_t ia_g : 1;
367 uint8_t not_used_01 : 1;
368#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
369 uint8_t not_used_01 : 1;
370 uint8_t ia_g : 1;
371 uint8_t zh_g : 1;
372 uint8_t zl_g : 1;
373 uint8_t yh_g : 1;
374 uint8_t yl_g : 1;
375 uint8_t xh_g : 1;
376 uint8_t xl_g : 1;
377#endif /* DRV_BYTE_ORDER */
379
380#define LSM9DS1_OUT_TEMP_L 0x15U
381#define LSM9DS1_OUT_TEMP_H 0x16U
382#define LSM9DS1_STATUS_REG 0x17U
383typedef struct
384{
385#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
386 uint8_t xlda : 1;
387 uint8_t gda : 1;
388 uint8_t tda : 1;
389 uint8_t boot_status : 1;
390 uint8_t inact : 1;
391 uint8_t ig_g : 1;
392 uint8_t ig_xl : 1;
393 uint8_t not_used_01 : 1;
394#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
395 uint8_t not_used_01 : 1;
396 uint8_t ig_xl : 1;
397 uint8_t ig_g : 1;
398 uint8_t inact : 1;
399 uint8_t boot_status : 1;
400 uint8_t tda : 1;
401 uint8_t gda : 1;
402 uint8_t xlda : 1;
403#endif /* DRV_BYTE_ORDER */
405
406#define LSM9DS1_OUT_X_L_G 0x18U
407#define LSM9DS1_OUT_X_H_G 0x19U
408#define LSM9DS1_OUT_Y_L_G 0x1AU
409#define LSM9DS1_OUT_Y_H_G 0x1BU
410#define LSM9DS1_OUT_Z_L_G 0x1CU
411#define LSM9DS1_OUT_Z_H_G 0x1DU
412#define LSM9DS1_CTRL_REG4 0x1EU
413typedef struct
414{
415#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
416 uint8_t _4d_xl1 : 1;
417 uint8_t lir_xl1 : 1;
418 uint8_t not_used_01 : 1;
419 uint8_t xen_g : 1;
420 uint8_t yen_g : 1;
421 uint8_t zen_g : 1;
422 uint8_t not_used_02 : 2;
423#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
424 uint8_t not_used_02 : 2;
425 uint8_t zen_g : 1;
426 uint8_t yen_g : 1;
427 uint8_t xen_g : 1;
428 uint8_t not_used_01 : 1;
429 uint8_t lir_xl1 : 1;
430 uint8_t _4d_xl1 : 1;
431#endif /* DRV_BYTE_ORDER */
433
434#define LSM9DS1_CTRL_REG5_XL 0x1FU
435typedef struct
436{
437#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
438 uint8_t not_used_01 : 3;
439 uint8_t xen_xl : 1;
440 uint8_t yen_xl : 1;
441 uint8_t zen_xl : 1;
442 uint8_t dec : 2;
443#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
444 uint8_t dec : 2;
445 uint8_t zen_xl : 1;
446 uint8_t yen_xl : 1;
447 uint8_t xen_xl : 1;
448 uint8_t not_used_01 : 3;
449#endif /* DRV_BYTE_ORDER */
451
452#define LSM9DS1_CTRL_REG6_XL 0x20U
453typedef struct
454{
455#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
456 uint8_t bw_xl : 2;
457 uint8_t bw_scal_odr : 1;
458 uint8_t fs_xl : 2;
459 uint8_t odr_xl : 3;
460#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
461 uint8_t odr_xl : 3;
462 uint8_t fs_xl : 2;
463 uint8_t bw_scal_odr : 1;
464 uint8_t bw_xl : 2;
465#endif /* DRV_BYTE_ORDER */
467
468#define LSM9DS1_CTRL_REG7_XL 0x21U
469typedef struct
470{
471#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
472 uint8_t hpis1 : 1;
473 uint8_t not_used_01 : 1;
474 uint8_t fds : 1;
475 uint8_t not_used_02 : 2;
476 uint8_t dcf : 2;
477 uint8_t hr : 1;
478#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
479 uint8_t hr : 1;
480 uint8_t dcf : 2;
481 uint8_t not_used_02 : 2;
482 uint8_t fds : 1;
483 uint8_t not_used_01 : 1;
484 uint8_t hpis1 : 1;
485#endif /* DRV_BYTE_ORDER */
487
488#define LSM9DS1_CTRL_REG8 0x22U
489typedef struct
490{
491#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
492 uint8_t sw_reset : 1;
493 uint8_t ble : 1;
494 uint8_t if_add_inc : 1;
495 uint8_t sim : 1;
496 uint8_t pp_od : 1;
497 uint8_t h_lactive : 1;
498 uint8_t bdu : 1;
499 uint8_t boot : 1;
500#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
501 uint8_t boot : 1;
502 uint8_t bdu : 1;
503 uint8_t h_lactive : 1;
504 uint8_t pp_od : 1;
505 uint8_t sim : 1;
506 uint8_t if_add_inc : 1;
507 uint8_t ble : 1;
508 uint8_t sw_reset : 1;
509#endif /* DRV_BYTE_ORDER */
511
512#define LSM9DS1_CTRL_REG9 0x23U
513typedef struct
514{
515#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
516 uint8_t stop_on_fth : 1;
517 uint8_t fifo_en : 1;
518 uint8_t i2c_disable : 1;
519 uint8_t drdy_mask_bit : 1;
520 uint8_t fifo_temp_en : 1;
521 uint8_t not_used_01 : 1;
522 uint8_t sleep_g : 1;
523 uint8_t not_used_02 : 1;
524#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
525 uint8_t not_used_02 : 1;
526 uint8_t sleep_g : 1;
527 uint8_t not_used_01 : 1;
528 uint8_t fifo_temp_en : 1;
529 uint8_t drdy_mask_bit : 1;
530 uint8_t i2c_disable : 1;
531 uint8_t fifo_en : 1;
532 uint8_t stop_on_fth : 1;
533#endif /* DRV_BYTE_ORDER */
535
536#define LSM9DS1_CTRL_REG10 0x24U
537typedef struct
538{
539#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
540 uint8_t st_xl : 1;
541 uint8_t not_used_01 : 1;
542 uint8_t st_g : 1;
543 uint8_t not_used_02 : 5;
544#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
545 uint8_t not_used_02 : 5;
546 uint8_t st_g : 1;
547 uint8_t not_used_01 : 1;
548 uint8_t st_xl : 1;
549#endif /* DRV_BYTE_ORDER */
551
552#define LSM9DS1_INT_GEN_SRC_XL 0x26U
553typedef struct
554{
555#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
556 uint8_t xl_xl : 1;
557 uint8_t xh_xl : 1;
558 uint8_t yl_xl : 1;
559 uint8_t yh_xl : 1;
560 uint8_t zl_xl : 1;
561 uint8_t zh_xl : 1;
562 uint8_t ia_xl : 1;
563 uint8_t not_used_01 : 1;
564#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
565 uint8_t not_used_01 : 1;
566 uint8_t ia_xl : 1;
567 uint8_t zh_xl : 1;
568 uint8_t zl_xl : 1;
569 uint8_t yh_xl : 1;
570 uint8_t yl_xl : 1;
571 uint8_t xh_xl : 1;
572 uint8_t xl_xl : 1;
573#endif /* DRV_BYTE_ORDER */
575
576#define LSM9DS1_OUT_X_L_XL 0x28U
577#define LSM9DS1_OUT_X_H_XL 0x29U
578#define LSM9DS1_OUT_Y_L_XL 0x2AU
579#define LSM9DS1_OUT_Y_H_XL 0x2BU
580#define LSM9DS1_OUT_Z_L_XL 0x2CU
581#define LSM9DS1_OUT_Z_H_XL 0x2DU
582#define LSM9DS1_FIFO_CTRL 0x2EU
583typedef struct
584{
585#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
586 uint8_t fth : 5;
587 uint8_t fmode : 3;
588#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
589 uint8_t fmode : 3;
590 uint8_t fth : 5;
591#endif /* DRV_BYTE_ORDER */
593
594#define LSM9DS1_FIFO_SRC 0x2FU
595typedef struct
596{
597#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
598 uint8_t fss : 6;
599 uint8_t ovrn : 1;
600 uint8_t fth : 1;
601#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
602 uint8_t fth : 1;
603 uint8_t ovrn : 1;
604 uint8_t fss : 6;
605#endif /* DRV_BYTE_ORDER */
607
608#define LSM9DS1_INT_GEN_CFG_G 0x30U
609typedef struct
610{
611#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
612 uint8_t xlie_g : 1;
613 uint8_t xhie_g : 1;
614 uint8_t ylie_g : 1;
615 uint8_t yhie_g : 1;
616 uint8_t zlie_g : 1;
617 uint8_t zhie_g : 1;
618 uint8_t lir_g : 1;
619 uint8_t aoi_g : 1;
620#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
621 uint8_t aoi_g : 1;
622 uint8_t lir_g : 1;
623 uint8_t zhie_g : 1;
624 uint8_t zlie_g : 1;
625 uint8_t yhie_g : 1;
626 uint8_t ylie_g : 1;
627 uint8_t xhie_g : 1;
628 uint8_t xlie_g : 1;
629#endif /* DRV_BYTE_ORDER */
631
632#define LSM9DS1_INT_GEN_THS_XH_G 0x31U
633typedef struct
634{
635#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
636 uint8_t ths_g_x : 7;
637 uint8_t dcrm_g : 1;
638#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
639 uint8_t dcrm_g : 1;
640 uint8_t ths_g_x : 7;
641#endif /* DRV_BYTE_ORDER */
643
644#define LSM9DS1_INT_GEN_THS_XL_G 0x32U
645typedef struct
646{
647 uint8_t ths_g_x : 8;
649#define LSM9DS1_INT_GEN_THS_YH_G 0x33U
650typedef struct
651{
652#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
653 uint8_t ths_g_y : 7;
654 uint8_t not_used_01 : 1;
655#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
656 uint8_t not_used_01 : 1;
657 uint8_t ths_g_y : 7;
658#endif /* DRV_BYTE_ORDER */
660
661#define LSM9DS1_INT_GEN_THS_YL_G 0x34U
662typedef struct
663{
664 uint8_t ths_g_y : 8;
666#define LSM9DS1_INT_GEN_THS_ZH_G 0x35U
667typedef struct
668{
669#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
670 uint8_t ths_g_z : 7;
671 uint8_t not_used_01 : 1;
672#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
673 uint8_t not_used_01 : 1;
674 uint8_t ths_g_z : 7;
675#endif /* DRV_BYTE_ORDER */
677
678#define LSM9DS1_INT_GEN_THS_ZL_G 0x36U
679typedef struct
680{
681 uint8_t ths_g_z : 8;
683#define LSM9DS1_INT_GEN_DUR_G 0x37U
684typedef struct
685{
686#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
687 uint8_t dur_g : 7;
688 uint8_t wait_g : 1;
689#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
690 uint8_t wait_g : 1;
691 uint8_t dur_g : 7;
692#endif /* DRV_BYTE_ORDER */
694
695#define LSM9DS1_OFFSET_X_REG_L_M 0x05U
696#define LSM9DS1_OFFSET_X_REG_H_M 0x06U
697#define LSM9DS1_OFFSET_Y_REG_L_M 0x07U
698#define LSM9DS1_OFFSET_Y_REG_H_M 0x08U
699#define LSM9DS1_OFFSET_Z_REG_L_M 0x09U
700#define LSM9DS1_OFFSET_Z_REG_H_M 0x0AU
701
702#define LSM9DS1_WHO_AM_I_M 0x0FU
703#define LSM9DS1_CTRL_REG1_M 0x20U
704typedef struct
705{
706#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
707 uint8_t st : 1;
708 uint8_t fast_odr : 1;
709 uint8_t _do : 3;
710 uint8_t om : 2;
711 uint8_t temp_comp : 1;
712#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
713 uint8_t temp_comp : 1;
714 uint8_t om : 2;
715 uint8_t _do : 3;
716 uint8_t fast_odr : 1;
717 uint8_t st : 1;
718#endif /* DRV_BYTE_ORDER */
720
721#define LSM9DS1_CTRL_REG2_M 0x21U
722typedef struct
723{
724#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
725 uint8_t not_used_01 : 2;
726 uint8_t soft_rst : 1;
727 uint8_t reboot : 1;
728 uint8_t not_used_02 : 1;
729 uint8_t fs : 2;
730 uint8_t not_used_03 : 1;
731#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
732 uint8_t not_used_03 : 1;
733 uint8_t fs : 2;
734 uint8_t not_used_02 : 1;
735 uint8_t reboot : 1;
736 uint8_t soft_rst : 1;
737 uint8_t not_used_01 : 2;
738#endif /* DRV_BYTE_ORDER */
740
741#define LSM9DS1_CTRL_REG3_M 0x22U
742typedef struct
743{
744#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
745 uint8_t md : 2;
746 uint8_t sim : 1;
747 uint8_t not_used_01 : 2;
748 uint8_t lp : 1;
749 uint8_t not_used_02 : 1;
750 uint8_t i2c_disable : 1;
751#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
752 uint8_t i2c_disable : 1;
753 uint8_t not_used_02 : 1;
754 uint8_t lp : 1;
755 uint8_t not_used_01 : 2;
756 uint8_t sim : 1;
757 uint8_t md : 2;
758#endif /* DRV_BYTE_ORDER */
760
761#define LSM9DS1_CTRL_REG4_M 0x23U
762typedef struct
763{
764#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
765 uint8_t not_used_01 : 1;
766 uint8_t ble : 1;
767 uint8_t omz : 2;
768 uint8_t not_used_02 : 4;
769#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
770 uint8_t not_used_02 : 4;
771 uint8_t omz : 2;
772 uint8_t ble : 1;
773 uint8_t not_used_01 : 1;
774#endif /* DRV_BYTE_ORDER */
776
777#define LSM9DS1_CTRL_REG5_M 0x24U
778typedef struct
779{
780#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
781 uint8_t not_used_01 : 6;
782 uint8_t bdu : 1;
783 uint8_t fast_read : 1;
784#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
785 uint8_t fast_read : 1;
786 uint8_t bdu : 1;
787 uint8_t not_used_01 : 6;
788#endif /* DRV_BYTE_ORDER */
790
791#define LSM9DS1_STATUS_REG_M 0x27U
792typedef struct
793{
794#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
795 uint8_t xda : 1;
796 uint8_t yda : 1;
797 uint8_t zda : 1;
798 uint8_t zyxda : 1;
799 uint8_t _xor : 1;
800 uint8_t yor : 1;
801 uint8_t zor : 1;
802 uint8_t zyxor : 1;
803#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
804 uint8_t zyxor : 1;
805 uint8_t zor : 1;
806 uint8_t yor : 1;
807 uint8_t _xor : 1;
808 uint8_t zyxda : 1;
809 uint8_t zda : 1;
810 uint8_t yda : 1;
811 uint8_t xda : 1;
812#endif /* DRV_BYTE_ORDER */
814
815#define LSM9DS1_OUT_X_L_M 0x28U
816#define LSM9DS1_OUT_X_H_M 0x29U
817#define LSM9DS1_OUT_Y_L_M 0x2AU
818#define LSM9DS1_OUT_Y_H_M 0x2BU
819#define LSM9DS1_OUT_Z_L_M 0x2CU
820#define LSM9DS1_OUT_Z_H_M 0x2DU
821#define LSM9DS1_INT_CFG_M 0x30U
822typedef struct
823{
824#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
825 uint8_t ien : 1;
826 uint8_t iel : 1;
827 uint8_t iea : 1;
828 uint8_t not_used_01 : 2;
829 uint8_t zien : 1;
830 uint8_t yien : 1;
831 uint8_t xien : 1;
832#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
833 uint8_t xien : 1;
834 uint8_t yien : 1;
835 uint8_t zien : 1;
836 uint8_t not_used_01 : 2;
837 uint8_t iea : 1;
838 uint8_t iel : 1;
839 uint8_t ien : 1;
840#endif /* DRV_BYTE_ORDER */
842
843#define LSM9DS1_INT_SRC_M 0x31U
844typedef struct
845{
846#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
847 uint8_t _int : 1;
848 uint8_t mroi : 1;
849 uint8_t nth_z : 1;
850 uint8_t nth_y : 1;
851 uint8_t nth_x : 1;
852 uint8_t pth_z : 1;
853 uint8_t pth_y : 1;
854 uint8_t pth_x : 1;
855#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
856 uint8_t pth_x : 1;
857 uint8_t pth_y : 1;
858 uint8_t pth_z : 1;
859 uint8_t nth_x : 1;
860 uint8_t nth_y : 1;
861 uint8_t nth_z : 1;
862 uint8_t mroi : 1;
863 uint8_t _int : 1;
864#endif /* DRV_BYTE_ORDER */
866
867#define LSM9DS1_INT_THS_L_M 0x32U
868typedef struct
869{
870 uint8_t ths : 8;
872
873#define LSM9DS1_INT_THS_H_M 0x33U
874typedef struct
875{
876#if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
877 uint8_t ths : 7;
878 uint8_t not_used_01 : 1;
879#elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
880 uint8_t not_used_01 : 1;
881 uint8_t ths : 7;
882#endif /* DRV_BYTE_ORDER */
884
897typedef union
898{
939 uint8_t byte;
941
947#ifndef __weak
948#define __weak __attribute__((weak))
949#endif /* __weak */
950
951/*
952 * These are the basic platform dependent I/O routines to read
953 * and write device registers connected on a standard bus.
954 * The driver keeps offering a default implementation based on function
955 * pointers to read/write routines for backward compatibility.
956 * The __weak directive allows the final application to overwrite
957 * them with a custom implementation.
958 */
959
960int32_t lsm9ds1_read_reg(const stmdev_ctx_t *ctx, uint8_t reg,
961 uint8_t *data,
962 uint16_t len);
963int32_t lsm9ds1_write_reg(const stmdev_ctx_t *ctx, uint8_t reg,
964 uint8_t *data,
965 uint16_t len);
966
967float_t lsm9ds1_from_fs2g_to_mg(int16_t lsb);
968float_t lsm9ds1_from_fs4g_to_mg(int16_t lsb);
969float_t lsm9ds1_from_fs8g_to_mg(int16_t lsb);
970float_t lsm9ds1_from_fs16g_to_mg(int16_t lsb);
971
972float_t lsm9ds1_from_fs245dps_to_mdps(int16_t lsb);
973float_t lsm9ds1_from_fs500dps_to_mdps(int16_t lsb);
974float_t lsm9ds1_from_fs2000dps_to_mdps(int16_t lsb);
975
976float_t lsm9ds1_from_fs4gauss_to_mG(int16_t lsb);
977float_t lsm9ds1_from_fs8gauss_to_mG(int16_t lsb);
978float_t lsm9ds1_from_fs12gauss_to_mG(int16_t lsb);
979float_t lsm9ds1_from_fs16gauss_to_mG(int16_t lsb);
980
981float_t lsm9ds1_from_lsb_to_celsius(int16_t lsb);
982
989int32_t lsm9ds1_gy_full_scale_set(const stmdev_ctx_t *ctx,
990 lsm9ds1_gy_fs_t val);
991int32_t lsm9ds1_gy_full_scale_get(const stmdev_ctx_t *ctx,
992 lsm9ds1_gy_fs_t *val);
993
1022int32_t lsm9ds1_imu_data_rate_set(const stmdev_ctx_t *ctx,
1023 lsm9ds1_imu_odr_t val);
1024int32_t lsm9ds1_imu_data_rate_get(const stmdev_ctx_t *ctx,
1025 lsm9ds1_imu_odr_t *val);
1026
1027typedef struct
1028{
1029 uint8_t orient : 3;
1030 uint8_t signz_g : 1; /*(0: positive; 1: negative)*/
1031 uint8_t signy_g : 1; /*(0: positive; 1: negative)*/
1032 uint8_t signx_g : 1; /*(0: positive; 1: negative)*/
1034int32_t lsm9ds1_gy_orient_set(const stmdev_ctx_t *ctx,
1036int32_t lsm9ds1_gy_orient_get(const stmdev_ctx_t *ctx,
1037 lsm9ds1_gy_orient_t *val);
1038
1040 uint8_t *val);
1041
1043 uint8_t *val);
1044
1046 uint8_t *val);
1047
1048typedef struct
1049{
1050 uint8_t xen_g : 1;
1051 uint8_t yen_g : 1;
1052 uint8_t zen_g : 1;
1054int32_t lsm9ds1_gy_axis_set(const stmdev_ctx_t *ctx, lsm9ds1_gy_axis_t val);
1055int32_t lsm9ds1_gy_axis_get(const stmdev_ctx_t *ctx,
1056 lsm9ds1_gy_axis_t *val);
1057
1058typedef struct
1059{
1060 uint8_t xen_xl : 1;
1061 uint8_t yen_xl : 1;
1062 uint8_t zen_xl : 1;
1064int32_t lsm9ds1_xl_axis_set(const stmdev_ctx_t *ctx, lsm9ds1_xl_axis_t val);
1065int32_t lsm9ds1_xl_axis_get(const stmdev_ctx_t *ctx,
1066 lsm9ds1_xl_axis_t *val);
1067
1075int32_t lsm9ds1_xl_decimation_set(const stmdev_ctx_t *ctx,
1076 lsm9ds1_dec_t val);
1077int32_t lsm9ds1_xl_decimation_get(const stmdev_ctx_t *ctx,
1078 lsm9ds1_dec_t *val);
1079
1087int32_t lsm9ds1_xl_full_scale_set(const stmdev_ctx_t *ctx,
1088 lsm9ds1_xl_fs_t val);
1089int32_t lsm9ds1_xl_full_scale_get(const stmdev_ctx_t *ctx,
1090 lsm9ds1_xl_fs_t *val);
1091
1092int32_t lsm9ds1_block_data_update_set(const stmdev_ctx_t *ctx_mag,
1093 stmdev_ctx_t *ctx_imu, uint8_t val);
1094int32_t lsm9ds1_block_data_update_get(const stmdev_ctx_t *ctx_mag,
1095 stmdev_ctx_t *ctx_imu, uint8_t *val);
1096
1097int32_t lsm9ds1_mag_offset_set(const stmdev_ctx_t *ctx, int16_t *val);
1098int32_t lsm9ds1_mag_offset_get(const stmdev_ctx_t *ctx, int16_t *val);
1099
1141int32_t lsm9ds1_mag_data_rate_set(const stmdev_ctx_t *ctx,
1143int32_t lsm9ds1_mag_data_rate_get(const stmdev_ctx_t *ctx,
1145
1153int32_t lsm9ds1_mag_full_scale_set(const stmdev_ctx_t *ctx,
1154 lsm9ds1_mag_fs_t val);
1155int32_t lsm9ds1_mag_full_scale_get(const stmdev_ctx_t *ctx,
1156 lsm9ds1_mag_fs_t *val);
1157
1159 uint8_t *val);
1160
1161int32_t lsm9ds1_temperature_raw_get(const stmdev_ctx_t *ctx, int16_t *val);
1162
1163int32_t lsm9ds1_angular_rate_raw_get(const stmdev_ctx_t *ctx, int16_t *val);
1164
1165int32_t lsm9ds1_acceleration_raw_get(const stmdev_ctx_t *ctx, int16_t *val);
1166
1167int32_t lsm9ds1_magnetic_raw_get(const stmdev_ctx_t *ctx, int16_t *val);
1168
1170 uint8_t *val);
1171
1172typedef struct
1173{
1174 uint8_t imu;
1175 uint8_t mag;
1176} lsm9ds1_id_t;
1177int32_t lsm9ds1_dev_id_get(const stmdev_ctx_t *ctx_mag,
1178 stmdev_ctx_t *ctx_imu,
1179 lsm9ds1_id_t *buff);
1180
1186int32_t lsm9ds1_dev_status_get(const stmdev_ctx_t *ctx_mag,
1187 stmdev_ctx_t *ctx_imu,
1188 lsm9ds1_status_t *val);
1189
1190int32_t lsm9ds1_dev_reset_set(const stmdev_ctx_t *ctx_mag,
1191 stmdev_ctx_t *ctx_imu,
1192 uint8_t val);
1193int32_t lsm9ds1_dev_reset_get(const stmdev_ctx_t *ctx_mag,
1194 stmdev_ctx_t *ctx_imu,
1195 uint8_t *val);
1196
1202int32_t lsm9ds1_dev_data_format_set(const stmdev_ctx_t *ctx_mag,
1203 stmdev_ctx_t *ctx_imu,
1204 lsm9ds1_ble_t val);
1205int32_t lsm9ds1_dev_data_format_get(const stmdev_ctx_t *ctx_mag,
1206 stmdev_ctx_t *ctx_imu,
1207 lsm9ds1_ble_t *val);
1208
1209int32_t lsm9ds1_dev_boot_set(const stmdev_ctx_t *ctx_mag,
1210 stmdev_ctx_t *ctx_imu,
1211 uint8_t val);
1212int32_t lsm9ds1_dev_boot_get(const stmdev_ctx_t *ctx_mag,
1213 stmdev_ctx_t *ctx_imu,
1214 uint8_t *val);
1215
1217 uint8_t *buff);
1219 uint8_t *buff);
1220
1229 lsm9ds1_gy_lp_bw_t val);
1231 lsm9ds1_gy_lp_bw_t *val);
1232
1244
1256
1271 lsm9ds1_gy_hp_bw_t val);
1273 lsm9ds1_gy_hp_bw_t *val);
1274
1284 lsm9ds1_xl_aa_bw_t val);
1286 lsm9ds1_xl_aa_bw_t *val);
1296
1306
1316 lsm9ds1_xl_lp_bw_t val);
1318 lsm9ds1_xl_lp_bw_t *val);
1319
1328 lsm9ds1_xl_hp_bw_t val);
1330 lsm9ds1_xl_hp_bw_t *val);
1331
1333 uint8_t val);
1335 uint8_t *val);
1336
1337int32_t lsm9ds1_auto_increment_set(const stmdev_ctx_t *ctx, uint8_t val);
1338int32_t lsm9ds1_auto_increment_get(const stmdev_ctx_t *ctx, uint8_t *val);
1339
1345int32_t lsm9ds1_spi_mode_set(const stmdev_ctx_t *ctx_mag,
1346 stmdev_ctx_t *ctx_imu,
1347 lsm9ds1_sim_t val);
1348int32_t lsm9ds1_spi_mode_get(const stmdev_ctx_t *ctx_mag,
1349 stmdev_ctx_t *ctx_imu,
1350 lsm9ds1_sim_t *val);
1351
1357int32_t lsm9ds1_i2c_interface_set(const stmdev_ctx_t *ctx_mag,
1358 stmdev_ctx_t *ctx_imu,
1359 lsm9ds1_i2c_dis_t val);
1360int32_t lsm9ds1_i2c_interface_get(const stmdev_ctx_t *ctx_mag,
1361 stmdev_ctx_t *ctx_imu,
1362 lsm9ds1_i2c_dis_t *val);
1363
1369int32_t lsm9ds1_pin_logic_set(const stmdev_ctx_t *ctx,
1371int32_t lsm9ds1_pin_logic_get(const stmdev_ctx_t *ctx,
1372 lsm9ds1_pin_logic_t *val);
1373
1374typedef struct
1375{
1376 uint8_t int1_drdy_xl : 1;
1377 uint8_t int1_drdy_g : 1;
1378 uint8_t int1_boot : 1;
1379 uint8_t int1_fth : 1;
1380 uint8_t int1_ovr : 1;
1381 uint8_t int1_fss5 : 1;
1382 uint8_t int1_ig_xl : 1;
1383 uint8_t int1_ig_g : 1;
1385int32_t lsm9ds1_pin_int1_route_set(const stmdev_ctx_t *ctx,
1387int32_t lsm9ds1_pin_int1_route_get(const stmdev_ctx_t *ctx,
1389typedef struct
1390{
1391 uint8_t int2_drdy_xl : 1;
1392 uint8_t int2_drdy_g : 1;
1393 uint8_t int2_drdy_temp : 1;
1394 uint8_t int2_fth : 1;
1395 uint8_t int2_ovr : 1;
1396 uint8_t int2_fss5 : 1;
1397 uint8_t int2_inact : 1;
1399int32_t lsm9ds1_pin_int2_route_set(const stmdev_ctx_t *ctx,
1401int32_t lsm9ds1_pin_int2_route_get(const stmdev_ctx_t *ctx,
1403
1409int32_t lsm9ds1_pin_notification_set(const stmdev_ctx_t *ctx_mag,
1410 stmdev_ctx_t *ctx_imu,
1411 lsm9ds1_lir_t val);
1412int32_t lsm9ds1_pin_notification_get(const stmdev_ctx_t *ctx_mag,
1413 stmdev_ctx_t *ctx_imu,
1414 lsm9ds1_lir_t *val);
1415
1421int32_t lsm9ds1_pin_mode_set(const stmdev_ctx_t *ctx, lsm9ds1_pp_od_t val);
1422int32_t lsm9ds1_pin_mode_get(const stmdev_ctx_t *ctx, lsm9ds1_pp_od_t *val);
1423
1424typedef struct
1425{
1426 uint8_t ien : 1;
1428int32_t lsm9ds1_pin_int_m_route_set(const stmdev_ctx_t *ctx,
1430int32_t lsm9ds1_pin_int_m_route_get(const stmdev_ctx_t *ctx,
1437int32_t lsm9ds1_pin_polarity_set(const stmdev_ctx_t *ctx_mag,
1438 stmdev_ctx_t *ctx_imu,
1439 lsm9ds1_polarity_t val);
1440int32_t lsm9ds1_pin_polarity_get(const stmdev_ctx_t *ctx_mag,
1441 stmdev_ctx_t *ctx_imu,
1442 lsm9ds1_polarity_t *val);
1443
1444typedef struct
1445{
1446 uint8_t xlie_xl : 1;
1447 uint8_t xhie_xl : 1;
1448 uint8_t ylie_xl : 1;
1449 uint8_t yhie_xl : 1;
1450 uint8_t zlie_xl : 1;
1451 uint8_t zhie_xl : 1;
1453int32_t lsm9ds1_xl_trshld_axis_set(const stmdev_ctx_t *ctx,
1455int32_t lsm9ds1_xl_trshld_axis_get(const stmdev_ctx_t *ctx,
1457
1458int32_t lsm9ds1_xl_trshld_set(const stmdev_ctx_t *ctx, uint8_t *buff);
1459int32_t lsm9ds1_xl_trshld_get(const stmdev_ctx_t *ctx, uint8_t *buff);
1460
1462 uint8_t val);
1464 uint8_t *val);
1465
1466typedef struct
1467{
1468 uint8_t xl_g : 1;
1469 uint8_t xh_g : 1;
1470 uint8_t yl_g : 1;
1471 uint8_t yh_g : 1;
1472 uint8_t zl_g : 1;
1473 uint8_t zh_g : 1;
1474 uint8_t ia_g : 1;
1476int32_t lsm9ds1_gy_trshld_src_get(const stmdev_ctx_t *ctx,
1478
1479typedef struct
1480{
1481 uint8_t xl_xl : 1;
1482 uint8_t xh_xl : 1;
1483 uint8_t yl_xl : 1;
1484 uint8_t yh_xl : 1;
1485 uint8_t zl_xl : 1;
1486 uint8_t zh_xl : 1;
1487 uint8_t ia_xl : 1;
1489int32_t lsm9ds1_xl_trshld_src_get(const stmdev_ctx_t *ctx,
1491
1492typedef struct
1493{
1494 uint8_t xlie_g : 1;
1495 uint8_t xhie_g : 1;
1496 uint8_t ylie_g : 1;
1497 uint8_t yhie_g : 1;
1498 uint8_t zlie_g : 1;
1499 uint8_t zhie_g : 1;
1501int32_t lsm9ds1_gy_trshld_axis_set(const stmdev_ctx_t *ctx,
1503int32_t lsm9ds1_gy_trshld_axis_get(const stmdev_ctx_t *ctx,
1505
1511int32_t lsm9ds1_gy_trshld_mode_set(const stmdev_ctx_t *ctx,
1512 lsm9ds1_dcrm_g_t val);
1513int32_t lsm9ds1_gy_trshld_mode_get(const stmdev_ctx_t *ctx,
1514 lsm9ds1_dcrm_g_t *val);
1515
1516int32_t lsm9ds1_gy_trshld_x_set(const stmdev_ctx_t *ctx, uint16_t val);
1517int32_t lsm9ds1_gy_trshld_x_get(const stmdev_ctx_t *ctx, uint16_t *val);
1518
1519int32_t lsm9ds1_gy_trshld_y_set(const stmdev_ctx_t *ctx, uint16_t val);
1520int32_t lsm9ds1_gy_trshld_y_get(const stmdev_ctx_t *ctx, uint16_t *val);
1521
1522int32_t lsm9ds1_gy_trshld_z_set(const stmdev_ctx_t *ctx, uint16_t val);
1523int32_t lsm9ds1_gy_trshld_z_get(const stmdev_ctx_t *ctx, uint16_t *val);
1524
1526 uint8_t val);
1528 uint8_t *val);
1529
1530typedef struct
1531{
1532 uint8_t zien : 1;
1533 uint8_t yien : 1;
1534 uint8_t xien : 1;
1536int32_t lsm9ds1_mag_trshld_axis_set(const stmdev_ctx_t *ctx,
1538int32_t lsm9ds1_mag_trshld_axis_get(const stmdev_ctx_t *ctx,
1540typedef struct
1541{
1542 uint8_t _int : 1;
1543 uint8_t nth_z : 1;
1544 uint8_t nth_y : 1;
1545 uint8_t nth_x : 1;
1546 uint8_t pth_z : 1;
1547 uint8_t pth_y : 1;
1548 uint8_t pth_x : 1;
1550int32_t lsm9ds1_mag_trshld_src_get(const stmdev_ctx_t *ctx,
1552
1553int32_t lsm9ds1_mag_trshld_set(const stmdev_ctx_t *ctx, uint8_t *val);
1554int32_t lsm9ds1_mag_trshld_get(const stmdev_ctx_t *ctx, uint8_t *val);
1555
1556int32_t lsm9ds1_act_threshold_set(const stmdev_ctx_t *ctx, uint8_t val);
1557int32_t lsm9ds1_act_threshold_get(const stmdev_ctx_t *ctx, uint8_t *val);
1558
1564int32_t lsm9ds1_act_mode_set(const stmdev_ctx_t *ctx,
1565 lsm9ds1_act_mode_t val);
1566int32_t lsm9ds1_act_mode_get(const stmdev_ctx_t *ctx,
1567 lsm9ds1_act_mode_t *val);
1568
1569int32_t lsm9ds1_act_duration_set(const stmdev_ctx_t *ctx, uint8_t *buff);
1570int32_t lsm9ds1_act_duration_get(const stmdev_ctx_t *ctx, uint8_t *buff);
1571
1577int32_t lsm9ds1_act_src_get(const stmdev_ctx_t *ctx, lsm9ds1_inact_t *val);
1578
1587int32_t lsm9ds1_6d_mode_set(const stmdev_ctx_t *ctx, lsm9ds1_6d_mode_t val);
1588int32_t lsm9ds1_6d_mode_get(const stmdev_ctx_t *ctx,
1589 lsm9ds1_6d_mode_t *val);
1590
1591int32_t lsm9ds1_6d_threshold_set(const stmdev_ctx_t *ctx, uint8_t *buff);
1592int32_t lsm9ds1_6d_threshold_get(const stmdev_ctx_t *ctx, uint8_t *buff);
1593
1594typedef struct
1595{
1596 uint8_t xl_xl : 1;
1597 uint8_t xh_xl : 1;
1598 uint8_t yl_xl : 1;
1599 uint8_t yh_xl : 1;
1600 uint8_t zl_xl : 1;
1601 uint8_t zh_xl : 1;
1602 uint8_t ia_xl : 1;
1604int32_t lsm9ds1_6d_src_get(const stmdev_ctx_t *ctx, lsm9ds1_6d_src_t *val);
1605
1606int32_t lsm9ds1_fifo_stop_on_wtm_set(const stmdev_ctx_t *ctx, uint8_t val);
1607int32_t lsm9ds1_fifo_stop_on_wtm_get(const stmdev_ctx_t *ctx, uint8_t *val);
1608
1618int32_t lsm9ds1_fifo_mode_set(const stmdev_ctx_t *ctx,
1619 lsm9ds1_fifo_md_t val);
1620int32_t lsm9ds1_fifo_mode_get(const stmdev_ctx_t *ctx,
1621 lsm9ds1_fifo_md_t *val);
1622
1623int32_t lsm9ds1_fifo_temp_batch_set(const stmdev_ctx_t *ctx, uint8_t val);
1624int32_t lsm9ds1_fifo_temp_batch_get(const stmdev_ctx_t *ctx, uint8_t *val);
1625
1626int32_t lsm9ds1_fifo_watermark_set(const stmdev_ctx_t *ctx, uint8_t val);
1627int32_t lsm9ds1_fifo_watermark_get(const stmdev_ctx_t *ctx, uint8_t *val);
1628
1629int32_t lsm9ds1_fifo_full_flag_get(const stmdev_ctx_t *ctx, uint8_t *val);
1630
1631int32_t lsm9ds1_fifo_data_level_get(const stmdev_ctx_t *ctx, uint8_t *val);
1632
1633int32_t lsm9ds1_fifo_ovr_flag_get(const stmdev_ctx_t *ctx, uint8_t *val);
1634
1635int32_t lsm9ds1_fifo_wtm_flag_get(const stmdev_ctx_t *ctx, uint8_t *val);
1636
1637int32_t lsm9ds1_xl_self_test_set(const stmdev_ctx_t *ctx, uint8_t val);
1638int32_t lsm9ds1_xl_self_test_get(const stmdev_ctx_t *ctx, uint8_t *val);
1639
1640int32_t lsm9ds1_gy_self_test_set(const stmdev_ctx_t *ctx, uint8_t val);
1641int32_t lsm9ds1_gy_self_test_get(const stmdev_ctx_t *ctx, uint8_t *val);
1642
1643int32_t lsm9ds1_mag_self_test_set(const stmdev_ctx_t *ctx, uint8_t val);
1644int32_t lsm9ds1_mag_self_test_get(const stmdev_ctx_t *ctx, uint8_t *val);
1650#ifdef __cplusplus
1651}
1652#endif
1653
1654#endif /* LSM9DS1_REGS_H */
1655
1656/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
void(* stmdev_mdelay_ptr)(uint32_t millisec)
int32_t(* stmdev_read_ptr)(void *, uint8_t, uint8_t *, uint16_t)
int32_t(* stmdev_write_ptr)(void *, uint8_t, const uint8_t *, uint16_t)
int32_t lsm9ds1_magnetic_raw_get(const stmdev_ctx_t *ctx, int16_t *val)
Magnetic sensor.
int32_t lsm9ds1_dev_data_format_set(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, lsm9ds1_ble_t val)
Big/Little Endian data selection.
lsm9ds1_mag_fs_t
int32_t lsm9ds1_block_data_update_set(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, uint8_t val)
Blockdataupdate.
int32_t lsm9ds1_gy_filter_hp_bandwidth_set(const stmdev_ctx_t *ctx, lsm9ds1_gy_hp_bw_t val)
Gyroscope high-pass filter bandwidth selection.
int32_t lsm9ds1_pin_polarity_get(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, lsm9ds1_polarity_t *val)
Configure the interrupt pin polarity.
float_t lsm9ds1_from_fs12gauss_to_mG(int16_t lsb)
int32_t lsm9ds1_mag_trshld_axis_get(const stmdev_ctx_t *ctx, lsm9ds1_mag_trshld_axis_t *val)
Enable interrupt generation on threshold event.
lsm9ds1_dec_t
int32_t lsm9ds1_act_duration_get(const stmdev_ctx_t *ctx, uint8_t *buff)
Inactivity duration in number of sample.
int32_t lsm9ds1_dev_reset_get(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, uint8_t *val)
Software reset.
int32_t lsm9ds1_xl_trshld_src_get(const stmdev_ctx_t *ctx, lsm9ds1_xl_trshld_src_t *val)
Accelerometer interrupt on threshold source.
int32_t lsm9ds1_xl_full_scale_set(const stmdev_ctx_t *ctx, lsm9ds1_xl_fs_t val)
Accelerometer full-scale selection.
int32_t lsm9ds1_pin_logic_set(const stmdev_ctx_t *ctx, lsm9ds1_pin_logic_t val)
AND/OR combination of accelerometer’s interrupt events.
int32_t lsm9ds1_gy_filter_int_path_set(const stmdev_ctx_t *ctx, lsm9ds1_gy_int_path_t val)
Gyro interrupt filter path configuration.
int32_t lsm9ds1_xl_filter_hp_bandwidth_get(const stmdev_ctx_t *ctx, lsm9ds1_xl_hp_bw_t *val)
Accelerometer digital filter high pass cutoff frequency selection.
int32_t lsm9ds1_mag_trshld_get(const stmdev_ctx_t *ctx, uint8_t *val)
The value is expressed in 15-bit unsigned.
int32_t lsm9ds1_act_duration_set(const stmdev_ctx_t *ctx, uint8_t *buff)
Inactivity duration in number of sample.
int32_t lsm9ds1_pin_int_m_route_get(const stmdev_ctx_t *ctx, lsm9ds1_pin_m_route_t *val)
Route a signal on INT_M pin.
int32_t lsm9ds1_xl_full_scale_get(const stmdev_ctx_t *ctx, lsm9ds1_xl_fs_t *val)
Accelerometer full-scale selection.
float_t lsm9ds1_from_fs2g_to_mg(int16_t lsb)
lsm9ds1_lir_t
int32_t lsm9ds1_act_mode_set(const stmdev_ctx_t *ctx, lsm9ds1_act_mode_t val)
Gyroscope operating mode during inactivity.
int32_t lsm9ds1_act_threshold_set(const stmdev_ctx_t *ctx, uint8_t val)
Inactivity threshold.
int32_t lsm9ds1_spi_mode_set(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, lsm9ds1_sim_t val)
SPI Serial Interface Mode selection.
int32_t lsm9ds1_mag_trshld_axis_set(const stmdev_ctx_t *ctx, lsm9ds1_mag_trshld_axis_t val)
Enable interrupt generation on threshold event.
int32_t lsm9ds1_gy_filter_hp_bandwidth_get(const stmdev_ctx_t *ctx, lsm9ds1_gy_hp_bw_t *val)
Gyroscope high-pass filter bandwidth selection.
int32_t lsm9ds1_mag_self_test_set(const stmdev_ctx_t *ctx, uint8_t val)
Enable/disable self-test mode for magnatic sensor.
lsm9ds1_ble_t
int32_t lsm9ds1_gy_self_test_set(const stmdev_ctx_t *ctx, uint8_t val)
Enable/disable self-test mode for gyroscope.
int32_t lsm9ds1_auto_increment_set(const stmdev_ctx_t *ctx, uint8_t val)
Register address automatically incremented during a multiple byte access with a serial interface.
int32_t lsm9ds1_xl_filter_out_path_get(const stmdev_ctx_t *ctx, lsm9ds1_xl_out_path_t *val)
Accelerometer output filter path configuration.
float_t lsm9ds1_from_fs245dps_to_mdps(int16_t lsb)
int32_t lsm9ds1_temperature_raw_get(const stmdev_ctx_t *ctx, int16_t *val)
Temperature data output register (r).
lsm9ds1_pin_logic_t
int32_t lsm9ds1_6d_mode_get(const stmdev_ctx_t *ctx, lsm9ds1_6d_mode_t *val)
6D feature working mode.
int32_t lsm9ds1_gy_trshld_min_sample_set(const stmdev_ctx_t *ctx, uint8_t val)
Enter/exit interrupt duration value.
int32_t lsm9ds1_gy_full_scale_get(const stmdev_ctx_t *ctx, lsm9ds1_gy_fs_t *val)
Gyroscope full-scale selection.
int32_t lsm9ds1_gy_trshld_mode_set(const stmdev_ctx_t *ctx, lsm9ds1_dcrm_g_t val)
Decrement or reset counter mode selection.
int32_t lsm9ds1_gy_trshld_mode_get(const stmdev_ctx_t *ctx, lsm9ds1_dcrm_g_t *val)
Decrement or reset counter mode selection.
int32_t lsm9ds1_gy_trshld_axis_get(const stmdev_ctx_t *ctx, lsm9ds1_gy_trshld_en_t *val)
Enable interrupt generation on threshold event.
int32_t lsm9ds1_gy_filter_out_path_get(const stmdev_ctx_t *ctx, lsm9ds1_gy_out_path_t *val)
Gyro output filter path configuration.
lsm9ds1_fifo_md_t
int32_t lsm9ds1_auto_increment_get(const stmdev_ctx_t *ctx, uint8_t *val)
Register address automatically incremented during a multiple byte access with a serial interface.
int32_t lsm9ds1_fifo_stop_on_wtm_get(const stmdev_ctx_t *ctx, uint8_t *val)
Sensing chain FIFO stop values memorization at threshold level.
int32_t lsm9ds1_gy_trshld_x_get(const stmdev_ctx_t *ctx, uint16_t *val)
Angular rate sensor interrupt threshold on pitch (X) axis.
int32_t lsm9ds1_pin_int1_route_get(const stmdev_ctx_t *ctx, lsm9ds1_pin_int1_route_t *val)
Route a signal on INT 1_A/G pin.
int32_t lsm9ds1_xl_axis_get(const stmdev_ctx_t *ctx, lsm9ds1_xl_axis_t *val)
Enable accelerometer axis.
lsm9ds1_sim_t
int32_t lsm9ds1_filter_settling_mask_get(const stmdev_ctx_t *ctx, uint8_t *val)
Mask DRDY on pin (both XL & Gyro) until filter settling ends.
int32_t lsm9ds1_gy_trshld_x_set(const stmdev_ctx_t *ctx, uint16_t val)
Angular rate sensor interrupt threshold on pitch (X) axis.
int32_t lsm9ds1_gy_filter_lp_bandwidth_set(const stmdev_ctx_t *ctx, lsm9ds1_gy_lp_bw_t val)
Gyroscope lowpass filter bandwidth selection.
int32_t lsm9ds1_mag_data_rate_set(const stmdev_ctx_t *ctx, lsm9ds1_mag_data_rate_t val)
Magnetometer data rate selection.
int32_t lsm9ds1_mag_offset_set(const stmdev_ctx_t *ctx, int16_t *val)
This register is a 16-bit register and represents the X offset used to compensate environmental effec...
int32_t lsm9ds1_mag_full_scale_set(const stmdev_ctx_t *ctx, lsm9ds1_mag_fs_t val)
Magnetometer full Scale Selection.
int32_t lsm9ds1_xl_self_test_get(const stmdev_ctx_t *ctx, uint8_t *val)
Enable/disable self-test mode for accelerometer.
int32_t lsm9ds1_magnetic_overflow_get(const stmdev_ctx_t *ctx, uint8_t *val)
Internal measurement range overflow on magnetic value.
int32_t lsm9ds1_gy_orient_get(const stmdev_ctx_t *ctx, lsm9ds1_gy_orient_t *val)
Configure gyro orientation.
int32_t lsm9ds1_fifo_full_flag_get(const stmdev_ctx_t *ctx, uint8_t *val)
FIFOfullstatus.
int32_t lsm9ds1_fifo_data_level_get(const stmdev_ctx_t *ctx, uint8_t *val)
Number of unread words (16-bit axes) stored in FIFO.
int32_t lsm9ds1_xl_filter_hp_bandwidth_set(const stmdev_ctx_t *ctx, lsm9ds1_xl_hp_bw_t val)
Accelerometer digital filter high pass cutoff frequency selection.
int32_t lsm9ds1_6d_threshold_get(const stmdev_ctx_t *ctx, uint8_t *buff)
6D functionality axis interrupt threshold.
float_t lsm9ds1_from_fs16g_to_mg(int16_t lsb)
int32_t lsm9ds1_xl_trshld_min_sample_set(const stmdev_ctx_t *ctx, uint8_t val)
Enter/exit interrupt duration value.
int32_t lsm9ds1_pin_int2_route_set(const stmdev_ctx_t *ctx, lsm9ds1_pin_int2_route_t val)
Route a signal on INT 2_A/G pin.
int32_t lsm9ds1_spi_mode_get(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, lsm9ds1_sim_t *val)
SPI Serial Interface Mode selection.
int32_t lsm9ds1_mag_data_rate_get(const stmdev_ctx_t *ctx, lsm9ds1_mag_data_rate_t *val)
Magnetometer data rate selection.
int32_t lsm9ds1_mag_full_scale_get(const stmdev_ctx_t *ctx, lsm9ds1_mag_fs_t *val)
Magnetometer full scale selection.
int32_t lsm9ds1_mag_self_test_get(const stmdev_ctx_t *ctx, uint8_t *val)
Enable/disable self-test mode for magnatic sensor.
int32_t lsm9ds1_dev_reset_set(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, uint8_t val)
Software reset.
int32_t lsm9ds1_pin_logic_get(const stmdev_ctx_t *ctx, lsm9ds1_pin_logic_t *val)
AND/OR combination of accelerometer’s interrupt events.
lsm9ds1_xl_out_path_t
int32_t lsm9ds1_gy_filter_int_path_get(const stmdev_ctx_t *ctx, lsm9ds1_gy_int_path_t *val)
Gyro interrupt filter path configuration.
lsm9ds1_xl_fs_t
lsm9ds1_gy_int_path_t
int32_t lsm9ds1_6d_threshold_set(const stmdev_ctx_t *ctx, uint8_t *buff)
6D functionality axis interrupt threshold.
int32_t lsm9ds1_fifo_temp_batch_get(const stmdev_ctx_t *ctx, uint8_t *val)
Batching of temperature data.
float_t lsm9ds1_from_fs2000dps_to_mdps(int16_t lsb)
int32_t lsm9ds1_fifo_stop_on_wtm_set(const stmdev_ctx_t *ctx, uint8_t val)
Sensing chain FIFO stop values memorization at threshold level.
int32_t lsm9ds1_fifo_mode_get(const stmdev_ctx_t *ctx, lsm9ds1_fifo_md_t *val)
FIFO mode selection.
int32_t lsm9ds1_xl_trshld_min_sample_get(const stmdev_ctx_t *ctx, uint8_t *val)
Enter/exit interrupt duration value.
int32_t lsm9ds1_gy_full_scale_set(const stmdev_ctx_t *ctx, lsm9ds1_gy_fs_t val)
Gyroscope full-scale selection.
int32_t lsm9ds1_pin_mode_get(const stmdev_ctx_t *ctx, lsm9ds1_pp_od_t *val)
Push-pull/open drain selection on interrupt pads.
lsm9ds1_dcrm_g_t
int32_t lsm9ds1_write_reg(const stmdev_ctx_t *ctx, uint8_t reg, uint8_t *data, uint16_t len)
Write generic device register.
Definition lsm9ds1_reg.c:75
float_t lsm9ds1_from_fs8g_to_mg(int16_t lsb)
int32_t lsm9ds1_dev_boot_set(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, uint8_t val)
Reboot memory content.
int32_t lsm9ds1_mag_trshld_src_get(const stmdev_ctx_t *ctx, lsm9ds1_mag_trshld_src_t *val)
Magnetometer interrupt on threshold source.
int32_t lsm9ds1_pin_polarity_set(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, lsm9ds1_polarity_t val)
Configure the interrupt pin polarity.
lsm9ds1_xl_lp_bw_t
lsm9ds1_gy_hp_bw_t
int32_t lsm9ds1_dev_id_get(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, lsm9ds1_id_t *buff)
DeviceWhoamI.
int32_t lsm9ds1_pin_int_m_route_set(const stmdev_ctx_t *ctx, lsm9ds1_pin_m_route_t val)
Route a signal on INT_M pin.
int32_t lsm9ds1_pin_mode_set(const stmdev_ctx_t *ctx, lsm9ds1_pp_od_t val)
Push-pull/open drain selection on interrupt pads.
int32_t lsm9ds1_xl_axis_set(const stmdev_ctx_t *ctx, lsm9ds1_xl_axis_t val)
Enable accelerometer axis.
int32_t lsm9ds1_xl_filter_int_path_get(const stmdev_ctx_t *ctx, lsm9ds1_xl_hp_path_t *val)
int32_t lsm9ds1_gy_filter_out_path_set(const stmdev_ctx_t *ctx, lsm9ds1_gy_out_path_t val)
Gyro output filter path configuration.
int32_t lsm9ds1_pin_notification_set(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, lsm9ds1_lir_t val)
Latched/pulsed interrupt.
lsm9ds1_pp_od_t
int32_t lsm9ds1_pin_int1_route_set(const stmdev_ctx_t *ctx, lsm9ds1_pin_int1_route_t val)
Route a signal on INT 1_A/G pin.
lsm9ds1_act_mode_t
lsm9ds1_xl_hp_bw_t
int32_t lsm9ds1_imu_data_rate_set(const stmdev_ctx_t *ctx, lsm9ds1_imu_odr_t val)
Data rate selection when both the accelerometer and gyroscope are activated.
int32_t lsm9ds1_gy_flag_data_ready_get(const stmdev_ctx_t *ctx, uint8_t *val)
Gyroscope new data available.
lsm9ds1_xl_hp_path_t
int32_t lsm9ds1_gy_filter_reference_set(const stmdev_ctx_t *ctx, uint8_t *buff)
Reference value for gyroscope’s digital high-pass filter.
int32_t lsm9ds1_xl_filter_aalias_bandwidth_get(const stmdev_ctx_t *ctx, lsm9ds1_xl_aa_bw_t *val)
Configure accelerometer anti aliasing filter.
int32_t lsm9ds1_pin_notification_get(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, lsm9ds1_lir_t *val)
Configure the interrupt notification mode.
int32_t lsm9ds1_fifo_mode_set(const stmdev_ctx_t *ctx, lsm9ds1_fifo_md_t val)
FIFO mode selection.
lsm9ds1_6d_mode_t
int32_t lsm9ds1_xl_filter_lp_bandwidth_get(const stmdev_ctx_t *ctx, lsm9ds1_xl_lp_bw_t *val)
Accelerometer digital filter low pass cutoff frequency selection.
int32_t lsm9ds1_mag_flag_data_ready_get(const stmdev_ctx_t *ctx, uint8_t *val)
New data available from magnetometer.
int32_t lsm9ds1_6d_src_get(const stmdev_ctx_t *ctx, lsm9ds1_6d_src_t *val)
lsm9ds1_mag_data_rate_t
int32_t lsm9ds1_xl_trshld_get(const stmdev_ctx_t *ctx, uint8_t *buff)
Axis interrupt threshold.
int32_t lsm9ds1_mag_trshld_set(const stmdev_ctx_t *ctx, uint8_t *val)
float_t lsm9ds1_from_fs4g_to_mg(int16_t lsb)
int32_t lsm9ds1_pin_int2_route_get(const stmdev_ctx_t *ctx, lsm9ds1_pin_int2_route_t *val)
Route a signal on INT 2_A/G pin.
int32_t lsm9ds1_act_src_get(const stmdev_ctx_t *ctx, lsm9ds1_inact_t *val)
Inactivity interrupt output signal.
int32_t lsm9ds1_gy_trshld_y_get(const stmdev_ctx_t *ctx, uint16_t *val)
Angular rate sensor interrupt threshold on roll (Y) axis.
lsm9ds1_imu_odr_t
int32_t lsm9ds1_act_mode_get(const stmdev_ctx_t *ctx, lsm9ds1_act_mode_t *val)
Gyroscope operating mode during inactivity.
int32_t lsm9ds1_gy_trshld_axis_set(const stmdev_ctx_t *ctx, lsm9ds1_gy_trshld_en_t val)
Enable interrupt generation on threshold event.
float_t lsm9ds1_from_fs500dps_to_mdps(int16_t lsb)
int32_t lsm9ds1_xl_filter_aalias_bandwidth_set(const stmdev_ctx_t *ctx, lsm9ds1_xl_aa_bw_t val)
Configure accelerometer anti aliasing filter.
int32_t lsm9ds1_angular_rate_raw_get(const stmdev_ctx_t *ctx, int16_t *val)
Angular rate sensor.
int32_t lsm9ds1_gy_axis_get(const stmdev_ctx_t *ctx, lsm9ds1_gy_axis_t *val)
Enable gyroscope axis.
int32_t lsm9ds1_fifo_temp_batch_set(const stmdev_ctx_t *ctx, uint8_t val)
Batching of temperature data.
int32_t lsm9ds1_filter_settling_mask_set(const stmdev_ctx_t *ctx, uint8_t val)
Mask DRDY on pin (both XL & Gyro) until filter settling ends.
int32_t lsm9ds1_i2c_interface_set(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, lsm9ds1_i2c_dis_t val)
Enable / Disable I2C interface.
int32_t lsm9ds1_read_reg(const stmdev_ctx_t *ctx, uint8_t reg, uint8_t *data, uint16_t len)
Read generic device register.
Definition lsm9ds1_reg.c:49
float_t lsm9ds1_from_fs16gauss_to_mG(int16_t lsb)
float_t lsm9ds1_from_fs4gauss_to_mG(int16_t lsb)
lsm9ds1_gy_out_path_t
int32_t lsm9ds1_fifo_watermark_get(const stmdev_ctx_t *ctx, uint8_t *val)
FIFO watermark level selection.
lsm9ds1_inact_t
int32_t lsm9ds1_gy_self_test_get(const stmdev_ctx_t *ctx, uint8_t *val)
Enable/disable self-test mode for gyroscope.
lsm9ds1_i2c_dis_t
lsm9ds1_gy_lp_bw_t
int32_t lsm9ds1_dev_status_get(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, lsm9ds1_status_t *val)
Device status register.
int32_t lsm9ds1_block_data_update_get(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, uint8_t *val)
Blockdataupdate.
int32_t lsm9ds1_fifo_ovr_flag_get(const stmdev_ctx_t *ctx, uint8_t *val)
FIFO overrun status.
int32_t lsm9ds1_gy_trshld_src_get(const stmdev_ctx_t *ctx, lsm9ds1_gy_trshld_src_t *val)
Angular rate sensor interrupt on threshold source.
lsm9ds1_polarity_t
int32_t lsm9ds1_imu_data_rate_get(const stmdev_ctx_t *ctx, lsm9ds1_imu_odr_t *val)
Data rate selection when both the accelerometer and gyroscope are activated.
int32_t lsm9ds1_xl_trshld_axis_get(const stmdev_ctx_t *ctx, lsm9ds1_xl_trshld_en_t *val)
Enable interrupt generation on threshold event.
int32_t lsm9ds1_dev_boot_get(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, uint8_t *val)
Reboot memory content.
int32_t lsm9ds1_gy_orient_set(const stmdev_ctx_t *ctx, lsm9ds1_gy_orient_t val)
Configure gyro orientation.
int32_t lsm9ds1_mag_offset_get(const stmdev_ctx_t *ctx, int16_t *val)
This register is a 16-bit register and represents the X offset used to compensate environmental effec...
int32_t lsm9ds1_acceleration_raw_get(const stmdev_ctx_t *ctx, int16_t *val)
Linear acceleration output register.
int32_t lsm9ds1_xl_trshld_set(const stmdev_ctx_t *ctx, uint8_t *buff)
Axis interrupt threshold.
int32_t lsm9ds1_gy_axis_set(const stmdev_ctx_t *ctx, lsm9ds1_gy_axis_t val)
Enable gyroscope axis.
int32_t lsm9ds1_xl_self_test_set(const stmdev_ctx_t *ctx, uint8_t val)
Enable/disable self-test mode for accelerometer.
int32_t lsm9ds1_xl_filter_int_path_set(const stmdev_ctx_t *ctx, lsm9ds1_xl_hp_path_t val)
Configure HP accelerometer filter.
int32_t lsm9ds1_gy_filter_reference_get(const stmdev_ctx_t *ctx, uint8_t *buff)
Reference value for gyroscope’s digital high-pass filter.
lsm9ds1_gy_fs_t
int32_t lsm9ds1_xl_filter_lp_bandwidth_set(const stmdev_ctx_t *ctx, lsm9ds1_xl_lp_bw_t val)
Accelerometer digital filter low pass cutoff frequency selection.
int32_t lsm9ds1_xl_decimation_set(const stmdev_ctx_t *ctx, lsm9ds1_dec_t val)
Decimation of acceleration data on OUT REG and FIFO.
int32_t lsm9ds1_xl_decimation_get(const stmdev_ctx_t *ctx, lsm9ds1_dec_t *val)
Decimation of acceleration data on OUT REG and FIFO.
int32_t lsm9ds1_6d_mode_set(const stmdev_ctx_t *ctx, lsm9ds1_6d_mode_t val)
6D feature working mode.
int32_t lsm9ds1_i2c_interface_get(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, lsm9ds1_i2c_dis_t *val)
Enable / Disable I2C interface.
int32_t lsm9ds1_fifo_watermark_set(const stmdev_ctx_t *ctx, uint8_t val)
FIFO watermark level selection.
int32_t lsm9ds1_dev_data_format_get(const stmdev_ctx_t *ctx_mag, stmdev_ctx_t *ctx_imu, lsm9ds1_ble_t *val)
Big/Little Endian data selection.
int32_t lsm9ds1_gy_trshld_y_set(const stmdev_ctx_t *ctx, uint16_t val)
Angular rate sensor interrupt threshold on roll (Y) axis.
int32_t lsm9ds1_gy_trshld_min_sample_get(const stmdev_ctx_t *ctx, uint8_t *val)
Enter/exit interrupt duration value.
int32_t lsm9ds1_xl_filter_out_path_set(const stmdev_ctx_t *ctx, lsm9ds1_xl_out_path_t val)
Accelerometer output filter path configuration.
float_t lsm9ds1_from_lsb_to_celsius(int16_t lsb)
lsm9ds1_xl_aa_bw_t
int32_t lsm9ds1_fifo_wtm_flag_get(const stmdev_ctx_t *ctx, uint8_t *val)
FIFO watermark status.
int32_t lsm9ds1_gy_trshld_z_set(const stmdev_ctx_t *ctx, uint16_t val)
Angular rate sensor interrupt thresholds on yaw (Z) axis.
float_t lsm9ds1_from_fs8gauss_to_mG(int16_t lsb)
int32_t lsm9ds1_xl_trshld_axis_set(const stmdev_ctx_t *ctx, lsm9ds1_xl_trshld_en_t val)
Enable interrupt generation on threshold event.
int32_t lsm9ds1_act_threshold_get(const stmdev_ctx_t *ctx, uint8_t *val)
Inactivity threshold.
int32_t lsm9ds1_gy_trshld_z_get(const stmdev_ctx_t *ctx, uint16_t *val)
Angular rate sensor interrupt thresholds on yaw (Z) axis.
int32_t lsm9ds1_xl_flag_data_ready_get(const stmdev_ctx_t *ctx, uint8_t *val)
Accelerometer new data available.
int32_t lsm9ds1_temp_flag_data_ready_get(const stmdev_ctx_t *ctx, uint8_t *val)
Temperature new data available.
int32_t lsm9ds1_gy_filter_lp_bandwidth_get(const stmdev_ctx_t *ctx, lsm9ds1_gy_lp_bw_t *val)
Gyroscope lowpass filter bandwidth selection.
@ LSM9DS1_12Ga
@ LSM9DS1_4Ga
@ LSM9DS1_16Ga
@ LSM9DS1_8Ga
@ LSM9DS1_NO_DECIMATION
@ LSM9DS1_EVERY_8_SAMPLES
@ LSM9DS1_EVERY_4_SAMPLES
@ LSM9DS1_EVERY_2_SAMPLES
@ LSM9DS1_INT_LATCHED
@ LSM9DS1_INT_PULSED
@ LSM9DS1_MSB_LOW_ADDRESS
@ LSM9DS1_LSB_LOW_ADDRESS
@ LSM9DS1_LOGIC_OR
@ LSM9DS1_LOGIC_AND
@ LSM9DS1_FIFO_OFF
@ LSM9DS1_BYPASS_MODE
@ LSM9DS1_STREAM_TO_FIFO_MODE
@ LSM9DS1_BYPASS_TO_STREAM_MODE
@ LSM9DS1_FIFO_MODE
@ LSM9DS1_STREAM_MODE
@ LSM9DS1_SPI_4_WIRE
@ LSM9DS1_SPI_3_WIRE
@ LSM9DS1_LP_OUT
@ LSM9DS1_HP_OUT
@ LSM9DS1_2g
@ LSM9DS1_4g
@ LSM9DS1_16g
@ LSM9DS1_8g
@ LSM9DS1_LPF1_HPF_INT
@ LSM9DS1_LPF1_HPF_LPF2_INT
@ LSM9DS1_LPF1_INT
@ LSM9DS1_LPF1_LPF2_INT
@ LSM9DS1_DECREMENT_MODE
@ LSM9DS1_RESET_MODE
@ LSM9DS1_LP_ODR_DIV_400
@ LSM9DS1_LP_ODR_DIV_9
@ LSM9DS1_LP_ODR_DIV_100
@ LSM9DS1_LP_DISABLE
@ LSM9DS1_LP_ODR_DIV_50
@ LSM9DS1_HP_LIGHT
@ LSM9DS1_HP_EXTREME
@ LSM9DS1_HP_ULTRA_STRONG
@ LSM9DS1_HP_ULTRA_LIGHT
@ LSM9DS1_HP_MEDIUM
@ LSM9DS1_HP_LOW
@ LSM9DS1_HP_STRONG
@ LSM9DS1_HP_HIGH
@ LSM9DS1_HP_ULTRA_LOW
@ LSM9DS1_HP_ULTRA_HIGH
@ LSM9DS1_OPEN_DRAIN
@ LSM9DS1_PUSH_PULL
@ LSM9DS1_GYRO_POWER_DOWN
@ LSM9DS1_GYRO_SLEEP
@ LSM9DS1_HP_ODR_DIV_100
@ LSM9DS1_HP_ODR_DIV_9
@ LSM9DS1_HP_ODR_DIV_400
@ LSM9DS1_HP_ODR_DIV_50
@ LSM9DS1_HP_DIS
@ LSM9DS1_HP_EN
@ LSM9DS1_POS_MOVE_RECO_DISABLE
@ LSM9DS1_4D_POS_RECO
@ LSM9DS1_6D_MOVE_RECO
@ LSM9DS1_6D_POS_RECO
@ LSM9DS1_4D_MOVE_RECO
@ LSM9DS1_MAG_LP_20Hz
@ LSM9DS1_MAG_HP_1Hz25
@ LSM9DS1_MAG_MP_560Hz
@ LSM9DS1_MAG_LP_80Hz
@ LSM9DS1_MAG_UHP_80Hz
@ LSM9DS1_MAG_MP_1Hz25
@ LSM9DS1_MAG_MP_40Hz
@ LSM9DS1_MAG_LP_5Hz
@ LSM9DS1_MAG_HP_40Hz
@ LSM9DS1_MAG_UHP_10Hz
@ LSM9DS1_MAG_HP_80Hz
@ LSM9DS1_MAG_MP_20Hz
@ LSM9DS1_MAG_ONE_SHOT
@ LSM9DS1_MAG_MP_5Hz
@ LSM9DS1_MAG_LP_2Hz5
@ LSM9DS1_MAG_UHP_1Hz25
@ LSM9DS1_MAG_MP_10Hz
@ LSM9DS1_MAG_MP_2Hz5
@ LSM9DS1_MAG_LP_40Hz
@ LSM9DS1_MAG_UHP_40Hz
@ LSM9DS1_MAG_POWER_DOWN
@ LSM9DS1_MAG_HP_5Hz
@ LSM9DS1_MAG_LP_1Hz25
@ LSM9DS1_MAG_UHP_155Hz
@ LSM9DS1_MAG_HP_300Hz
@ LSM9DS1_MAG_MP_0Hz625
@ LSM9DS1_MAG_LP_1000Hz
@ LSM9DS1_MAG_LP_10Hz
@ LSM9DS1_MAG_UHP_20Hz
@ LSM9DS1_MAG_UHP_2Hz5
@ LSM9DS1_MAG_HP_10Hz
@ LSM9DS1_MAG_UHP_5Hz
@ LSM9DS1_MAG_UHP_0Hz625
@ LSM9DS1_MAG_MP_80Hz
@ LSM9DS1_MAG_LP_0Hz625
@ LSM9DS1_MAG_HP_20Hz
@ LSM9DS1_MAG_HP_0Hz625
@ LSM9DS1_MAG_HP_2Hz5
@ LSM9DS1_GY_OFF_XL_952Hz
@ LSM9DS1_XL_OFF_GY_59Hz5_LP
@ LSM9DS1_IMU_59Hz5_LP
@ LSM9DS1_IMU_14Hz9_LP
@ LSM9DS1_GY_OFF_XL_50Hz
@ LSM9DS1_XL_OFF_GY_14Hz9_LP
@ LSM9DS1_IMU_OFF
@ LSM9DS1_IMU_119Hz
@ LSM9DS1_XL_OFF_GY_476Hz
@ LSM9DS1_GY_OFF_XL_238Hz
@ LSM9DS1_IMU_59Hz5
@ LSM9DS1_IMU_14Hz9
@ LSM9DS1_XL_OFF_GY_119Hz_LP
@ LSM9DS1_XL_OFF_GY_59Hz5
@ LSM9DS1_GY_OFF_XL_476Hz
@ LSM9DS1_XL_OFF_GY_119Hz
@ LSM9DS1_XL_OFF_GY_238Hz
@ LSM9DS1_IMU_238Hz
@ LSM9DS1_IMU_119Hz_LP
@ LSM9DS1_IMU_952Hz
@ LSM9DS1_XL_OFF_GY_14Hz9
@ LSM9DS1_GY_OFF_XL_119Hz
@ LSM9DS1_XL_OFF_GY_952Hz
@ LSM9DS1_IMU_476Hz
@ LSM9DS1_GY_OFF_XL_10Hz
@ LSM9DS1_LPF1_LPF2_OUT
@ LSM9DS1_LPF1_HPF_OUT
@ LSM9DS1_LPF1_OUT
@ LSM9DS1_LPF1_HPF_LPF2_OUT
@ LSM9DS1_INACTIVITY
@ LSM9DS1_ACTIVITY
@ LSM9DS1_I2C_ENABLE
@ LSM9DS1_I2C_DISABLE
@ LSM9DS1_LP_LIGHT
@ LSM9DS1_LP_STRONG
@ LSM9DS1_LP_MEDIUM
@ LSM9DS1_LP_ULTRA_LIGHT
@ LSM9DS1_ACTIVE_HIGH
@ LSM9DS1_ACTIVE_LOW
@ LSM9DS1_245dps
@ LSM9DS1_2000dps
@ LSM9DS1_500dps
@ LSM9DS1_AUTO
@ LSM9DS1_50Hz
@ LSM9DS1_105Hz
@ LSM9DS1_408Hz
@ LSM9DS1_211Hz
uint8_t bit1
Definition lsm9ds1_reg.h:82
uint8_t bit6
Definition lsm9ds1_reg.h:87
uint8_t bit2
Definition lsm9ds1_reg.h:83
uint8_t bit3
Definition lsm9ds1_reg.h:84
uint8_t bit7
Definition lsm9ds1_reg.h:88
uint8_t bit4
Definition lsm9ds1_reg.h:85
uint8_t bit0
Definition lsm9ds1_reg.h:81
uint8_t bit5
Definition lsm9ds1_reg.h:86
uint8_t sleep_on_inact_en
lsm9ds1_status_reg_m_t status_mag
lsm9ds1_status_reg_t status_imu
stmdev_read_ptr read_reg
stmdev_mdelay_ptr mdelay
Component optional fields.
stmdev_write_ptr write_reg
Component mandatory fields.
void * handle
Customizable optional pointer.
uint8_t address
uint8_t data
lsm9ds1_ctrl_reg4_m_t ctrl_reg4_m
lsm9ds1_int_src_m_t int_src_m
lsm9ds1_int_gen_ths_yl_g_t int_gen_ths_yl_g
lsm9ds1_ctrl_reg2_m_t ctrl_reg2_m
lsm9ds1_fifo_ctrl_t fifo_ctrl
lsm9ds1_fifo_src_t fifo_src
lsm9ds1_status_reg_t status_reg
lsm9ds1_status_reg_m_t status_reg_m
lsm9ds1_int_gen_ths_xl_g_t int_gen_ths_xl_g
lsm9ds1_int_gen_ths_zl_g_t int_gen_ths_zl_g
lsm9ds1_act_ths_t act_ths
lsm9ds1_ctrl_reg4_t ctrl_reg4
lsm9ds1_int_ths_h_m_t int_ths_h_m
lsm9ds1_ctrl_reg2_g_t ctrl_reg2_g
lsm9ds1_ctrl_reg3_m_t ctrl_reg3_m
lsm9ds1_int1_ctrl_t int1_ctrl
lsm9ds1_int_gen_ths_yh_g_t int_gen_ths_yh_g
lsm9ds1_int_gen_dur_g_t int_gen_dur_g
bitwise_t bitwise
lsm9ds1_int_gen_ths_zh_g_t int_gen_ths_zh_g
lsm9ds1_int_gen_src_g_t int_gen_src_g
lsm9ds1_orient_cfg_g_t orient_cfg_g
lsm9ds1_ctrl_reg1_g_t ctrl_reg1_g
lsm9ds1_int_gen_cfg_g_t int_gen_cfg_g
lsm9ds1_int_gen_ths_xh_g_t int_gen_ths_xh_g
lsm9ds1_ctrl_reg3_g_t ctrl_reg3_g
lsm9ds1_int_gen_dur_xl_t int_gen_dur_xl
lsm9ds1_int_ths_l_m_t int_ths_l_m
lsm9ds1_ctrl_reg9_t ctrl_reg9
lsm9ds1_ctrl_reg5_xl_t ctrl_reg5_xl
lsm9ds1_ctrl_reg6_xl_t ctrl_reg6_xl
lsm9ds1_ctrl_reg10_t ctrl_reg10
lsm9ds1_int_gen_src_xl_t int_gen_src_xl
lsm9ds1_int2_ctrl_t int2_ctrl
lsm9ds1_ctrl_reg7_xl_t ctrl_reg7_xl
lsm9ds1_ctrl_reg1_m_t ctrl_reg1_m
lsm9ds1_int_cfg_m_t int_cfg_m
lsm9ds1_ctrl_reg5_m_t ctrl_reg5_m
lsm9ds1_int_gen_cfg_xl_t int_gen_cfg_xl
lsm9ds1_ctrl_reg8_t ctrl_reg8