1 /*
2   ******************************************************************************
3   * @file    asm330lhhx_reg.h
4   * @author  Sensor Solutions Software Team
5   * @brief   This file contains all the functions prototypes for the
6   *          asm330lhhx_reg.c driver.
7   ******************************************************************************
8   * @attention
9   *
10   * <h2><center>&copy; Copyright (c) 2023 STMicroelectronics.
11   * All rights reserved.</center></h2>
12   *
13   * This software component is licensed by ST under BSD 3-Clause license,
14   * the "License"; You may not use this file except in compliance with the
15   * License. You may obtain a copy of the License at:
16   *                        opensource.org/licenses/BSD-3-Clause
17   *
18   ******************************************************************************
19   */
20 
21 /* Define to prevent recursive inclusion -------------------------------------*/
22 #ifndef ASM330LHHX_REGS_H
23 #define ASM330LHHX_REGS_H
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /* Includes ------------------------------------------------------------------*/
30 #include <stdint.h>
31 #include <stddef.h>
32 #include <math.h>
33 
34 /** @addtogroup ASM330LHHX
35   * @{
36   *
37   */
38 
39 /** @defgroup  Endianness definitions
40   * @{
41   *
42   */
43 
44 #ifndef DRV_BYTE_ORDER
45 #ifndef __BYTE_ORDER__
46 
47 #define DRV_LITTLE_ENDIAN 1234
48 #define DRV_BIG_ENDIAN    4321
49 
50 /** if _BYTE_ORDER is not defined, choose the endianness of your architecture
51   * by uncommenting the define which fits your platform endianness
52   */
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 
65 /**
66   * @}
67   *
68   */
69 
70 /** @defgroup STMicroelectronics sensors common types
71   * @{
72   *
73   */
74 
75 #ifndef MEMS_SHARED_TYPES
76 #define MEMS_SHARED_TYPES
77 
78 typedef 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 
104 /** @addtogroup  Interfaces_Functions
105   * @brief       This section provide a set of functions used to read and
106   *              write a generic register of the device.
107   *              MANDATORY: return 0 -> no Error.
108   * @{
109   *
110   */
111 
112 typedef int32_t (*stmdev_write_ptr)(void *, uint8_t, const uint8_t *, uint16_t);
113 typedef int32_t (*stmdev_read_ptr)(void *, uint8_t, uint8_t *, uint16_t);
114 typedef void (*stmdev_mdelay_ptr)(uint32_t millisec);
115 
116 typedef struct
117 {
118   /** Component mandatory fields **/
119   stmdev_write_ptr  write_reg;
120   stmdev_read_ptr   read_reg;
121   /** Component optional fields **/
122   stmdev_mdelay_ptr   mdelay;
123   /** Customizable optional pointer **/
124   void *handle;
125 } stmdev_ctx_t;
126 
127 /**
128   * @}
129   *
130   */
131 
132 #endif /* MEMS_SHARED_TYPES */
133 
134 #ifndef MEMS_UCF_SHARED_TYPES
135 #define MEMS_UCF_SHARED_TYPES
136 
137 /** @defgroup    Generic address-data structure definition
138   * @brief       This structure is useful to load a predefined configuration
139   *              of a sensor.
140   *              You can create a sensor configuration by your own or using
141   *              Unico / Unicleo tools available on STMicroelectronics
142   *              web site.
143   *
144   * @{
145   *
146   */
147 
148 typedef struct
149 {
150   uint8_t address;
151   uint8_t data;
152 } ucf_line_t;
153 
154 /**
155   * @}
156   *
157   */
158 
159 #endif /* MEMS_UCF_SHARED_TYPES */
160 
161 /**
162   * @}
163   *
164   */
165 
166 /** @defgroup ASM330LHHX Infos
167   * @{
168   *
169   */
170 
171 /** I2C Device Address 8 bit format  if SA0=0 -> D5 if SA0=1 -> D7 **/
172 #define ASM330LHHX_I2C_ADD_L                    0xD5U
173 #define ASM330LHHX_I2C_ADD_H                    0xD7U
174 
175 /** Device Identification (Who am I) **/
176 #define ASM330LHHX_ID                           0x6BU
177 
178 /**
179   * @}
180   *
181   */
182 
183 #define ASM330LHHX_FUNC_CFG_ACCESS              0x01U
184 typedef struct
185 {
186 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
187   uint8_t not_used_01              : 6;
188   uint8_t reg_access               : 2; /* shub_reg_access + func_cfg_access */
189 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
190   uint8_t reg_access               : 2; /* shub_reg_access + func_cfg_access */
191   uint8_t not_used_01              : 6;
192 #endif /* DRV_BYTE_ORDER */
193 } asm330lhhx_func_cfg_access_t;
194 
195 #define ASM330LHHX_PIN_CTRL                     0x02U
196 typedef struct
197 {
198 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
199   uint8_t not_used_01              : 6;
200   uint8_t sdo_pu_en                : 1;
201   uint8_t not_used_02              : 1;
202 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
203   uint8_t not_used_02              : 1;
204   uint8_t sdo_pu_en                : 1;
205   uint8_t not_used_01              : 6;
206 #endif /* DRV_BYTE_ORDER */
207 } asm330lhhx_pin_ctrl_t;
208 
209 #define ASM330LHHX_FIFO_CTRL1                   0x07U
210 typedef struct
211 {
212   uint8_t wtm                      : 8;
213 } asm330lhhx_fifo_ctrl1_t;
214 
215 #define ASM330LHHX_FIFO_CTRL2                   0x08U
216 typedef struct
217 {
218 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
219   uint8_t wtm                      : 1;
220   uint8_t not_used_01              : 3;
221   uint8_t odrchg_en                : 1;
222   uint8_t not_used_02              : 2;
223   uint8_t stop_on_wtm              : 1;
224 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
225   uint8_t stop_on_wtm              : 1;
226   uint8_t not_used_02              : 2;
227   uint8_t odrchg_en                : 1;
228   uint8_t not_used_01              : 3;
229   uint8_t wtm                      : 1;
230 #endif /* DRV_BYTE_ORDER */
231 } asm330lhhx_fifo_ctrl2_t;
232 
233 #define ASM330LHHX_FIFO_CTRL3                   0x09U
234 typedef struct
235 {
236 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
237   uint8_t bdr_xl                   : 4;
238   uint8_t bdr_gy                   : 4;
239 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
240   uint8_t bdr_gy                   : 4;
241   uint8_t bdr_xl                   : 4;
242 #endif /* DRV_BYTE_ORDER */
243 } asm330lhhx_fifo_ctrl3_t;
244 
245 #define ASM330LHHX_FIFO_CTRL4                   0x0AU
246 typedef struct
247 {
248 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
249   uint8_t fifo_mode                : 3;
250   uint8_t not_used_01              : 1;
251   uint8_t odr_t_batch              : 2;
252   uint8_t dec_ts_batch             : 2;
253 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
254   uint8_t dec_ts_batch             : 2;
255   uint8_t odr_t_batch              : 2;
256   uint8_t not_used_01              : 1;
257   uint8_t fifo_mode                : 3;
258 #endif /* DRV_BYTE_ORDER */
259 } asm330lhhx_fifo_ctrl4_t;
260 
261 #define ASM330LHHX_COUNTER_BDR_REG1             0x0BU
262 typedef struct
263 {
264 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
265   uint8_t cnt_bdr_th               : 3;
266   uint8_t not_used_01              : 2;
267   uint8_t trig_counter_bdr         : 1;
268   uint8_t rst_counter_bdr          : 1;
269   uint8_t dataready_pulsed         : 1;
270 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
271   uint8_t dataready_pulsed         : 1;
272   uint8_t rst_counter_bdr          : 1;
273   uint8_t trig_counter_bdr         : 1;
274   uint8_t not_used_01              : 2;
275   uint8_t cnt_bdr_th               : 3;
276 #endif /* DRV_BYTE_ORDER */
277 } asm330lhhx_counter_bdr_reg1_t;
278 
279 #define ASM330LHHX_COUNTER_BDR_REG2             0x0CU
280 typedef struct
281 {
282   uint8_t cnt_bdr_th               : 8;
283 } asm330lhhx_counter_bdr_reg2_t;
284 
285 #define ASM330LHHX_INT1_CTRL                    0x0DU
286 typedef struct
287 {
288 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
289   uint8_t int1_drdy_xl             : 1;
290   uint8_t int1_drdy_g              : 1;
291   uint8_t int1_boot                : 1;
292   uint8_t int1_fifo_th             : 1;
293   uint8_t int1_fifo_ovr            : 1;
294   uint8_t int1_fifo_full           : 1;
295   uint8_t int1_cnt_bdr             : 1;
296   uint8_t den_drdy_flag            : 1;
297 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
298   uint8_t den_drdy_flag            : 1;
299   uint8_t int1_cnt_bdr             : 1;
300   uint8_t int1_fifo_full           : 1;
301   uint8_t int1_fifo_ovr            : 1;
302   uint8_t int1_fifo_th             : 1;
303   uint8_t int1_boot                : 1;
304   uint8_t int1_drdy_g              : 1;
305   uint8_t int1_drdy_xl             : 1;
306 #endif /* DRV_BYTE_ORDER */
307 } asm330lhhx_int1_ctrl_t;
308 
309 #define ASM330LHHX_INT2_CTRL                    0x0EU
310 typedef struct
311 {
312 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
313   uint8_t int2_drdy_xl             : 1;
314   uint8_t int2_drdy_g              : 1;
315   uint8_t int2_drdy_temp           : 1;
316   uint8_t int2_fifo_th             : 1;
317   uint8_t int2_fifo_ovr            : 1;
318   uint8_t int2_fifo_full           : 1;
319   uint8_t int2_cnt_bdr             : 1;
320   uint8_t not_used_01              : 1;
321 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
322   uint8_t not_used_01              : 1;
323   uint8_t int2_cnt_bdr             : 1;
324   uint8_t int2_fifo_full           : 1;
325   uint8_t int2_fifo_ovr            : 1;
326   uint8_t int2_fifo_th             : 1;
327   uint8_t int2_drdy_temp           : 1;
328   uint8_t int2_drdy_g              : 1;
329   uint8_t int2_drdy_xl             : 1;
330 #endif /* DRV_BYTE_ORDER */
331 } asm330lhhx_int2_ctrl_t;
332 
333 #define ASM330LHHX_WHO_AM_I                     0x0FU
334 
335 #define ASM330LHHX_CTRL1_XL                     0x10U
336 typedef struct
337 {
338 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
339   uint8_t not_used_01              : 1;
340   uint8_t lpf2_xl_en               : 1;
341   uint8_t fs_xl                    : 2;
342   uint8_t odr_xl                   : 4;
343 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
344   uint8_t odr_xl                   : 4;
345   uint8_t fs_xl                    : 2;
346   uint8_t lpf2_xl_en               : 1;
347   uint8_t not_used_01              : 1;
348 #endif /* DRV_BYTE_ORDER */
349 } asm330lhhx_ctrl1_xl_t;
350 
351 #define ASM330LHHX_CTRL2_G                      0x11U
352 typedef struct
353 {
354 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
355   uint8_t fs_g                     : 4; /* fs_4000 + fs_125 + fs_g */
356   uint8_t odr_g                    : 4;
357 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
358   uint8_t odr_g                    : 4;
359   uint8_t fs_g                     : 4; /* fs_4000 + fs_125 + fs_g */
360 #endif /* DRV_BYTE_ORDER */
361 } asm330lhhx_ctrl2_g_t;
362 
363 #define ASM330LHHX_CTRL3_C                      0x12U
364 typedef struct
365 {
366 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
367   uint8_t sw_reset                 : 1;
368   uint8_t not_used_01              : 1;
369   uint8_t if_inc                   : 1;
370   uint8_t sim                      : 1;
371   uint8_t pp_od                    : 1;
372   uint8_t h_lactive                : 1;
373   uint8_t bdu                      : 1;
374   uint8_t boot                     : 1;
375 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
376   uint8_t boot                     : 1;
377   uint8_t bdu                      : 1;
378   uint8_t h_lactive                : 1;
379   uint8_t pp_od                    : 1;
380   uint8_t sim                      : 1;
381   uint8_t if_inc                   : 1;
382   uint8_t not_used_01              : 1;
383   uint8_t sw_reset                 : 1;
384 #endif /* DRV_BYTE_ORDER */
385 } asm330lhhx_ctrl3_c_t;
386 
387 #define ASM330LHHX_CTRL4_C                      0x13U
388 typedef struct
389 {
390 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
391   uint8_t not_used_01              : 1;
392   uint8_t lpf1_sel_g               : 1;
393   uint8_t i2c_disable              : 1;
394   uint8_t drdy_mask                : 1;
395   uint8_t not_used_02              : 1;
396   uint8_t int2_on_int1             : 1;
397   uint8_t sleep_g                  : 1;
398   uint8_t not_used_03              : 1;
399 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
400   uint8_t not_used_03              : 1;
401   uint8_t sleep_g                  : 1;
402   uint8_t int2_on_int1             : 1;
403   uint8_t not_used_02              : 1;
404   uint8_t drdy_mask                : 1;
405   uint8_t i2c_disable              : 1;
406   uint8_t lpf1_sel_g               : 1;
407   uint8_t not_used_01              : 1;
408 #endif /* DRV_BYTE_ORDER */
409 } asm330lhhx_ctrl4_c_t;
410 
411 #define ASM330LHHX_CTRL5_C                      0x14U
412 typedef struct
413 {
414 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
415   uint8_t st_xl                    : 2;
416   uint8_t st_g                     : 2;
417   uint8_t not_used_01              : 1;
418   uint8_t rounding                 : 2;
419   uint8_t not_used_02              : 1;
420 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
421   uint8_t not_used_02              : 1;
422   uint8_t rounding                 : 2;
423   uint8_t not_used_01              : 1;
424   uint8_t st_g                     : 2;
425   uint8_t st_xl                    : 2;
426 #endif /* DRV_BYTE_ORDER */
427 } asm330lhhx_ctrl5_c_t;
428 
429 #define ASM330LHHX_CTRL6_C                      0x15U
430 typedef struct
431 {
432 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
433   uint8_t ftype                    : 3;
434   uint8_t usr_off_w                : 1;
435   uint8_t xl_hm_mode               : 1;
436   uint8_t den_mode                 : 3;   /* trig_en + lvl1_en + lvl2_en */
437 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
438   uint8_t den_mode                 : 3;   /* trig_en + lvl1_en + lvl2_en */
439   uint8_t xl_hm_mode               : 1;
440   uint8_t usr_off_w                : 1;
441   uint8_t ftype                    : 3;
442 #endif /* DRV_BYTE_ORDER */
443 } asm330lhhx_ctrl6_c_t;
444 
445 #define ASM330LHHX_CTRL7_G                      0x16U
446 typedef struct
447 {
448 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
449   uint8_t not_used_00              : 1;
450   uint8_t usr_off_on_out           : 1;
451   uint8_t not_used_01              : 2;
452   uint8_t hpm_g                    : 2;
453   uint8_t hp_en_g                  : 1;
454   uint8_t g_hm_mode                : 1;
455 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
456   uint8_t g_hm_mode                : 1;
457   uint8_t hp_en_g                  : 1;
458   uint8_t hpm_g                    : 2;
459   uint8_t not_used_01              : 2;
460   uint8_t usr_off_on_out           : 1;
461   uint8_t not_used_00              : 1;
462 #endif /* DRV_BYTE_ORDER */
463 } asm330lhhx_ctrl7_g_t;
464 
465 #define ASM330LHHX_CTRL8_XL                     0x17U
466 typedef struct
467 {
468 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
469   uint8_t low_pass_on_6d           : 1;
470   uint8_t not_used_01              : 1;
471   uint8_t hp_slope_xl_en           : 1;
472   uint8_t fastsettl_mode_xl        : 1;
473   uint8_t hp_ref_mode_xl           : 1;
474   uint8_t hpcf_xl                  : 3;
475 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
476   uint8_t hpcf_xl                  : 3;
477   uint8_t hp_ref_mode_xl           : 1;
478   uint8_t fastsettl_mode_xl        : 1;
479   uint8_t hp_slope_xl_en           : 1;
480   uint8_t not_used_01              : 1;
481   uint8_t low_pass_on_6d           : 1;
482 #endif /* DRV_BYTE_ORDER */
483 } asm330lhhx_ctrl8_xl_t;
484 
485 #define ASM330LHHX_CTRL9_XL                     0x18U
486 typedef struct
487 {
488 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
489   uint8_t not_used_01              : 1;
490   uint8_t i3c_disable              : 1;
491   uint8_t den_lh                   : 1;
492   uint8_t den_xl_g                 : 2;   /* den_xl_en + den_xl_g */
493   uint8_t den_z                    : 1;
494   uint8_t den_y                    : 1;
495   uint8_t den_x                    : 1;
496 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
497   uint8_t den_x                    : 1;
498   uint8_t den_y                    : 1;
499   uint8_t den_z                    : 1;
500   uint8_t den_xl_g                 : 2;   /* den_xl_en + den_xl_g */
501   uint8_t den_lh                   : 1;
502   uint8_t i3c_disable              : 1;
503   uint8_t not_used_01              : 1;
504 #endif /* DRV_BYTE_ORDER */
505 } asm330lhhx_ctrl9_xl_t;
506 
507 #define ASM330LHHX_CTRL10_C                     0x19U
508 typedef struct
509 {
510 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
511   uint8_t not_used_01              : 5;
512   uint8_t timestamp_en             : 1;
513   uint8_t not_used_02              : 2;
514 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
515   uint8_t not_used_02              : 2;
516   uint8_t timestamp_en             : 1;
517   uint8_t not_used_01              : 5;
518 #endif /* DRV_BYTE_ORDER */
519 } asm330lhhx_ctrl10_c_t;
520 
521 #define ASM330LHHX_ALL_INT_SRC                  0x1AU
522 typedef struct
523 {
524 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
525   uint8_t ff_ia                    : 1;
526   uint8_t wu_ia                    : 1;
527   uint8_t not_used_00              : 2;
528   uint8_t d6d_ia                   : 1;
529   uint8_t sleep_change_ia          : 1;
530   uint8_t not_used_01              : 1;
531   uint8_t timestamp_endcount       : 1;
532 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
533   uint8_t timestamp_endcount       : 1;
534   uint8_t not_used_01              : 1;
535   uint8_t sleep_change_ia          : 1;
536   uint8_t d6d_ia                   : 1;
537   uint8_t not_used_00              : 2;
538   uint8_t wu_ia                    : 1;
539   uint8_t ff_ia                    : 1;
540 #endif /* DRV_BYTE_ORDER */
541 } asm330lhhx_all_int_src_t;
542 
543 #define ASM330LHHX_WAKE_UP_SRC                  0x1BU
544 typedef struct
545 {
546 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
547   uint8_t z_wu                     : 1;
548   uint8_t y_wu                     : 1;
549   uint8_t x_wu                     : 1;
550   uint8_t wu_ia                    : 1;
551   uint8_t sleep_state              : 1;
552   uint8_t ff_ia                    : 1;
553   uint8_t sleep_change_ia          : 1;
554   uint8_t not_used_01              : 1;
555 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
556   uint8_t not_used_01              : 1;
557   uint8_t sleep_change_ia          : 1;
558   uint8_t ff_ia                    : 1;
559   uint8_t sleep_state              : 1;
560   uint8_t wu_ia                    : 1;
561   uint8_t x_wu                     : 1;
562   uint8_t y_wu                     : 1;
563   uint8_t z_wu                     : 1;
564 #endif /* DRV_BYTE_ORDER */
565 } asm330lhhx_wake_up_src_t;
566 
567 #define ASM330LHHX_D6D_SRC                      0x1DU
568 typedef struct
569 {
570 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
571   uint8_t xl                       : 1;
572   uint8_t xh                       : 1;
573   uint8_t yl                       : 1;
574   uint8_t yh                       : 1;
575   uint8_t zl                       : 1;
576   uint8_t zh                       : 1;
577   uint8_t d6d_ia                   : 1;
578   uint8_t den_drdy                 : 1;
579 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
580   uint8_t den_drdy                 : 1;
581   uint8_t d6d_ia                   : 1;
582   uint8_t zh                       : 1;
583   uint8_t zl                       : 1;
584   uint8_t yh                       : 1;
585   uint8_t yl                       : 1;
586   uint8_t xh                       : 1;
587   uint8_t xl                       : 1;
588 #endif /* DRV_BYTE_ORDER */
589 } asm330lhhx_d6d_src_t;
590 
591 #define ASM330LHHX_STATUS_REG                   0x1EU
592 typedef struct
593 {
594 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
595   uint8_t xlda                     : 1;
596   uint8_t gda                      : 1;
597   uint8_t tda                      : 1;
598   uint8_t not_used_01              : 5;
599 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
600   uint8_t not_used_01              : 5;
601   uint8_t tda                      : 1;
602   uint8_t gda                      : 1;
603   uint8_t xlda                     : 1;
604 #endif /* DRV_BYTE_ORDER */
605 } asm330lhhx_status_reg_t;
606 
607 #define ASM330LHHX_OUT_TEMP_L                   0x20U
608 #define ASM330LHHX_OUT_TEMP_H                   0x21U
609 #define ASM330LHHX_OUTX_L_G                     0x22U
610 #define ASM330LHHX_OUTX_H_G                     0x23U
611 #define ASM330LHHX_OUTY_L_G                     0x24U
612 #define ASM330LHHX_OUTY_H_G                     0x25U
613 #define ASM330LHHX_OUTZ_L_G                     0x26U
614 #define ASM330LHHX_OUTZ_H_G                     0x27U
615 #define ASM330LHHX_OUTX_L_A                     0x28U
616 #define ASM330LHHX_OUTX_H_A                     0x29U
617 #define ASM330LHHX_OUTY_L_A                     0x2AU
618 #define ASM330LHHX_OUTY_H_A                     0x2BU
619 #define ASM330LHHX_OUTZ_L_A                     0x2CU
620 #define ASM330LHHX_OUTZ_H_A                     0x2DU
621 #define ASM330LHHX_EMB_FUNC_STATUS_MAINPAGE     0x35U
622 typedef struct
623 {
624 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
625   uint8_t not_used_01             : 7;
626   uint8_t is_fsm_lc               : 1;
627 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
628   uint8_t is_fsm_lc               : 1;
629   uint8_t not_used_01             : 7;
630 #endif /* DRV_BYTE_ORDER */
631 } asm330lhhx_emb_func_status_mainpage_t;
632 
633 #define ASM330LHHX_FSM_STATUS_A_MAINPAGE        0x36U
634 typedef struct
635 {
636 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
637   uint8_t is_fsm1                 : 1;
638   uint8_t is_fsm2                 : 1;
639   uint8_t is_fsm3                 : 1;
640   uint8_t is_fsm4                 : 1;
641   uint8_t is_fsm5                 : 1;
642   uint8_t is_fsm6                 : 1;
643   uint8_t is_fsm7                 : 1;
644   uint8_t is_fsm8                 : 1;
645 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
646   uint8_t is_fsm8                 : 1;
647   uint8_t is_fsm7                 : 1;
648   uint8_t is_fsm6                 : 1;
649   uint8_t is_fsm5                 : 1;
650   uint8_t is_fsm4                 : 1;
651   uint8_t is_fsm3                 : 1;
652   uint8_t is_fsm2                 : 1;
653   uint8_t is_fsm1                 : 1;
654 #endif /* DRV_BYTE_ORDER */
655 } asm330lhhx_fsm_status_a_mainpage_t;
656 
657 #define ASM330LHHX_FSM_STATUS_B_MAINPAGE        0x37U
658 typedef struct
659 {
660 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
661   uint8_t is_fsm9                 : 1;
662   uint8_t is_fsm10                : 1;
663   uint8_t is_fsm11                : 1;
664   uint8_t is_fsm12                : 1;
665   uint8_t is_fsm13                : 1;
666   uint8_t is_fsm14                : 1;
667   uint8_t is_fsm15                : 1;
668   uint8_t is_fsm16                : 1;
669 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
670   uint8_t is_fsm16                : 1;
671   uint8_t is_fsm15                : 1;
672   uint8_t is_fsm14                : 1;
673   uint8_t is_fsm13                : 1;
674   uint8_t is_fsm12                : 1;
675   uint8_t is_fsm11                : 1;
676   uint8_t is_fsm10                : 1;
677   uint8_t is_fsm9                 : 1;
678 #endif /* DRV_BYTE_ORDER */
679 } asm330lhhx_fsm_status_b_mainpage_t;
680 
681 #define ASM330LHHX_MLC_STATUS_MAINPAGE          0x38U
682 typedef struct
683 {
684 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
685   uint8_t is_mlc1                 : 1;
686   uint8_t is_mlc2                 : 1;
687   uint8_t is_mlc3                 : 1;
688   uint8_t is_mlc4                 : 1;
689   uint8_t is_mlc5                 : 1;
690   uint8_t is_mlc6                 : 1;
691   uint8_t is_mlc7                 : 1;
692   uint8_t is_mlc8                 : 1;
693 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
694   uint8_t is_mlc8                 : 1;
695   uint8_t is_mlc7                 : 1;
696   uint8_t is_mlc6                 : 1;
697   uint8_t is_mlc5                 : 1;
698   uint8_t is_mlc4                 : 1;
699   uint8_t is_mlc3                 : 1;
700   uint8_t is_mlc2                 : 1;
701   uint8_t is_mlc1                 : 1;
702 #endif /* DRV_BYTE_ORDER */
703 } asm330lhhx_mlc_status_mainpage_t;
704 
705 #define ASM330LHHX_STATUS_MASTER_MAINPAGE       0x39U
706 typedef struct
707 {
708 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
709   uint8_t sens_hub_endop          : 1;
710   uint8_t not_used_01             : 2;
711   uint8_t slave0_nack             : 1;
712   uint8_t slave1_nack             : 1;
713   uint8_t slave2_nack             : 1;
714   uint8_t slave3_nack             : 1;
715   uint8_t wr_once_done            : 1;
716 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
717   uint8_t wr_once_done            : 1;
718   uint8_t slave3_nack             : 1;
719   uint8_t slave2_nack             : 1;
720   uint8_t slave1_nack             : 1;
721   uint8_t slave0_nack             : 1;
722   uint8_t not_used_01             : 2;
723   uint8_t sens_hub_endop          : 1;
724 #endif /* DRV_BYTE_ORDER */
725 } asm330lhhx_status_master_mainpage_t;
726 
727 #define ASM330LHHX_FIFO_STATUS1                 0x3AU
728 typedef struct
729 {
730   uint8_t diff_fifo                : 8;
731 } asm330lhhx_fifo_status1_t;
732 
733 #define ASM330LHHX_FIFO_STATUS2                 0x3BU
734 typedef struct
735 {
736 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
737   uint8_t diff_fifo                : 2;
738   uint8_t not_used_01              : 1;
739   uint8_t over_run_latched         : 1;
740   uint8_t counter_bdr_ia           : 1;
741   uint8_t fifo_full_ia             : 1;
742   uint8_t fifo_ovr_ia              : 1;
743   uint8_t fifo_wtm_ia              : 1;
744 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
745   uint8_t fifo_wtm_ia              : 1;
746   uint8_t fifo_ovr_ia              : 1;
747   uint8_t fifo_full_ia             : 1;
748   uint8_t counter_bdr_ia           : 1;
749   uint8_t over_run_latched         : 1;
750   uint8_t not_used_01              : 1;
751   uint8_t diff_fifo                : 2;
752 #endif /* DRV_BYTE_ORDER */
753 } asm330lhhx_fifo_status2_t;
754 
755 #define ASM330LHHX_TIMESTAMP0                   0x40U
756 #define ASM330LHHX_TIMESTAMP1                   0x41U
757 #define ASM330LHHX_TIMESTAMP2                   0x42U
758 #define ASM330LHHX_TIMESTAMP3                   0x43U
759 #define ASM330LHHX_INT_CFG0                     0x56U
760 typedef struct
761 {
762 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
763   uint8_t lir                      : 1;
764   uint8_t not_used_01              : 3;
765   uint8_t slope_fds                : 1;
766   uint8_t sleep_status_on_int      : 1;
767   uint8_t int_clr_on_read          : 1;
768   uint8_t not_used_02              : 1;
769 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
770   uint8_t not_used_02              : 1;
771   uint8_t int_clr_on_read          : 1;
772   uint8_t sleep_status_on_int      : 1;
773   uint8_t slope_fds                : 1;
774   uint8_t not_used_01              : 3;
775   uint8_t lir                      : 1;
776 #endif /* DRV_BYTE_ORDER */
777 } asm330lhhx_int_cfg0_t;
778 
779 #define ASM330LHHX_INT_CFG1                     0x58U
780 typedef struct
781 {
782 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
783   uint8_t not_used_01              : 5;
784   uint8_t inact_en                 : 2;
785   uint8_t interrupts_enable        : 1;
786 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
787   uint8_t interrupts_enable        : 1;
788   uint8_t inact_en                 : 2;
789   uint8_t not_used_01              : 5;
790 #endif /* DRV_BYTE_ORDER */
791 } asm330lhhx_int_cfg1_t;
792 
793 #define ASM330LHHX_THS_6D                   0x59U
794 typedef struct
795 {
796 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
797   uint8_t not_used_01              : 5;
798   uint8_t sixd_ths                 : 2;
799   uint8_t d4d_en                   : 1;
800 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
801   uint8_t d4d_en                   : 1;
802   uint8_t sixd_ths                 : 2;
803   uint8_t not_used_01              : 5;
804 #endif /* DRV_BYTE_ORDER */
805 } asm330lhhx_ths_6d_t;
806 
807 #define ASM330LHHX_WAKE_UP_THS                  0x5BU
808 typedef struct
809 {
810 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
811   uint8_t wk_ths                   : 6;
812   uint8_t usr_off_on_wu            : 1;
813   uint8_t not_used_01              : 1;
814 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
815   uint8_t not_used_01              : 1;
816   uint8_t usr_off_on_wu            : 1;
817   uint8_t wk_ths                   : 6;
818 #endif /* DRV_BYTE_ORDER */
819 } asm330lhhx_wake_up_ths_t;
820 
821 #define ASM330LHHX_WAKE_UP_DUR                  0x5CU
822 typedef struct
823 {
824 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
825   uint8_t sleep_dur                : 4;
826   uint8_t wake_ths_w               : 1;
827   uint8_t wake_dur                 : 2;
828   uint8_t ff_dur                   : 1;
829 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
830   uint8_t ff_dur                   : 1;
831   uint8_t wake_dur                 : 2;
832   uint8_t wake_ths_w               : 1;
833   uint8_t sleep_dur                : 4;
834 #endif /* DRV_BYTE_ORDER */
835 } asm330lhhx_wake_up_dur_t;
836 
837 #define ASM330LHHX_FREE_FALL                    0x5DU
838 typedef struct
839 {
840 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
841   uint8_t ff_ths                   : 3;
842   uint8_t ff_dur                   : 5;
843 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
844   uint8_t ff_dur                   : 5;
845   uint8_t ff_ths                   : 3;
846 #endif /* DRV_BYTE_ORDER */
847 } asm330lhhx_free_fall_t;
848 
849 #define ASM330LHHX_MD1_CFG                      0x5EU
850 typedef struct
851 {
852 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
853   uint8_t int1_shub                : 1;
854   uint8_t int1_emb_func            : 1;
855   uint8_t int1_6d                  : 1;
856   uint8_t not_used_01              : 1;
857   uint8_t int1_ff                  : 1;
858   uint8_t int1_wu                  : 1;
859   uint8_t not_used_02              : 1;
860   uint8_t int1_sleep_change        : 1;
861 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
862   uint8_t int1_sleep_change        : 1;
863   uint8_t not_used_02              : 1;
864   uint8_t int1_wu                  : 1;
865   uint8_t int1_ff                  : 1;
866   uint8_t not_used_01              : 1;
867   uint8_t int1_6d                  : 1;
868   uint8_t int1_emb_func            : 1;
869   uint8_t int1_shub                : 1;
870 #endif /* DRV_BYTE_ORDER */
871 } asm330lhhx_md1_cfg_t;
872 
873 #define ASM330LHHX_MD2_CFG                      0x5FU
874 typedef struct
875 {
876 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
877   uint8_t int2_timestamp           : 1;
878   uint8_t int2_emb_func            : 1;
879   uint8_t int2_6d                  : 1;
880   uint8_t not_used_01              : 1;
881   uint8_t int2_ff                  : 1;
882   uint8_t int2_wu                  : 1;
883   uint8_t not_used_02              : 1;
884   uint8_t int2_sleep_change        : 1;
885 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
886   uint8_t int2_sleep_change        : 1;
887   uint8_t not_used_02              : 1;
888   uint8_t int2_wu                  : 1;
889   uint8_t int2_ff                  : 1;
890   uint8_t not_used_01              : 1;
891   uint8_t int2_6d                  : 1;
892   uint8_t int2_emb_func            : 1;
893   uint8_t int2_timestamp           : 1;
894 #endif /* DRV_BYTE_ORDER */
895 } asm330lhhx_md2_cfg_t;
896 
897 #define ASM330LHHX_I3C_BUS_AVB                  0x62U
898 typedef struct
899 {
900 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
901   uint8_t pd_dis_int1              : 1;
902   uint8_t not_used_01              : 2;
903   uint8_t i3c_bus_avb_sel          : 2;
904   uint8_t not_used_02              : 3;
905 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
906   uint8_t not_used_02              : 3;
907   uint8_t i3c_bus_avb_sel          : 2;
908   uint8_t not_used_01              : 2;
909   uint8_t pd_dis_int1              : 1;
910 #endif /* DRV_BYTE_ORDER */
911 } asm330lhhx_i3c_bus_avb_t;
912 
913 #define ASM330LHHX_INTERNAL_FREQ_FINE           0x63U
914 typedef struct
915 {
916   uint8_t freq_fine                : 8;
917 } asm330lhhx_internal_freq_fine_t;
918 
919 #define ASM330LHHX_X_OFS_USR                    0x73U
920 #define ASM330LHHX_Y_OFS_USR                    0x74U
921 #define ASM330LHHX_Z_OFS_USR                    0x75U
922 #define ASM330LHHX_FIFO_DATA_OUT_TAG            0x78U
923 typedef struct
924 {
925 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
926   uint8_t tag_parity               : 1;
927   uint8_t tag_cnt                  : 2;
928   uint8_t tag_sensor               : 5;
929 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
930   uint8_t tag_sensor               : 5;
931   uint8_t tag_cnt                  : 2;
932   uint8_t tag_parity               : 1;
933 #endif /* DRV_BYTE_ORDER */
934 } asm330lhhx_fifo_data_out_tag_t;
935 
936 #define ASM330LHHX_FIFO_DATA_OUT_X_L            0x79U
937 #define ASM330LHHX_FIFO_DATA_OUT_X_H            0x7AU
938 #define ASM330LHHX_FIFO_DATA_OUT_Y_L            0x7BU
939 #define ASM330LHHX_FIFO_DATA_OUT_Y_H            0x7CU
940 #define ASM330LHHX_FIFO_DATA_OUT_Z_L            0x7DU
941 #define ASM330LHHX_FIFO_DATA_OUT_Z_H            0x7EU
942 
943 #define ASM330LHHX_PAGE_SEL                     0x02U
944 typedef struct
945 {
946 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
947   uint8_t not_used_01              : 1;
948   uint8_t emb_func_clk_dis         : 1;
949   uint8_t not_used_02              : 2;
950   uint8_t page_sel                 : 4;
951 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
952   uint8_t page_sel                 : 4;
953   uint8_t not_used_02              : 2;
954   uint8_t emb_func_clk_dis         : 1;
955   uint8_t not_used_01              : 1;
956 #endif /* DRV_BYTE_ORDER */
957 } asm330lhhx_page_sel_t;
958 
959 #define ASM330LHHX_EMB_FUNC_EN_B                0x05U
960 typedef struct
961 {
962 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
963   uint8_t fsm_en                   : 1;
964   uint8_t not_used_01              : 3;
965   uint8_t mlc_en                   : 1;
966   uint8_t not_used_02              : 3;
967 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
968   uint8_t not_used_02              : 3;
969   uint8_t mlc_en                   : 1;
970   uint8_t not_used_01              : 3;
971   uint8_t fsm_en                   : 1;
972 #endif /* DRV_BYTE_ORDER */
973 } asm330lhhx_emb_func_en_b_t;
974 
975 #define ASM330LHHX_PAGE_ADDRESS                 0x08U
976 typedef struct
977 {
978   uint8_t page_addr                : 8;
979 } asm330lhhx_page_address_t;
980 
981 #define ASM330LHHX_PAGE_VALUE                   0x09U
982 typedef struct
983 {
984   uint8_t page_value               : 8;
985 } asm330lhhx_page_value_t;
986 
987 #define ASM330LHHX_EMB_FUNC_INT1                0x0AU
988 typedef struct
989 {
990 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
991   uint8_t not_used_01              : 7;
992   uint8_t int1_fsm_lc              : 1;
993 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
994   uint8_t int1_fsm_lc              : 1;
995   uint8_t not_used_01              : 7;
996 #endif /* DRV_BYTE_ORDER */
997 } asm330lhhx_emb_func_int1_t;
998 
999 #define ASM330LHHX_FSM_INT1_A                   0x0BU
1000 typedef struct
1001 {
1002 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1003   uint8_t int1_fsm1                : 1;
1004   uint8_t int1_fsm2                : 1;
1005   uint8_t int1_fsm3                : 1;
1006   uint8_t int1_fsm4                : 1;
1007   uint8_t int1_fsm5                : 1;
1008   uint8_t int1_fsm6                : 1;
1009   uint8_t int1_fsm7                : 1;
1010   uint8_t int1_fsm8                : 1;
1011 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1012   uint8_t int1_fsm8                : 1;
1013   uint8_t int1_fsm7                : 1;
1014   uint8_t int1_fsm6                : 1;
1015   uint8_t int1_fsm5                : 1;
1016   uint8_t int1_fsm4                : 1;
1017   uint8_t int1_fsm3                : 1;
1018   uint8_t int1_fsm2                : 1;
1019   uint8_t int1_fsm1                : 1;
1020 #endif /* DRV_BYTE_ORDER */
1021 } asm330lhhx_fsm_int1_a_t;
1022 
1023 #define ASM330LHHX_FSM_INT1_B                   0x0CU
1024 typedef struct
1025 {
1026 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1027   uint8_t int1_fsm9                : 1;
1028   uint8_t int1_fsm10               : 1;
1029   uint8_t int1_fsm11               : 1;
1030   uint8_t int1_fsm12               : 1;
1031   uint8_t int1_fsm13               : 1;
1032   uint8_t int1_fsm14               : 1;
1033   uint8_t int1_fsm15               : 1;
1034   uint8_t int1_fsm16               : 1;
1035 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1036   uint8_t int1_fsm16               : 1;
1037   uint8_t int1_fsm15               : 1;
1038   uint8_t int1_fsm14               : 1;
1039   uint8_t int1_fsm13               : 1;
1040   uint8_t int1_fsm12               : 1;
1041   uint8_t int1_fsm11               : 1;
1042   uint8_t int1_fsm10               : 1;
1043   uint8_t int1_fsm9                : 1;
1044 #endif /* DRV_BYTE_ORDER */
1045 } asm330lhhx_fsm_int1_b_t;
1046 
1047 #define ASM330LHHX_MLC_INT1                     0x0DU
1048 typedef struct
1049 {
1050 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1051   uint8_t int1_mlc1                : 1;
1052   uint8_t int1_mlc2                : 1;
1053   uint8_t int1_mlc3                : 1;
1054   uint8_t int1_mlc4                : 1;
1055   uint8_t int1_mlc5                : 1;
1056   uint8_t int1_mlc6                : 1;
1057   uint8_t int1_mlc7                : 1;
1058   uint8_t int1_mlc8                : 1;
1059 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1060   uint8_t int1_mlc8                : 1;
1061   uint8_t int1_mlc7                : 1;
1062   uint8_t int1_mlc6                : 1;
1063   uint8_t int1_mlc5                : 1;
1064   uint8_t int1_mlc4                : 1;
1065   uint8_t int1_mlc3                : 1;
1066   uint8_t int1_mlc2                : 1;
1067   uint8_t int1_mlc1                : 1;
1068 #endif /* DRV_BYTE_ORDER */
1069 } asm330lhhx_mlc_int1_t;
1070 
1071 #define ASM330LHHX_EMB_FUNC_INT2                0x0EU
1072 typedef struct
1073 {
1074 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1075   uint8_t not_used_01              : 7;
1076   uint8_t int2_fsm_lc              : 1;
1077 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1078   uint8_t int2_fsm_lc              : 1;
1079   uint8_t not_used_01              : 7;
1080 #endif /* DRV_BYTE_ORDER */
1081 } asm330lhhx_emb_func_int2_t;
1082 
1083 #define ASM330LHHX_FSM_INT2_A                   0x0FU
1084 typedef struct
1085 {
1086 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1087   uint8_t int2_fsm1                : 1;
1088   uint8_t int2_fsm2                : 1;
1089   uint8_t int2_fsm3                : 1;
1090   uint8_t int2_fsm4                : 1;
1091   uint8_t int2_fsm5                : 1;
1092   uint8_t int2_fsm6                : 1;
1093   uint8_t int2_fsm7                : 1;
1094   uint8_t int2_fsm8                : 1;
1095 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1096   uint8_t int2_fsm8                : 1;
1097   uint8_t int2_fsm7                : 1;
1098   uint8_t int2_fsm6                : 1;
1099   uint8_t int2_fsm5                : 1;
1100   uint8_t int2_fsm4                : 1;
1101   uint8_t int2_fsm3                : 1;
1102   uint8_t int2_fsm2                : 1;
1103   uint8_t int2_fsm1                : 1;
1104 #endif /* DRV_BYTE_ORDER */
1105 } asm330lhhx_fsm_int2_a_t;
1106 
1107 #define ASM330LHHX_FSM_INT2_B                   0x10U
1108 typedef struct
1109 {
1110 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1111   uint8_t int2_fsm9                : 1;
1112   uint8_t int2_fsm10               : 1;
1113   uint8_t int2_fsm11               : 1;
1114   uint8_t int2_fsm12               : 1;
1115   uint8_t int2_fsm13               : 1;
1116   uint8_t int2_fsm14               : 1;
1117   uint8_t int2_fsm15               : 1;
1118   uint8_t int2_fsm16               : 1;
1119 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1120   uint8_t int2_fsm16               : 1;
1121   uint8_t int2_fsm15               : 1;
1122   uint8_t int2_fsm14               : 1;
1123   uint8_t int2_fsm13               : 1;
1124   uint8_t int2_fsm12               : 1;
1125   uint8_t int2_fsm11               : 1;
1126   uint8_t int2_fsm10               : 1;
1127   uint8_t int2_fsm9                : 1;
1128 #endif /* DRV_BYTE_ORDER */
1129 } asm330lhhx_fsm_int2_b_t;
1130 
1131 #define ASM330LHHX_MLC_INT2                     0x11U
1132 typedef struct
1133 {
1134 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1135   uint8_t int2_mlc1             : 1;
1136   uint8_t int2_mlc2             : 1;
1137   uint8_t int2_mlc3             : 1;
1138   uint8_t int2_mlc4             : 1;
1139   uint8_t int2_mlc5             : 1;
1140   uint8_t int2_mlc6             : 1;
1141   uint8_t int2_mlc7             : 1;
1142   uint8_t int2_mlc8             : 1;
1143 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1144   uint8_t int2_mlc8             : 1;
1145   uint8_t int2_mlc7             : 1;
1146   uint8_t int2_mlc6             : 1;
1147   uint8_t int2_mlc5             : 1;
1148   uint8_t int2_mlc4             : 1;
1149   uint8_t int2_mlc3             : 1;
1150   uint8_t int2_mlc2             : 1;
1151   uint8_t int2_mlc1             : 1;
1152 #endif /* DRV_BYTE_ORDER */
1153 } asm330lhhx_mlc_int2_t;
1154 
1155 #define ASM330LHHX_EMB_FUNC_STATUS              0x12U
1156 typedef struct
1157 {
1158 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1159   uint8_t not_used_01              : 7;
1160   uint8_t is_fsm_lc                : 1;
1161 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1162   uint8_t is_fsm_lc                : 1;
1163   uint8_t not_used_01              : 7;
1164 #endif /* DRV_BYTE_ORDER */
1165 } asm330lhhx_emb_func_status_t;
1166 
1167 #define ASM330LHHX_FSM_STATUS_A                 0x13U
1168 typedef struct
1169 {
1170 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1171   uint8_t is_fsm1                  : 1;
1172   uint8_t is_fsm2                  : 1;
1173   uint8_t is_fsm3                  : 1;
1174   uint8_t is_fsm4                  : 1;
1175   uint8_t is_fsm5                  : 1;
1176   uint8_t is_fsm6                  : 1;
1177   uint8_t is_fsm7                  : 1;
1178   uint8_t is_fsm8                  : 1;
1179 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1180   uint8_t is_fsm8                  : 1;
1181   uint8_t is_fsm7                  : 1;
1182   uint8_t is_fsm6                  : 1;
1183   uint8_t is_fsm5                  : 1;
1184   uint8_t is_fsm4                  : 1;
1185   uint8_t is_fsm3                  : 1;
1186   uint8_t is_fsm2                  : 1;
1187   uint8_t is_fsm1                  : 1;
1188 #endif /* DRV_BYTE_ORDER */
1189 } asm330lhhx_fsm_status_a_t;
1190 
1191 #define ASM330LHHX_FSM_STATUS_B                 0x14U
1192 typedef struct
1193 {
1194 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1195   uint8_t is_fsm9                  : 1;
1196   uint8_t is_fsm10                 : 1;
1197   uint8_t is_fsm11                 : 1;
1198   uint8_t is_fsm12                 : 1;
1199   uint8_t is_fsm13                 : 1;
1200   uint8_t is_fsm14                 : 1;
1201   uint8_t is_fsm15                 : 1;
1202   uint8_t is_fsm16                 : 1;
1203 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1204   uint8_t is_fsm16                 : 1;
1205   uint8_t is_fsm15                 : 1;
1206   uint8_t is_fsm14                 : 1;
1207   uint8_t is_fsm13                 : 1;
1208   uint8_t is_fsm12                 : 1;
1209   uint8_t is_fsm11                 : 1;
1210   uint8_t is_fsm10                 : 1;
1211   uint8_t is_fsm9                  : 1;
1212 #endif /* DRV_BYTE_ORDER */
1213 } asm330lhhx_fsm_status_b_t;
1214 
1215 #define ASM330LHHX_MLC_STATUS                   0x15U
1216 typedef struct
1217 {
1218 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1219   uint8_t is_mlc1            : 1;
1220   uint8_t is_mlc2            : 1;
1221   uint8_t is_mlc3            : 1;
1222   uint8_t is_mlc4            : 1;
1223   uint8_t is_mlc5            : 1;
1224   uint8_t is_mlc6            : 1;
1225   uint8_t is_mlc7            : 1;
1226   uint8_t is_mlc8            : 1;
1227 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1228   uint8_t is_mlc8            : 1;
1229   uint8_t is_mlc7            : 1;
1230   uint8_t is_mlc6            : 1;
1231   uint8_t is_mlc5            : 1;
1232   uint8_t is_mlc4            : 1;
1233   uint8_t is_mlc3            : 1;
1234   uint8_t is_mlc2            : 1;
1235   uint8_t is_mlc1            : 1;
1236 #endif /* DRV_BYTE_ORDER */
1237 } asm330lhhx_mlc_status_t;
1238 
1239 #define ASM330LHHX_PAGE_RW                      0x17U
1240 typedef struct
1241 {
1242 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1243   uint8_t not_used_01              : 5;
1244   uint8_t page_rw                  : 2;  /* page_write + page_read */
1245   uint8_t emb_func_lir             : 1;
1246 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1247   uint8_t emb_func_lir             : 1;
1248   uint8_t page_rw                  : 2;  /* page_write + page_read */
1249   uint8_t not_used_01              : 5;
1250 #endif /* DRV_BYTE_ORDER */
1251 } asm330lhhx_page_rw_t;
1252 
1253 #define ASM330LHHX_FSM_ENABLE_A                 0x46U
1254 typedef struct
1255 {
1256 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1257   uint8_t fsm1_en                  : 1;
1258   uint8_t fsm2_en                  : 1;
1259   uint8_t fsm3_en                  : 1;
1260   uint8_t fsm4_en                  : 1;
1261   uint8_t fsm5_en                  : 1;
1262   uint8_t fsm6_en                  : 1;
1263   uint8_t fsm7_en                  : 1;
1264   uint8_t fsm8_en                  : 1;
1265 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1266   uint8_t fsm8_en                  : 1;
1267   uint8_t fsm7_en                  : 1;
1268   uint8_t fsm6_en                  : 1;
1269   uint8_t fsm5_en                  : 1;
1270   uint8_t fsm4_en                  : 1;
1271   uint8_t fsm3_en                  : 1;
1272   uint8_t fsm2_en                  : 1;
1273   uint8_t fsm1_en                  : 1;
1274 #endif /* DRV_BYTE_ORDER */
1275 } asm330lhhx_fsm_enable_a_t;
1276 
1277 #define ASM330LHHX_FSM_ENABLE_B                 0x47U
1278 typedef struct
1279 {
1280 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1281   uint8_t fsm9_en                  : 1;
1282   uint8_t fsm10_en                 : 1;
1283   uint8_t fsm11_en                 : 1;
1284   uint8_t fsm12_en                 : 1;
1285   uint8_t fsm13_en                 : 1;
1286   uint8_t fsm14_en                 : 1;
1287   uint8_t fsm15_en                 : 1;
1288   uint8_t fsm16_en                 : 1;
1289 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1290   uint8_t fsm16_en                 : 1;
1291   uint8_t fsm15_en                 : 1;
1292   uint8_t fsm14_en                 : 1;
1293   uint8_t fsm13_en                 : 1;
1294   uint8_t fsm12_en                 : 1;
1295   uint8_t fsm11_en                 : 1;
1296   uint8_t fsm10_en                 : 1;
1297   uint8_t fsm9_en                  : 1;
1298 #endif /* DRV_BYTE_ORDER */
1299 } asm330lhhx_fsm_enable_b_t;
1300 
1301 #define ASM330LHHX_FSM_LONG_COUNTER_L           0x48U
1302 #define ASM330LHHX_FSM_LONG_COUNTER_H           0x49U
1303 #define ASM330LHHX_FSM_LONG_COUNTER_CLEAR       0x4AU
1304 typedef struct
1305 {
1306 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1307   uint8_t fsm_lc_clr               : 2;  /* fsm_lc_cleared + fsm_lc_clear */
1308   uint8_t not_used_01              : 6;
1309 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1310   uint8_t not_used_01              : 6;
1311   uint8_t fsm_lc_clr               : 2;  /* fsm_lc_cleared + fsm_lc_clear */
1312 #endif /* DRV_BYTE_ORDER */
1313 } asm330lhhx_fsm_long_counter_clear_t;
1314 
1315 #define ASM330LHHX_FSM_OUTS1                    0x4CU
1316 typedef struct
1317 {
1318 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1319   uint8_t n_v                      : 1;
1320   uint8_t p_v                      : 1;
1321   uint8_t n_z                      : 1;
1322   uint8_t p_z                      : 1;
1323   uint8_t n_y                      : 1;
1324   uint8_t p_y                      : 1;
1325   uint8_t n_x                      : 1;
1326   uint8_t p_x                      : 1;
1327 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1328   uint8_t p_x                      : 1;
1329   uint8_t n_x                      : 1;
1330   uint8_t p_y                      : 1;
1331   uint8_t n_y                      : 1;
1332   uint8_t p_z                      : 1;
1333   uint8_t n_z                      : 1;
1334   uint8_t p_v                      : 1;
1335   uint8_t n_v                      : 1;
1336 #endif /* DRV_BYTE_ORDER */
1337 } asm330lhhx_fsm_outs1_t;
1338 
1339 #define ASM330LHHX_FSM_OUTS2                    0x4DU
1340 typedef struct
1341 {
1342 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1343   uint8_t n_v                      : 1;
1344   uint8_t p_v                      : 1;
1345   uint8_t n_z                      : 1;
1346   uint8_t p_z                      : 1;
1347   uint8_t n_y                      : 1;
1348   uint8_t p_y                      : 1;
1349   uint8_t n_x                      : 1;
1350   uint8_t p_x                      : 1;
1351 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1352   uint8_t p_x                      : 1;
1353   uint8_t n_x                      : 1;
1354   uint8_t p_y                      : 1;
1355   uint8_t n_y                      : 1;
1356   uint8_t p_z                      : 1;
1357   uint8_t n_z                      : 1;
1358   uint8_t p_v                      : 1;
1359   uint8_t n_v                      : 1;
1360 #endif /* DRV_BYTE_ORDER */
1361 } asm330lhhx_fsm_outs2_t;
1362 
1363 #define ASM330LHHX_FSM_OUTS3                    0x4EU
1364 typedef struct
1365 {
1366 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1367   uint8_t n_v                      : 1;
1368   uint8_t p_v                      : 1;
1369   uint8_t n_z                      : 1;
1370   uint8_t p_z                      : 1;
1371   uint8_t n_y                      : 1;
1372   uint8_t p_y                      : 1;
1373   uint8_t n_x                      : 1;
1374   uint8_t p_x                      : 1;
1375 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1376   uint8_t p_x                      : 1;
1377   uint8_t n_x                      : 1;
1378   uint8_t p_y                      : 1;
1379   uint8_t n_y                      : 1;
1380   uint8_t p_z                      : 1;
1381   uint8_t n_z                      : 1;
1382   uint8_t p_v                      : 1;
1383   uint8_t n_v                      : 1;
1384 #endif /* DRV_BYTE_ORDER */
1385 } asm330lhhx_fsm_outs3_t;
1386 
1387 #define ASM330LHHX_FSM_OUTS4                    0x4FU
1388 typedef struct
1389 {
1390 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1391   uint8_t n_v                      : 1;
1392   uint8_t p_v                      : 1;
1393   uint8_t n_z                      : 1;
1394   uint8_t p_z                      : 1;
1395   uint8_t n_y                      : 1;
1396   uint8_t p_y                      : 1;
1397   uint8_t n_x                      : 1;
1398   uint8_t p_x                      : 1;
1399 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1400   uint8_t p_x                      : 1;
1401   uint8_t n_x                      : 1;
1402   uint8_t p_y                      : 1;
1403   uint8_t n_y                      : 1;
1404   uint8_t p_z                      : 1;
1405   uint8_t n_z                      : 1;
1406   uint8_t p_v                      : 1;
1407   uint8_t n_v                      : 1;
1408 #endif /* DRV_BYTE_ORDER */
1409 } asm330lhhx_fsm_outs4_t;
1410 
1411 #define ASM330LHHX_FSM_OUTS5                    0x50U
1412 typedef struct
1413 {
1414 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1415   uint8_t n_v                      : 1;
1416   uint8_t p_v                      : 1;
1417   uint8_t n_z                      : 1;
1418   uint8_t p_z                      : 1;
1419   uint8_t n_y                      : 1;
1420   uint8_t p_y                      : 1;
1421   uint8_t n_x                      : 1;
1422   uint8_t p_x                      : 1;
1423 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1424   uint8_t p_x                      : 1;
1425   uint8_t n_x                      : 1;
1426   uint8_t p_y                      : 1;
1427   uint8_t n_y                      : 1;
1428   uint8_t p_z                      : 1;
1429   uint8_t n_z                      : 1;
1430   uint8_t p_v                      : 1;
1431   uint8_t n_v                      : 1;
1432 #endif /* DRV_BYTE_ORDER */
1433 } asm330lhhx_fsm_outs5_t;
1434 
1435 #define ASM330LHHX_FSM_OUTS6                    0x51U
1436 typedef struct
1437 {
1438 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1439   uint8_t n_v                      : 1;
1440   uint8_t p_v                      : 1;
1441   uint8_t n_z                      : 1;
1442   uint8_t p_z                      : 1;
1443   uint8_t n_y                      : 1;
1444   uint8_t p_y                      : 1;
1445   uint8_t n_x                      : 1;
1446   uint8_t p_x                      : 1;
1447 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1448   uint8_t p_x                      : 1;
1449   uint8_t n_x                      : 1;
1450   uint8_t p_y                      : 1;
1451   uint8_t n_y                      : 1;
1452   uint8_t p_z                      : 1;
1453   uint8_t n_z                      : 1;
1454   uint8_t p_v                      : 1;
1455   uint8_t n_v                      : 1;
1456 #endif /* DRV_BYTE_ORDER */
1457 } asm330lhhx_fsm_outs6_t;
1458 
1459 #define ASM330LHHX_FSM_OUTS7                    0x52U
1460 typedef struct
1461 {
1462 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1463   uint8_t n_v                      : 1;
1464   uint8_t p_v                      : 1;
1465   uint8_t n_z                      : 1;
1466   uint8_t p_z                      : 1;
1467   uint8_t n_y                      : 1;
1468   uint8_t p_y                      : 1;
1469   uint8_t n_x                      : 1;
1470   uint8_t p_x                      : 1;
1471 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1472   uint8_t p_x                      : 1;
1473   uint8_t n_x                      : 1;
1474   uint8_t p_y                      : 1;
1475   uint8_t n_y                      : 1;
1476   uint8_t p_z                      : 1;
1477   uint8_t n_z                      : 1;
1478   uint8_t p_v                      : 1;
1479   uint8_t n_v                      : 1;
1480 #endif /* DRV_BYTE_ORDER */
1481 } asm330lhhx_fsm_outs7_t;
1482 
1483 #define ASM330LHHX_FSM_OUTS8                    0x53U
1484 typedef struct
1485 {
1486 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1487   uint8_t n_v                      : 1;
1488   uint8_t p_v                      : 1;
1489   uint8_t n_z                      : 1;
1490   uint8_t p_z                      : 1;
1491   uint8_t n_y                      : 1;
1492   uint8_t p_y                      : 1;
1493   uint8_t n_x                      : 1;
1494   uint8_t p_x                      : 1;
1495 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1496   uint8_t p_x                      : 1;
1497   uint8_t n_x                      : 1;
1498   uint8_t p_y                      : 1;
1499   uint8_t n_y                      : 1;
1500   uint8_t p_z                      : 1;
1501   uint8_t n_z                      : 1;
1502   uint8_t p_v                      : 1;
1503   uint8_t n_v                      : 1;
1504 #endif /* DRV_BYTE_ORDER */
1505 } asm330lhhx_fsm_outs8_t;
1506 
1507 #define ASM330LHHX_FSM_OUTS9                    0x54U
1508 typedef struct
1509 {
1510 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1511   uint8_t n_v                      : 1;
1512   uint8_t p_v                      : 1;
1513   uint8_t n_z                      : 1;
1514   uint8_t p_z                      : 1;
1515   uint8_t n_y                      : 1;
1516   uint8_t p_y                      : 1;
1517   uint8_t n_x                      : 1;
1518   uint8_t p_x                      : 1;
1519 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1520   uint8_t p_x                      : 1;
1521   uint8_t n_x                      : 1;
1522   uint8_t p_y                      : 1;
1523   uint8_t n_y                      : 1;
1524   uint8_t p_z                      : 1;
1525   uint8_t n_z                      : 1;
1526   uint8_t p_v                      : 1;
1527   uint8_t n_v                      : 1;
1528 #endif /* DRV_BYTE_ORDER */
1529 } asm330lhhx_fsm_outs9_t;
1530 
1531 #define ASM330LHHX_FSM_OUTS10                   0x55U
1532 typedef struct
1533 {
1534 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1535   uint8_t n_v                      : 1;
1536   uint8_t p_v                      : 1;
1537   uint8_t n_z                      : 1;
1538   uint8_t p_z                      : 1;
1539   uint8_t n_y                      : 1;
1540   uint8_t p_y                      : 1;
1541   uint8_t n_x                      : 1;
1542   uint8_t p_x                      : 1;
1543 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1544   uint8_t p_x                      : 1;
1545   uint8_t n_x                      : 1;
1546   uint8_t p_y                      : 1;
1547   uint8_t n_y                      : 1;
1548   uint8_t p_z                      : 1;
1549   uint8_t n_z                      : 1;
1550   uint8_t p_v                      : 1;
1551   uint8_t n_v                      : 1;
1552 #endif /* DRV_BYTE_ORDER */
1553 } asm330lhhx_fsm_outs10_t;
1554 
1555 #define ASM330LHHX_FSM_OUTS11                   0x56U
1556 typedef struct
1557 {
1558 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1559   uint8_t n_v                      : 1;
1560   uint8_t p_v                      : 1;
1561   uint8_t n_z                      : 1;
1562   uint8_t p_z                      : 1;
1563   uint8_t n_y                      : 1;
1564   uint8_t p_y                      : 1;
1565   uint8_t n_x                      : 1;
1566   uint8_t p_x                      : 1;
1567 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1568   uint8_t p_x                      : 1;
1569   uint8_t n_x                      : 1;
1570   uint8_t p_y                      : 1;
1571   uint8_t n_y                      : 1;
1572   uint8_t p_z                      : 1;
1573   uint8_t n_z                      : 1;
1574   uint8_t p_v                      : 1;
1575   uint8_t n_v                      : 1;
1576 #endif /* DRV_BYTE_ORDER */
1577 } asm330lhhx_fsm_outs11_t;
1578 
1579 #define ASM330LHHX_FSM_OUTS12                   0x57U
1580 typedef struct
1581 {
1582 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1583   uint8_t n_v                      : 1;
1584   uint8_t p_v                      : 1;
1585   uint8_t n_z                      : 1;
1586   uint8_t p_z                      : 1;
1587   uint8_t n_y                      : 1;
1588   uint8_t p_y                      : 1;
1589   uint8_t n_x                      : 1;
1590   uint8_t p_x                      : 1;
1591 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1592   uint8_t p_x                      : 1;
1593   uint8_t n_x                      : 1;
1594   uint8_t p_y                      : 1;
1595   uint8_t n_y                      : 1;
1596   uint8_t p_z                      : 1;
1597   uint8_t n_z                      : 1;
1598   uint8_t p_v                      : 1;
1599   uint8_t n_v                      : 1;
1600 #endif /* DRV_BYTE_ORDER */
1601 } asm330lhhx_fsm_outs12_t;
1602 
1603 #define ASM330LHHX_FSM_OUTS13                   0x58U
1604 typedef struct
1605 {
1606 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1607   uint8_t n_v                      : 1;
1608   uint8_t p_v                      : 1;
1609   uint8_t n_z                      : 1;
1610   uint8_t p_z                      : 1;
1611   uint8_t n_y                      : 1;
1612   uint8_t p_y                      : 1;
1613   uint8_t n_x                      : 1;
1614   uint8_t p_x                      : 1;
1615 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1616   uint8_t p_x                      : 1;
1617   uint8_t n_x                      : 1;
1618   uint8_t p_y                      : 1;
1619   uint8_t n_y                      : 1;
1620   uint8_t p_z                      : 1;
1621   uint8_t n_z                      : 1;
1622   uint8_t p_v                      : 1;
1623   uint8_t n_v                      : 1;
1624 #endif /* DRV_BYTE_ORDER */
1625 } asm330lhhx_fsm_outs13_t;
1626 
1627 #define ASM330LHHX_FSM_OUTS14                   0x59U
1628 typedef struct
1629 {
1630 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1631   uint8_t n_v                      : 1;
1632   uint8_t p_v                      : 1;
1633   uint8_t n_z                      : 1;
1634   uint8_t p_z                      : 1;
1635   uint8_t n_y                      : 1;
1636   uint8_t p_y                      : 1;
1637   uint8_t n_x                      : 1;
1638   uint8_t p_x                      : 1;
1639 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1640   uint8_t p_x                      : 1;
1641   uint8_t n_x                      : 1;
1642   uint8_t p_y                      : 1;
1643   uint8_t n_y                      : 1;
1644   uint8_t p_z                      : 1;
1645   uint8_t n_z                      : 1;
1646   uint8_t p_v                      : 1;
1647   uint8_t n_v                      : 1;
1648 #endif /* DRV_BYTE_ORDER */
1649 } asm330lhhx_fsm_outs14_t;
1650 
1651 #define ASM330LHHX_FSM_OUTS15                   0x5AU
1652 typedef struct
1653 {
1654 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1655   uint8_t n_v                      : 1;
1656   uint8_t p_v                      : 1;
1657   uint8_t n_z                      : 1;
1658   uint8_t p_z                      : 1;
1659   uint8_t n_y                      : 1;
1660   uint8_t p_y                      : 1;
1661   uint8_t n_x                      : 1;
1662   uint8_t p_x                      : 1;
1663 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1664   uint8_t p_x                      : 1;
1665   uint8_t n_x                      : 1;
1666   uint8_t p_y                      : 1;
1667   uint8_t n_y                      : 1;
1668   uint8_t p_z                      : 1;
1669   uint8_t n_z                      : 1;
1670   uint8_t p_v                      : 1;
1671   uint8_t n_v                      : 1;
1672 #endif /* DRV_BYTE_ORDER */
1673 } asm330lhhx_fsm_outs15_t;
1674 
1675 #define ASM330LHHX_FSM_OUTS16                   0x5BU
1676 typedef struct
1677 {
1678 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1679   uint8_t n_v                      : 1;
1680   uint8_t p_v                      : 1;
1681   uint8_t n_z                      : 1;
1682   uint8_t p_z                      : 1;
1683   uint8_t n_y                      : 1;
1684   uint8_t p_y                      : 1;
1685   uint8_t n_x                      : 1;
1686   uint8_t p_x                      : 1;
1687 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1688   uint8_t p_x                      : 1;
1689   uint8_t n_x                      : 1;
1690   uint8_t p_y                      : 1;
1691   uint8_t n_y                      : 1;
1692   uint8_t p_z                      : 1;
1693   uint8_t n_z                      : 1;
1694   uint8_t p_v                      : 1;
1695   uint8_t n_v                      : 1;
1696 #endif /* DRV_BYTE_ORDER */
1697 } asm330lhhx_fsm_outs16_t;
1698 
1699 #define ASM330LHHX_EMB_FUNC_ODR_CFG_B           0x5FU
1700 typedef struct
1701 {
1702 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1703   uint8_t not_used_01              : 3;
1704   uint8_t fsm_odr                  : 2;
1705   uint8_t not_used_02              : 3;
1706 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1707   uint8_t not_used_02              : 3;
1708   uint8_t fsm_odr                  : 2;
1709   uint8_t not_used_01              : 3;
1710 #endif /* DRV_BYTE_ORDER */
1711 } asm330lhhx_emb_func_odr_cfg_b_t;
1712 
1713 #define ASM330LHHX_EMB_FUNC_ODR_CFG_C           0x60U
1714 typedef struct
1715 {
1716 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1717   uint8_t not_used_01             : 4;
1718   uint8_t mlc_odr                 : 2;
1719   uint8_t not_used_02             : 2;
1720 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1721   uint8_t not_used_02             : 2;
1722   uint8_t mlc_odr                 : 2;
1723   uint8_t not_used_01             : 4;
1724 #endif /* DRV_BYTE_ORDER */
1725 } asm330lhhx_emb_func_odr_cfg_c_t;
1726 
1727 #define ASM330LHHX_EMB_FUNC_INIT_B              0x67U
1728 typedef struct
1729 {
1730 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1731   uint8_t fsm_init                 : 1;
1732   uint8_t not_used_01              : 3;
1733   uint8_t mlc_init                 : 1;
1734   uint8_t not_used_02              : 3;
1735 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1736   uint8_t not_used_02              : 3;
1737   uint8_t mlc_init                 : 1;
1738   uint8_t not_used_01              : 3;
1739   uint8_t fsm_init                 : 1;
1740 #endif /* DRV_BYTE_ORDER */
1741 } asm330lhhx_emb_func_init_b_t;
1742 
1743 #define ASM330LHHX_MLC0_SRC                     0x70U
1744 #define ASM330LHHX_MLC1_SRC                     0x71U
1745 #define ASM330LHHX_MLC2_SRC                     0x72U
1746 #define ASM330LHHX_MLC3_SRC                     0x73U
1747 #define ASM330LHHX_MLC4_SRC                     0x74U
1748 #define ASM330LHHX_MLC5_SRC                     0x75U
1749 #define ASM330LHHX_MLC6_SRC                     0x76U
1750 #define ASM330LHHX_MLC7_SRC                     0x77U
1751 
1752 #define ASM330LHHX_MAG_SENSITIVITY_L            0xBAU
1753 #define ASM330LHHX_MAG_SENSITIVITY_H            0xBBU
1754 #define ASM330LHHX_MAG_OFFX_L                   0xC0U
1755 #define ASM330LHHX_MAG_OFFX_H                   0xC1U
1756 #define ASM330LHHX_MAG_OFFY_L                   0xC2U
1757 #define ASM330LHHX_MAG_OFFY_H                   0xC3U
1758 #define ASM330LHHX_MAG_OFFZ_L                   0xC4U
1759 #define ASM330LHHX_MAG_OFFZ_H                   0xC5U
1760 #define ASM330LHHX_MAG_SI_XX_L                  0xC6U
1761 #define ASM330LHHX_MAG_SI_XX_H                  0xC7U
1762 #define ASM330LHHX_MAG_SI_XY_L                  0xC8U
1763 #define ASM330LHHX_MAG_SI_XY_H                  0xC9U
1764 #define ASM330LHHX_MAG_SI_XZ_L                  0xCAU
1765 #define ASM330LHHX_MAG_SI_XZ_H                  0xCBU
1766 #define ASM330LHHX_MAG_SI_YY_L                  0xCCU
1767 #define ASM330LHHX_MAG_SI_YY_H                  0xCDU
1768 #define ASM330LHHX_MAG_SI_YZ_L                  0xCEU
1769 #define ASM330LHHX_MAG_SI_YZ_H                  0xCFU
1770 #define ASM330LHHX_MAG_SI_ZZ_L                  0xD0U
1771 #define ASM330LHHX_MAG_SI_ZZ_H                  0xD1U
1772 #define ASM330LHHX_MAG_CFG_A                    0xD4U
1773 typedef struct
1774 {
1775 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1776   uint8_t mag_z_axis               : 3;
1777   uint8_t not_used_01              : 1;
1778   uint8_t mag_y_axis               : 3;
1779   uint8_t not_used_02              : 1;
1780 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1781   uint8_t not_used_02              : 1;
1782   uint8_t mag_y_axis               : 3;
1783   uint8_t not_used_01              : 1;
1784   uint8_t mag_z_axis               : 3;
1785 #endif /* DRV_BYTE_ORDER */
1786 } asm330lhhx_mag_cfg_a_t;
1787 
1788 #define ASM330LHHX_MAG_CFG_B                    0xD5U
1789 typedef struct
1790 {
1791 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1792   uint8_t mag_x_axis               : 3;
1793   uint8_t not_used_01              : 5;
1794 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1795   uint8_t not_used_01              : 5;
1796   uint8_t mag_x_axis               : 3;
1797 #endif /* DRV_BYTE_ORDER */
1798 } asm330lhhx_mag_cfg_b_t;
1799 
1800 #define ASM330LHHX_FSM_LC_TIMEOUT_L             0x17AU
1801 #define ASM330LHHX_FSM_LC_TIMEOUT_H             0x17BU
1802 #define ASM330LHHX_FSM_PROGRAMS                 0x17CU
1803 #define ASM330LHHX_FSM_START_ADD_L              0x17EU
1804 #define ASM330LHHX_FSM_START_ADD_H              0x17FU
1805 
1806 #define ASM330LHHX_MLC_MAG_SENSITIVITY_L        0x1E8U
1807 #define ASM330LHHX_MLC_MAG_SENSITIVITY_H        0x1E9U
1808 
1809 #define ASM330LHHX_SENSOR_HUB_1                 0x02U
1810 typedef struct
1811 {
1812 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1813   uint8_t bit0                    : 1;
1814   uint8_t bit1                    : 1;
1815   uint8_t bit2                    : 1;
1816   uint8_t bit3                    : 1;
1817   uint8_t bit4                    : 1;
1818   uint8_t bit5                    : 1;
1819   uint8_t bit6                    : 1;
1820   uint8_t bit7                    : 1;
1821 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1822   uint8_t bit7                    : 1;
1823   uint8_t bit6                    : 1;
1824   uint8_t bit5                    : 1;
1825   uint8_t bit4                    : 1;
1826   uint8_t bit3                    : 1;
1827   uint8_t bit2                    : 1;
1828   uint8_t bit1                    : 1;
1829   uint8_t bit0                    : 1;
1830 #endif /* DRV_BYTE_ORDER */
1831 } asm330lhhx_sensor_hub_1_t;
1832 
1833 #define ASM330LHHX_SENSOR_HUB_2                 0x03U
1834 typedef struct
1835 {
1836 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1837   uint8_t bit0                    : 1;
1838   uint8_t bit1                    : 1;
1839   uint8_t bit2                    : 1;
1840   uint8_t bit3                    : 1;
1841   uint8_t bit4                    : 1;
1842   uint8_t bit5                    : 1;
1843   uint8_t bit6                    : 1;
1844   uint8_t bit7                    : 1;
1845 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1846   uint8_t bit7                    : 1;
1847   uint8_t bit6                    : 1;
1848   uint8_t bit5                    : 1;
1849   uint8_t bit4                    : 1;
1850   uint8_t bit3                    : 1;
1851   uint8_t bit2                    : 1;
1852   uint8_t bit1                    : 1;
1853   uint8_t bit0                    : 1;
1854 #endif /* DRV_BYTE_ORDER */
1855 } asm330lhhx_sensor_hub_2_t;
1856 
1857 #define ASM330LHHX_SENSOR_HUB_3                 0x04U
1858 typedef struct
1859 {
1860 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1861   uint8_t bit0                    : 1;
1862   uint8_t bit1                    : 1;
1863   uint8_t bit2                    : 1;
1864   uint8_t bit3                    : 1;
1865   uint8_t bit4                    : 1;
1866   uint8_t bit5                    : 1;
1867   uint8_t bit6                    : 1;
1868   uint8_t bit7                    : 1;
1869 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1870   uint8_t bit7                    : 1;
1871   uint8_t bit6                    : 1;
1872   uint8_t bit5                    : 1;
1873   uint8_t bit4                    : 1;
1874   uint8_t bit3                    : 1;
1875   uint8_t bit2                    : 1;
1876   uint8_t bit1                    : 1;
1877   uint8_t bit0                    : 1;
1878 #endif /* DRV_BYTE_ORDER */
1879 } asm330lhhx_sensor_hub_3_t;
1880 
1881 #define ASM330LHHX_SENSOR_HUB_4                 0x05U
1882 typedef struct
1883 {
1884 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1885   uint8_t bit0                    : 1;
1886   uint8_t bit1                    : 1;
1887   uint8_t bit2                    : 1;
1888   uint8_t bit3                    : 1;
1889   uint8_t bit4                    : 1;
1890   uint8_t bit5                    : 1;
1891   uint8_t bit6                    : 1;
1892   uint8_t bit7                    : 1;
1893 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1894   uint8_t bit7                    : 1;
1895   uint8_t bit6                    : 1;
1896   uint8_t bit5                    : 1;
1897   uint8_t bit4                    : 1;
1898   uint8_t bit3                    : 1;
1899   uint8_t bit2                    : 1;
1900   uint8_t bit1                    : 1;
1901   uint8_t bit0                    : 1;
1902 #endif /* DRV_BYTE_ORDER */
1903 } asm330lhhx_sensor_hub_4_t;
1904 
1905 #define ASM330LHHX_SENSOR_HUB_5                 0x06U
1906 typedef struct
1907 {
1908 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1909   uint8_t bit0                    : 1;
1910   uint8_t bit1                    : 1;
1911   uint8_t bit2                    : 1;
1912   uint8_t bit3                    : 1;
1913   uint8_t bit4                    : 1;
1914   uint8_t bit5                    : 1;
1915   uint8_t bit6                    : 1;
1916   uint8_t bit7                    : 1;
1917 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1918   uint8_t bit7                    : 1;
1919   uint8_t bit6                    : 1;
1920   uint8_t bit5                    : 1;
1921   uint8_t bit4                    : 1;
1922   uint8_t bit3                    : 1;
1923   uint8_t bit2                    : 1;
1924   uint8_t bit1                    : 1;
1925   uint8_t bit0                    : 1;
1926 #endif /* DRV_BYTE_ORDER */
1927 } asm330lhhx_sensor_hub_5_t;
1928 
1929 #define ASM330LHHX_SENSOR_HUB_6                 0x07U
1930 typedef struct
1931 {
1932 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1933   uint8_t bit0                    : 1;
1934   uint8_t bit1                    : 1;
1935   uint8_t bit2                    : 1;
1936   uint8_t bit3                    : 1;
1937   uint8_t bit4                    : 1;
1938   uint8_t bit5                    : 1;
1939   uint8_t bit6                    : 1;
1940   uint8_t bit7                    : 1;
1941 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1942   uint8_t bit7                    : 1;
1943   uint8_t bit6                    : 1;
1944   uint8_t bit5                    : 1;
1945   uint8_t bit4                    : 1;
1946   uint8_t bit3                    : 1;
1947   uint8_t bit2                    : 1;
1948   uint8_t bit1                    : 1;
1949   uint8_t bit0                    : 1;
1950 #endif /* DRV_BYTE_ORDER */
1951 } asm330lhhx_sensor_hub_6_t;
1952 
1953 #define ASM330LHHX_SENSOR_HUB_7                 0x08U
1954 typedef struct
1955 {
1956 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1957   uint8_t bit0                    : 1;
1958   uint8_t bit1                    : 1;
1959   uint8_t bit2                    : 1;
1960   uint8_t bit3                    : 1;
1961   uint8_t bit4                    : 1;
1962   uint8_t bit5                    : 1;
1963   uint8_t bit6                    : 1;
1964   uint8_t bit7                    : 1;
1965 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1966   uint8_t bit7                    : 1;
1967   uint8_t bit6                    : 1;
1968   uint8_t bit5                    : 1;
1969   uint8_t bit4                    : 1;
1970   uint8_t bit3                    : 1;
1971   uint8_t bit2                    : 1;
1972   uint8_t bit1                    : 1;
1973   uint8_t bit0                    : 1;
1974 #endif /* DRV_BYTE_ORDER */
1975 } asm330lhhx_sensor_hub_7_t;
1976 
1977 #define ASM330LHHX_SENSOR_HUB_8                 0x09U
1978 typedef struct
1979 {
1980 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
1981   uint8_t bit0                    : 1;
1982   uint8_t bit1                    : 1;
1983   uint8_t bit2                    : 1;
1984   uint8_t bit3                    : 1;
1985   uint8_t bit4                    : 1;
1986   uint8_t bit5                    : 1;
1987   uint8_t bit6                    : 1;
1988   uint8_t bit7                    : 1;
1989 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
1990   uint8_t bit7                    : 1;
1991   uint8_t bit6                    : 1;
1992   uint8_t bit5                    : 1;
1993   uint8_t bit4                    : 1;
1994   uint8_t bit3                    : 1;
1995   uint8_t bit2                    : 1;
1996   uint8_t bit1                    : 1;
1997   uint8_t bit0                    : 1;
1998 #endif /* DRV_BYTE_ORDER */
1999 } asm330lhhx_sensor_hub_8_t;
2000 
2001 #define ASM330LHHX_SENSOR_HUB_9                 0x0AU
2002 typedef struct
2003 {
2004 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2005   uint8_t bit0                    : 1;
2006   uint8_t bit1                    : 1;
2007   uint8_t bit2                    : 1;
2008   uint8_t bit3                    : 1;
2009   uint8_t bit4                    : 1;
2010   uint8_t bit5                    : 1;
2011   uint8_t bit6                    : 1;
2012   uint8_t bit7                    : 1;
2013 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2014   uint8_t bit7                    : 1;
2015   uint8_t bit6                    : 1;
2016   uint8_t bit5                    : 1;
2017   uint8_t bit4                    : 1;
2018   uint8_t bit3                    : 1;
2019   uint8_t bit2                    : 1;
2020   uint8_t bit1                    : 1;
2021   uint8_t bit0                    : 1;
2022 #endif /* DRV_BYTE_ORDER */
2023 } asm330lhhx_sensor_hub_9_t;
2024 
2025 #define ASM330LHHX_SENSOR_HUB_10                0x0BU
2026 typedef struct
2027 {
2028 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2029   uint8_t bit0                    : 1;
2030   uint8_t bit1                    : 1;
2031   uint8_t bit2                    : 1;
2032   uint8_t bit3                    : 1;
2033   uint8_t bit4                    : 1;
2034   uint8_t bit5                    : 1;
2035   uint8_t bit6                    : 1;
2036   uint8_t bit7                    : 1;
2037 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2038   uint8_t bit7                    : 1;
2039   uint8_t bit6                    : 1;
2040   uint8_t bit5                    : 1;
2041   uint8_t bit4                    : 1;
2042   uint8_t bit3                    : 1;
2043   uint8_t bit2                    : 1;
2044   uint8_t bit1                    : 1;
2045   uint8_t bit0                    : 1;
2046 #endif /* DRV_BYTE_ORDER */
2047 } asm330lhhx_sensor_hub_10_t;
2048 
2049 #define ASM330LHHX_SENSOR_HUB_11                0x0CU
2050 typedef struct
2051 {
2052 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2053   uint8_t bit0                    : 1;
2054   uint8_t bit1                    : 1;
2055   uint8_t bit2                    : 1;
2056   uint8_t bit3                    : 1;
2057   uint8_t bit4                    : 1;
2058   uint8_t bit5                    : 1;
2059   uint8_t bit6                    : 1;
2060   uint8_t bit7                    : 1;
2061 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2062   uint8_t bit7                    : 1;
2063   uint8_t bit6                    : 1;
2064   uint8_t bit5                    : 1;
2065   uint8_t bit4                    : 1;
2066   uint8_t bit3                    : 1;
2067   uint8_t bit2                    : 1;
2068   uint8_t bit1                    : 1;
2069   uint8_t bit0                    : 1;
2070 #endif /* DRV_BYTE_ORDER */
2071 } asm330lhhx_sensor_hub_11_t;
2072 
2073 #define ASM330LHHX_SENSOR_HUB_12                0x0DU
2074 typedef struct
2075 {
2076 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2077   uint8_t bit0                    : 1;
2078   uint8_t bit1                    : 1;
2079   uint8_t bit2                    : 1;
2080   uint8_t bit3                    : 1;
2081   uint8_t bit4                    : 1;
2082   uint8_t bit5                    : 1;
2083   uint8_t bit6                    : 1;
2084   uint8_t bit7                    : 1;
2085 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2086   uint8_t bit7                    : 1;
2087   uint8_t bit6                    : 1;
2088   uint8_t bit5                    : 1;
2089   uint8_t bit4                    : 1;
2090   uint8_t bit3                    : 1;
2091   uint8_t bit2                    : 1;
2092   uint8_t bit1                    : 1;
2093   uint8_t bit0                    : 1;
2094 #endif /* DRV_BYTE_ORDER */
2095 } asm330lhhx_sensor_hub_12_t;
2096 
2097 #define ASM330LHHX_SENSOR_HUB_13                0x0EU
2098 typedef struct
2099 {
2100 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2101   uint8_t bit0                    : 1;
2102   uint8_t bit1                    : 1;
2103   uint8_t bit2                    : 1;
2104   uint8_t bit3                    : 1;
2105   uint8_t bit4                    : 1;
2106   uint8_t bit5                    : 1;
2107   uint8_t bit6                    : 1;
2108   uint8_t bit7                    : 1;
2109 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2110   uint8_t bit7                    : 1;
2111   uint8_t bit6                    : 1;
2112   uint8_t bit5                    : 1;
2113   uint8_t bit4                    : 1;
2114   uint8_t bit3                    : 1;
2115   uint8_t bit2                    : 1;
2116   uint8_t bit1                    : 1;
2117   uint8_t bit0                    : 1;
2118 #endif /* DRV_BYTE_ORDER */
2119 } asm330lhhx_sensor_hub_13_t;
2120 
2121 #define ASM330LHHX_SENSOR_HUB_14                0x0FU
2122 typedef struct
2123 {
2124 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2125   uint8_t bit0                    : 1;
2126   uint8_t bit1                    : 1;
2127   uint8_t bit2                    : 1;
2128   uint8_t bit3                    : 1;
2129   uint8_t bit4                    : 1;
2130   uint8_t bit5                    : 1;
2131   uint8_t bit6                    : 1;
2132   uint8_t bit7                    : 1;
2133 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2134   uint8_t bit7                    : 1;
2135   uint8_t bit6                    : 1;
2136   uint8_t bit5                    : 1;
2137   uint8_t bit4                    : 1;
2138   uint8_t bit3                    : 1;
2139   uint8_t bit2                    : 1;
2140   uint8_t bit1                    : 1;
2141   uint8_t bit0                    : 1;
2142 #endif /* DRV_BYTE_ORDER */
2143 } asm330lhhx_sensor_hub_14_t;
2144 
2145 #define ASM330LHHX_SENSOR_HUB_15                0x10U
2146 typedef struct
2147 {
2148 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2149   uint8_t bit0                    : 1;
2150   uint8_t bit1                    : 1;
2151   uint8_t bit2                    : 1;
2152   uint8_t bit3                    : 1;
2153   uint8_t bit4                    : 1;
2154   uint8_t bit5                    : 1;
2155   uint8_t bit6                    : 1;
2156   uint8_t bit7                    : 1;
2157 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2158   uint8_t bit7                    : 1;
2159   uint8_t bit6                    : 1;
2160   uint8_t bit5                    : 1;
2161   uint8_t bit4                    : 1;
2162   uint8_t bit3                    : 1;
2163   uint8_t bit2                    : 1;
2164   uint8_t bit1                    : 1;
2165   uint8_t bit0                    : 1;
2166 #endif /* DRV_BYTE_ORDER */
2167 } asm330lhhx_sensor_hub_15_t;
2168 
2169 #define ASM330LHHX_SENSOR_HUB_16                0x11U
2170 typedef struct
2171 {
2172 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2173   uint8_t bit0                    : 1;
2174   uint8_t bit1                    : 1;
2175   uint8_t bit2                    : 1;
2176   uint8_t bit3                    : 1;
2177   uint8_t bit4                    : 1;
2178   uint8_t bit5                    : 1;
2179   uint8_t bit6                    : 1;
2180   uint8_t bit7                    : 1;
2181 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2182   uint8_t bit7                    : 1;
2183   uint8_t bit6                    : 1;
2184   uint8_t bit5                    : 1;
2185   uint8_t bit4                    : 1;
2186   uint8_t bit3                    : 1;
2187   uint8_t bit2                    : 1;
2188   uint8_t bit1                    : 1;
2189   uint8_t bit0                    : 1;
2190 #endif /* DRV_BYTE_ORDER */
2191 } asm330lhhx_sensor_hub_16_t;
2192 
2193 #define ASM330LHHX_SENSOR_HUB_17                0x12U
2194 typedef struct
2195 {
2196 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2197   uint8_t bit0                    : 1;
2198   uint8_t bit1                    : 1;
2199   uint8_t bit2                    : 1;
2200   uint8_t bit3                    : 1;
2201   uint8_t bit4                    : 1;
2202   uint8_t bit5                    : 1;
2203   uint8_t bit6                    : 1;
2204   uint8_t bit7                    : 1;
2205 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2206   uint8_t bit7                    : 1;
2207   uint8_t bit6                    : 1;
2208   uint8_t bit5                    : 1;
2209   uint8_t bit4                    : 1;
2210   uint8_t bit3                    : 1;
2211   uint8_t bit2                    : 1;
2212   uint8_t bit1                    : 1;
2213   uint8_t bit0                    : 1;
2214 #endif /* DRV_BYTE_ORDER */
2215 } asm330lhhx_sensor_hub_17_t;
2216 
2217 #define ASM330LHHX_SENSOR_HUB_18                0x13U
2218 typedef struct
2219 {
2220 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2221   uint8_t bit0                    : 1;
2222   uint8_t bit1                    : 1;
2223   uint8_t bit2                    : 1;
2224   uint8_t bit3                    : 1;
2225   uint8_t bit4                    : 1;
2226   uint8_t bit5                    : 1;
2227   uint8_t bit6                    : 1;
2228   uint8_t bit7                    : 1;
2229 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2230   uint8_t bit7                    : 1;
2231   uint8_t bit6                    : 1;
2232   uint8_t bit5                    : 1;
2233   uint8_t bit4                    : 1;
2234   uint8_t bit3                    : 1;
2235   uint8_t bit2                    : 1;
2236   uint8_t bit1                    : 1;
2237   uint8_t bit0                    : 1;
2238 #endif /* DRV_BYTE_ORDER */
2239 } asm330lhhx_sensor_hub_18_t;
2240 
2241 #define ASM330LHHX_MASTER_CONFIG                0x14U
2242 typedef struct
2243 {
2244 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2245   uint8_t aux_sens_on              : 2;
2246   uint8_t master_on                : 1;
2247   uint8_t shub_pu_en               : 1;
2248   uint8_t pass_through_mode        : 1;
2249   uint8_t start_config             : 1;
2250   uint8_t write_once               : 1;
2251   uint8_t rst_master_regs          : 1;
2252 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2253   uint8_t rst_master_regs          : 1;
2254   uint8_t write_once               : 1;
2255   uint8_t start_config             : 1;
2256   uint8_t pass_through_mode        : 1;
2257   uint8_t shub_pu_en               : 1;
2258   uint8_t master_on                : 1;
2259   uint8_t aux_sens_on              : 2;
2260 #endif /* DRV_BYTE_ORDER */
2261 } asm330lhhx_master_config_t;
2262 
2263 #define ASM330LHHX_SLV0_ADD                     0x15U
2264 typedef struct
2265 {
2266 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2267   uint8_t rw_0                     : 1;
2268   uint8_t slave0                   : 7;
2269 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2270   uint8_t slave0                   : 7;
2271   uint8_t rw_0                     : 1;
2272 #endif /* DRV_BYTE_ORDER */
2273 } asm330lhhx_slv0_add_t;
2274 
2275 #define ASM330LHHX_SLV0_SUBADD                  0x16U
2276 typedef struct
2277 {
2278   uint8_t slave0_reg               : 8;
2279 } asm330lhhx_slv0_subadd_t;
2280 
2281 #define ASM330LHHX_SLV0_CONFIG                  0x17U
2282 typedef struct
2283 {
2284 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2285   uint8_t slave0_numop             : 3;
2286   uint8_t batch_ext_sens_0_en      : 1;
2287   uint8_t not_used_01              : 2;
2288   uint8_t shub_odr                 : 2;
2289 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2290   uint8_t shub_odr                 : 2;
2291   uint8_t not_used_01              : 2;
2292   uint8_t batch_ext_sens_0_en      : 1;
2293   uint8_t slave0_numop             : 3;
2294 #endif /* DRV_BYTE_ORDER */
2295 } asm330lhhx_slv0_config_t;
2296 
2297 #define ASM330LHHX_SLV1_ADD                     0x18U
2298 typedef struct
2299 {
2300 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2301   uint8_t r_1                      : 1;
2302   uint8_t slave1_add               : 7;
2303 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2304   uint8_t slave1_add               : 7;
2305   uint8_t r_1                      : 1;
2306 #endif /* DRV_BYTE_ORDER */
2307 } asm330lhhx_slv1_add_t;
2308 
2309 #define ASM330LHHX_SLV1_SUBADD                  0x19U
2310 typedef struct
2311 {
2312   uint8_t slave1_reg               : 8;
2313 } asm330lhhx_slv1_subadd_t;
2314 
2315 #define ASM330LHHX_SLV1_CONFIG                  0x1AU
2316 typedef struct
2317 {
2318 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2319   uint8_t slave1_numop             : 3;
2320   uint8_t batch_ext_sens_1_en      : 1;
2321   uint8_t not_used_01              : 4;
2322 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2323   uint8_t not_used_01              : 4;
2324   uint8_t batch_ext_sens_1_en      : 1;
2325   uint8_t slave1_numop             : 3;
2326 #endif /* DRV_BYTE_ORDER */
2327 } asm330lhhx_slv1_config_t;
2328 
2329 #define ASM330LHHX_SLV2_ADD                     0x1BU
2330 typedef struct
2331 {
2332 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2333   uint8_t r_2                      : 1;
2334   uint8_t slave2_add               : 7;
2335 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2336   uint8_t slave2_add               : 7;
2337   uint8_t r_2                      : 1;
2338 #endif /* DRV_BYTE_ORDER */
2339 } asm330lhhx_slv2_add_t;
2340 
2341 #define ASM330LHHX_SLV2_SUBADD                  0x1CU
2342 typedef struct
2343 {
2344   uint8_t slave2_reg               : 8;
2345 } asm330lhhx_slv2_subadd_t;
2346 
2347 #define ASM330LHHX_SLV2_CONFIG                  0x1DU
2348 typedef struct
2349 {
2350 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2351   uint8_t slave2_numop             : 3;
2352   uint8_t batch_ext_sens_2_en      : 1;
2353   uint8_t not_used_01              : 4;
2354 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2355   uint8_t not_used_01              : 4;
2356   uint8_t batch_ext_sens_2_en      : 1;
2357   uint8_t slave2_numop             : 3;
2358 #endif /* DRV_BYTE_ORDER */
2359 } asm330lhhx_slv2_config_t;
2360 
2361 #define ASM330LHHX_SLV3_ADD                     0x1EU
2362 typedef struct
2363 {
2364 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2365   uint8_t r_3                      : 1;
2366   uint8_t slave3_add               : 7;
2367 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2368   uint8_t slave3_add               : 7;
2369   uint8_t r_3                      : 1;
2370 #endif /* DRV_BYTE_ORDER */
2371 } asm330lhhx_slv3_add_t;
2372 
2373 #define ASM330LHHX_SLV3_SUBADD                  0x1FU
2374 typedef struct
2375 {
2376   uint8_t slave3_reg               : 8;
2377 } asm330lhhx_slv3_subadd_t;
2378 
2379 #define ASM330LHHX_SLV3_CONFIG                  0x20U
2380 typedef struct
2381 {
2382 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2383   uint8_t slave3_numop             : 3;
2384   uint8_t batch_ext_sens_3_en      : 1;
2385   uint8_t not_used_01              : 4;
2386 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2387   uint8_t not_used_01              : 4;
2388   uint8_t batch_ext_sens_3_en      : 1;
2389   uint8_t slave3_numop             : 3;
2390 #endif /* DRV_BYTE_ORDER */
2391 } asm330lhhx_slv3_config_t;
2392 
2393 #define ASM330LHHX_DATAWRITE_SLV0  0x21U
2394 typedef struct
2395 {
2396   uint8_t slave0_dataw             : 8;
2397 } asm330lhhx_datawrite_slv0_t;
2398 
2399 #define ASM330LHHX_STATUS_MASTER                0x22U
2400 typedef struct
2401 {
2402 #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
2403   uint8_t sens_hub_endop           : 1;
2404   uint8_t not_used_01              : 2;
2405   uint8_t slave0_nack              : 1;
2406   uint8_t slave1_nack              : 1;
2407   uint8_t slave2_nack              : 1;
2408   uint8_t slave3_nack              : 1;
2409   uint8_t wr_once_done             : 1;
2410 #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
2411   uint8_t wr_once_done             : 1;
2412   uint8_t slave3_nack              : 1;
2413   uint8_t slave2_nack              : 1;
2414   uint8_t slave1_nack              : 1;
2415   uint8_t slave0_nack              : 1;
2416   uint8_t not_used_01              : 2;
2417   uint8_t sens_hub_endop           : 1;
2418 #endif /* DRV_BYTE_ORDER */
2419 } asm330lhhx_status_master_t;
2420 
2421 #define ASM330LHHX_FSM_LC_TIMEOUT_L             0x17AU
2422 #define ASM330LHHX_FSM_LC_TIMEOUT_H             0x17BU
2423 #define ASM330LHHX_FSM_PROGRAMS                 0x17CU
2424 #define ASM330LHHX_FSM_START_ADD_L              0x17EU
2425 #define ASM330LHHX_FSM_START_ADD_H              0x17FU
2426 
2427 /**
2428   * @defgroup ASM330LHHX_Register_Union
2429   * @brief    This union group all the registers that has a bit-field
2430   *           description.
2431   *           This union is useful but not need by the driver.
2432   *
2433   *           REMOVING this union you are compliant with:
2434   *           MISRA-C 2012 [Rule 19.2] -> " Union are not allowed "
2435   *
2436   * @{
2437   *
2438   */
2439 typedef union
2440 {
2441   asm330lhhx_func_cfg_access_t               func_cfg_access;
2442   asm330lhhx_pin_ctrl_t                      pin_ctrl;
2443   asm330lhhx_fifo_ctrl1_t                    fifo_ctrl1;
2444   asm330lhhx_fifo_ctrl2_t                    fifo_ctrl2;
2445   asm330lhhx_fifo_ctrl3_t                    fifo_ctrl3;
2446   asm330lhhx_fifo_ctrl4_t                    fifo_ctrl4;
2447   asm330lhhx_counter_bdr_reg1_t              counter_bdr_reg1;
2448   asm330lhhx_counter_bdr_reg2_t              counter_bdr_reg2;
2449   asm330lhhx_int1_ctrl_t                     int1_ctrl;
2450   asm330lhhx_int2_ctrl_t                     int2_ctrl;
2451   asm330lhhx_ctrl1_xl_t                      ctrl1_xl;
2452   asm330lhhx_ctrl2_g_t                       ctrl2_g;
2453   asm330lhhx_ctrl3_c_t                       ctrl3_c;
2454   asm330lhhx_ctrl4_c_t                       ctrl4_c;
2455   asm330lhhx_ctrl5_c_t                       ctrl5_c;
2456   asm330lhhx_ctrl6_c_t                       ctrl6_c;
2457   asm330lhhx_ctrl7_g_t                       ctrl7_g;
2458   asm330lhhx_ctrl8_xl_t                      ctrl8_xl;
2459   asm330lhhx_ctrl9_xl_t                      ctrl9_xl;
2460   asm330lhhx_ctrl10_c_t                      ctrl10_c;
2461   asm330lhhx_all_int_src_t                   all_int_src;
2462   asm330lhhx_wake_up_src_t                   wake_up_src;
2463   asm330lhhx_d6d_src_t                       d6d_src;
2464   asm330lhhx_status_reg_t                    status_reg;
2465   asm330lhhx_fifo_status1_t                  fifo_status1;
2466   asm330lhhx_fifo_status2_t                  fifo_status2;
2467   asm330lhhx_int_cfg0_t                      int_cfg0;
2468   asm330lhhx_int_cfg1_t                      int_cfg1;
2469   asm330lhhx_ths_6d_t                        ths_6d;
2470   asm330lhhx_wake_up_ths_t                   wake_up_ths;
2471   asm330lhhx_wake_up_dur_t                   wake_up_dur;
2472   asm330lhhx_free_fall_t                     free_fall;
2473   asm330lhhx_md1_cfg_t                       md1_cfg;
2474   asm330lhhx_md2_cfg_t                       md2_cfg;
2475   asm330lhhx_i3c_bus_avb_t                   i3c_bus_avb;
2476   asm330lhhx_internal_freq_fine_t            internal_freq_fine;
2477   asm330lhhx_fifo_data_out_tag_t             fifo_data_out_tag;
2478   asm330lhhx_page_sel_t                      page_sel;
2479   asm330lhhx_emb_func_en_b_t                 emb_func_en_b;
2480   asm330lhhx_page_address_t                  page_address;
2481   asm330lhhx_page_value_t                    page_value;
2482   asm330lhhx_emb_func_int1_t                 emb_func_int1;
2483   asm330lhhx_fsm_int1_a_t                    fsm_int1_a;
2484   asm330lhhx_fsm_int1_b_t                    fsm_int1_b;
2485   asm330lhhx_mlc_int1_t                      mlc_int1;
2486   asm330lhhx_emb_func_int2_t                 emb_func_int2;
2487   asm330lhhx_fsm_int2_a_t                    fsm_int2_a;
2488   asm330lhhx_fsm_int2_b_t                    fsm_int2_b;
2489   asm330lhhx_mlc_int2_t                      mlc_int2;
2490   asm330lhhx_emb_func_status_t               emb_func_status;
2491   asm330lhhx_fsm_status_a_t                  fsm_status_a;
2492   asm330lhhx_fsm_status_b_t                  fsm_status_b;
2493   asm330lhhx_mlc_status_mainpage_t           mlc_status_mainpage;
2494   asm330lhhx_emb_func_odr_cfg_c_t            emb_func_odr_cfg_c;
2495   asm330lhhx_page_rw_t                       page_rw;
2496   asm330lhhx_fsm_enable_a_t                  fsm_enable_a;
2497   asm330lhhx_fsm_enable_b_t                  fsm_enable_b;
2498   asm330lhhx_fsm_long_counter_clear_t        fsm_long_counter_clear;
2499   asm330lhhx_fsm_outs1_t                     fsm_outs1;
2500   asm330lhhx_fsm_outs2_t                     fsm_outs2;
2501   asm330lhhx_fsm_outs3_t                     fsm_outs3;
2502   asm330lhhx_fsm_outs4_t                     fsm_outs4;
2503   asm330lhhx_fsm_outs5_t                     fsm_outs5;
2504   asm330lhhx_fsm_outs6_t                     fsm_outs6;
2505   asm330lhhx_fsm_outs7_t                     fsm_outs7;
2506   asm330lhhx_fsm_outs8_t                     fsm_outs8;
2507   asm330lhhx_fsm_outs9_t                     fsm_outs9;
2508   asm330lhhx_fsm_outs10_t                    fsm_outs10;
2509   asm330lhhx_fsm_outs11_t                    fsm_outs11;
2510   asm330lhhx_fsm_outs12_t                    fsm_outs12;
2511   asm330lhhx_fsm_outs13_t                    fsm_outs13;
2512   asm330lhhx_fsm_outs14_t                    fsm_outs14;
2513   asm330lhhx_fsm_outs15_t                    fsm_outs15;
2514   asm330lhhx_fsm_outs16_t                    fsm_outs16;
2515   asm330lhhx_emb_func_odr_cfg_b_t            emb_func_odr_cfg_b;
2516   asm330lhhx_emb_func_init_b_t               emb_func_init_b;
2517   asm330lhhx_mag_cfg_a_t                     mag_cfg_a;
2518   asm330lhhx_mag_cfg_b_t                     mag_cfg_b;
2519   asm330lhhx_sensor_hub_1_t                  sensor_hub_1;
2520   asm330lhhx_sensor_hub_2_t                  sensor_hub_2;
2521   asm330lhhx_sensor_hub_3_t                  sensor_hub_3;
2522   asm330lhhx_sensor_hub_4_t                  sensor_hub_4;
2523   asm330lhhx_sensor_hub_5_t                  sensor_hub_5;
2524   asm330lhhx_sensor_hub_6_t                  sensor_hub_6;
2525   asm330lhhx_sensor_hub_7_t                  sensor_hub_7;
2526   asm330lhhx_sensor_hub_8_t                  sensor_hub_8;
2527   asm330lhhx_sensor_hub_9_t                  sensor_hub_9;
2528   asm330lhhx_sensor_hub_10_t                 sensor_hub_10;
2529   asm330lhhx_sensor_hub_11_t                 sensor_hub_11;
2530   asm330lhhx_sensor_hub_12_t                 sensor_hub_12;
2531   asm330lhhx_sensor_hub_13_t                 sensor_hub_13;
2532   asm330lhhx_sensor_hub_14_t                 sensor_hub_14;
2533   asm330lhhx_sensor_hub_15_t                 sensor_hub_15;
2534   asm330lhhx_sensor_hub_16_t                 sensor_hub_16;
2535   asm330lhhx_sensor_hub_17_t                 sensor_hub_17;
2536   asm330lhhx_sensor_hub_18_t                 sensor_hub_18;
2537   asm330lhhx_master_config_t                 master_config;
2538   asm330lhhx_slv0_add_t                      slv0_add;
2539   asm330lhhx_slv0_subadd_t                   slv0_subadd;
2540   asm330lhhx_slv0_config_t                   slv0_config;
2541   asm330lhhx_slv1_add_t                      slv1_add;
2542   asm330lhhx_slv1_subadd_t                   slv1_subadd;
2543   asm330lhhx_slv1_config_t                   slv1_config;
2544   asm330lhhx_slv2_add_t                      slv2_add;
2545   asm330lhhx_slv2_subadd_t                   slv2_subadd;
2546   asm330lhhx_slv2_config_t                   slv2_config;
2547   asm330lhhx_slv3_add_t                      slv3_add;
2548   asm330lhhx_slv3_subadd_t                   slv3_subadd;
2549   asm330lhhx_slv3_config_t                   slv3_config;
2550   asm330lhhx_datawrite_slv0_t                datawrite_slv0;
2551   asm330lhhx_status_master_t                 status_master;
2552   bitwise_t                                  bitwise;
2553   uint8_t                                    byte;
2554 } asm330lhhx_reg_t;
2555 
2556 /**
2557   * @}
2558   *
2559   */
2560 
2561 #ifndef __weak
2562 #define __weak __attribute__((weak))
2563 #endif /* __weak */
2564 
2565 /*
2566  * These are the basic platform dependent I/O routines to read
2567  * and write device registers connected on a standard bus.
2568  * The driver keeps offering a default implementation based on function
2569  * pointers to read/write routines for backward compatibility.
2570  * The __weak directive allows the final application to overwrite
2571  * them with a custom implementation.
2572  */
2573 
2574 int32_t asm330lhhx_read_reg(const stmdev_ctx_t *ctx, uint8_t reg, uint8_t *data,
2575                             uint16_t len);
2576 int32_t asm330lhhx_write_reg(const stmdev_ctx_t *ctx, uint8_t reg, uint8_t *data,
2577                              uint16_t len);
2578 
2579 float_t asm330lhhx_from_fs2g_to_mg(int16_t lsb);
2580 float_t asm330lhhx_from_fs4g_to_mg(int16_t lsb);
2581 float_t asm330lhhx_from_fs8g_to_mg(int16_t lsb);
2582 float_t asm330lhhx_from_fs16g_to_mg(int16_t lsb);
2583 float_t asm330lhhx_from_fs125dps_to_mdps(int16_t lsb);
2584 float_t asm330lhhx_from_fs250dps_to_mdps(int16_t lsb);
2585 float_t asm330lhhx_from_fs500dps_to_mdps(int16_t lsb);
2586 float_t asm330lhhx_from_fs1000dps_to_mdps(int16_t lsb);
2587 float_t asm330lhhx_from_fs2000dps_to_mdps(int16_t lsb);
2588 float_t asm330lhhx_from_fs4000dps_to_mdps(int16_t lsb);
2589 float_t asm330lhhx_from_lsb_to_celsius(int16_t lsb);
2590 float_t asm330lhhx_from_lsb_to_nsec(int32_t lsb);
2591 
2592 typedef enum
2593 {
2594   ASM330LHHX_2g   = 0,
2595   ASM330LHHX_16g  = 1, /* if XL_FS_MODE = '1' -> ASM330LHHX_2g */
2596   ASM330LHHX_4g   = 2,
2597   ASM330LHHX_8g   = 3,
2598 } asm330lhhx_fs_xl_t;
2599 int32_t asm330lhhx_xl_full_scale_set(const stmdev_ctx_t *ctx, asm330lhhx_fs_xl_t val);
2600 int32_t asm330lhhx_xl_full_scale_get(const stmdev_ctx_t *ctx,
2601                                      asm330lhhx_fs_xl_t *val);
2602 
2603 typedef enum
2604 {
2605   ASM330LHHX_XL_ODR_OFF    = 0,
2606   ASM330LHHX_XL_ODR_12Hz5  = 1,
2607   ASM330LHHX_XL_ODR_26Hz   = 2,
2608   ASM330LHHX_XL_ODR_52Hz   = 3,
2609   ASM330LHHX_XL_ODR_104Hz  = 4,
2610   ASM330LHHX_XL_ODR_208Hz  = 5,
2611   ASM330LHHX_XL_ODR_417Hz  = 6,
2612   ASM330LHHX_XL_ODR_833Hz  = 7,
2613   ASM330LHHX_XL_ODR_1667Hz = 8,
2614   ASM330LHHX_XL_ODR_3333Hz =  9,
2615   ASM330LHHX_XL_ODR_6667Hz = 10,
2616   ASM330LHHX_XL_ODR_1Hz6   = 11, /* (low power only) */
2617 } asm330lhhx_odr_xl_t;
2618 int32_t asm330lhhx_xl_data_rate_set(const stmdev_ctx_t *ctx, asm330lhhx_odr_xl_t val);
2619 int32_t asm330lhhx_xl_data_rate_get(const stmdev_ctx_t *ctx,
2620                                     asm330lhhx_odr_xl_t *val);
2621 
2622 typedef enum
2623 {
2624   ASM330LHHX_125dps = 2,
2625   ASM330LHHX_250dps = 0,
2626   ASM330LHHX_500dps = 4,
2627   ASM330LHHX_1000dps = 8,
2628   ASM330LHHX_2000dps = 12,
2629   ASM330LHHX_4000dps = 1,
2630 } asm330lhhx_fs_g_t;
2631 int32_t asm330lhhx_gy_full_scale_set(const stmdev_ctx_t *ctx, asm330lhhx_fs_g_t val);
2632 int32_t asm330lhhx_gy_full_scale_get(const stmdev_ctx_t *ctx, asm330lhhx_fs_g_t *val);
2633 
2634 typedef enum
2635 {
2636   ASM330LHHX_GY_ODR_OFF    = 0,
2637   ASM330LHHX_GY_ODR_12Hz5  = 1,
2638   ASM330LHHX_GY_ODR_26Hz   = 2,
2639   ASM330LHHX_GY_ODR_52Hz   = 3,
2640   ASM330LHHX_GY_ODR_104Hz  = 4,
2641   ASM330LHHX_GY_ODR_208Hz  = 5,
2642   ASM330LHHX_GY_ODR_417Hz  = 6,
2643   ASM330LHHX_GY_ODR_833Hz  = 7,
2644   ASM330LHHX_GY_ODR_1667Hz = 8,
2645   ASM330LHHX_GY_ODR_3333Hz =  9,
2646   ASM330LHHX_GY_ODR_6667Hz = 10,
2647 } asm330lhhx_odr_g_t;
2648 int32_t asm330lhhx_gy_data_rate_set(const stmdev_ctx_t *ctx,
2649                                     asm330lhhx_odr_g_t val);
2650 int32_t asm330lhhx_gy_data_rate_get(const stmdev_ctx_t *ctx,
2651                                     asm330lhhx_odr_g_t *val);
2652 
2653 int32_t asm330lhhx_block_data_update_set(const stmdev_ctx_t *ctx, uint8_t val);
2654 int32_t asm330lhhx_block_data_update_get(const stmdev_ctx_t *ctx, uint8_t *val);
2655 
2656 typedef enum
2657 {
2658   ASM330LHHX_LSb_1mg  = 0,
2659   ASM330LHHX_LSb_16mg = 1,
2660 } asm330lhhx_usr_off_w_t;
2661 int32_t asm330lhhx_xl_offset_weight_set(const stmdev_ctx_t *ctx,
2662                                         asm330lhhx_usr_off_w_t val);
2663 int32_t asm330lhhx_xl_offset_weight_get(const stmdev_ctx_t *ctx,
2664                                         asm330lhhx_usr_off_w_t *val);
2665 
2666 typedef enum
2667 {
2668   ASM330LHHX_HIGH_PERFORMANCE_MD  = 0,
2669   ASM330LHHX_LOW_NORMAL_POWER_MD  = 1,
2670 } asm330lhhx_xl_hm_mode_t;
2671 int32_t asm330lhhx_xl_power_mode_set(const stmdev_ctx_t *ctx,
2672                                      asm330lhhx_xl_hm_mode_t val);
2673 int32_t asm330lhhx_xl_power_mode_get(const stmdev_ctx_t *ctx,
2674                                      asm330lhhx_xl_hm_mode_t *val);
2675 
2676 typedef enum
2677 {
2678   ASM330LHHX_GY_HIGH_PERFORMANCE  = 0,
2679   ASM330LHHX_GY_NORMAL            = 1,
2680 } asm330lhhx_g_hm_mode_t;
2681 int32_t asm330lhhx_gy_power_mode_set(const stmdev_ctx_t *ctx,
2682                                      asm330lhhx_g_hm_mode_t val);
2683 int32_t asm330lhhx_gy_power_mode_get(const stmdev_ctx_t *ctx,
2684                                      asm330lhhx_g_hm_mode_t *val);
2685 
2686 typedef struct
2687 {
2688   asm330lhhx_all_int_src_t           all_int_src;
2689   asm330lhhx_wake_up_src_t           wake_up_src;
2690   asm330lhhx_d6d_src_t               d6d_src;
2691   asm330lhhx_status_reg_t            status_reg;
2692   asm330lhhx_emb_func_status_t       emb_func_status;
2693   asm330lhhx_fsm_status_a_t          fsm_status_a;
2694   asm330lhhx_fsm_status_b_t          fsm_status_b;
2695   asm330lhhx_mlc_status_mainpage_t   mlc_status;
2696 } asm330lhhx_all_sources_t;
2697 int32_t asm330lhhx_all_sources_get(const stmdev_ctx_t *ctx,
2698                                    asm330lhhx_all_sources_t *val);
2699 
2700 int32_t asm330lhhx_status_reg_get(const stmdev_ctx_t *ctx,
2701                                   asm330lhhx_status_reg_t *val);
2702 
2703 int32_t asm330lhhx_xl_flag_data_ready_get(const stmdev_ctx_t *ctx, uint8_t *val);
2704 
2705 int32_t asm330lhhx_gy_flag_data_ready_get(const stmdev_ctx_t *ctx, uint8_t *val);
2706 
2707 int32_t asm330lhhx_temp_flag_data_ready_get(const stmdev_ctx_t *ctx, uint8_t *val);
2708 
2709 int32_t asm330lhhx_xl_usr_offset_x_set(const stmdev_ctx_t *ctx, uint8_t *buff);
2710 int32_t asm330lhhx_xl_usr_offset_x_get(const stmdev_ctx_t *ctx, uint8_t *buff);
2711 
2712 int32_t asm330lhhx_xl_usr_offset_y_set(const stmdev_ctx_t *ctx, uint8_t *buff);
2713 int32_t asm330lhhx_xl_usr_offset_y_get(const stmdev_ctx_t *ctx, uint8_t *buff);
2714 
2715 int32_t asm330lhhx_xl_usr_offset_z_set(const stmdev_ctx_t *ctx, uint8_t *buff);
2716 int32_t asm330lhhx_xl_usr_offset_z_get(const stmdev_ctx_t *ctx, uint8_t *buff);
2717 
2718 int32_t asm330lhhx_xl_usr_offset_set(const stmdev_ctx_t *ctx, uint8_t val);
2719 int32_t asm330lhhx_xl_usr_offset_get(const stmdev_ctx_t *ctx, uint8_t *val);
2720 
2721 int32_t asm330lhhx_timestamp_rst(const stmdev_ctx_t *ctx);
2722 
2723 int32_t asm330lhhx_timestamp_set(const stmdev_ctx_t *ctx, uint8_t val);
2724 int32_t asm330lhhx_timestamp_get(const stmdev_ctx_t *ctx, uint8_t *val);
2725 
2726 int32_t asm330lhhx_timestamp_raw_get(const stmdev_ctx_t *ctx, uint32_t *val);
2727 
2728 typedef enum
2729 {
2730   ASM330LHHX_NO_ROUND      = 0,
2731   ASM330LHHX_ROUND_XL      = 1,
2732   ASM330LHHX_ROUND_GY      = 2,
2733   ASM330LHHX_ROUND_GY_XL   = 3,
2734 } asm330lhhx_rounding_t;
2735 int32_t asm330lhhx_rounding_mode_set(const stmdev_ctx_t *ctx,
2736                                      asm330lhhx_rounding_t val);
2737 int32_t asm330lhhx_rounding_mode_get(const stmdev_ctx_t *ctx,
2738                                      asm330lhhx_rounding_t *val);
2739 
2740 int32_t asm330lhhx_temperature_raw_get(const stmdev_ctx_t *ctx, int16_t *val);
2741 
2742 int32_t asm330lhhx_angular_rate_raw_get(const stmdev_ctx_t *ctx, int16_t *val);
2743 
2744 int32_t asm330lhhx_acceleration_raw_get(const stmdev_ctx_t *ctx, int16_t *val);
2745 
2746 int32_t asm330lhhx_fifo_out_raw_get(const stmdev_ctx_t *ctx, uint8_t *val);
2747 
2748 int32_t asm330lhhx_odr_cal_reg_set(const stmdev_ctx_t *ctx, uint8_t val);
2749 int32_t asm330lhhx_odr_cal_reg_get(const stmdev_ctx_t *ctx, uint8_t *val);
2750 
2751 typedef enum
2752 {
2753   ASM330LHHX_USER_BANK           = 0,
2754   ASM330LHHX_SENSOR_HUB_BANK     = 1,
2755   ASM330LHHX_EMBEDDED_FUNC_BANK  = 2,
2756 } asm330lhhx_reg_access_t;
2757 int32_t asm330lhhx_mem_bank_set(const stmdev_ctx_t *ctx, asm330lhhx_reg_access_t val);
2758 int32_t asm330lhhx_mem_bank_get(const stmdev_ctx_t *ctx,
2759                                 asm330lhhx_reg_access_t *val);
2760 
2761 int32_t asm330lhhx_ln_pg_write_byte(const stmdev_ctx_t *ctx, uint16_t address,
2762                                     uint8_t *val);
2763 int32_t asm330lhhx_ln_pg_write(const stmdev_ctx_t *ctx, uint16_t address,
2764                                uint8_t *buf, uint8_t len);
2765 int32_t asm330lhhx_ln_pg_read_byte(const stmdev_ctx_t *ctx, uint16_t add,
2766                                    uint8_t *val);
2767 int32_t asm330lhhx_ln_pg_read(const stmdev_ctx_t *ctx, uint16_t address,
2768                               uint8_t *val);
2769 
2770 typedef enum
2771 {
2772   ASM330LHHX_DRDY_LATCHED = 0,
2773   ASM330LHHX_DRDY_PULSED  = 1,
2774 } asm330lhhx_dataready_pulsed_t;
2775 int32_t asm330lhhx_data_ready_mode_set(const stmdev_ctx_t *ctx,
2776                                        asm330lhhx_dataready_pulsed_t val);
2777 int32_t asm330lhhx_data_ready_mode_get(const stmdev_ctx_t *ctx,
2778                                        asm330lhhx_dataready_pulsed_t *val);
2779 
2780 int32_t asm330lhhx_device_id_get(const stmdev_ctx_t *ctx, uint8_t *buff);
2781 
2782 int32_t asm330lhhx_reset_set(const stmdev_ctx_t *ctx, uint8_t val);
2783 int32_t asm330lhhx_reset_get(const stmdev_ctx_t *ctx, uint8_t *val);
2784 
2785 int32_t asm330lhhx_auto_increment_set(const stmdev_ctx_t *ctx, uint8_t val);
2786 int32_t asm330lhhx_auto_increment_get(const stmdev_ctx_t *ctx, uint8_t *val);
2787 
2788 int32_t asm330lhhx_boot_set(const stmdev_ctx_t *ctx, uint8_t val);
2789 int32_t asm330lhhx_boot_get(const stmdev_ctx_t *ctx, uint8_t *val);
2790 
2791 typedef enum
2792 {
2793   ASM330LHHX_XL_ST_DISABLE  = 0,
2794   ASM330LHHX_XL_ST_POSITIVE = 1,
2795   ASM330LHHX_XL_ST_NEGATIVE = 2,
2796 } asm330lhhx_st_xl_t;
2797 int32_t asm330lhhx_xl_self_test_set(const stmdev_ctx_t *ctx, asm330lhhx_st_xl_t val);
2798 int32_t asm330lhhx_xl_self_test_get(const stmdev_ctx_t *ctx, asm330lhhx_st_xl_t *val);
2799 
2800 typedef enum
2801 {
2802   ASM330LHHX_GY_ST_DISABLE  = 0,
2803   ASM330LHHX_GY_ST_POSITIVE = 1,
2804   ASM330LHHX_GY_ST_NEGATIVE = 3,
2805 } asm330lhhx_st_g_t;
2806 int32_t asm330lhhx_gy_self_test_set(const stmdev_ctx_t *ctx, asm330lhhx_st_g_t val);
2807 int32_t asm330lhhx_gy_self_test_get(const stmdev_ctx_t *ctx, asm330lhhx_st_g_t *val);
2808 
2809 int32_t asm330lhhx_xl_filter_lp2_set(const stmdev_ctx_t *ctx, uint8_t val);
2810 int32_t asm330lhhx_xl_filter_lp2_get(const stmdev_ctx_t *ctx, uint8_t *val);
2811 
2812 int32_t asm330lhhx_gy_filter_lp1_set(const stmdev_ctx_t *ctx, uint8_t val);
2813 int32_t asm330lhhx_gy_filter_lp1_get(const stmdev_ctx_t *ctx, uint8_t *val);
2814 
2815 int32_t asm330lhhx_filter_settling_mask_set(const stmdev_ctx_t *ctx, uint8_t val);
2816 int32_t asm330lhhx_filter_settling_mask_get(const stmdev_ctx_t *ctx, uint8_t *val);
2817 
2818 typedef enum
2819 {
2820   ASM330LHHX_ULTRA_LIGHT  = 0,
2821   ASM330LHHX_VERY_LIGHT   = 1,
2822   ASM330LHHX_LIGHT        = 2,
2823   ASM330LHHX_MEDIUM       = 3,
2824   ASM330LHHX_STRONG       = 4,
2825   ASM330LHHX_VERY_STRONG  = 5,
2826   ASM330LHHX_AGGRESSIVE   = 6,
2827   ASM330LHHX_XTREME       = 7,
2828 } asm330lhhx_ftype_t;
2829 int32_t asm330lhhx_gy_lp1_bandwidth_set(const stmdev_ctx_t *ctx,
2830                                         asm330lhhx_ftype_t val);
2831 int32_t asm330lhhx_gy_lp1_bandwidth_get(const stmdev_ctx_t *ctx,
2832                                         asm330lhhx_ftype_t *val);
2833 
2834 int32_t asm330lhhx_xl_lp2_on_6d_set(const stmdev_ctx_t *ctx, uint8_t val);
2835 int32_t asm330lhhx_xl_lp2_on_6d_get(const stmdev_ctx_t *ctx, uint8_t *val);
2836 
2837 typedef enum
2838 {
2839   ASM330LHHX_HP_PATH_DISABLE_ON_OUT    = 0x00,
2840   ASM330LHHX_SLOPE_ODR_DIV_4           = 0x10,
2841   ASM330LHHX_HP_ODR_DIV_10             = 0x11,
2842   ASM330LHHX_HP_ODR_DIV_20             = 0x12,
2843   ASM330LHHX_HP_ODR_DIV_45             = 0x13,
2844   ASM330LHHX_HP_ODR_DIV_100            = 0x14,
2845   ASM330LHHX_HP_ODR_DIV_200            = 0x15,
2846   ASM330LHHX_HP_ODR_DIV_400            = 0x16,
2847   ASM330LHHX_HP_ODR_DIV_800            = 0x17,
2848   ASM330LHHX_HP_REF_MD_ODR_DIV_10      = 0x31,
2849   ASM330LHHX_HP_REF_MD_ODR_DIV_20      = 0x32,
2850   ASM330LHHX_HP_REF_MD_ODR_DIV_45      = 0x33,
2851   ASM330LHHX_HP_REF_MD_ODR_DIV_100     = 0x34,
2852   ASM330LHHX_HP_REF_MD_ODR_DIV_200     = 0x35,
2853   ASM330LHHX_HP_REF_MD_ODR_DIV_400     = 0x36,
2854   ASM330LHHX_HP_REF_MD_ODR_DIV_800     = 0x37,
2855   ASM330LHHX_LP_ODR_DIV_10             = 0x01,
2856   ASM330LHHX_LP_ODR_DIV_20             = 0x02,
2857   ASM330LHHX_LP_ODR_DIV_45             = 0x03,
2858   ASM330LHHX_LP_ODR_DIV_100            = 0x04,
2859   ASM330LHHX_LP_ODR_DIV_200            = 0x05,
2860   ASM330LHHX_LP_ODR_DIV_400            = 0x06,
2861   ASM330LHHX_LP_ODR_DIV_800            = 0x07,
2862 } asm330lhhx_hp_slope_xl_en_t;
2863 int32_t asm330lhhx_xl_hp_path_on_out_set(const stmdev_ctx_t *ctx,
2864                                          asm330lhhx_hp_slope_xl_en_t val);
2865 int32_t asm330lhhx_xl_hp_path_on_out_get(const stmdev_ctx_t *ctx,
2866                                          asm330lhhx_hp_slope_xl_en_t *val);
2867 
2868 int32_t asm330lhhx_xl_fast_settling_set(const stmdev_ctx_t *ctx, uint8_t val);
2869 int32_t asm330lhhx_xl_fast_settling_get(const stmdev_ctx_t *ctx, uint8_t *val);
2870 
2871 typedef enum
2872 {
2873   ASM330LHHX_USE_SLOPE = 0,
2874   ASM330LHHX_USE_HPF   = 1,
2875 } asm330lhhx_slope_fds_t;
2876 int32_t asm330lhhx_xl_hp_path_internal_set(const stmdev_ctx_t *ctx,
2877                                            asm330lhhx_slope_fds_t val);
2878 int32_t asm330lhhx_xl_hp_path_internal_get(const stmdev_ctx_t *ctx,
2879                                            asm330lhhx_slope_fds_t *val);
2880 
2881 typedef enum
2882 {
2883   ASM330LHHX_HP_FILTER_NONE     = 0x00,
2884   ASM330LHHX_HP_FILTER_16mHz    = 0x80,
2885   ASM330LHHX_HP_FILTER_65mHz    = 0x81,
2886   ASM330LHHX_HP_FILTER_260mHz   = 0x82,
2887   ASM330LHHX_HP_FILTER_1Hz04    = 0x83,
2888 } asm330lhhx_hpm_g_t;
2889 int32_t asm330lhhx_gy_hp_path_internal_set(const stmdev_ctx_t *ctx,
2890                                            asm330lhhx_hpm_g_t val);
2891 int32_t asm330lhhx_gy_hp_path_internal_get(const stmdev_ctx_t *ctx,
2892                                            asm330lhhx_hpm_g_t *val);
2893 
2894 typedef enum
2895 {
2896   ASM330LHHX_PULL_UP_DISC       = 0,
2897   ASM330LHHX_PULL_UP_CONNECT    = 1,
2898 } asm330lhhx_sdo_pu_en_t;
2899 int32_t asm330lhhx_sdo_sa0_mode_set(const stmdev_ctx_t *ctx,
2900                                     asm330lhhx_sdo_pu_en_t val);
2901 int32_t asm330lhhx_sdo_sa0_mode_get(const stmdev_ctx_t *ctx,
2902                                     asm330lhhx_sdo_pu_en_t *val);
2903 
2904 typedef enum
2905 {
2906   ASM330LHHX_PULL_DOWN_CONNECT       = 0,
2907   ASM330LHHX_PULL_DOWN_DISC          = 1,
2908 } asm330lhhx_pd_dis_int1_t;
2909 int32_t asm330lhhx_int1_mode_set(const stmdev_ctx_t *ctx,
2910                                  asm330lhhx_pd_dis_int1_t val);
2911 int32_t asm330lhhx_int1_mode_get(const stmdev_ctx_t *ctx,
2912                                  asm330lhhx_pd_dis_int1_t *val);
2913 
2914 typedef enum
2915 {
2916   ASM330LHHX_SPI_4_WIRE = 0,
2917   ASM330LHHX_SPI_3_WIRE = 1,
2918 } asm330lhhx_sim_t;
2919 int32_t asm330lhhx_spi_mode_set(const stmdev_ctx_t *ctx, asm330lhhx_sim_t val);
2920 int32_t asm330lhhx_spi_mode_get(const stmdev_ctx_t *ctx, asm330lhhx_sim_t *val);
2921 
2922 typedef enum
2923 {
2924   ASM330LHHX_I2C_ENABLE  = 0,
2925   ASM330LHHX_I2C_DISABLE = 1,
2926 } asm330lhhx_i2c_disable_t;
2927 int32_t asm330lhhx_i2c_interface_set(const stmdev_ctx_t *ctx,
2928                                      asm330lhhx_i2c_disable_t val);
2929 int32_t asm330lhhx_i2c_interface_get(const stmdev_ctx_t *ctx,
2930                                      asm330lhhx_i2c_disable_t *val);
2931 
2932 typedef enum
2933 {
2934   ASM330LHHX_I3C_DISABLE         = 0x80,
2935   ASM330LHHX_I3C_ENABLE_T_50us   = 0x00,
2936   ASM330LHHX_I3C_ENABLE_T_2us    = 0x01,
2937   ASM330LHHX_I3C_ENABLE_T_1ms    = 0x02,
2938   ASM330LHHX_I3C_ENABLE_T_25ms   = 0x03,
2939 } asm330lhhx_i3c_disable_t;
2940 int32_t asm330lhhx_i3c_disable_set(const stmdev_ctx_t *ctx,
2941                                    asm330lhhx_i3c_disable_t val);
2942 int32_t asm330lhhx_i3c_disable_get(const stmdev_ctx_t *ctx,
2943                                    asm330lhhx_i3c_disable_t *val);
2944 
2945 typedef struct
2946 {
2947   asm330lhhx_int1_ctrl_t          int1_ctrl;
2948   asm330lhhx_md1_cfg_t            md1_cfg;
2949   asm330lhhx_emb_func_int1_t      emb_func_int1;
2950   asm330lhhx_fsm_int1_a_t         fsm_int1_a;
2951   asm330lhhx_fsm_int1_b_t         fsm_int1_b;
2952   asm330lhhx_mlc_int1_t           mlc_int1;
2953 } asm330lhhx_pin_int1_route_t;
2954 int32_t asm330lhhx_pin_int1_route_set(const stmdev_ctx_t *ctx,
2955                                       asm330lhhx_pin_int1_route_t *val);
2956 int32_t asm330lhhx_pin_int1_route_get(const stmdev_ctx_t *ctx,
2957                                       asm330lhhx_pin_int1_route_t *val);
2958 
2959 typedef struct
2960 {
2961   asm330lhhx_int2_ctrl_t          int2_ctrl;
2962   asm330lhhx_md2_cfg_t            md2_cfg;
2963   asm330lhhx_emb_func_int2_t      emb_func_int2;
2964   asm330lhhx_fsm_int2_a_t         fsm_int2_a;
2965   asm330lhhx_fsm_int2_b_t         fsm_int2_b;
2966   asm330lhhx_mlc_int2_t           mlc_int2;
2967 } asm330lhhx_pin_int2_route_t;
2968 int32_t asm330lhhx_pin_int2_route_set(const stmdev_ctx_t *ctx,
2969                                       asm330lhhx_pin_int2_route_t *val);
2970 int32_t asm330lhhx_pin_int2_route_get(const stmdev_ctx_t *ctx,
2971                                       asm330lhhx_pin_int2_route_t *val);
2972 
2973 typedef enum
2974 {
2975   ASM330LHHX_PUSH_PULL   = 0,
2976   ASM330LHHX_OPEN_DRAIN  = 1,
2977 } asm330lhhx_pp_od_t;
2978 int32_t asm330lhhx_pin_mode_set(const stmdev_ctx_t *ctx, asm330lhhx_pp_od_t val);
2979 int32_t asm330lhhx_pin_mode_get(const stmdev_ctx_t *ctx, asm330lhhx_pp_od_t *val);
2980 
2981 typedef enum
2982 {
2983   ASM330LHHX_ACTIVE_HIGH = 0,
2984   ASM330LHHX_ACTIVE_LOW  = 1,
2985 } asm330lhhx_h_lactive_t;
2986 int32_t asm330lhhx_pin_polarity_set(const stmdev_ctx_t *ctx,
2987                                     asm330lhhx_h_lactive_t val);
2988 int32_t asm330lhhx_pin_polarity_get(const stmdev_ctx_t *ctx,
2989                                     asm330lhhx_h_lactive_t *val);
2990 
2991 int32_t asm330lhhx_all_on_int1_set(const stmdev_ctx_t *ctx, uint8_t val);
2992 int32_t asm330lhhx_all_on_int1_get(const stmdev_ctx_t *ctx, uint8_t *val);
2993 
2994 typedef enum
2995 {
2996   ASM330LHHX_ALL_INT_PULSED            = 0,
2997   ASM330LHHX_BASE_LATCHED_EMB_PULSED   = 1,
2998   ASM330LHHX_BASE_PULSED_EMB_LATCHED   = 2,
2999   ASM330LHHX_ALL_INT_LATCHED           = 3,
3000 } asm330lhhx_lir_t;
3001 int32_t asm330lhhx_int_notification_set(const stmdev_ctx_t *ctx,
3002                                         asm330lhhx_lir_t val);
3003 int32_t asm330lhhx_int_notification_get(const stmdev_ctx_t *ctx,
3004                                         asm330lhhx_lir_t *val);
3005 
3006 typedef enum
3007 {
3008   ASM330LHHX_LSb_FS_DIV_64       = 0,
3009   ASM330LHHX_LSb_FS_DIV_256      = 1,
3010 } asm330lhhx_wake_ths_w_t;
3011 int32_t asm330lhhx_wkup_ths_weight_set(const stmdev_ctx_t *ctx,
3012                                        asm330lhhx_wake_ths_w_t val);
3013 int32_t asm330lhhx_wkup_ths_weight_get(const stmdev_ctx_t *ctx,
3014                                        asm330lhhx_wake_ths_w_t *val);
3015 
3016 int32_t asm330lhhx_wkup_threshold_set(const stmdev_ctx_t *ctx, uint8_t val);
3017 int32_t asm330lhhx_wkup_threshold_get(const stmdev_ctx_t *ctx, uint8_t *val);
3018 
3019 int32_t asm330lhhx_xl_usr_offset_on_wkup_set(const stmdev_ctx_t *ctx,
3020                                              uint8_t val);
3021 int32_t asm330lhhx_xl_usr_offset_on_wkup_get(const stmdev_ctx_t *ctx,
3022                                              uint8_t *val);
3023 
3024 int32_t asm330lhhx_wkup_dur_set(const stmdev_ctx_t *ctx, uint8_t val);
3025 int32_t asm330lhhx_wkup_dur_get(const stmdev_ctx_t *ctx, uint8_t *val);
3026 
3027 int32_t asm330lhhx_gy_sleep_mode_set(const stmdev_ctx_t *ctx, uint8_t val);
3028 int32_t asm330lhhx_gy_sleep_mode_get(const stmdev_ctx_t *ctx, uint8_t *val);
3029 
3030 typedef enum
3031 {
3032   ASM330LHHX_DRIVE_SLEEP_CHG_EVENT = 0,
3033   ASM330LHHX_DRIVE_SLEEP_STATUS    = 1,
3034 } asm330lhhx_sleep_status_on_int_t;
3035 int32_t asm330lhhx_act_pin_notification_set(const stmdev_ctx_t *ctx,
3036                                             asm330lhhx_sleep_status_on_int_t val);
3037 int32_t asm330lhhx_act_pin_notification_get(const stmdev_ctx_t *ctx,
3038                                             asm330lhhx_sleep_status_on_int_t *val);
3039 
3040 typedef enum
3041 {
3042   ASM330LHHX_XL_AND_GY_NOT_AFFECTED      = 0,
3043   ASM330LHHX_XL_12Hz5_GY_NOT_AFFECTED    = 1,
3044   ASM330LHHX_XL_12Hz5_GY_SLEEP           = 2,
3045   ASM330LHHX_XL_12Hz5_GY_PD              = 3,
3046 } asm330lhhx_inact_en_t;
3047 int32_t asm330lhhx_act_mode_set(const stmdev_ctx_t *ctx,
3048                                 asm330lhhx_inact_en_t val);
3049 int32_t asm330lhhx_act_mode_get(const stmdev_ctx_t *ctx,
3050                                 asm330lhhx_inact_en_t *val);
3051 
3052 int32_t asm330lhhx_act_sleep_dur_set(const stmdev_ctx_t *ctx, uint8_t val);
3053 int32_t asm330lhhx_act_sleep_dur_get(const stmdev_ctx_t *ctx, uint8_t *val);
3054 
3055 typedef enum
3056 {
3057   ASM330LHHX_DEG_80  = 0,
3058   ASM330LHHX_DEG_70  = 1,
3059   ASM330LHHX_DEG_60  = 2,
3060   ASM330LHHX_DEG_50  = 3,
3061 } asm330lhhx_sixd_ths_t;
3062 int32_t asm330lhhx_6d_threshold_set(const stmdev_ctx_t *ctx,
3063                                     asm330lhhx_sixd_ths_t val);
3064 int32_t asm330lhhx_6d_threshold_get(const stmdev_ctx_t *ctx,
3065                                     asm330lhhx_sixd_ths_t *val);
3066 
3067 int32_t asm330lhhx_4d_mode_set(const stmdev_ctx_t *ctx, uint8_t val);
3068 int32_t asm330lhhx_4d_mode_get(const stmdev_ctx_t *ctx, uint8_t *val);
3069 
3070 typedef enum
3071 {
3072   ASM330LHHX_FF_TSH_156mg = 0,
3073   ASM330LHHX_FF_TSH_219mg = 1,
3074   ASM330LHHX_FF_TSH_250mg = 2,
3075   ASM330LHHX_FF_TSH_312mg = 3,
3076   ASM330LHHX_FF_TSH_344mg = 4,
3077   ASM330LHHX_FF_TSH_406mg = 5,
3078   ASM330LHHX_FF_TSH_469mg = 6,
3079   ASM330LHHX_FF_TSH_500mg = 7,
3080 } asm330lhhx_ff_ths_t;
3081 int32_t asm330lhhx_ff_threshold_set(const stmdev_ctx_t *ctx,
3082                                     asm330lhhx_ff_ths_t val);
3083 int32_t asm330lhhx_ff_threshold_get(const stmdev_ctx_t *ctx,
3084                                     asm330lhhx_ff_ths_t *val);
3085 
3086 int32_t asm330lhhx_ff_dur_set(const stmdev_ctx_t *ctx, uint8_t val);
3087 int32_t asm330lhhx_ff_dur_get(const stmdev_ctx_t *ctx, uint8_t *val);
3088 
3089 int32_t asm330lhhx_fifo_watermark_set(const stmdev_ctx_t *ctx, uint16_t val);
3090 int32_t asm330lhhx_fifo_watermark_get(const stmdev_ctx_t *ctx, uint16_t *val);
3091 
3092 int32_t asm330lhhx_fifo_virtual_sens_odr_chg_set(const stmdev_ctx_t *ctx,
3093                                                  uint8_t val);
3094 int32_t asm330lhhx_fifo_virtual_sens_odr_chg_get(const stmdev_ctx_t *ctx,
3095                                                  uint8_t *val);
3096 
3097 int32_t asm330lhhx_fifo_stop_on_wtm_set(const stmdev_ctx_t *ctx, uint8_t val);
3098 int32_t asm330lhhx_fifo_stop_on_wtm_get(const stmdev_ctx_t *ctx, uint8_t *val);
3099 
3100 typedef enum
3101 {
3102   ASM330LHHX_XL_NOT_BATCHED        =  0,
3103   ASM330LHHX_XL_BATCHED_AT_12Hz5   =  1,
3104   ASM330LHHX_XL_BATCHED_AT_26Hz    =  2,
3105   ASM330LHHX_XL_BATCHED_AT_52Hz    =  3,
3106   ASM330LHHX_XL_BATCHED_AT_104Hz   =  4,
3107   ASM330LHHX_XL_BATCHED_AT_208Hz   =  5,
3108   ASM330LHHX_XL_BATCHED_AT_417Hz   =  6,
3109   ASM330LHHX_XL_BATCHED_AT_833Hz   =  7,
3110   ASM330LHHX_XL_BATCHED_AT_1667Hz  =  8,
3111   ASM330LHHX_XL_BATCHED_AT_3333Hz  =  9,
3112   ASM330LHHX_XL_BATCHED_AT_6667Hz  = 10,
3113   ASM330LHHX_XL_BATCHED_AT_1Hz6    = 11,
3114 } asm330lhhx_bdr_xl_t;
3115 int32_t asm330lhhx_fifo_xl_batch_set(const stmdev_ctx_t *ctx,
3116                                      asm330lhhx_bdr_xl_t val);
3117 int32_t asm330lhhx_fifo_xl_batch_get(const stmdev_ctx_t *ctx,
3118                                      asm330lhhx_bdr_xl_t *val);
3119 
3120 typedef enum
3121 {
3122   ASM330LHHX_GY_NOT_BATCHED         = 0,
3123   ASM330LHHX_GY_BATCHED_AT_12Hz5    = 1,
3124   ASM330LHHX_GY_BATCHED_AT_26Hz     = 2,
3125   ASM330LHHX_GY_BATCHED_AT_52Hz     = 3,
3126   ASM330LHHX_GY_BATCHED_AT_104Hz    = 4,
3127   ASM330LHHX_GY_BATCHED_AT_208Hz    = 5,
3128   ASM330LHHX_GY_BATCHED_AT_417Hz    = 6,
3129   ASM330LHHX_GY_BATCHED_AT_833Hz    = 7,
3130   ASM330LHHX_GY_BATCHED_AT_1667Hz   = 8,
3131   ASM330LHHX_GY_BATCHED_AT_3333Hz   = 9,
3132   ASM330LHHX_GY_BATCHED_AT_6667Hz   = 10,
3133   ASM330LHHX_GY_BATCHED_AT_6Hz5     = 11,
3134 } asm330lhhx_bdr_gy_t;
3135 int32_t asm330lhhx_fifo_gy_batch_set(const stmdev_ctx_t *ctx,
3136                                      asm330lhhx_bdr_gy_t val);
3137 int32_t asm330lhhx_fifo_gy_batch_get(const stmdev_ctx_t *ctx,
3138                                      asm330lhhx_bdr_gy_t *val);
3139 
3140 typedef enum
3141 {
3142   ASM330LHHX_BYPASS_MODE             = 0,
3143   ASM330LHHX_FIFO_MODE               = 1,
3144   ASM330LHHX_STREAM_TO_FIFO_MODE     = 3,
3145   ASM330LHHX_BYPASS_TO_STREAM_MODE   = 4,
3146   ASM330LHHX_STREAM_MODE             = 6,
3147   ASM330LHHX_BYPASS_TO_FIFO_MODE     = 7,
3148 } asm330lhhx_fifo_mode_t;
3149 int32_t asm330lhhx_fifo_mode_set(const stmdev_ctx_t *ctx, asm330lhhx_fifo_mode_t val);
3150 int32_t asm330lhhx_fifo_mode_get(const stmdev_ctx_t *ctx,
3151                                  asm330lhhx_fifo_mode_t *val);
3152 
3153 typedef enum
3154 {
3155   ASM330LHHX_TEMP_NOT_BATCHED        = 0,
3156   ASM330LHHX_TEMP_BATCHED_AT_52Hz    = 1,
3157   ASM330LHHX_TEMP_BATCHED_AT_12Hz5   = 2,
3158   ASM330LHHX_TEMP_BATCHED_AT_1Hz6    = 3,
3159 } asm330lhhx_odr_t_batch_t;
3160 int32_t asm330lhhx_fifo_temp_batch_set(const stmdev_ctx_t *ctx,
3161                                        asm330lhhx_odr_t_batch_t val);
3162 int32_t asm330lhhx_fifo_temp_batch_get(const stmdev_ctx_t *ctx,
3163                                        asm330lhhx_odr_t_batch_t *val);
3164 
3165 typedef enum
3166 {
3167   ASM330LHHX_NO_DECIMATION = 0,
3168   ASM330LHHX_DEC_1         = 1,
3169   ASM330LHHX_DEC_8         = 2,
3170   ASM330LHHX_DEC_32        = 3,
3171 } asm330lhhx_dec_ts_batch_t;
3172 int32_t asm330lhhx_fifo_timestamp_decimation_set(const stmdev_ctx_t *ctx,
3173                                                  asm330lhhx_dec_ts_batch_t val);
3174 int32_t asm330lhhx_fifo_timestamp_decimation_get(const stmdev_ctx_t *ctx,
3175                                                  asm330lhhx_dec_ts_batch_t *val);
3176 
3177 typedef enum
3178 {
3179   ASM330LHHX_XL_BATCH_EVENT   = 0,
3180   ASM330LHHX_GYRO_BATCH_EVENT = 1,
3181 } asm330lhhx_trig_counter_bdr_t;
3182 int32_t asm330lhhx_fifo_cnt_event_batch_set(const stmdev_ctx_t *ctx,
3183                                             asm330lhhx_trig_counter_bdr_t val);
3184 int32_t asm330lhhx_fifo_cnt_event_batch_get(const stmdev_ctx_t *ctx,
3185                                             asm330lhhx_trig_counter_bdr_t *val);
3186 
3187 int32_t asm330lhhx_rst_batch_counter_set(const stmdev_ctx_t *ctx, uint8_t val);
3188 int32_t asm330lhhx_rst_batch_counter_get(const stmdev_ctx_t *ctx, uint8_t *val);
3189 
3190 int32_t asm330lhhx_batch_counter_threshold_set(const stmdev_ctx_t *ctx,
3191                                                uint16_t val);
3192 int32_t asm330lhhx_batch_counter_threshold_get(const stmdev_ctx_t *ctx,
3193                                                uint16_t *val);
3194 
3195 int32_t asm330lhhx_fifo_data_level_get(const stmdev_ctx_t *ctx, uint16_t *val);
3196 
3197 int32_t asm330lhhx_fifo_status_get(const stmdev_ctx_t *ctx,
3198                                    asm330lhhx_fifo_status2_t *val);
3199 
3200 int32_t asm330lhhx_fifo_full_flag_get(const stmdev_ctx_t *ctx, uint8_t *val);
3201 
3202 int32_t asm330lhhx_fifo_ovr_flag_get(const stmdev_ctx_t *ctx, uint8_t *val);
3203 
3204 int32_t asm330lhhx_fifo_wtm_flag_get(const stmdev_ctx_t *ctx, uint8_t *val);
3205 
3206 typedef enum
3207 {
3208   ASM330LHHX_GYRO_NC_TAG          = 0x01,
3209   ASM330LHHX_XL_NC_TAG            = 0x02,
3210   ASM330LHHX_TEMPERATURE_TAG      = 0x03,
3211   ASM330LHHX_TIMESTAMP_TAG        = 0x04,
3212   ASM330LHHX_CFG_CHANGE_TAG       = 0x05,
3213   ASM330LHHX_SENSORHUB_SLAVE0_TAG = 0x0E,
3214   ASM330LHHX_SENSORHUB_SLAVE1_TAG = 0x0F,
3215   ASM330LHHX_SENSORHUB_SLAVE2_TAG = 0x10,
3216   ASM330LHHX_SENSORHUB_SLAVE3_TAG = 0x11,
3217   ASM330LHHX_SENSORHUB_NACK_TAG   = 0x19,
3218 } asm330lhhx_fifo_tag_t;
3219 int32_t asm330lhhx_fifo_sensor_tag_get(const stmdev_ctx_t *ctx,
3220                                        asm330lhhx_fifo_tag_t *val);
3221 
3222 int32_t asm330lhhx_sh_batch_slave_0_set(const stmdev_ctx_t *ctx, uint8_t val);
3223 int32_t asm330lhhx_sh_batch_slave_0_get(const stmdev_ctx_t *ctx, uint8_t *val);
3224 
3225 int32_t asm330lhhx_sh_batch_slave_1_set(const stmdev_ctx_t *ctx, uint8_t val);
3226 int32_t asm330lhhx_sh_batch_slave_1_get(const stmdev_ctx_t *ctx, uint8_t *val);
3227 
3228 int32_t asm330lhhx_sh_batch_slave_2_set(const stmdev_ctx_t *ctx, uint8_t val);
3229 int32_t asm330lhhx_sh_batch_slave_2_get(const stmdev_ctx_t *ctx, uint8_t *val);
3230 
3231 int32_t asm330lhhx_sh_batch_slave_3_set(const stmdev_ctx_t *ctx, uint8_t val);
3232 int32_t asm330lhhx_sh_batch_slave_3_get(const stmdev_ctx_t *ctx, uint8_t *val);
3233 
3234 typedef enum
3235 {
3236   ASM330LHHX_DEN_DISABLE    = 0,
3237   ASM330LHHX_LEVEL_FIFO     = 6,
3238   ASM330LHHX_LEVEL_LETCHED  = 3,
3239   ASM330LHHX_LEVEL_TRIGGER  = 2,
3240   ASM330LHHX_EDGE_TRIGGER   = 4,
3241 } asm330lhhx_den_mode_t;
3242 int32_t asm330lhhx_den_mode_set(const stmdev_ctx_t *ctx,
3243                                 asm330lhhx_den_mode_t val);
3244 int32_t asm330lhhx_den_mode_get(const stmdev_ctx_t *ctx,
3245                                 asm330lhhx_den_mode_t *val);
3246 
3247 typedef enum
3248 {
3249   ASM330LHHX_DEN_ACT_LOW  = 0,
3250   ASM330LHHX_DEN_ACT_HIGH = 1,
3251 } asm330lhhx_den_lh_t;
3252 int32_t asm330lhhx_den_polarity_set(const stmdev_ctx_t *ctx,
3253                                     asm330lhhx_den_lh_t val);
3254 int32_t asm330lhhx_den_polarity_get(const stmdev_ctx_t *ctx,
3255                                     asm330lhhx_den_lh_t *val);
3256 
3257 typedef enum
3258 {
3259   ASM330LHHX_STAMP_IN_GY_DATA     = 0,
3260   ASM330LHHX_STAMP_IN_XL_DATA     = 1,
3261   ASM330LHHX_STAMP_IN_GY_XL_DATA  = 2,
3262 } asm330lhhx_den_xl_g_t;
3263 int32_t asm330lhhx_den_enable_set(const stmdev_ctx_t *ctx,
3264                                   asm330lhhx_den_xl_g_t val);
3265 int32_t asm330lhhx_den_enable_get(const stmdev_ctx_t *ctx,
3266                                   asm330lhhx_den_xl_g_t *val);
3267 
3268 int32_t asm330lhhx_den_mark_axis_x_set(const stmdev_ctx_t *ctx, uint8_t val);
3269 int32_t asm330lhhx_den_mark_axis_x_get(const stmdev_ctx_t *ctx, uint8_t *val);
3270 
3271 int32_t asm330lhhx_den_mark_axis_y_set(const stmdev_ctx_t *ctx, uint8_t val);
3272 int32_t asm330lhhx_den_mark_axis_y_get(const stmdev_ctx_t *ctx, uint8_t *val);
3273 
3274 int32_t asm330lhhx_den_mark_axis_z_set(const stmdev_ctx_t *ctx, uint8_t val);
3275 int32_t asm330lhhx_den_mark_axis_z_get(const stmdev_ctx_t *ctx, uint8_t *val);
3276 
3277 int32_t asm330lhhx_mag_sensitivity_set(const stmdev_ctx_t *ctx, uint16_t val);
3278 int32_t asm330lhhx_mag_sensitivity_get(const stmdev_ctx_t *ctx, uint16_t *val);
3279 
3280 int32_t asm330lhhx_mag_offset_set(const stmdev_ctx_t *ctx, int16_t *val);
3281 int32_t asm330lhhx_mag_offset_get(const stmdev_ctx_t *ctx, int16_t *val);
3282 
3283 int32_t asm330lhhx_mag_soft_iron_set(const stmdev_ctx_t *ctx, uint16_t *val);
3284 int32_t asm330lhhx_mag_soft_iron_get(const stmdev_ctx_t *ctx, uint16_t *val);
3285 
3286 typedef enum
3287 {
3288   ASM330LHHX_Z_EQ_Y     = 0,
3289   ASM330LHHX_Z_EQ_MIN_Y = 1,
3290   ASM330LHHX_Z_EQ_X     = 2,
3291   ASM330LHHX_Z_EQ_MIN_X = 3,
3292   ASM330LHHX_Z_EQ_MIN_Z = 4,
3293   ASM330LHHX_Z_EQ_Z     = 5,
3294 } asm330lhhx_mag_z_axis_t;
3295 int32_t asm330lhhx_mag_z_orient_set(const stmdev_ctx_t *ctx,
3296                                     asm330lhhx_mag_z_axis_t val);
3297 int32_t asm330lhhx_mag_z_orient_get(const stmdev_ctx_t *ctx,
3298                                     asm330lhhx_mag_z_axis_t *val);
3299 
3300 typedef enum
3301 {
3302   ASM330LHHX_Y_EQ_Y     = 0,
3303   ASM330LHHX_Y_EQ_MIN_Y = 1,
3304   ASM330LHHX_Y_EQ_X     = 2,
3305   ASM330LHHX_Y_EQ_MIN_X = 3,
3306   ASM330LHHX_Y_EQ_MIN_Z = 4,
3307   ASM330LHHX_Y_EQ_Z     = 5,
3308 } asm330lhhx_mag_y_axis_t;
3309 int32_t asm330lhhx_mag_y_orient_set(const stmdev_ctx_t *ctx,
3310                                     asm330lhhx_mag_y_axis_t val);
3311 int32_t asm330lhhx_mag_y_orient_get(const stmdev_ctx_t *ctx,
3312                                     asm330lhhx_mag_y_axis_t *val);
3313 
3314 typedef enum
3315 {
3316   ASM330LHHX_X_EQ_Y     = 0,
3317   ASM330LHHX_X_EQ_MIN_Y = 1,
3318   ASM330LHHX_X_EQ_X     = 2,
3319   ASM330LHHX_X_EQ_MIN_X = 3,
3320   ASM330LHHX_X_EQ_MIN_Z = 4,
3321   ASM330LHHX_X_EQ_Z     = 5,
3322 } asm330lhhx_mag_x_axis_t;
3323 int32_t asm330lhhx_mag_x_orient_set(const stmdev_ctx_t *ctx,
3324                                     asm330lhhx_mag_x_axis_t val);
3325 int32_t asm330lhhx_mag_x_orient_get(const stmdev_ctx_t *ctx,
3326                                     asm330lhhx_mag_x_axis_t *val);
3327 
3328 typedef struct
3329 {
3330   uint16_t fsm1 : 1;
3331   uint16_t fsm2 : 1;
3332   uint16_t fsm3 : 1;
3333   uint16_t fsm4 : 1;
3334   uint16_t fsm5 : 1;
3335   uint16_t fsm6 : 1;
3336   uint16_t fsm7 : 1;
3337   uint16_t fsm8 : 1;
3338   uint16_t fsm9 : 1;
3339   uint16_t fsm10 : 1;
3340   uint16_t fsm11 : 1;
3341   uint16_t fsm12 : 1;
3342   uint16_t fsm13 : 1;
3343   uint16_t fsm14 : 1;
3344   uint16_t fsm15 : 1;
3345   uint16_t fsm16 : 1;
3346 } asm330lhhx_fsm_status_t;
3347 int32_t asm330lhhx_fsm_status_get(const stmdev_ctx_t *ctx,
3348                                   asm330lhhx_fsm_status_t *val);
3349 int32_t asm330lhhx_fsm_out_get(const stmdev_ctx_t *ctx, uint8_t *buff);
3350 
3351 int32_t asm330lhhx_long_cnt_flag_data_ready_get(const stmdev_ctx_t *ctx,
3352                                                 uint8_t *val);
3353 
3354 int32_t asm330lhhx_emb_func_clk_dis_set(const stmdev_ctx_t *ctx, uint8_t val);
3355 int32_t asm330lhhx_emb_func_clk_dis_get(const stmdev_ctx_t *ctx, uint8_t *val);
3356 
3357 int32_t asm330lhhx_emb_fsm_en_set(const stmdev_ctx_t *ctx, uint8_t val);
3358 int32_t asm330lhhx_emb_fsm_en_get(const stmdev_ctx_t *ctx, uint8_t *val);
3359 
3360 typedef struct
3361 {
3362   asm330lhhx_fsm_enable_a_t          fsm_enable_a;
3363   asm330lhhx_fsm_enable_b_t          fsm_enable_b;
3364 } asm330lhhx_emb_fsm_enable_t;
3365 int32_t asm330lhhx_fsm_enable_set(const stmdev_ctx_t *ctx,
3366                                   asm330lhhx_emb_fsm_enable_t *val);
3367 int32_t asm330lhhx_fsm_enable_get(const stmdev_ctx_t *ctx,
3368                                   asm330lhhx_emb_fsm_enable_t *val);
3369 
3370 int32_t asm330lhhx_long_cnt_set(const stmdev_ctx_t *ctx, uint16_t val);
3371 int32_t asm330lhhx_long_cnt_get(const stmdev_ctx_t *ctx, uint16_t *val);
3372 
3373 typedef enum
3374 {
3375   ASM330LHHX_LC_NORMAL     = 0,
3376   ASM330LHHX_LC_CLEAR      = 1,
3377   ASM330LHHX_LC_CLEAR_DONE = 2,
3378 } asm330lhhx_fsm_lc_clr_t;
3379 int32_t asm330lhhx_long_clr_set(const stmdev_ctx_t *ctx,
3380                                 asm330lhhx_fsm_lc_clr_t val);
3381 int32_t asm330lhhx_long_clr_get(const stmdev_ctx_t *ctx,
3382                                 asm330lhhx_fsm_lc_clr_t *val);
3383 
3384 typedef enum
3385 {
3386   ASM330LHHX_ODR_FSM_12Hz5 = 0,
3387   ASM330LHHX_ODR_FSM_26Hz  = 1,
3388   ASM330LHHX_ODR_FSM_52Hz  = 2,
3389   ASM330LHHX_ODR_FSM_104Hz = 3,
3390 } asm330lhhx_fsm_odr_t;
3391 int32_t asm330lhhx_fsm_data_rate_set(const stmdev_ctx_t *ctx,
3392                                      asm330lhhx_fsm_odr_t val);
3393 int32_t asm330lhhx_fsm_data_rate_get(const stmdev_ctx_t *ctx,
3394                                      asm330lhhx_fsm_odr_t *val);
3395 
3396 int32_t asm330lhhx_fsm_init_set(const stmdev_ctx_t *ctx, uint8_t val);
3397 int32_t asm330lhhx_fsm_init_get(const stmdev_ctx_t *ctx, uint8_t *val);
3398 
3399 int32_t asm330lhhx_long_cnt_int_value_set(const stmdev_ctx_t *ctx, uint16_t val);
3400 int32_t asm330lhhx_long_cnt_int_value_get(const stmdev_ctx_t *ctx, uint16_t *val);
3401 
3402 int32_t asm330lhhx_fsm_number_of_programs_set(const stmdev_ctx_t *ctx,
3403                                               uint8_t *buff);
3404 int32_t asm330lhhx_fsm_number_of_programs_get(const stmdev_ctx_t *ctx,
3405                                               uint8_t *buff);
3406 
3407 int32_t asm330lhhx_fsm_start_address_set(const stmdev_ctx_t *ctx, uint16_t val);
3408 int32_t asm330lhhx_fsm_start_address_get(const stmdev_ctx_t *ctx, uint16_t *val);
3409 
3410 int32_t asm330lhhx_mlc_set(const stmdev_ctx_t *ctx, uint8_t val);
3411 int32_t asm330lhhx_mlc_get(const stmdev_ctx_t *ctx, uint8_t *val);
3412 
3413 int32_t asm330lhhx_mlc_status_get(const stmdev_ctx_t *ctx,
3414                                   asm330lhhx_mlc_status_mainpage_t *val);
3415 
3416 typedef enum
3417 {
3418   ASM330LHHX_ODR_PRGS_12Hz5 = 0,
3419   ASM330LHHX_ODR_PRGS_26Hz  = 1,
3420   ASM330LHHX_ODR_PRGS_52Hz  = 2,
3421   ASM330LHHX_ODR_PRGS_104Hz = 3,
3422 } asm330lhhx_mlc_odr_t;
3423 int32_t asm330lhhx_mlc_data_rate_set(const stmdev_ctx_t *ctx,
3424                                      asm330lhhx_mlc_odr_t val);
3425 int32_t asm330lhhx_mlc_data_rate_get(const stmdev_ctx_t *ctx,
3426                                      asm330lhhx_mlc_odr_t *val);
3427 
3428 int32_t asm330lhhx_mlc_init_set(const stmdev_ctx_t *ctx, uint8_t val);
3429 int32_t asm330lhhx_mlc_init_get(const stmdev_ctx_t *ctx, uint8_t *val);
3430 
3431 int32_t asm330lhhx_mlc_out_get(const stmdev_ctx_t *ctx, uint8_t *buff);
3432 
3433 int32_t asm330lhhx_mlc_mag_sensitivity_set(const stmdev_ctx_t *ctx, uint16_t val);
3434 int32_t asm330lhhx_mlc_mag_sensitivity_get(const stmdev_ctx_t *ctx, uint16_t *val);
3435 typedef struct
3436 {
3437   asm330lhhx_sensor_hub_1_t   sh_byte_1;
3438   asm330lhhx_sensor_hub_2_t   sh_byte_2;
3439   asm330lhhx_sensor_hub_3_t   sh_byte_3;
3440   asm330lhhx_sensor_hub_4_t   sh_byte_4;
3441   asm330lhhx_sensor_hub_5_t   sh_byte_5;
3442   asm330lhhx_sensor_hub_6_t   sh_byte_6;
3443   asm330lhhx_sensor_hub_7_t   sh_byte_7;
3444   asm330lhhx_sensor_hub_8_t   sh_byte_8;
3445   asm330lhhx_sensor_hub_9_t   sh_byte_9;
3446   asm330lhhx_sensor_hub_10_t  sh_byte_10;
3447   asm330lhhx_sensor_hub_11_t  sh_byte_11;
3448   asm330lhhx_sensor_hub_12_t  sh_byte_12;
3449   asm330lhhx_sensor_hub_13_t  sh_byte_13;
3450   asm330lhhx_sensor_hub_14_t  sh_byte_14;
3451   asm330lhhx_sensor_hub_15_t  sh_byte_15;
3452   asm330lhhx_sensor_hub_16_t  sh_byte_16;
3453   asm330lhhx_sensor_hub_17_t  sh_byte_17;
3454   asm330lhhx_sensor_hub_18_t  sh_byte_18;
3455 } asm330lhhx_emb_sh_read_t;
3456 int32_t asm330lhhx_sh_read_data_raw_get(const stmdev_ctx_t *ctx,
3457                                         asm330lhhx_emb_sh_read_t *val);
3458 
3459 typedef enum
3460 {
3461   ASM330LHHX_SLV_0       = 0,
3462   ASM330LHHX_SLV_0_1     = 1,
3463   ASM330LHHX_SLV_0_1_2   = 2,
3464   ASM330LHHX_SLV_0_1_2_3 = 3,
3465 } asm330lhhx_aux_sens_on_t;
3466 int32_t asm330lhhx_sh_slave_connected_set(const stmdev_ctx_t *ctx,
3467                                           asm330lhhx_aux_sens_on_t val);
3468 int32_t asm330lhhx_sh_slave_connected_get(const stmdev_ctx_t *ctx,
3469                                           asm330lhhx_aux_sens_on_t *val);
3470 
3471 int32_t asm330lhhx_sh_master_set(const stmdev_ctx_t *ctx, uint8_t val);
3472 int32_t asm330lhhx_sh_master_get(const stmdev_ctx_t *ctx, uint8_t *val);
3473 
3474 typedef enum
3475 {
3476   ASM330LHHX_EXT_PULL_UP      = 0,
3477   ASM330LHHX_INTERNAL_PULL_UP = 1,
3478 } asm330lhhx_shub_pu_en_t;
3479 int32_t asm330lhhx_sh_pin_mode_set(const stmdev_ctx_t *ctx,
3480                                    asm330lhhx_shub_pu_en_t val);
3481 int32_t asm330lhhx_sh_pin_mode_get(const stmdev_ctx_t *ctx,
3482                                    asm330lhhx_shub_pu_en_t *val);
3483 
3484 int32_t asm330lhhx_sh_pass_through_set(const stmdev_ctx_t *ctx, uint8_t val);
3485 int32_t asm330lhhx_sh_pass_through_get(const stmdev_ctx_t *ctx, uint8_t *val);
3486 
3487 typedef enum
3488 {
3489   ASM330LHHX_EXT_ON_INT2_PIN = 0,
3490   ASM330LHHX_XL_GY_DRDY      = 1,
3491 } asm330lhhx_start_config_t;
3492 int32_t asm330lhhx_sh_syncro_mode_set(const stmdev_ctx_t *ctx,
3493                                       asm330lhhx_start_config_t val);
3494 int32_t asm330lhhx_sh_syncro_mode_get(const stmdev_ctx_t *ctx,
3495                                       asm330lhhx_start_config_t *val);
3496 
3497 typedef enum
3498 {
3499   ASM330LHHX_EACH_SH_CYCLE    = 0,
3500   ASM330LHHX_ONLY_FIRST_CYCLE = 1,
3501 } asm330lhhx_write_once_t;
3502 int32_t asm330lhhx_sh_write_mode_set(const stmdev_ctx_t *ctx,
3503                                      asm330lhhx_write_once_t val);
3504 int32_t asm330lhhx_sh_write_mode_get(const stmdev_ctx_t *ctx,
3505                                      asm330lhhx_write_once_t *val);
3506 
3507 int32_t asm330lhhx_sh_reset_set(const stmdev_ctx_t *ctx);
3508 int32_t asm330lhhx_sh_reset_get(const stmdev_ctx_t *ctx, uint8_t *val);
3509 
3510 typedef enum
3511 {
3512   ASM330LHHX_SH_ODR_104Hz = 0,
3513   ASM330LHHX_SH_ODR_52Hz  = 1,
3514   ASM330LHHX_SH_ODR_26Hz  = 2,
3515   ASM330LHHX_SH_ODR_13Hz  = 3,
3516 } asm330lhhx_shub_odr_t;
3517 int32_t asm330lhhx_sh_data_rate_set(const stmdev_ctx_t *ctx,
3518                                     asm330lhhx_shub_odr_t val);
3519 int32_t asm330lhhx_sh_data_rate_get(const stmdev_ctx_t *ctx,
3520                                     asm330lhhx_shub_odr_t *val);
3521 
3522 typedef struct
3523 {
3524   uint8_t   slv0_add;
3525   uint8_t   slv0_subadd;
3526   uint8_t   slv0_data;
3527 } asm330lhhx_sh_cfg_write_t;
3528 int32_t asm330lhhx_sh_cfg_write(const stmdev_ctx_t *ctx,
3529                                 asm330lhhx_sh_cfg_write_t *val);
3530 
3531 typedef struct
3532 {
3533   uint8_t   slv_add;
3534   uint8_t   slv_subadd;
3535   uint8_t   slv_len;
3536 } asm330lhhx_sh_cfg_read_t;
3537 int32_t asm330lhhx_sh_slv0_cfg_read(const stmdev_ctx_t *ctx,
3538                                     asm330lhhx_sh_cfg_read_t *val);
3539 int32_t asm330lhhx_sh_slv1_cfg_read(const stmdev_ctx_t *ctx,
3540                                     asm330lhhx_sh_cfg_read_t *val);
3541 int32_t asm330lhhx_sh_slv2_cfg_read(const stmdev_ctx_t *ctx,
3542                                     asm330lhhx_sh_cfg_read_t *val);
3543 int32_t asm330lhhx_sh_slv3_cfg_read(const stmdev_ctx_t *ctx,
3544                                     asm330lhhx_sh_cfg_read_t *val);
3545 
3546 int32_t asm330lhhx_sh_status_get(const stmdev_ctx_t *ctx,
3547                                  asm330lhhx_status_master_t *val);
3548 
3549 /**
3550   *@}
3551   *
3552   */
3553 
3554 #ifdef __cplusplus
3555 }
3556 #endif
3557 
3558 #endif /* ASM330LHHX_REGS_H */
3559 
3560 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
3561