lsm6ds3tr-c_reg.h 100 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797
  1. /**
  2. ******************************************************************************
  3. * @file lsm6ds3tr_c_reg.h
  4. * @author Sensors Software Solution Team
  5. * @brief This file contains all the functions prototypes for the
  6. * lsm6ds3tr_c_reg.c driver.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * <h2><center>&copy; Copyright (c) 2021 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. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef LSM6DS3TR_C_DRIVER_H
  22. #define LSM6DS3TR_C_DRIVER_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* Includes ------------------------------------------------------------------*/
  27. #include <stdint.h>
  28. #include <stddef.h>
  29. #include <math.h>
  30. #include "system.h"
  31. /** @addtogroup LSM6DS3TR_C
  32. * @{
  33. *
  34. */
  35. /** @defgroup Endianness definitions
  36. * @{
  37. *
  38. */
  39. #ifndef DRV_BYTE_ORDER
  40. #ifndef __BYTE_ORDER__
  41. #define DRV_LITTLE_ENDIAN 1234
  42. #define DRV_BIG_ENDIAN 4321
  43. /** if _BYTE_ORDER is not defined, choose the endianness of your architecture
  44. * by uncommenting the define which fits your platform endianness
  45. */
  46. //#define DRV_BYTE_ORDER DRV_BIG_ENDIAN
  47. #define DRV_BYTE_ORDER DRV_LITTLE_ENDIAN
  48. #else /* defined __BYTE_ORDER__ */
  49. #define DRV_LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
  50. #define DRV_BIG_ENDIAN __ORDER_BIG_ENDIAN__
  51. #define DRV_BYTE_ORDER __BYTE_ORDER__
  52. #endif /* __BYTE_ORDER__*/
  53. #endif /* DRV_BYTE_ORDER */
  54. /**
  55. * @}
  56. *
  57. */
  58. /** @defgroup STMicroelectronics sensors common types
  59. * @{
  60. *
  61. */
  62. #ifndef MEMS_SHARED_TYPES
  63. #define MEMS_SHARED_TYPES
  64. typedef struct
  65. {
  66. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  67. uint8_t bit0 : 1;
  68. uint8_t bit1 : 1;
  69. uint8_t bit2 : 1;
  70. uint8_t bit3 : 1;
  71. uint8_t bit4 : 1;
  72. uint8_t bit5 : 1;
  73. uint8_t bit6 : 1;
  74. uint8_t bit7 : 1;
  75. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  76. uint8_t bit7 : 1;
  77. uint8_t bit6 : 1;
  78. uint8_t bit5 : 1;
  79. uint8_t bit4 : 1;
  80. uint8_t bit3 : 1;
  81. uint8_t bit2 : 1;
  82. uint8_t bit1 : 1;
  83. uint8_t bit0 : 1;
  84. #endif /* DRV_BYTE_ORDER */
  85. } bitwise_t;
  86. #define PROPERTY_DISABLE (0U)
  87. #define PROPERTY_ENABLE (1U)
  88. /** @addtogroup Interfaces_Functions
  89. * @brief This section provide a set of functions used to read and
  90. * write a generic register of the device.
  91. * MANDATORY: return 0 -> no Error.
  92. * @{
  93. *
  94. */
  95. typedef int32_t (*stmdev_write_ptr)(void *, uint8_t, const uint8_t *, uint16_t);
  96. typedef int32_t (*stmdev_read_ptr)(void *, uint8_t, uint8_t *, uint16_t);
  97. typedef struct
  98. {
  99. /** Component mandatory fields **/
  100. stmdev_write_ptr write_reg;
  101. stmdev_read_ptr read_reg;
  102. /** Customizable optional pointer **/
  103. void *handle;
  104. } stmdev_ctx_t;
  105. /**
  106. * @}
  107. *
  108. */
  109. #endif /* MEMS_SHARED_TYPES */
  110. #ifndef MEMS_UCF_SHARED_TYPES
  111. #define MEMS_UCF_SHARED_TYPES
  112. /** @defgroup Generic address-data structure definition
  113. * @brief This structure is useful to load a predefined configuration
  114. * of a sensor.
  115. * You can create a sensor configuration by your own or using
  116. * Unico / Unicleo tools available on STMicroelectronics
  117. * web site.
  118. *
  119. * @{
  120. *
  121. */
  122. typedef struct
  123. {
  124. uint8_t address;
  125. uint8_t data;
  126. } ucf_line_t;
  127. /**
  128. * @}
  129. *
  130. */
  131. #endif /* MEMS_UCF_SHARED_TYPES */
  132. /**
  133. * @}
  134. *
  135. */
  136. /** @defgroup LSM6DS3TR_C_Infos
  137. * @{
  138. *
  139. */
  140. /** I2C Device Address 8 bit format if SA0=0 -> D5 if SA0=1 -> D7 **/
  141. #define LSM6DS3TR_C_I2C_ADD_L 0xD5U
  142. #define LSM6DS3TR_C_I2C_ADD_H 0xD7U
  143. /** Device Identification (Who am I) **/
  144. #define LSM6DS3TR_C_ID 0x6AU
  145. /**
  146. * @}
  147. *
  148. */
  149. #define LSM6DS3TR_C_FUNC_CFG_ACCESS 0x01U
  150. typedef struct
  151. {
  152. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  153. uint8_t not_used_01 : 5;
  154. uint8_t func_cfg_en :
  155. 3; /* func_cfg_en + func_cfg_en_b */
  156. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  157. uint8_t func_cfg_en :
  158. 3; /* func_cfg_en + func_cfg_en_b */
  159. uint8_t not_used_01 : 5;
  160. #endif /* DRV_BYTE_ORDER */
  161. } lsm6ds3tr_c_func_cfg_access_t;
  162. #define LSM6DS3TR_C_SENSOR_SYNC_TIME_FRAME 0x04U
  163. typedef struct
  164. {
  165. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  166. uint8_t tph : 4;
  167. uint8_t not_used_01 : 4;
  168. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  169. uint8_t not_used_01 : 4;
  170. uint8_t tph : 4;
  171. #endif /* DRV_BYTE_ORDER */
  172. } lsm6ds3tr_c_sensor_sync_time_frame_t;
  173. #define LSM6DS3TR_C_SENSOR_SYNC_RES_RATIO 0x05U
  174. typedef struct
  175. {
  176. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  177. uint8_t rr : 2;
  178. uint8_t not_used_01 : 6;
  179. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  180. uint8_t not_used_01 : 6;
  181. uint8_t rr : 2;
  182. #endif /* DRV_BYTE_ORDER */
  183. } lsm6ds3tr_c_sensor_sync_res_ratio_t;
  184. #define LSM6DS3TR_C_FIFO_CTRL1 0x06U
  185. typedef struct
  186. {
  187. uint8_t fth : 8; /* + FIFO_CTRL2(fth) */
  188. } lsm6ds3tr_c_fifo_ctrl1_t;
  189. #define LSM6DS3TR_C_FIFO_CTRL2 0x07U
  190. typedef struct
  191. {
  192. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  193. uint8_t fth : 3; /* + FIFO_CTRL1(fth) */
  194. uint8_t fifo_temp_en : 1;
  195. uint8_t not_used_01 : 2;
  196. uint8_t timer_pedo_fifo_drdy : 1;
  197. uint8_t timer_pedo_fifo_en : 1;
  198. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  199. uint8_t timer_pedo_fifo_en : 1;
  200. uint8_t timer_pedo_fifo_drdy : 1;
  201. uint8_t not_used_01 : 2;
  202. uint8_t fifo_temp_en : 1;
  203. uint8_t fth : 3; /* + FIFO_CTRL1(fth) */
  204. #endif /* DRV_BYTE_ORDER */
  205. } lsm6ds3tr_c_fifo_ctrl2_t;
  206. #define LSM6DS3TR_C_FIFO_CTRL3 0x08U
  207. typedef struct
  208. {
  209. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  210. uint8_t dec_fifo_xl : 3;
  211. uint8_t dec_fifo_gyro : 3;
  212. uint8_t not_used_01 : 2;
  213. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  214. uint8_t not_used_01 : 2;
  215. uint8_t dec_fifo_gyro : 3;
  216. uint8_t dec_fifo_xl : 3;
  217. #endif /* DRV_BYTE_ORDER */
  218. } lsm6ds3tr_c_fifo_ctrl3_t;
  219. #define LSM6DS3TR_C_FIFO_CTRL4 0x09U
  220. typedef struct
  221. {
  222. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  223. uint8_t dec_ds3_fifo : 3;
  224. uint8_t dec_ds4_fifo : 3;
  225. uint8_t only_high_data : 1;
  226. uint8_t stop_on_fth : 1;
  227. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  228. uint8_t stop_on_fth : 1;
  229. uint8_t only_high_data : 1;
  230. uint8_t dec_ds4_fifo : 3;
  231. uint8_t dec_ds3_fifo : 3;
  232. #endif /* DRV_BYTE_ORDER */
  233. } lsm6ds3tr_c_fifo_ctrl4_t;
  234. #define LSM6DS3TR_C_FIFO_CTRL5 0x0AU
  235. typedef struct
  236. {
  237. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  238. uint8_t fifo_mode : 3;
  239. uint8_t odr_fifo : 4;
  240. uint8_t not_used_01 : 1;
  241. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  242. uint8_t not_used_01 : 1;
  243. uint8_t odr_fifo : 4;
  244. uint8_t fifo_mode : 3;
  245. #endif /* DRV_BYTE_ORDER */
  246. } lsm6ds3tr_c_fifo_ctrl5_t;
  247. #define LSM6DS3TR_C_DRDY_PULSE_CFG_G 0x0BU
  248. typedef struct
  249. {
  250. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  251. uint8_t int2_wrist_tilt : 1;
  252. uint8_t not_used_01 : 6;
  253. uint8_t drdy_pulsed : 1;
  254. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  255. uint8_t drdy_pulsed : 1;
  256. uint8_t not_used_01 : 6;
  257. uint8_t int2_wrist_tilt : 1;
  258. #endif /* DRV_BYTE_ORDER */
  259. } lsm6ds3tr_c_drdy_pulse_cfg_g_t;
  260. #define LSM6DS3TR_C_INT1_CTRL 0x0DU
  261. typedef struct
  262. {
  263. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  264. uint8_t int1_drdy_xl : 1;
  265. uint8_t int1_drdy_g : 1;
  266. uint8_t int1_boot : 1;
  267. uint8_t int1_fth : 1;
  268. uint8_t int1_fifo_ovr : 1;
  269. uint8_t int1_full_flag : 1;
  270. uint8_t int1_sign_mot : 1;
  271. uint8_t int1_step_detector : 1;
  272. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  273. uint8_t int1_step_detector : 1;
  274. uint8_t int1_sign_mot : 1;
  275. uint8_t int1_full_flag : 1;
  276. uint8_t int1_fifo_ovr : 1;
  277. uint8_t int1_fth : 1;
  278. uint8_t int1_boot : 1;
  279. uint8_t int1_drdy_g : 1;
  280. uint8_t int1_drdy_xl : 1;
  281. #endif /* DRV_BYTE_ORDER */
  282. } lsm6ds3tr_c_int1_ctrl_t;
  283. #define LSM6DS3TR_C_INT2_CTRL 0x0EU
  284. typedef struct
  285. {
  286. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  287. uint8_t int2_drdy_xl : 1;
  288. uint8_t int2_drdy_g : 1;
  289. uint8_t int2_drdy_temp : 1;
  290. uint8_t int2_fth : 1;
  291. uint8_t int2_fifo_ovr : 1;
  292. uint8_t int2_full_flag : 1;
  293. uint8_t int2_step_count_ov : 1;
  294. uint8_t int2_step_delta : 1;
  295. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  296. uint8_t int2_step_delta : 1;
  297. uint8_t int2_step_count_ov : 1;
  298. uint8_t int2_full_flag : 1;
  299. uint8_t int2_fifo_ovr : 1;
  300. uint8_t int2_fth : 1;
  301. uint8_t int2_drdy_temp : 1;
  302. uint8_t int2_drdy_g : 1;
  303. uint8_t int2_drdy_xl : 1;
  304. #endif /* DRV_BYTE_ORDER */
  305. } lsm6ds3tr_c_int2_ctrl_t;
  306. #define LSM6DS3TR_C_WHO_AM_I 0x0FU
  307. #define LSM6DS3TR_C_CTRL1_XL 0x10U
  308. typedef struct
  309. {
  310. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  311. uint8_t bw0_xl : 1;
  312. uint8_t lpf1_bw_sel : 1;
  313. uint8_t fs_xl : 2;
  314. uint8_t odr_xl : 4;
  315. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  316. uint8_t odr_xl : 4;
  317. uint8_t fs_xl : 2;
  318. uint8_t lpf1_bw_sel : 1;
  319. uint8_t bw0_xl : 1;
  320. #endif /* DRV_BYTE_ORDER */
  321. } lsm6ds3tr_c_ctrl1_xl_t;
  322. #define LSM6DS3TR_C_CTRL2_G 0x11U
  323. typedef struct
  324. {
  325. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  326. uint8_t not_used_01 : 1;
  327. uint8_t fs_g : 3; /* fs_g + fs_125 */
  328. uint8_t odr_g : 4;
  329. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  330. uint8_t odr_g : 4;
  331. uint8_t fs_g : 3; /* fs_g + fs_125 */
  332. uint8_t not_used_01 : 1;
  333. #endif /* DRV_BYTE_ORDER */
  334. } lsm6ds3tr_c_ctrl2_g_t;
  335. #define LSM6DS3TR_C_CTRL3_C 0x12U
  336. typedef struct
  337. {
  338. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  339. uint8_t sw_reset : 1;
  340. uint8_t ble : 1;
  341. uint8_t if_inc : 1;
  342. uint8_t sim : 1;
  343. uint8_t pp_od : 1;
  344. uint8_t h_lactive : 1;
  345. uint8_t bdu : 1;
  346. uint8_t boot : 1;
  347. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  348. uint8_t boot : 1;
  349. uint8_t bdu : 1;
  350. uint8_t h_lactive : 1;
  351. uint8_t pp_od : 1;
  352. uint8_t sim : 1;
  353. uint8_t if_inc : 1;
  354. uint8_t ble : 1;
  355. uint8_t sw_reset : 1;
  356. #endif /* DRV_BYTE_ORDER */
  357. } lsm6ds3tr_c_ctrl3_c_t;
  358. #define LSM6DS3TR_C_CTRL4_C 0x13U
  359. typedef struct
  360. {
  361. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  362. uint8_t not_used_01 : 1;
  363. uint8_t lpf1_sel_g : 1;
  364. uint8_t i2c_disable : 1;
  365. uint8_t drdy_mask : 1;
  366. uint8_t den_drdy_int1 : 1;
  367. uint8_t int2_on_int1 : 1;
  368. uint8_t sleep : 1;
  369. uint8_t den_xl_en : 1;
  370. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  371. uint8_t den_xl_en : 1;
  372. uint8_t sleep : 1;
  373. uint8_t int2_on_int1 : 1;
  374. uint8_t den_drdy_int1 : 1;
  375. uint8_t drdy_mask : 1;
  376. uint8_t i2c_disable : 1;
  377. uint8_t lpf1_sel_g : 1;
  378. uint8_t not_used_01 : 1;
  379. #endif /* DRV_BYTE_ORDER */
  380. } lsm6ds3tr_c_ctrl4_c_t;
  381. #define LSM6DS3TR_C_CTRL5_C 0x14U
  382. typedef struct
  383. {
  384. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  385. uint8_t st_xl : 2;
  386. uint8_t st_g : 2;
  387. uint8_t den_lh : 1;
  388. uint8_t rounding : 3;
  389. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  390. uint8_t rounding : 3;
  391. uint8_t den_lh : 1;
  392. uint8_t st_g : 2;
  393. uint8_t st_xl : 2;
  394. #endif /* DRV_BYTE_ORDER */
  395. } lsm6ds3tr_c_ctrl5_c_t;
  396. #define LSM6DS3TR_C_CTRL6_C 0x15U
  397. typedef struct
  398. {
  399. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  400. uint8_t ftype : 2;
  401. uint8_t not_used_01 : 1;
  402. uint8_t usr_off_w : 1;
  403. uint8_t xl_hm_mode : 1;
  404. uint8_t den_mode :
  405. 3; /* trig_en + lvl_en + lvl2_en */
  406. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  407. uint8_t den_mode :
  408. 3; /* trig_en + lvl_en + lvl2_en */
  409. uint8_t xl_hm_mode : 1;
  410. uint8_t usr_off_w : 1;
  411. uint8_t not_used_01 : 1;
  412. uint8_t ftype : 2;
  413. #endif /* DRV_BYTE_ORDER */
  414. } lsm6ds3tr_c_ctrl6_c_t;
  415. #define LSM6DS3TR_C_CTRL7_G 0x16U
  416. typedef struct
  417. {
  418. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  419. uint8_t not_used_01 : 2;
  420. uint8_t rounding_status : 1;
  421. uint8_t not_used_02 : 1;
  422. uint8_t hpm_g : 2;
  423. uint8_t hp_en_g : 1;
  424. uint8_t g_hm_mode : 1;
  425. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  426. uint8_t g_hm_mode : 1;
  427. uint8_t hp_en_g : 1;
  428. uint8_t hpm_g : 2;
  429. uint8_t not_used_02 : 1;
  430. uint8_t rounding_status : 1;
  431. uint8_t not_used_01 : 2;
  432. #endif /* DRV_BYTE_ORDER */
  433. } lsm6ds3tr_c_ctrl7_g_t;
  434. #define LSM6DS3TR_C_CTRL8_XL 0x17U
  435. typedef struct
  436. {
  437. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  438. uint8_t low_pass_on_6d : 1;
  439. uint8_t not_used_01 : 1;
  440. uint8_t hp_slope_xl_en : 1;
  441. uint8_t input_composite : 1;
  442. uint8_t hp_ref_mode : 1;
  443. uint8_t hpcf_xl : 2;
  444. uint8_t lpf2_xl_en : 1;
  445. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  446. uint8_t lpf2_xl_en : 1;
  447. uint8_t hpcf_xl : 2;
  448. uint8_t hp_ref_mode : 1;
  449. uint8_t input_composite : 1;
  450. uint8_t hp_slope_xl_en : 1;
  451. uint8_t not_used_01 : 1;
  452. uint8_t low_pass_on_6d : 1;
  453. #endif /* DRV_BYTE_ORDER */
  454. } lsm6ds3tr_c_ctrl8_xl_t;
  455. #define LSM6DS3TR_C_CTRL9_XL 0x18U
  456. typedef struct
  457. {
  458. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  459. uint8_t not_used_01 : 2;
  460. uint8_t soft_en : 1;
  461. uint8_t not_used_02 : 1;
  462. uint8_t den_xl_g : 1;
  463. uint8_t den_z : 1;
  464. uint8_t den_y : 1;
  465. uint8_t den_x : 1;
  466. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  467. uint8_t den_x : 1;
  468. uint8_t den_y : 1;
  469. uint8_t den_z : 1;
  470. uint8_t den_xl_g : 1;
  471. uint8_t not_used_02 : 1;
  472. uint8_t soft_en : 1;
  473. uint8_t not_used_01 : 2;
  474. #endif /* DRV_BYTE_ORDER */
  475. } lsm6ds3tr_c_ctrl9_xl_t;
  476. #define LSM6DS3TR_C_CTRL10_C 0x19U
  477. typedef struct
  478. {
  479. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  480. uint8_t sign_motion_en : 1;
  481. uint8_t pedo_rst_step : 1;
  482. uint8_t func_en : 1;
  483. uint8_t tilt_en : 1;
  484. uint8_t pedo_en : 1;
  485. uint8_t timer_en : 1;
  486. uint8_t not_used_01 : 1;
  487. uint8_t wrist_tilt_en : 1;
  488. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  489. uint8_t wrist_tilt_en : 1;
  490. uint8_t not_used_01 : 1;
  491. uint8_t timer_en : 1;
  492. uint8_t pedo_en : 1;
  493. uint8_t tilt_en : 1;
  494. uint8_t func_en : 1;
  495. uint8_t pedo_rst_step : 1;
  496. uint8_t sign_motion_en : 1;
  497. #endif /* DRV_BYTE_ORDER */
  498. } lsm6ds3tr_c_ctrl10_c_t;
  499. #define LSM6DS3TR_C_MASTER_CONFIG 0x1AU
  500. typedef struct
  501. {
  502. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  503. uint8_t master_on : 1;
  504. uint8_t iron_en : 1;
  505. uint8_t pass_through_mode : 1;
  506. uint8_t pull_up_en : 1;
  507. uint8_t start_config : 1;
  508. uint8_t not_used_01 : 1;
  509. uint8_t data_valid_sel_fifo : 1;
  510. uint8_t drdy_on_int1 : 1;
  511. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  512. uint8_t drdy_on_int1 : 1;
  513. uint8_t data_valid_sel_fifo : 1;
  514. uint8_t not_used_01 : 1;
  515. uint8_t start_config : 1;
  516. uint8_t pull_up_en : 1;
  517. uint8_t pass_through_mode : 1;
  518. uint8_t iron_en : 1;
  519. uint8_t master_on : 1;
  520. #endif /* DRV_BYTE_ORDER */
  521. } lsm6ds3tr_c_master_config_t;
  522. #define LSM6DS3TR_C_WAKE_UP_SRC 0x1BU
  523. typedef struct
  524. {
  525. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  526. uint8_t z_wu : 1;
  527. uint8_t y_wu : 1;
  528. uint8_t x_wu : 1;
  529. uint8_t wu_ia : 1;
  530. uint8_t sleep_state_ia : 1;
  531. uint8_t ff_ia : 1;
  532. uint8_t not_used_01 : 2;
  533. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  534. uint8_t not_used_01 : 2;
  535. uint8_t ff_ia : 1;
  536. uint8_t sleep_state_ia : 1;
  537. uint8_t wu_ia : 1;
  538. uint8_t x_wu : 1;
  539. uint8_t y_wu : 1;
  540. uint8_t z_wu : 1;
  541. #endif /* DRV_BYTE_ORDER */
  542. } lsm6ds3tr_c_wake_up_src_t;
  543. #define LSM6DS3TR_C_TAP_SRC 0x1CU
  544. typedef struct
  545. {
  546. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  547. uint8_t z_tap : 1;
  548. uint8_t y_tap : 1;
  549. uint8_t x_tap : 1;
  550. uint8_t tap_sign : 1;
  551. uint8_t double_tap : 1;
  552. uint8_t single_tap : 1;
  553. uint8_t tap_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 tap_ia : 1;
  558. uint8_t single_tap : 1;
  559. uint8_t double_tap : 1;
  560. uint8_t tap_sign : 1;
  561. uint8_t x_tap : 1;
  562. uint8_t y_tap : 1;
  563. uint8_t z_tap : 1;
  564. #endif /* DRV_BYTE_ORDER */
  565. } lsm6ds3tr_c_tap_src_t;
  566. #define LSM6DS3TR_C_D6D_SRC 0x1DU
  567. typedef struct
  568. {
  569. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  570. uint8_t xl : 1;
  571. uint8_t xh : 1;
  572. uint8_t yl : 1;
  573. uint8_t yh : 1;
  574. uint8_t zl : 1;
  575. uint8_t zh : 1;
  576. uint8_t d6d_ia : 1;
  577. uint8_t den_drdy : 1;
  578. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  579. uint8_t den_drdy : 1;
  580. uint8_t d6d_ia : 1;
  581. uint8_t zh : 1;
  582. uint8_t zl : 1;
  583. uint8_t yh : 1;
  584. uint8_t yl : 1;
  585. uint8_t xh : 1;
  586. uint8_t xl : 1;
  587. #endif /* DRV_BYTE_ORDER */
  588. } lsm6ds3tr_c_d6d_src_t;
  589. #define LSM6DS3TR_C_STATUS_REG 0x1EU
  590. typedef struct
  591. {
  592. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  593. uint8_t xlda : 1;
  594. uint8_t gda : 1;
  595. uint8_t tda : 1;
  596. uint8_t not_used_01 : 5;
  597. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  598. uint8_t not_used_01 : 5;
  599. uint8_t tda : 1;
  600. uint8_t gda : 1;
  601. uint8_t xlda : 1;
  602. #endif /* DRV_BYTE_ORDER */
  603. } lsm6ds3tr_c_status_reg_t;
  604. #define LSM6DS3TR_C_OUT_TEMP_L 0x20U
  605. #define LSM6DS3TR_C_OUT_TEMP_H 0x21U
  606. #define LSM6DS3TR_C_OUTX_L_G 0x22U
  607. #define LSM6DS3TR_C_OUTX_H_G 0x23U
  608. #define LSM6DS3TR_C_OUTY_L_G 0x24U
  609. #define LSM6DS3TR_C_OUTY_H_G 0x25U
  610. #define LSM6DS3TR_C_OUTZ_L_G 0x26U
  611. #define LSM6DS3TR_C_OUTZ_H_G 0x27U
  612. #define LSM6DS3TR_C_OUTX_L_XL 0x28U
  613. #define LSM6DS3TR_C_OUTX_H_XL 0x29U
  614. #define LSM6DS3TR_C_OUTY_L_XL 0x2AU
  615. #define LSM6DS3TR_C_OUTY_H_XL 0x2BU
  616. #define LSM6DS3TR_C_OUTZ_L_XL 0x2CU
  617. #define LSM6DS3TR_C_OUTZ_H_XL 0x2DU
  618. #define LSM6DS3TR_C_SENSORHUB1_REG 0x2EU
  619. typedef struct
  620. {
  621. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  622. uint8_t bit0 : 1;
  623. uint8_t bit1 : 1;
  624. uint8_t bit2 : 1;
  625. uint8_t bit3 : 1;
  626. uint8_t bit4 : 1;
  627. uint8_t bit5 : 1;
  628. uint8_t bit6 : 1;
  629. uint8_t bit7 : 1;
  630. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  631. uint8_t bit7 : 1;
  632. uint8_t bit6 : 1;
  633. uint8_t bit5 : 1;
  634. uint8_t bit4 : 1;
  635. uint8_t bit3 : 1;
  636. uint8_t bit2 : 1;
  637. uint8_t bit1 : 1;
  638. uint8_t bit0 : 1;
  639. #endif /* DRV_BYTE_ORDER */
  640. } lsm6ds3tr_c_sensorhub1_reg_t;
  641. #define LSM6DS3TR_C_SENSORHUB2_REG 0x2FU
  642. typedef struct
  643. {
  644. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  645. uint8_t bit0 : 1;
  646. uint8_t bit1 : 1;
  647. uint8_t bit2 : 1;
  648. uint8_t bit3 : 1;
  649. uint8_t bit4 : 1;
  650. uint8_t bit5 : 1;
  651. uint8_t bit6 : 1;
  652. uint8_t bit7 : 1;
  653. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  654. uint8_t bit7 : 1;
  655. uint8_t bit6 : 1;
  656. uint8_t bit5 : 1;
  657. uint8_t bit4 : 1;
  658. uint8_t bit3 : 1;
  659. uint8_t bit2 : 1;
  660. uint8_t bit1 : 1;
  661. uint8_t bit0 : 1;
  662. #endif /* DRV_BYTE_ORDER */
  663. } lsm6ds3tr_c_sensorhub2_reg_t;
  664. #define LSM6DS3TR_C_SENSORHUB3_REG 0x30U
  665. typedef struct
  666. {
  667. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  668. uint8_t bit0 : 1;
  669. uint8_t bit1 : 1;
  670. uint8_t bit2 : 1;
  671. uint8_t bit3 : 1;
  672. uint8_t bit4 : 1;
  673. uint8_t bit5 : 1;
  674. uint8_t bit6 : 1;
  675. uint8_t bit7 : 1;
  676. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  677. uint8_t bit7 : 1;
  678. uint8_t bit6 : 1;
  679. uint8_t bit5 : 1;
  680. uint8_t bit4 : 1;
  681. uint8_t bit3 : 1;
  682. uint8_t bit2 : 1;
  683. uint8_t bit1 : 1;
  684. uint8_t bit0 : 1;
  685. #endif /* DRV_BYTE_ORDER */
  686. } lsm6ds3tr_c_sensorhub3_reg_t;
  687. #define LSM6DS3TR_C_SENSORHUB4_REG 0x31U
  688. typedef struct
  689. {
  690. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  691. uint8_t bit0 : 1;
  692. uint8_t bit1 : 1;
  693. uint8_t bit2 : 1;
  694. uint8_t bit3 : 1;
  695. uint8_t bit4 : 1;
  696. uint8_t bit5 : 1;
  697. uint8_t bit6 : 1;
  698. uint8_t bit7 : 1;
  699. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  700. uint8_t bit7 : 1;
  701. uint8_t bit6 : 1;
  702. uint8_t bit5 : 1;
  703. uint8_t bit4 : 1;
  704. uint8_t bit3 : 1;
  705. uint8_t bit2 : 1;
  706. uint8_t bit1 : 1;
  707. uint8_t bit0 : 1;
  708. #endif /* DRV_BYTE_ORDER */
  709. } lsm6ds3tr_c_sensorhub4_reg_t;
  710. #define LSM6DS3TR_C_SENSORHUB5_REG 0x32U
  711. typedef struct
  712. {
  713. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  714. uint8_t bit0 : 1;
  715. uint8_t bit1 : 1;
  716. uint8_t bit2 : 1;
  717. uint8_t bit3 : 1;
  718. uint8_t bit4 : 1;
  719. uint8_t bit5 : 1;
  720. uint8_t bit6 : 1;
  721. uint8_t bit7 : 1;
  722. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  723. uint8_t bit7 : 1;
  724. uint8_t bit6 : 1;
  725. uint8_t bit5 : 1;
  726. uint8_t bit4 : 1;
  727. uint8_t bit3 : 1;
  728. uint8_t bit2 : 1;
  729. uint8_t bit1 : 1;
  730. uint8_t bit0 : 1;
  731. #endif /* DRV_BYTE_ORDER */
  732. } lsm6ds3tr_c_sensorhub5_reg_t;
  733. #define LSM6DS3TR_C_SENSORHUB6_REG 0x33U
  734. typedef struct
  735. {
  736. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  737. uint8_t bit0 : 1;
  738. uint8_t bit1 : 1;
  739. uint8_t bit2 : 1;
  740. uint8_t bit3 : 1;
  741. uint8_t bit4 : 1;
  742. uint8_t bit5 : 1;
  743. uint8_t bit6 : 1;
  744. uint8_t bit7 : 1;
  745. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  746. uint8_t bit7 : 1;
  747. uint8_t bit6 : 1;
  748. uint8_t bit5 : 1;
  749. uint8_t bit4 : 1;
  750. uint8_t bit3 : 1;
  751. uint8_t bit2 : 1;
  752. uint8_t bit1 : 1;
  753. uint8_t bit0 : 1;
  754. #endif /* DRV_BYTE_ORDER */
  755. } lsm6ds3tr_c_sensorhub6_reg_t;
  756. #define LSM6DS3TR_C_SENSORHUB7_REG 0x34U
  757. typedef struct
  758. {
  759. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  760. uint8_t bit0 : 1;
  761. uint8_t bit1 : 1;
  762. uint8_t bit2 : 1;
  763. uint8_t bit3 : 1;
  764. uint8_t bit4 : 1;
  765. uint8_t bit5 : 1;
  766. uint8_t bit6 : 1;
  767. uint8_t bit7 : 1;
  768. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  769. uint8_t bit7 : 1;
  770. uint8_t bit6 : 1;
  771. uint8_t bit5 : 1;
  772. uint8_t bit4 : 1;
  773. uint8_t bit3 : 1;
  774. uint8_t bit2 : 1;
  775. uint8_t bit1 : 1;
  776. uint8_t bit0 : 1;
  777. #endif /* DRV_BYTE_ORDER */
  778. } lsm6ds3tr_c_sensorhub7_reg_t;
  779. #define LSM6DS3TR_C_SENSORHUB8_REG 0x35U
  780. typedef struct
  781. {
  782. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  783. uint8_t bit0 : 1;
  784. uint8_t bit1 : 1;
  785. uint8_t bit2 : 1;
  786. uint8_t bit3 : 1;
  787. uint8_t bit4 : 1;
  788. uint8_t bit5 : 1;
  789. uint8_t bit6 : 1;
  790. uint8_t bit7 : 1;
  791. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  792. uint8_t bit7 : 1;
  793. uint8_t bit6 : 1;
  794. uint8_t bit5 : 1;
  795. uint8_t bit4 : 1;
  796. uint8_t bit3 : 1;
  797. uint8_t bit2 : 1;
  798. uint8_t bit1 : 1;
  799. uint8_t bit0 : 1;
  800. #endif /* DRV_BYTE_ORDER */
  801. } lsm6ds3tr_c_sensorhub8_reg_t;
  802. #define LSM6DS3TR_C_SENSORHUB9_REG 0x36U
  803. typedef struct
  804. {
  805. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  806. uint8_t bit0 : 1;
  807. uint8_t bit1 : 1;
  808. uint8_t bit2 : 1;
  809. uint8_t bit3 : 1;
  810. uint8_t bit4 : 1;
  811. uint8_t bit5 : 1;
  812. uint8_t bit6 : 1;
  813. uint8_t bit7 : 1;
  814. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  815. uint8_t bit7 : 1;
  816. uint8_t bit6 : 1;
  817. uint8_t bit5 : 1;
  818. uint8_t bit4 : 1;
  819. uint8_t bit3 : 1;
  820. uint8_t bit2 : 1;
  821. uint8_t bit1 : 1;
  822. uint8_t bit0 : 1;
  823. #endif /* DRV_BYTE_ORDER */
  824. } lsm6ds3tr_c_sensorhub9_reg_t;
  825. #define LSM6DS3TR_C_SENSORHUB10_REG 0x37U
  826. typedef struct
  827. {
  828. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  829. uint8_t bit0 : 1;
  830. uint8_t bit1 : 1;
  831. uint8_t bit2 : 1;
  832. uint8_t bit3 : 1;
  833. uint8_t bit4 : 1;
  834. uint8_t bit5 : 1;
  835. uint8_t bit6 : 1;
  836. uint8_t bit7 : 1;
  837. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  838. uint8_t bit7 : 1;
  839. uint8_t bit6 : 1;
  840. uint8_t bit5 : 1;
  841. uint8_t bit4 : 1;
  842. uint8_t bit3 : 1;
  843. uint8_t bit2 : 1;
  844. uint8_t bit1 : 1;
  845. uint8_t bit0 : 1;
  846. #endif /* DRV_BYTE_ORDER */
  847. } lsm6ds3tr_c_sensorhub10_reg_t;
  848. #define LSM6DS3TR_C_SENSORHUB11_REG 0x38U
  849. typedef struct
  850. {
  851. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  852. uint8_t bit0 : 1;
  853. uint8_t bit1 : 1;
  854. uint8_t bit2 : 1;
  855. uint8_t bit3 : 1;
  856. uint8_t bit4 : 1;
  857. uint8_t bit5 : 1;
  858. uint8_t bit6 : 1;
  859. uint8_t bit7 : 1;
  860. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  861. uint8_t bit7 : 1;
  862. uint8_t bit6 : 1;
  863. uint8_t bit5 : 1;
  864. uint8_t bit4 : 1;
  865. uint8_t bit3 : 1;
  866. uint8_t bit2 : 1;
  867. uint8_t bit1 : 1;
  868. uint8_t bit0 : 1;
  869. #endif /* DRV_BYTE_ORDER */
  870. } lsm6ds3tr_c_sensorhub11_reg_t;
  871. #define LSM6DS3TR_C_SENSORHUB12_REG 0x39U
  872. typedef struct
  873. {
  874. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  875. uint8_t bit0 : 1;
  876. uint8_t bit1 : 1;
  877. uint8_t bit2 : 1;
  878. uint8_t bit3 : 1;
  879. uint8_t bit4 : 1;
  880. uint8_t bit5 : 1;
  881. uint8_t bit6 : 1;
  882. uint8_t bit7 : 1;
  883. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  884. uint8_t bit7 : 1;
  885. uint8_t bit6 : 1;
  886. uint8_t bit5 : 1;
  887. uint8_t bit4 : 1;
  888. uint8_t bit3 : 1;
  889. uint8_t bit2 : 1;
  890. uint8_t bit1 : 1;
  891. uint8_t bit0 : 1;
  892. #endif /* DRV_BYTE_ORDER */
  893. } lsm6ds3tr_c_sensorhub12_reg_t;
  894. #define LSM6DS3TR_C_FIFO_STATUS1 0x3AU
  895. typedef struct
  896. {
  897. uint8_t diff_fifo : 8; /* + FIFO_STATUS2(diff_fifo) */
  898. } lsm6ds3tr_c_fifo_status1_t;
  899. #define LSM6DS3TR_C_FIFO_STATUS2 0x3BU
  900. typedef struct
  901. {
  902. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  903. uint8_t diff_fifo : 3; /* + FIFO_STATUS1(diff_fifo) */
  904. uint8_t not_used_01 : 1;
  905. uint8_t fifo_empty : 1;
  906. uint8_t fifo_full_smart : 1;
  907. uint8_t over_run : 1;
  908. uint8_t waterm : 1;
  909. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  910. uint8_t waterm : 1;
  911. uint8_t over_run : 1;
  912. uint8_t fifo_full_smart : 1;
  913. uint8_t fifo_empty : 1;
  914. uint8_t not_used_01 : 1;
  915. uint8_t diff_fifo : 3; /* + FIFO_STATUS1(diff_fifo) */
  916. #endif /* DRV_BYTE_ORDER */
  917. } lsm6ds3tr_c_fifo_status2_t;
  918. #define LSM6DS3TR_C_FIFO_STATUS3 0x3CU
  919. typedef struct
  920. {
  921. uint8_t fifo_pattern :
  922. 8; /* + FIFO_STATUS4(fifo_pattern) */
  923. } lsm6ds3tr_c_fifo_status3_t;
  924. #define LSM6DS3TR_C_FIFO_STATUS4 0x3DU
  925. typedef struct
  926. {
  927. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  928. uint8_t fifo_pattern :
  929. 2; /* + FIFO_STATUS3(fifo_pattern) */
  930. uint8_t not_used_01 : 6;
  931. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  932. uint8_t not_used_01 : 6;
  933. uint8_t fifo_pattern :
  934. 2; /* + FIFO_STATUS3(fifo_pattern) */
  935. #endif /* DRV_BYTE_ORDER */
  936. } lsm6ds3tr_c_fifo_status4_t;
  937. #define LSM6DS3TR_C_FIFO_DATA_OUT_L 0x3EU
  938. #define LSM6DS3TR_C_FIFO_DATA_OUT_H 0x3FU
  939. #define LSM6DS3TR_C_TIMESTAMP0_REG 0x40U
  940. #define LSM6DS3TR_C_TIMESTAMP1_REG 0x41U
  941. #define LSM6DS3TR_C_TIMESTAMP2_REG 0x42U
  942. #define LSM6DS3TR_C_STEP_TIMESTAMP_L 0x49U
  943. #define LSM6DS3TR_C_STEP_TIMESTAMP_H 0x4AU
  944. #define LSM6DS3TR_C_STEP_COUNTER_L 0x4BU
  945. #define LSM6DS3TR_C_STEP_COUNTER_H 0x4CU
  946. #define LSM6DS3TR_C_SENSORHUB13_REG 0x4DU
  947. typedef struct
  948. {
  949. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  950. uint8_t bit0 : 1;
  951. uint8_t bit1 : 1;
  952. uint8_t bit2 : 1;
  953. uint8_t bit3 : 1;
  954. uint8_t bit4 : 1;
  955. uint8_t bit5 : 1;
  956. uint8_t bit6 : 1;
  957. uint8_t bit7 : 1;
  958. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  959. uint8_t bit7 : 1;
  960. uint8_t bit6 : 1;
  961. uint8_t bit5 : 1;
  962. uint8_t bit4 : 1;
  963. uint8_t bit3 : 1;
  964. uint8_t bit2 : 1;
  965. uint8_t bit1 : 1;
  966. uint8_t bit0 : 1;
  967. #endif /* DRV_BYTE_ORDER */
  968. } lsm6ds3tr_c_sensorhub13_reg_t;
  969. #define LSM6DS3TR_C_SENSORHUB14_REG 0x4EU
  970. typedef struct
  971. {
  972. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  973. uint8_t bit0 : 1;
  974. uint8_t bit1 : 1;
  975. uint8_t bit2 : 1;
  976. uint8_t bit3 : 1;
  977. uint8_t bit4 : 1;
  978. uint8_t bit5 : 1;
  979. uint8_t bit6 : 1;
  980. uint8_t bit7 : 1;
  981. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  982. uint8_t bit7 : 1;
  983. uint8_t bit6 : 1;
  984. uint8_t bit5 : 1;
  985. uint8_t bit4 : 1;
  986. uint8_t bit3 : 1;
  987. uint8_t bit2 : 1;
  988. uint8_t bit1 : 1;
  989. uint8_t bit0 : 1;
  990. #endif /* DRV_BYTE_ORDER */
  991. } lsm6ds3tr_c_sensorhub14_reg_t;
  992. #define LSM6DS3TR_C_SENSORHUB15_REG 0x4FU
  993. typedef struct
  994. {
  995. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  996. uint8_t bit0 : 1;
  997. uint8_t bit1 : 1;
  998. uint8_t bit2 : 1;
  999. uint8_t bit3 : 1;
  1000. uint8_t bit4 : 1;
  1001. uint8_t bit5 : 1;
  1002. uint8_t bit6 : 1;
  1003. uint8_t bit7 : 1;
  1004. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1005. uint8_t bit7 : 1;
  1006. uint8_t bit6 : 1;
  1007. uint8_t bit5 : 1;
  1008. uint8_t bit4 : 1;
  1009. uint8_t bit3 : 1;
  1010. uint8_t bit2 : 1;
  1011. uint8_t bit1 : 1;
  1012. uint8_t bit0 : 1;
  1013. #endif /* DRV_BYTE_ORDER */
  1014. } lsm6ds3tr_c_sensorhub15_reg_t;
  1015. #define LSM6DS3TR_C_SENSORHUB16_REG 0x50U
  1016. typedef struct
  1017. {
  1018. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1019. uint8_t bit0 : 1;
  1020. uint8_t bit1 : 1;
  1021. uint8_t bit2 : 1;
  1022. uint8_t bit3 : 1;
  1023. uint8_t bit4 : 1;
  1024. uint8_t bit5 : 1;
  1025. uint8_t bit6 : 1;
  1026. uint8_t bit7 : 1;
  1027. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1028. uint8_t bit7 : 1;
  1029. uint8_t bit6 : 1;
  1030. uint8_t bit5 : 1;
  1031. uint8_t bit4 : 1;
  1032. uint8_t bit3 : 1;
  1033. uint8_t bit2 : 1;
  1034. uint8_t bit1 : 1;
  1035. uint8_t bit0 : 1;
  1036. #endif /* DRV_BYTE_ORDER */
  1037. } lsm6ds3tr_c_sensorhub16_reg_t;
  1038. #define LSM6DS3TR_C_SENSORHUB17_REG 0x51U
  1039. typedef struct
  1040. {
  1041. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1042. uint8_t bit0 : 1;
  1043. uint8_t bit1 : 1;
  1044. uint8_t bit2 : 1;
  1045. uint8_t bit3 : 1;
  1046. uint8_t bit4 : 1;
  1047. uint8_t bit5 : 1;
  1048. uint8_t bit6 : 1;
  1049. uint8_t bit7 : 1;
  1050. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1051. uint8_t bit7 : 1;
  1052. uint8_t bit6 : 1;
  1053. uint8_t bit5 : 1;
  1054. uint8_t bit4 : 1;
  1055. uint8_t bit3 : 1;
  1056. uint8_t bit2 : 1;
  1057. uint8_t bit1 : 1;
  1058. uint8_t bit0 : 1;
  1059. #endif /* DRV_BYTE_ORDER */
  1060. } lsm6ds3tr_c_sensorhub17_reg_t;
  1061. #define LSM6DS3TR_C_SENSORHUB18_REG 0x52U
  1062. typedef struct
  1063. {
  1064. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1065. uint8_t bit0 : 1;
  1066. uint8_t bit1 : 1;
  1067. uint8_t bit2 : 1;
  1068. uint8_t bit3 : 1;
  1069. uint8_t bit4 : 1;
  1070. uint8_t bit5 : 1;
  1071. uint8_t bit6 : 1;
  1072. uint8_t bit7 : 1;
  1073. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1074. uint8_t bit7 : 1;
  1075. uint8_t bit6 : 1;
  1076. uint8_t bit5 : 1;
  1077. uint8_t bit4 : 1;
  1078. uint8_t bit3 : 1;
  1079. uint8_t bit2 : 1;
  1080. uint8_t bit1 : 1;
  1081. uint8_t bit0 : 1;
  1082. #endif /* DRV_BYTE_ORDER */
  1083. } lsm6ds3tr_c_sensorhub18_reg_t;
  1084. #define LSM6DS3TR_C_FUNC_SRC1 0x53U
  1085. typedef struct
  1086. {
  1087. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1088. uint8_t sensorhub_end_op : 1;
  1089. uint8_t si_end_op : 1;
  1090. uint8_t hi_fail : 1;
  1091. uint8_t step_overflow : 1;
  1092. uint8_t step_detected : 1;
  1093. uint8_t tilt_ia : 1;
  1094. uint8_t sign_motion_ia : 1;
  1095. uint8_t step_count_delta_ia : 1;
  1096. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1097. uint8_t step_count_delta_ia : 1;
  1098. uint8_t sign_motion_ia : 1;
  1099. uint8_t tilt_ia : 1;
  1100. uint8_t step_detected : 1;
  1101. uint8_t step_overflow : 1;
  1102. uint8_t hi_fail : 1;
  1103. uint8_t si_end_op : 1;
  1104. uint8_t sensorhub_end_op : 1;
  1105. #endif /* DRV_BYTE_ORDER */
  1106. } lsm6ds3tr_c_func_src1_t;
  1107. #define LSM6DS3TR_C_FUNC_SRC2 0x54U
  1108. typedef struct
  1109. {
  1110. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1111. uint8_t wrist_tilt_ia : 1;
  1112. uint8_t not_used_01 : 2;
  1113. uint8_t slave0_nack : 1;
  1114. uint8_t slave1_nack : 1;
  1115. uint8_t slave2_nack : 1;
  1116. uint8_t slave3_nack : 1;
  1117. uint8_t not_used_02 : 1;
  1118. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1119. uint8_t not_used_02 : 1;
  1120. uint8_t slave3_nack : 1;
  1121. uint8_t slave2_nack : 1;
  1122. uint8_t slave1_nack : 1;
  1123. uint8_t slave0_nack : 1;
  1124. uint8_t not_used_01 : 2;
  1125. uint8_t wrist_tilt_ia : 1;
  1126. #endif /* DRV_BYTE_ORDER */
  1127. } lsm6ds3tr_c_func_src2_t;
  1128. #define LSM6DS3TR_C_WRIST_TILT_IA 0x55U
  1129. typedef struct
  1130. {
  1131. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1132. uint8_t not_used_01 : 2;
  1133. uint8_t wrist_tilt_ia_zneg : 1;
  1134. uint8_t wrist_tilt_ia_zpos : 1;
  1135. uint8_t wrist_tilt_ia_yneg : 1;
  1136. uint8_t wrist_tilt_ia_ypos : 1;
  1137. uint8_t wrist_tilt_ia_xneg : 1;
  1138. uint8_t wrist_tilt_ia_xpos : 1;
  1139. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1140. uint8_t wrist_tilt_ia_xpos : 1;
  1141. uint8_t wrist_tilt_ia_xneg : 1;
  1142. uint8_t wrist_tilt_ia_ypos : 1;
  1143. uint8_t wrist_tilt_ia_yneg : 1;
  1144. uint8_t wrist_tilt_ia_zpos : 1;
  1145. uint8_t wrist_tilt_ia_zneg : 1;
  1146. uint8_t not_used_01 : 2;
  1147. #endif /* DRV_BYTE_ORDER */
  1148. } lsm6ds3tr_c_wrist_tilt_ia_t;
  1149. #define LSM6DS3TR_C_TAP_CFG 0x58U
  1150. typedef struct
  1151. {
  1152. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1153. uint8_t lir : 1;
  1154. uint8_t tap_z_en : 1;
  1155. uint8_t tap_y_en : 1;
  1156. uint8_t tap_x_en : 1;
  1157. uint8_t slope_fds : 1;
  1158. uint8_t inact_en : 2;
  1159. uint8_t interrupts_enable : 1;
  1160. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1161. uint8_t interrupts_enable : 1;
  1162. uint8_t inact_en : 2;
  1163. uint8_t slope_fds : 1;
  1164. uint8_t tap_x_en : 1;
  1165. uint8_t tap_y_en : 1;
  1166. uint8_t tap_z_en : 1;
  1167. uint8_t lir : 1;
  1168. #endif /* DRV_BYTE_ORDER */
  1169. } lsm6ds3tr_c_tap_cfg_t;
  1170. #define LSM6DS3TR_C_TAP_THS_6D 0x59U
  1171. typedef struct
  1172. {
  1173. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1174. uint8_t tap_ths : 5;
  1175. uint8_t sixd_ths : 2;
  1176. uint8_t d4d_en : 1;
  1177. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1178. uint8_t d4d_en : 1;
  1179. uint8_t sixd_ths : 2;
  1180. uint8_t tap_ths : 5;
  1181. #endif /* DRV_BYTE_ORDER */
  1182. } lsm6ds3tr_c_tap_ths_6d_t;
  1183. #define LSM6DS3TR_C_INT_DUR2 0x5AU
  1184. typedef struct
  1185. {
  1186. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1187. uint8_t shock : 2;
  1188. uint8_t quiet : 2;
  1189. uint8_t dur : 4;
  1190. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1191. uint8_t dur : 4;
  1192. uint8_t quiet : 2;
  1193. uint8_t shock : 2;
  1194. #endif /* DRV_BYTE_ORDER */
  1195. } lsm6ds3tr_c_int_dur2_t;
  1196. #define LSM6DS3TR_C_WAKE_UP_THS 0x5BU
  1197. typedef struct
  1198. {
  1199. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1200. uint8_t wk_ths : 6;
  1201. uint8_t not_used_01 : 1;
  1202. uint8_t single_double_tap : 1;
  1203. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1204. uint8_t single_double_tap : 1;
  1205. uint8_t not_used_01 : 1;
  1206. uint8_t wk_ths : 6;
  1207. #endif /* DRV_BYTE_ORDER */
  1208. } lsm6ds3tr_c_wake_up_ths_t;
  1209. #define LSM6DS3TR_C_WAKE_UP_DUR 0x5CU
  1210. typedef struct
  1211. {
  1212. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1213. uint8_t sleep_dur : 4;
  1214. uint8_t timer_hr : 1;
  1215. uint8_t wake_dur : 2;
  1216. uint8_t ff_dur : 1;
  1217. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1218. uint8_t ff_dur : 1;
  1219. uint8_t wake_dur : 2;
  1220. uint8_t timer_hr : 1;
  1221. uint8_t sleep_dur : 4;
  1222. #endif /* DRV_BYTE_ORDER */
  1223. } lsm6ds3tr_c_wake_up_dur_t;
  1224. #define LSM6DS3TR_C_FREE_FALL 0x5DU
  1225. typedef struct
  1226. {
  1227. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1228. uint8_t ff_ths : 3;
  1229. uint8_t ff_dur : 5;
  1230. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1231. uint8_t ff_dur : 5;
  1232. uint8_t ff_ths : 3;
  1233. #endif /* DRV_BYTE_ORDER */
  1234. } lsm6ds3tr_c_free_fall_t;
  1235. #define LSM6DS3TR_C_MD1_CFG 0x5EU
  1236. typedef struct
  1237. {
  1238. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1239. uint8_t int1_timer : 1;
  1240. uint8_t int1_tilt : 1;
  1241. uint8_t int1_6d : 1;
  1242. uint8_t int1_double_tap : 1;
  1243. uint8_t int1_ff : 1;
  1244. uint8_t int1_wu : 1;
  1245. uint8_t int1_single_tap : 1;
  1246. uint8_t int1_inact_state : 1;
  1247. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1248. uint8_t int1_inact_state : 1;
  1249. uint8_t int1_single_tap : 1;
  1250. uint8_t int1_wu : 1;
  1251. uint8_t int1_ff : 1;
  1252. uint8_t int1_double_tap : 1;
  1253. uint8_t int1_6d : 1;
  1254. uint8_t int1_tilt : 1;
  1255. uint8_t int1_timer : 1;
  1256. #endif /* DRV_BYTE_ORDER */
  1257. } lsm6ds3tr_c_md1_cfg_t;
  1258. #define LSM6DS3TR_C_MD2_CFG 0x5FU
  1259. typedef struct
  1260. {
  1261. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1262. uint8_t int2_iron : 1;
  1263. uint8_t int2_tilt : 1;
  1264. uint8_t int2_6d : 1;
  1265. uint8_t int2_double_tap : 1;
  1266. uint8_t int2_ff : 1;
  1267. uint8_t int2_wu : 1;
  1268. uint8_t int2_single_tap : 1;
  1269. uint8_t int2_inact_state : 1;
  1270. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1271. uint8_t int2_inact_state : 1;
  1272. uint8_t int2_single_tap : 1;
  1273. uint8_t int2_wu : 1;
  1274. uint8_t int2_ff : 1;
  1275. uint8_t int2_double_tap : 1;
  1276. uint8_t int2_6d : 1;
  1277. uint8_t int2_tilt : 1;
  1278. uint8_t int2_iron : 1;
  1279. #endif /* DRV_BYTE_ORDER */
  1280. } lsm6ds3tr_c_md2_cfg_t;
  1281. #define LSM6DS3TR_C_MASTER_CMD_CODE 0x60U
  1282. typedef struct
  1283. {
  1284. uint8_t master_cmd_code : 8;
  1285. } lsm6ds3tr_c_master_cmd_code_t;
  1286. #define LSM6DS3TR_C_SENS_SYNC_SPI_ERROR_CODE 0x61U
  1287. typedef struct
  1288. {
  1289. uint8_t error_code : 8;
  1290. } lsm6ds3tr_c_sens_sync_spi_error_code_t;
  1291. #define LSM6DS3TR_C_OUT_MAG_RAW_X_L 0x66U
  1292. #define LSM6DS3TR_C_OUT_MAG_RAW_X_H 0x67U
  1293. #define LSM6DS3TR_C_OUT_MAG_RAW_Y_L 0x68U
  1294. #define LSM6DS3TR_C_OUT_MAG_RAW_Y_H 0x69U
  1295. #define LSM6DS3TR_C_OUT_MAG_RAW_Z_L 0x6AU
  1296. #define LSM6DS3TR_C_OUT_MAG_RAW_Z_H 0x6BU
  1297. #define LSM6DS3TR_C_X_OFS_USR 0x73U
  1298. #define LSM6DS3TR_C_Y_OFS_USR 0x74U
  1299. #define LSM6DS3TR_C_Z_OFS_USR 0x75U
  1300. #define LSM6DS3TR_C_SLV0_ADD 0x02U
  1301. typedef struct
  1302. {
  1303. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1304. uint8_t rw_0 : 1;
  1305. uint8_t slave0_add : 7;
  1306. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1307. uint8_t slave0_add : 7;
  1308. uint8_t rw_0 : 1;
  1309. #endif /* DRV_BYTE_ORDER */
  1310. } lsm6ds3tr_c_slv0_add_t;
  1311. #define LSM6DS3TR_C_SLV0_SUBADD 0x03U
  1312. typedef struct
  1313. {
  1314. uint8_t slave0_reg : 8;
  1315. } lsm6ds3tr_c_slv0_subadd_t;
  1316. #define LSM6DS3TR_C_SLAVE0_CONFIG 0x04U
  1317. typedef struct
  1318. {
  1319. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1320. uint8_t slave0_numop : 3;
  1321. uint8_t src_mode : 1;
  1322. uint8_t aux_sens_on : 2;
  1323. uint8_t slave0_rate : 2;
  1324. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1325. uint8_t slave0_rate : 2;
  1326. uint8_t aux_sens_on : 2;
  1327. uint8_t src_mode : 1;
  1328. uint8_t slave0_numop : 3;
  1329. #endif /* DRV_BYTE_ORDER */
  1330. } lsm6ds3tr_c_slave0_config_t;
  1331. #define LSM6DS3TR_C_SLV1_ADD 0x05U
  1332. typedef struct
  1333. {
  1334. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1335. uint8_t r_1 : 1;
  1336. uint8_t slave1_add : 7;
  1337. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1338. uint8_t slave1_add : 7;
  1339. uint8_t r_1 : 1;
  1340. #endif /* DRV_BYTE_ORDER */
  1341. } lsm6ds3tr_c_slv1_add_t;
  1342. #define LSM6DS3TR_C_SLV1_SUBADD 0x06U
  1343. typedef struct
  1344. {
  1345. uint8_t slave1_reg : 8;
  1346. } lsm6ds3tr_c_slv1_subadd_t;
  1347. #define LSM6DS3TR_C_SLAVE1_CONFIG 0x07U
  1348. typedef struct
  1349. {
  1350. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1351. uint8_t slave1_numop : 3;
  1352. uint8_t not_used_01 : 2;
  1353. uint8_t write_once : 1;
  1354. uint8_t slave1_rate : 2;
  1355. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1356. uint8_t slave1_rate : 2;
  1357. uint8_t write_once : 1;
  1358. uint8_t not_used_01 : 2;
  1359. uint8_t slave1_numop : 3;
  1360. #endif /* DRV_BYTE_ORDER */
  1361. } lsm6ds3tr_c_slave1_config_t;
  1362. #define LSM6DS3TR_C_SLV2_ADD 0x08U
  1363. typedef struct
  1364. {
  1365. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1366. uint8_t r_2 : 1;
  1367. uint8_t slave2_add : 7;
  1368. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1369. uint8_t slave2_add : 7;
  1370. uint8_t r_2 : 1;
  1371. #endif /* DRV_BYTE_ORDER */
  1372. } lsm6ds3tr_c_slv2_add_t;
  1373. #define LSM6DS3TR_C_SLV2_SUBADD 0x09U
  1374. typedef struct
  1375. {
  1376. uint8_t slave2_reg : 8;
  1377. } lsm6ds3tr_c_slv2_subadd_t;
  1378. #define LSM6DS3TR_C_SLAVE2_CONFIG 0x0AU
  1379. typedef struct
  1380. {
  1381. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1382. uint8_t slave2_numop : 3;
  1383. uint8_t not_used_01 : 3;
  1384. uint8_t slave2_rate : 2;
  1385. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1386. uint8_t slave2_rate : 2;
  1387. uint8_t not_used_01 : 3;
  1388. uint8_t slave2_numop : 3;
  1389. #endif /* DRV_BYTE_ORDER */
  1390. } lsm6ds3tr_c_slave2_config_t;
  1391. #define LSM6DS3TR_C_SLV3_ADD 0x0BU
  1392. typedef struct
  1393. {
  1394. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1395. uint8_t r_3 : 1;
  1396. uint8_t slave3_add : 7;
  1397. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1398. uint8_t slave3_add : 7;
  1399. uint8_t r_3 : 1;
  1400. #endif /* DRV_BYTE_ORDER */
  1401. } lsm6ds3tr_c_slv3_add_t;
  1402. #define LSM6DS3TR_C_SLV3_SUBADD 0x0CU
  1403. typedef struct
  1404. {
  1405. uint8_t slave3_reg : 8;
  1406. } lsm6ds3tr_c_slv3_subadd_t;
  1407. #define LSM6DS3TR_C_SLAVE3_CONFIG 0x0DU
  1408. typedef struct
  1409. {
  1410. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1411. uint8_t slave3_numop : 3;
  1412. uint8_t not_used_01 : 3;
  1413. uint8_t slave3_rate : 2;
  1414. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1415. uint8_t slave3_rate : 2;
  1416. uint8_t not_used_01 : 3;
  1417. uint8_t slave3_numop : 3;
  1418. #endif /* DRV_BYTE_ORDER */
  1419. } lsm6ds3tr_c_slave3_config_t;
  1420. #define LSM6DS3TR_C_DATAWRITE_SRC_MODE_SUB_SLV0 0x0EU
  1421. typedef struct
  1422. {
  1423. uint8_t slave_dataw : 8;
  1424. } lsm6ds3tr_c_datawrite_src_mode_sub_slv0_t;
  1425. #define LSM6DS3TR_C_CONFIG_PEDO_THS_MIN 0x0FU
  1426. typedef struct
  1427. {
  1428. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1429. uint8_t ths_min : 5;
  1430. uint8_t not_used_01 : 2;
  1431. uint8_t pedo_fs : 1;
  1432. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1433. uint8_t pedo_fs : 1;
  1434. uint8_t not_used_01 : 2;
  1435. uint8_t ths_min : 5;
  1436. #endif /* DRV_BYTE_ORDER */
  1437. } lsm6ds3tr_c_config_pedo_ths_min_t;
  1438. #define LSM6DS3TR_C_SM_THS 0x13U
  1439. #define LSM6DS3TR_C_PEDO_DEB_REG 0x14U
  1440. typedef struct
  1441. {
  1442. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1443. uint8_t deb_step : 3;
  1444. uint8_t deb_time : 5;
  1445. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1446. uint8_t deb_time : 5;
  1447. uint8_t deb_step : 3;
  1448. #endif /* DRV_BYTE_ORDER */
  1449. } lsm6ds3tr_c_pedo_deb_reg_t;
  1450. #define LSM6DS3TR_C_STEP_COUNT_DELTA 0x15U
  1451. #define LSM6DS3TR_C_MAG_SI_XX 0x24U
  1452. #define LSM6DS3TR_C_MAG_SI_XY 0x25U
  1453. #define LSM6DS3TR_C_MAG_SI_XZ 0x26U
  1454. #define LSM6DS3TR_C_MAG_SI_YX 0x27U
  1455. #define LSM6DS3TR_C_MAG_SI_YY 0x28U
  1456. #define LSM6DS3TR_C_MAG_SI_YZ 0x29U
  1457. #define LSM6DS3TR_C_MAG_SI_ZX 0x2AU
  1458. #define LSM6DS3TR_C_MAG_SI_ZY 0x2BU
  1459. #define LSM6DS3TR_C_MAG_SI_ZZ 0x2CU
  1460. #define LSM6DS3TR_C_MAG_OFFX_L 0x2DU
  1461. #define LSM6DS3TR_C_MAG_OFFX_H 0x2EU
  1462. #define LSM6DS3TR_C_MAG_OFFY_L 0x2FU
  1463. #define LSM6DS3TR_C_MAG_OFFY_H 0x30U
  1464. #define LSM6DS3TR_C_MAG_OFFZ_L 0x31U
  1465. #define LSM6DS3TR_C_MAG_OFFZ_H 0x32U
  1466. #define LSM6DS3TR_C_A_WRIST_TILT_LAT 0x50U
  1467. #define LSM6DS3TR_C_A_WRIST_TILT_THS 0x54U
  1468. #define LSM6DS3TR_C_A_WRIST_TILT_MASK 0x59U
  1469. typedef struct
  1470. {
  1471. #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
  1472. uint8_t not_used_01 : 2;
  1473. uint8_t wrist_tilt_mask_zneg : 1;
  1474. uint8_t wrist_tilt_mask_zpos : 1;
  1475. uint8_t wrist_tilt_mask_yneg : 1;
  1476. uint8_t wrist_tilt_mask_ypos : 1;
  1477. uint8_t wrist_tilt_mask_xneg : 1;
  1478. uint8_t wrist_tilt_mask_xpos : 1;
  1479. #elif DRV_BYTE_ORDER == DRV_BIG_ENDIAN
  1480. uint8_t wrist_tilt_mask_xpos : 1;
  1481. uint8_t wrist_tilt_mask_xneg : 1;
  1482. uint8_t wrist_tilt_mask_ypos : 1;
  1483. uint8_t wrist_tilt_mask_yneg : 1;
  1484. uint8_t wrist_tilt_mask_zpos : 1;
  1485. uint8_t wrist_tilt_mask_zneg : 1;
  1486. uint8_t not_used_01 : 2;
  1487. #endif /* DRV_BYTE_ORDER */
  1488. } lsm6ds3tr_c_a_wrist_tilt_mask_t;
  1489. /**
  1490. * @defgroup LSM6DS3TR_C_Register_Union
  1491. * @brief This union group all the registers having a bit-field
  1492. * description.
  1493. * This union is useful but it's not needed by the driver.
  1494. *
  1495. * REMOVING this union you are compliant with:
  1496. * MISRA-C 2012 [Rule 19.2] -> " Union are not allowed "
  1497. *
  1498. * @{
  1499. *
  1500. */
  1501. typedef union
  1502. {
  1503. lsm6ds3tr_c_func_cfg_access_t func_cfg_access;
  1504. lsm6ds3tr_c_sensor_sync_time_frame_t sensor_sync_time_frame;
  1505. lsm6ds3tr_c_sensor_sync_res_ratio_t sensor_sync_res_ratio;
  1506. lsm6ds3tr_c_fifo_ctrl1_t fifo_ctrl1;
  1507. lsm6ds3tr_c_fifo_ctrl2_t fifo_ctrl2;
  1508. lsm6ds3tr_c_fifo_ctrl3_t fifo_ctrl3;
  1509. lsm6ds3tr_c_fifo_ctrl4_t fifo_ctrl4;
  1510. lsm6ds3tr_c_fifo_ctrl5_t fifo_ctrl5;
  1511. lsm6ds3tr_c_drdy_pulse_cfg_g_t drdy_pulse_cfg_g;
  1512. lsm6ds3tr_c_int1_ctrl_t int1_ctrl;
  1513. lsm6ds3tr_c_int2_ctrl_t int2_ctrl;
  1514. lsm6ds3tr_c_ctrl1_xl_t ctrl1_xl;
  1515. lsm6ds3tr_c_ctrl2_g_t ctrl2_g;
  1516. lsm6ds3tr_c_ctrl3_c_t ctrl3_c;
  1517. lsm6ds3tr_c_ctrl4_c_t ctrl4_c;
  1518. lsm6ds3tr_c_ctrl5_c_t ctrl5_c;
  1519. lsm6ds3tr_c_ctrl6_c_t ctrl6_c;
  1520. lsm6ds3tr_c_ctrl7_g_t ctrl7_g;
  1521. lsm6ds3tr_c_ctrl8_xl_t ctrl8_xl;
  1522. lsm6ds3tr_c_ctrl9_xl_t ctrl9_xl;
  1523. lsm6ds3tr_c_ctrl10_c_t ctrl10_c;
  1524. lsm6ds3tr_c_master_config_t master_config;
  1525. lsm6ds3tr_c_wake_up_src_t wake_up_src;
  1526. lsm6ds3tr_c_tap_src_t tap_src;
  1527. lsm6ds3tr_c_d6d_src_t d6d_src;
  1528. lsm6ds3tr_c_status_reg_t status_reg;
  1529. lsm6ds3tr_c_sensorhub1_reg_t sensorhub1_reg;
  1530. lsm6ds3tr_c_sensorhub2_reg_t sensorhub2_reg;
  1531. lsm6ds3tr_c_sensorhub3_reg_t sensorhub3_reg;
  1532. lsm6ds3tr_c_sensorhub4_reg_t sensorhub4_reg;
  1533. lsm6ds3tr_c_sensorhub5_reg_t sensorhub5_reg;
  1534. lsm6ds3tr_c_sensorhub6_reg_t sensorhub6_reg;
  1535. lsm6ds3tr_c_sensorhub7_reg_t sensorhub7_reg;
  1536. lsm6ds3tr_c_sensorhub8_reg_t sensorhub8_reg;
  1537. lsm6ds3tr_c_sensorhub9_reg_t sensorhub9_reg;
  1538. lsm6ds3tr_c_sensorhub10_reg_t sensorhub10_reg;
  1539. lsm6ds3tr_c_sensorhub11_reg_t sensorhub11_reg;
  1540. lsm6ds3tr_c_sensorhub12_reg_t sensorhub12_reg;
  1541. lsm6ds3tr_c_fifo_status1_t fifo_status1;
  1542. lsm6ds3tr_c_fifo_status2_t fifo_status2;
  1543. lsm6ds3tr_c_fifo_status3_t fifo_status3;
  1544. lsm6ds3tr_c_fifo_status4_t fifo_status4;
  1545. lsm6ds3tr_c_sensorhub13_reg_t sensorhub13_reg;
  1546. lsm6ds3tr_c_sensorhub14_reg_t sensorhub14_reg;
  1547. lsm6ds3tr_c_sensorhub15_reg_t sensorhub15_reg;
  1548. lsm6ds3tr_c_sensorhub16_reg_t sensorhub16_reg;
  1549. lsm6ds3tr_c_sensorhub17_reg_t sensorhub17_reg;
  1550. lsm6ds3tr_c_sensorhub18_reg_t sensorhub18_reg;
  1551. lsm6ds3tr_c_func_src1_t func_src1;
  1552. lsm6ds3tr_c_func_src2_t func_src2;
  1553. lsm6ds3tr_c_wrist_tilt_ia_t wrist_tilt_ia;
  1554. lsm6ds3tr_c_tap_cfg_t tap_cfg;
  1555. lsm6ds3tr_c_tap_ths_6d_t tap_ths_6d;
  1556. lsm6ds3tr_c_int_dur2_t int_dur2;
  1557. lsm6ds3tr_c_wake_up_ths_t wake_up_ths;
  1558. lsm6ds3tr_c_wake_up_dur_t wake_up_dur;
  1559. lsm6ds3tr_c_free_fall_t free_fall;
  1560. lsm6ds3tr_c_md1_cfg_t md1_cfg;
  1561. lsm6ds3tr_c_md2_cfg_t md2_cfg;
  1562. lsm6ds3tr_c_master_cmd_code_t master_cmd_code;
  1563. lsm6ds3tr_c_sens_sync_spi_error_code_t
  1564. sens_sync_spi_error_code;
  1565. lsm6ds3tr_c_slv0_add_t slv0_add;
  1566. lsm6ds3tr_c_slv0_subadd_t slv0_subadd;
  1567. lsm6ds3tr_c_slave0_config_t slave0_config;
  1568. lsm6ds3tr_c_slv1_add_t slv1_add;
  1569. lsm6ds3tr_c_slv1_subadd_t slv1_subadd;
  1570. lsm6ds3tr_c_slave1_config_t slave1_config;
  1571. lsm6ds3tr_c_slv2_add_t slv2_add;
  1572. lsm6ds3tr_c_slv2_subadd_t slv2_subadd;
  1573. lsm6ds3tr_c_slave2_config_t slave2_config;
  1574. lsm6ds3tr_c_slv3_add_t slv3_add;
  1575. lsm6ds3tr_c_slv3_subadd_t slv3_subadd;
  1576. lsm6ds3tr_c_slave3_config_t slave3_config;
  1577. lsm6ds3tr_c_datawrite_src_mode_sub_slv0_t
  1578. datawrite_src_mode_sub_slv0;
  1579. lsm6ds3tr_c_config_pedo_ths_min_t config_pedo_ths_min;
  1580. lsm6ds3tr_c_pedo_deb_reg_t pedo_deb_reg;
  1581. lsm6ds3tr_c_a_wrist_tilt_mask_t a_wrist_tilt_mask;
  1582. bitwise_t bitwise;
  1583. uint8_t byte;
  1584. } lsm6ds3tr_c_reg_t;
  1585. /**
  1586. * @}
  1587. *
  1588. */
  1589. int32_t lsm6ds3tr_c_read_reg(stmdev_ctx_t *ctx, uint8_t reg,
  1590. uint8_t *data,
  1591. uint16_t len);
  1592. int32_t lsm6ds3tr_c_write_reg(stmdev_ctx_t *ctx, uint8_t reg,
  1593. uint8_t *data,
  1594. uint16_t len);
  1595. float_t lsm6ds3tr_c_from_fs2g_to_mg(int16_t lsb);
  1596. float_t lsm6ds3tr_c_from_fs4g_to_mg(int16_t lsb);
  1597. float_t lsm6ds3tr_c_from_fs8g_to_mg(int16_t lsb);
  1598. float_t lsm6ds3tr_c_from_fs16g_to_mg(int16_t lsb);
  1599. float_t lsm6ds3tr_c_from_fs125dps_to_mdps(int16_t lsb);
  1600. float_t lsm6ds3tr_c_from_fs250dps_to_mdps(int16_t lsb);
  1601. float_t lsm6ds3tr_c_from_fs500dps_to_mdps(int16_t lsb);
  1602. float_t lsm6ds3tr_c_from_fs1000dps_to_mdps(int16_t lsb);
  1603. float_t lsm6ds3tr_c_from_fs2000dps_to_mdps(int16_t lsb);
  1604. float_t lsm6ds3tr_c_from_lsb_to_celsius(int16_t lsb);
  1605. typedef enum
  1606. {
  1607. LSM6DS3TR_C_2g = 0,
  1608. LSM6DS3TR_C_16g = 1,
  1609. LSM6DS3TR_C_4g = 2,
  1610. LSM6DS3TR_C_8g = 3,
  1611. LSM6DS3TR_C_XL_FS_ND = 4, /* ERROR CODE */
  1612. } lsm6ds3tr_c_fs_xl_t;
  1613. int32_t lsm6ds3tr_c_xl_full_scale_set(stmdev_ctx_t *ctx,
  1614. lsm6ds3tr_c_fs_xl_t val);
  1615. int32_t lsm6ds3tr_c_xl_full_scale_get(stmdev_ctx_t *ctx,
  1616. lsm6ds3tr_c_fs_xl_t *val);
  1617. typedef enum
  1618. {
  1619. LSM6DS3TR_C_XL_ODR_OFF = 0,
  1620. LSM6DS3TR_C_XL_ODR_12Hz5 = 1,
  1621. LSM6DS3TR_C_XL_ODR_26Hz = 2,
  1622. LSM6DS3TR_C_XL_ODR_52Hz = 3,
  1623. LSM6DS3TR_C_XL_ODR_104Hz = 4,
  1624. LSM6DS3TR_C_XL_ODR_208Hz = 5,
  1625. LSM6DS3TR_C_XL_ODR_416Hz = 6,
  1626. LSM6DS3TR_C_XL_ODR_833Hz = 7,
  1627. LSM6DS3TR_C_XL_ODR_1k66Hz = 8,
  1628. LSM6DS3TR_C_XL_ODR_3k33Hz = 9,
  1629. LSM6DS3TR_C_XL_ODR_6k66Hz = 10,
  1630. LSM6DS3TR_C_XL_ODR_1Hz6 = 11,
  1631. LSM6DS3TR_C_XL_ODR_ND = 12, /* ERROR CODE */
  1632. } lsm6ds3tr_c_odr_xl_t;
  1633. int32_t lsm6ds3tr_c_xl_data_rate_set(stmdev_ctx_t *ctx,
  1634. lsm6ds3tr_c_odr_xl_t val);
  1635. int32_t lsm6ds3tr_c_xl_data_rate_get(stmdev_ctx_t *ctx,
  1636. lsm6ds3tr_c_odr_xl_t *val);
  1637. typedef enum
  1638. {
  1639. LSM6DS3TR_C_250dps = 0,
  1640. LSM6DS3TR_C_125dps = 1,
  1641. LSM6DS3TR_C_500dps = 2,
  1642. LSM6DS3TR_C_1000dps = 4,
  1643. LSM6DS3TR_C_2000dps = 6,
  1644. LSM6DS3TR_C_GY_FS_ND = 7, /* ERROR CODE */
  1645. } lsm6ds3tr_c_fs_g_t;
  1646. int32_t lsm6ds3tr_c_gy_full_scale_set(stmdev_ctx_t *ctx,
  1647. lsm6ds3tr_c_fs_g_t val);
  1648. int32_t lsm6ds3tr_c_gy_full_scale_get(stmdev_ctx_t *ctx,
  1649. lsm6ds3tr_c_fs_g_t *val);
  1650. typedef enum
  1651. {
  1652. LSM6DS3TR_C_GY_ODR_OFF = 0,
  1653. LSM6DS3TR_C_GY_ODR_12Hz5 = 1,
  1654. LSM6DS3TR_C_GY_ODR_26Hz = 2,
  1655. LSM6DS3TR_C_GY_ODR_52Hz = 3,
  1656. LSM6DS3TR_C_GY_ODR_104Hz = 4,
  1657. LSM6DS3TR_C_GY_ODR_208Hz = 5,
  1658. LSM6DS3TR_C_GY_ODR_416Hz = 6,
  1659. LSM6DS3TR_C_GY_ODR_833Hz = 7,
  1660. LSM6DS3TR_C_GY_ODR_1k66Hz = 8,
  1661. LSM6DS3TR_C_GY_ODR_3k33Hz = 9,
  1662. LSM6DS3TR_C_GY_ODR_6k66Hz = 10,
  1663. LSM6DS3TR_C_GY_ODR_ND = 11, /* ERROR CODE */
  1664. } lsm6ds3tr_c_odr_g_t;
  1665. int32_t lsm6ds3tr_c_gy_data_rate_set(stmdev_ctx_t *ctx,
  1666. lsm6ds3tr_c_odr_g_t val);
  1667. int32_t lsm6ds3tr_c_gy_data_rate_get(stmdev_ctx_t *ctx,
  1668. lsm6ds3tr_c_odr_g_t *val);
  1669. int32_t lsm6ds3tr_c_block_data_update_set(stmdev_ctx_t *ctx,
  1670. uint8_t val);
  1671. int32_t lsm6ds3tr_c_block_data_update_get(stmdev_ctx_t *ctx,
  1672. uint8_t *val);
  1673. typedef enum
  1674. {
  1675. LSM6DS3TR_C_LSb_1mg = 0,
  1676. LSM6DS3TR_C_LSb_16mg = 1,
  1677. LSM6DS3TR_C_WEIGHT_ND = 2,
  1678. } lsm6ds3tr_c_usr_off_w_t;
  1679. int32_t lsm6ds3tr_c_xl_offset_weight_set(stmdev_ctx_t *ctx,
  1680. lsm6ds3tr_c_usr_off_w_t val);
  1681. int32_t lsm6ds3tr_c_xl_offset_weight_get(stmdev_ctx_t *ctx,
  1682. lsm6ds3tr_c_usr_off_w_t *val);
  1683. typedef enum
  1684. {
  1685. LSM6DS3TR_C_XL_HIGH_PERFORMANCE = 0,
  1686. LSM6DS3TR_C_XL_NORMAL = 1,
  1687. LSM6DS3TR_C_XL_PW_MODE_ND = 2, /* ERROR CODE */
  1688. } lsm6ds3tr_c_xl_hm_mode_t;
  1689. int32_t lsm6ds3tr_c_xl_power_mode_set(stmdev_ctx_t *ctx,
  1690. lsm6ds3tr_c_xl_hm_mode_t val);
  1691. int32_t lsm6ds3tr_c_xl_power_mode_get(stmdev_ctx_t *ctx,
  1692. lsm6ds3tr_c_xl_hm_mode_t *val);
  1693. typedef enum
  1694. {
  1695. LSM6DS3TR_C_STAT_RND_DISABLE = 0,
  1696. LSM6DS3TR_C_STAT_RND_ENABLE = 1,
  1697. LSM6DS3TR_C_STAT_RND_ND = 2, /* ERROR CODE */
  1698. } lsm6ds3tr_c_rounding_status_t;
  1699. int32_t lsm6ds3tr_c_rounding_on_status_set(stmdev_ctx_t *ctx,
  1700. lsm6ds3tr_c_rounding_status_t val);
  1701. int32_t lsm6ds3tr_c_rounding_on_status_get(stmdev_ctx_t *ctx,
  1702. lsm6ds3tr_c_rounding_status_t *val);
  1703. typedef enum
  1704. {
  1705. LSM6DS3TR_C_GY_HIGH_PERFORMANCE = 0,
  1706. LSM6DS3TR_C_GY_NORMAL = 1,
  1707. LSM6DS3TR_C_GY_PW_MODE_ND = 2, /* ERROR CODE */
  1708. } lsm6ds3tr_c_g_hm_mode_t;
  1709. int32_t lsm6ds3tr_c_gy_power_mode_set(stmdev_ctx_t *ctx,
  1710. lsm6ds3tr_c_g_hm_mode_t val);
  1711. int32_t lsm6ds3tr_c_gy_power_mode_get(stmdev_ctx_t *ctx,
  1712. lsm6ds3tr_c_g_hm_mode_t *val);
  1713. typedef struct
  1714. {
  1715. lsm6ds3tr_c_wake_up_src_t wake_up_src;
  1716. lsm6ds3tr_c_tap_src_t tap_src;
  1717. lsm6ds3tr_c_d6d_src_t d6d_src;
  1718. lsm6ds3tr_c_status_reg_t status_reg;
  1719. lsm6ds3tr_c_func_src1_t func_src1;
  1720. lsm6ds3tr_c_func_src2_t func_src2;
  1721. lsm6ds3tr_c_wrist_tilt_ia_t wrist_tilt_ia;
  1722. lsm6ds3tr_c_a_wrist_tilt_mask_t a_wrist_tilt_mask;
  1723. } lsm6ds3tr_c_all_sources_t;
  1724. int32_t lsm6ds3tr_c_all_sources_get(stmdev_ctx_t *ctx,
  1725. lsm6ds3tr_c_all_sources_t *val);
  1726. int32_t lsm6ds3tr_c_status_reg_get(stmdev_ctx_t *ctx,
  1727. lsm6ds3tr_c_status_reg_t *val);
  1728. int32_t lsm6ds3tr_c_xl_flag_data_ready_get(stmdev_ctx_t *ctx,
  1729. uint8_t *val);
  1730. int32_t lsm6ds3tr_c_gy_flag_data_ready_get(stmdev_ctx_t *ctx,
  1731. uint8_t *val);
  1732. int32_t lsm6ds3tr_c_temp_flag_data_ready_get(stmdev_ctx_t *ctx,
  1733. uint8_t *val);
  1734. int32_t lsm6ds3tr_c_xl_usr_offset_set(stmdev_ctx_t *ctx,
  1735. uint8_t *buff);
  1736. int32_t lsm6ds3tr_c_xl_usr_offset_get(stmdev_ctx_t *ctx,
  1737. uint8_t *buff);
  1738. int32_t lsm6ds3tr_c_timestamp_set(stmdev_ctx_t *ctx, uint8_t val);
  1739. int32_t lsm6ds3tr_c_timestamp_get(stmdev_ctx_t *ctx, uint8_t *val);
  1740. typedef enum
  1741. {
  1742. LSM6DS3TR_C_LSB_6ms4 = 0,
  1743. LSM6DS3TR_C_LSB_25us = 1,
  1744. LSM6DS3TR_C_TS_RES_ND = 2, /* ERROR CODE */
  1745. } lsm6ds3tr_c_timer_hr_t;
  1746. int32_t lsm6ds3tr_c_timestamp_res_set(stmdev_ctx_t *ctx,
  1747. lsm6ds3tr_c_timer_hr_t val);
  1748. int32_t lsm6ds3tr_c_timestamp_res_get(stmdev_ctx_t *ctx,
  1749. lsm6ds3tr_c_timer_hr_t *val);
  1750. typedef enum
  1751. {
  1752. LSM6DS3TR_C_ROUND_DISABLE = 0,
  1753. LSM6DS3TR_C_ROUND_XL = 1,
  1754. LSM6DS3TR_C_ROUND_GY = 2,
  1755. LSM6DS3TR_C_ROUND_GY_XL = 3,
  1756. LSM6DS3TR_C_ROUND_SH1_TO_SH6 = 4,
  1757. LSM6DS3TR_C_ROUND_XL_SH1_TO_SH6 = 5,
  1758. LSM6DS3TR_C_ROUND_GY_XL_SH1_TO_SH12 = 6,
  1759. LSM6DS3TR_C_ROUND_GY_XL_SH1_TO_SH6 = 7,
  1760. LSM6DS3TR_C_ROUND_OUT_ND = 8, /* ERROR CODE */
  1761. } lsm6ds3tr_c_rounding_t;
  1762. int32_t lsm6ds3tr_c_rounding_mode_set(stmdev_ctx_t *ctx,
  1763. lsm6ds3tr_c_rounding_t val);
  1764. int32_t lsm6ds3tr_c_rounding_mode_get(stmdev_ctx_t *ctx,
  1765. lsm6ds3tr_c_rounding_t *val);
  1766. int32_t lsm6ds3tr_c_temperature_raw_get(stmdev_ctx_t *ctx,
  1767. int16_t *val);
  1768. int32_t lsm6ds3tr_c_angular_rate_raw_get(stmdev_ctx_t *ctx,
  1769. int16_t *val);
  1770. int32_t lsm6ds3tr_c_acceleration_raw_get(stmdev_ctx_t *ctx,
  1771. int16_t *val);
  1772. int32_t lsm6ds3tr_c_mag_calibrated_raw_get(stmdev_ctx_t *ctx,
  1773. int16_t *val);
  1774. int32_t lsm6ds3tr_c_fifo_raw_data_get(stmdev_ctx_t *ctx,
  1775. uint8_t *buffer,
  1776. uint8_t len);
  1777. typedef enum
  1778. {
  1779. LSM6DS3TR_C_USER_BANK = 0,
  1780. LSM6DS3TR_C_BANK_A = 4,
  1781. LSM6DS3TR_C_BANK_B = 5,
  1782. LSM6DS3TR_C_BANK_ND = 6, /* ERROR CODE */
  1783. } lsm6ds3tr_c_func_cfg_en_t;
  1784. int32_t lsm6ds3tr_c_mem_bank_set(stmdev_ctx_t *ctx,
  1785. lsm6ds3tr_c_func_cfg_en_t val);
  1786. int32_t lsm6ds3tr_c_mem_bank_get(stmdev_ctx_t *ctx,
  1787. lsm6ds3tr_c_func_cfg_en_t *val);
  1788. typedef enum
  1789. {
  1790. LSM6DS3TR_C_DRDY_LATCHED = 0,
  1791. LSM6DS3TR_C_DRDY_PULSED = 1,
  1792. LSM6DS3TR_C_DRDY_ND = 2, /* ERROR CODE */
  1793. } lsm6ds3tr_c_drdy_pulsed_g_t;
  1794. int32_t lsm6ds3tr_c_data_ready_mode_set(stmdev_ctx_t *ctx,
  1795. lsm6ds3tr_c_drdy_pulsed_g_t val);
  1796. int32_t lsm6ds3tr_c_data_ready_mode_get(stmdev_ctx_t *ctx,
  1797. lsm6ds3tr_c_drdy_pulsed_g_t *val);
  1798. int32_t lsm6ds3tr_c_device_id_get(stmdev_ctx_t *ctx, uint8_t *buff);
  1799. int32_t lsm6ds3tr_c_reset_set(stmdev_ctx_t *ctx, uint8_t val);
  1800. int32_t lsm6ds3tr_c_reset_get(stmdev_ctx_t *ctx, uint8_t *val);
  1801. typedef enum
  1802. {
  1803. LSM6DS3TR_C_LSB_AT_LOW_ADD = 0,
  1804. LSM6DS3TR_C_MSB_AT_LOW_ADD = 1,
  1805. LSM6DS3TR_C_DATA_FMT_ND = 2, /* ERROR CODE */
  1806. } lsm6ds3tr_c_ble_t;
  1807. int32_t lsm6ds3tr_c_data_format_set(stmdev_ctx_t *ctx,
  1808. lsm6ds3tr_c_ble_t val);
  1809. int32_t lsm6ds3tr_c_data_format_get(stmdev_ctx_t *ctx,
  1810. lsm6ds3tr_c_ble_t *val);
  1811. int32_t lsm6ds3tr_c_auto_increment_set(stmdev_ctx_t *ctx,
  1812. uint8_t val);
  1813. int32_t lsm6ds3tr_c_auto_increment_get(stmdev_ctx_t *ctx,
  1814. uint8_t *val);
  1815. int32_t lsm6ds3tr_c_boot_set(stmdev_ctx_t *ctx, uint8_t val);
  1816. int32_t lsm6ds3tr_c_boot_get(stmdev_ctx_t *ctx, uint8_t *val);
  1817. typedef enum
  1818. {
  1819. LSM6DS3TR_C_XL_ST_DISABLE = 0,
  1820. LSM6DS3TR_C_XL_ST_POSITIVE = 1,
  1821. LSM6DS3TR_C_XL_ST_NEGATIVE = 2,
  1822. LSM6DS3TR_C_XL_ST_ND = 3, /* ERROR CODE */
  1823. } lsm6ds3tr_c_st_xl_t;
  1824. int32_t lsm6ds3tr_c_xl_self_test_set(stmdev_ctx_t *ctx,
  1825. lsm6ds3tr_c_st_xl_t val);
  1826. int32_t lsm6ds3tr_c_xl_self_test_get(stmdev_ctx_t *ctx,
  1827. lsm6ds3tr_c_st_xl_t *val);
  1828. typedef enum
  1829. {
  1830. LSM6DS3TR_C_GY_ST_DISABLE = 0,
  1831. LSM6DS3TR_C_GY_ST_POSITIVE = 1,
  1832. LSM6DS3TR_C_GY_ST_NEGATIVE = 3,
  1833. LSM6DS3TR_C_GY_ST_ND = 4, /* ERROR CODE */
  1834. } lsm6ds3tr_c_st_g_t;
  1835. int32_t lsm6ds3tr_c_gy_self_test_set(stmdev_ctx_t *ctx,
  1836. lsm6ds3tr_c_st_g_t val);
  1837. int32_t lsm6ds3tr_c_gy_self_test_get(stmdev_ctx_t *ctx,
  1838. lsm6ds3tr_c_st_g_t *val);
  1839. int32_t lsm6ds3tr_c_filter_settling_mask_set(stmdev_ctx_t *ctx,
  1840. uint8_t val);
  1841. int32_t lsm6ds3tr_c_filter_settling_mask_get(stmdev_ctx_t *ctx,
  1842. uint8_t *val);
  1843. typedef enum
  1844. {
  1845. LSM6DS3TR_C_USE_SLOPE = 0,
  1846. LSM6DS3TR_C_USE_HPF = 1,
  1847. LSM6DS3TR_C_HP_PATH_ND = 2, /* ERROR CODE */
  1848. } lsm6ds3tr_c_slope_fds_t;
  1849. int32_t lsm6ds3tr_c_xl_hp_path_internal_set(stmdev_ctx_t *ctx,
  1850. lsm6ds3tr_c_slope_fds_t val);
  1851. int32_t lsm6ds3tr_c_xl_hp_path_internal_get(stmdev_ctx_t *ctx,
  1852. lsm6ds3tr_c_slope_fds_t *val);
  1853. typedef enum
  1854. {
  1855. LSM6DS3TR_C_XL_ANA_BW_1k5Hz = 0,
  1856. LSM6DS3TR_C_XL_ANA_BW_400Hz = 1,
  1857. LSM6DS3TR_C_XL_ANA_BW_ND = 2, /* ERROR CODE */
  1858. } lsm6ds3tr_c_bw0_xl_t;
  1859. int32_t lsm6ds3tr_c_xl_filter_analog_set(stmdev_ctx_t *ctx,
  1860. lsm6ds3tr_c_bw0_xl_t val);
  1861. int32_t lsm6ds3tr_c_xl_filter_analog_get(stmdev_ctx_t *ctx,
  1862. lsm6ds3tr_c_bw0_xl_t *val);
  1863. typedef enum
  1864. {
  1865. LSM6DS3TR_C_XL_LP1_ODR_DIV_2 = 0,
  1866. LSM6DS3TR_C_XL_LP1_ODR_DIV_4 = 1,
  1867. LSM6DS3TR_C_XL_LP1_NA = 2, /* ERROR CODE */
  1868. } lsm6ds3tr_c_lpf1_bw_sel_t;
  1869. int32_t lsm6ds3tr_c_xl_lp1_bandwidth_set(stmdev_ctx_t *ctx,
  1870. lsm6ds3tr_c_lpf1_bw_sel_t val);
  1871. int32_t lsm6ds3tr_c_xl_lp1_bandwidth_get(stmdev_ctx_t *ctx,
  1872. lsm6ds3tr_c_lpf1_bw_sel_t *val);
  1873. typedef enum
  1874. {
  1875. LSM6DS3TR_C_XL_LOW_LAT_LP_ODR_DIV_50 = 0x00,
  1876. LSM6DS3TR_C_XL_LOW_LAT_LP_ODR_DIV_100 = 0x01,
  1877. LSM6DS3TR_C_XL_LOW_LAT_LP_ODR_DIV_9 = 0x02,
  1878. LSM6DS3TR_C_XL_LOW_LAT_LP_ODR_DIV_400 = 0x03,
  1879. LSM6DS3TR_C_XL_LOW_NOISE_LP_ODR_DIV_50 = 0x10,
  1880. LSM6DS3TR_C_XL_LOW_NOISE_LP_ODR_DIV_100 = 0x11,
  1881. LSM6DS3TR_C_XL_LOW_NOISE_LP_ODR_DIV_9 = 0x12,
  1882. LSM6DS3TR_C_XL_LOW_NOISE_LP_ODR_DIV_400 = 0x13,
  1883. LSM6DS3TR_C_XL_LP_NA = 0x20, /* ERROR CODE */
  1884. } lsm6ds3tr_c_input_composite_t;
  1885. int32_t lsm6ds3tr_c_xl_lp2_bandwidth_set(stmdev_ctx_t *ctx,
  1886. lsm6ds3tr_c_input_composite_t val);
  1887. int32_t lsm6ds3tr_c_xl_lp2_bandwidth_get(stmdev_ctx_t *ctx,
  1888. lsm6ds3tr_c_input_composite_t *val);
  1889. int32_t lsm6ds3tr_c_xl_reference_mode_set(stmdev_ctx_t *ctx,
  1890. uint8_t val);
  1891. int32_t lsm6ds3tr_c_xl_reference_mode_get(stmdev_ctx_t *ctx,
  1892. uint8_t *val);
  1893. typedef enum
  1894. {
  1895. LSM6DS3TR_C_XL_HP_ODR_DIV_4 = 0x00, /* Slope filter */
  1896. LSM6DS3TR_C_XL_HP_ODR_DIV_100 = 0x01,
  1897. LSM6DS3TR_C_XL_HP_ODR_DIV_9 = 0x02,
  1898. LSM6DS3TR_C_XL_HP_ODR_DIV_400 = 0x03,
  1899. LSM6DS3TR_C_XL_HP_NA = 0x10, /* ERROR CODE */
  1900. } lsm6ds3tr_c_hpcf_xl_t;
  1901. int32_t lsm6ds3tr_c_xl_hp_bandwidth_set(stmdev_ctx_t *ctx,
  1902. lsm6ds3tr_c_hpcf_xl_t val);
  1903. int32_t lsm6ds3tr_c_xl_hp_bandwidth_get(stmdev_ctx_t *ctx,
  1904. lsm6ds3tr_c_hpcf_xl_t *val);
  1905. typedef enum
  1906. {
  1907. LSM6DS3TR_C_LP2_ONLY = 0x00,
  1908. LSM6DS3TR_C_HP_16mHz_LP2 = 0x80,
  1909. LSM6DS3TR_C_HP_65mHz_LP2 = 0x90,
  1910. LSM6DS3TR_C_HP_260mHz_LP2 = 0xA0,
  1911. LSM6DS3TR_C_HP_1Hz04_LP2 = 0xB0,
  1912. LSM6DS3TR_C_HP_DISABLE_LP1_LIGHT = 0x0A,
  1913. LSM6DS3TR_C_HP_DISABLE_LP1_NORMAL = 0x09,
  1914. LSM6DS3TR_C_HP_DISABLE_LP_STRONG = 0x08,
  1915. LSM6DS3TR_C_HP_DISABLE_LP1_AGGRESSIVE = 0x0B,
  1916. LSM6DS3TR_C_HP_16mHz_LP1_LIGHT = 0x8A,
  1917. LSM6DS3TR_C_HP_65mHz_LP1_NORMAL = 0x99,
  1918. LSM6DS3TR_C_HP_260mHz_LP1_STRONG = 0xA8,
  1919. LSM6DS3TR_C_HP_1Hz04_LP1_AGGRESSIVE = 0xBB,
  1920. LSM6DS3TR_C_HP_GY_BAND_NA = 0xFF, /* ERROR CODE */
  1921. } lsm6ds3tr_c_lpf1_sel_g_t;
  1922. int32_t lsm6ds3tr_c_gy_band_pass_set(stmdev_ctx_t *ctx,
  1923. lsm6ds3tr_c_lpf1_sel_g_t val);
  1924. int32_t lsm6ds3tr_c_gy_band_pass_get(stmdev_ctx_t *ctx,
  1925. lsm6ds3tr_c_lpf1_sel_g_t *val);
  1926. typedef enum
  1927. {
  1928. LSM6DS3TR_C_SPI_4_WIRE = 0,
  1929. LSM6DS3TR_C_SPI_3_WIRE = 1,
  1930. LSM6DS3TR_C_SPI_MODE_ND = 2, /* ERROR CODE */
  1931. } lsm6ds3tr_c_sim_t;
  1932. int32_t lsm6ds3tr_c_spi_mode_set(stmdev_ctx_t *ctx,
  1933. lsm6ds3tr_c_sim_t val);
  1934. int32_t lsm6ds3tr_c_spi_mode_get(stmdev_ctx_t *ctx,
  1935. lsm6ds3tr_c_sim_t *val);
  1936. typedef enum
  1937. {
  1938. LSM6DS3TR_C_I2C_ENABLE = 0,
  1939. LSM6DS3TR_C_I2C_DISABLE = 1,
  1940. LSM6DS3TR_C_I2C_MODE_ND = 2, /* ERROR CODE */
  1941. } lsm6ds3tr_c_i2c_disable_t;
  1942. int32_t lsm6ds3tr_c_i2c_interface_set(stmdev_ctx_t *ctx,
  1943. lsm6ds3tr_c_i2c_disable_t val);
  1944. int32_t lsm6ds3tr_c_i2c_interface_get(stmdev_ctx_t *ctx,
  1945. lsm6ds3tr_c_i2c_disable_t *val);
  1946. typedef struct
  1947. {
  1948. uint8_t int1_drdy_xl : 1;
  1949. uint8_t int1_drdy_g : 1;
  1950. uint8_t int1_boot : 1;
  1951. uint8_t int1_fth : 1;
  1952. uint8_t int1_fifo_ovr : 1;
  1953. uint8_t int1_full_flag : 1;
  1954. uint8_t int1_sign_mot : 1;
  1955. uint8_t int1_step_detector : 1;
  1956. uint8_t int1_timer : 1;
  1957. uint8_t int1_tilt : 1;
  1958. uint8_t int1_6d : 1;
  1959. uint8_t int1_double_tap : 1;
  1960. uint8_t int1_ff : 1;
  1961. uint8_t int1_wu : 1;
  1962. uint8_t int1_single_tap : 1;
  1963. uint8_t int1_inact_state : 1;
  1964. uint8_t den_drdy_int1 : 1;
  1965. uint8_t drdy_on_int1 : 1;
  1966. } lsm6ds3tr_c_int1_route_t;
  1967. int32_t lsm6ds3tr_c_pin_int1_route_set(stmdev_ctx_t *ctx,
  1968. lsm6ds3tr_c_int1_route_t val);
  1969. int32_t lsm6ds3tr_c_pin_int1_route_get(stmdev_ctx_t *ctx,
  1970. lsm6ds3tr_c_int1_route_t *val);
  1971. typedef struct
  1972. {
  1973. uint8_t int2_drdy_xl : 1;
  1974. uint8_t int2_drdy_g : 1;
  1975. uint8_t int2_drdy_temp : 1;
  1976. uint8_t int2_fth : 1;
  1977. uint8_t int2_fifo_ovr : 1;
  1978. uint8_t int2_full_flag : 1;
  1979. uint8_t int2_step_count_ov : 1;
  1980. uint8_t int2_step_delta : 1;
  1981. uint8_t int2_iron : 1;
  1982. uint8_t int2_tilt : 1;
  1983. uint8_t int2_6d : 1;
  1984. uint8_t int2_double_tap : 1;
  1985. uint8_t int2_ff : 1;
  1986. uint8_t int2_wu : 1;
  1987. uint8_t int2_single_tap : 1;
  1988. uint8_t int2_inact_state : 1;
  1989. uint8_t int2_wrist_tilt : 1;
  1990. } lsm6ds3tr_c_int2_route_t;
  1991. int32_t lsm6ds3tr_c_pin_int2_route_set(stmdev_ctx_t *ctx,
  1992. lsm6ds3tr_c_int2_route_t val);
  1993. int32_t lsm6ds3tr_c_pin_int2_route_get(stmdev_ctx_t *ctx,
  1994. lsm6ds3tr_c_int2_route_t *val);
  1995. typedef enum
  1996. {
  1997. LSM6DS3TR_C_PUSH_PULL = 0,
  1998. LSM6DS3TR_C_OPEN_DRAIN = 1,
  1999. LSM6DS3TR_C_PIN_MODE_ND = 2, /* ERROR CODE */
  2000. } lsm6ds3tr_c_pp_od_t;
  2001. int32_t lsm6ds3tr_c_pin_mode_set(stmdev_ctx_t *ctx,
  2002. lsm6ds3tr_c_pp_od_t val);
  2003. int32_t lsm6ds3tr_c_pin_mode_get(stmdev_ctx_t *ctx,
  2004. lsm6ds3tr_c_pp_od_t *val);
  2005. typedef enum
  2006. {
  2007. LSM6DS3TR_C_ACTIVE_HIGH = 0,
  2008. LSM6DS3TR_C_ACTIVE_LOW = 1,
  2009. LSM6DS3TR_C_POLARITY_ND = 2, /* ERROR CODE */
  2010. } lsm6ds3tr_c_h_lactive_t;
  2011. int32_t lsm6ds3tr_c_pin_polarity_set(stmdev_ctx_t *ctx,
  2012. lsm6ds3tr_c_h_lactive_t val);
  2013. int32_t lsm6ds3tr_c_pin_polarity_get(stmdev_ctx_t *ctx,
  2014. lsm6ds3tr_c_h_lactive_t *val);
  2015. int32_t lsm6ds3tr_c_all_on_int1_set(stmdev_ctx_t *ctx, uint8_t val);
  2016. int32_t lsm6ds3tr_c_all_on_int1_get(stmdev_ctx_t *ctx, uint8_t *val);
  2017. typedef enum
  2018. {
  2019. LSM6DS3TR_C_INT_PULSED = 0,
  2020. LSM6DS3TR_C_INT_LATCHED = 1,
  2021. LSM6DS3TR_C_INT_MODE = 2, /* ERROR CODE */
  2022. } lsm6ds3tr_c_lir_t;
  2023. int32_t lsm6ds3tr_c_int_notification_set(stmdev_ctx_t *ctx,
  2024. lsm6ds3tr_c_lir_t val);
  2025. int32_t lsm6ds3tr_c_int_notification_get(stmdev_ctx_t *ctx,
  2026. lsm6ds3tr_c_lir_t *val);
  2027. int32_t lsm6ds3tr_c_wkup_threshold_set(stmdev_ctx_t *ctx,
  2028. uint8_t val);
  2029. int32_t lsm6ds3tr_c_wkup_threshold_get(stmdev_ctx_t *ctx,
  2030. uint8_t *val);
  2031. int32_t lsm6ds3tr_c_wkup_dur_set(stmdev_ctx_t *ctx, uint8_t val);
  2032. int32_t lsm6ds3tr_c_wkup_dur_get(stmdev_ctx_t *ctx, uint8_t *val);
  2033. int32_t lsm6ds3tr_c_gy_sleep_mode_set(stmdev_ctx_t *ctx, uint8_t val);
  2034. int32_t lsm6ds3tr_c_gy_sleep_mode_get(stmdev_ctx_t *ctx,
  2035. uint8_t *val);
  2036. typedef enum
  2037. {
  2038. LSM6DS3TR_C_PROPERTY_DISABLE = 0,
  2039. LSM6DS3TR_C_XL_12Hz5_GY_NOT_AFFECTED = 1,
  2040. LSM6DS3TR_C_XL_12Hz5_GY_SLEEP = 2,
  2041. LSM6DS3TR_C_XL_12Hz5_GY_PD = 3,
  2042. LSM6DS3TR_C_ACT_MODE_ND = 4, /* ERROR CODE */
  2043. } lsm6ds3tr_c_inact_en_t;
  2044. int32_t lsm6ds3tr_c_act_mode_set(stmdev_ctx_t *ctx,
  2045. lsm6ds3tr_c_inact_en_t val);
  2046. int32_t lsm6ds3tr_c_act_mode_get(stmdev_ctx_t *ctx,
  2047. lsm6ds3tr_c_inact_en_t *val);
  2048. int32_t lsm6ds3tr_c_act_sleep_dur_set(stmdev_ctx_t *ctx, uint8_t val);
  2049. int32_t lsm6ds3tr_c_act_sleep_dur_get(stmdev_ctx_t *ctx,
  2050. uint8_t *val);
  2051. int32_t lsm6ds3tr_c_tap_src_get(stmdev_ctx_t *ctx,
  2052. lsm6ds3tr_c_tap_src_t *val);
  2053. int32_t lsm6ds3tr_c_tap_detection_on_z_set(stmdev_ctx_t *ctx,
  2054. uint8_t val);
  2055. int32_t lsm6ds3tr_c_tap_detection_on_z_get(stmdev_ctx_t *ctx,
  2056. uint8_t *val);
  2057. int32_t lsm6ds3tr_c_tap_detection_on_y_set(stmdev_ctx_t *ctx,
  2058. uint8_t val);
  2059. int32_t lsm6ds3tr_c_tap_detection_on_y_get(stmdev_ctx_t *ctx,
  2060. uint8_t *val);
  2061. int32_t lsm6ds3tr_c_tap_detection_on_x_set(stmdev_ctx_t *ctx,
  2062. uint8_t val);
  2063. int32_t lsm6ds3tr_c_tap_detection_on_x_get(stmdev_ctx_t *ctx,
  2064. uint8_t *val);
  2065. int32_t lsm6ds3tr_c_tap_threshold_x_set(stmdev_ctx_t *ctx,
  2066. uint8_t val);
  2067. int32_t lsm6ds3tr_c_tap_threshold_x_get(stmdev_ctx_t *ctx,
  2068. uint8_t *val);
  2069. int32_t lsm6ds3tr_c_tap_shock_set(stmdev_ctx_t *ctx, uint8_t val);
  2070. int32_t lsm6ds3tr_c_tap_shock_get(stmdev_ctx_t *ctx, uint8_t *val);
  2071. int32_t lsm6ds3tr_c_tap_quiet_set(stmdev_ctx_t *ctx, uint8_t val);
  2072. int32_t lsm6ds3tr_c_tap_quiet_get(stmdev_ctx_t *ctx, uint8_t *val);
  2073. int32_t lsm6ds3tr_c_tap_dur_set(stmdev_ctx_t *ctx, uint8_t val);
  2074. int32_t lsm6ds3tr_c_tap_dur_get(stmdev_ctx_t *ctx, uint8_t *val);
  2075. typedef enum
  2076. {
  2077. LSM6DS3TR_C_ONLY_SINGLE = 0,
  2078. LSM6DS3TR_C_BOTH_SINGLE_DOUBLE = 1,
  2079. LSM6DS3TR_C_TAP_MODE_ND = 2, /* ERROR CODE */
  2080. } lsm6ds3tr_c_single_double_tap_t;
  2081. int32_t lsm6ds3tr_c_tap_mode_set(stmdev_ctx_t *ctx,
  2082. lsm6ds3tr_c_single_double_tap_t val);
  2083. int32_t lsm6ds3tr_c_tap_mode_get(stmdev_ctx_t *ctx,
  2084. lsm6ds3tr_c_single_double_tap_t *val);
  2085. typedef enum
  2086. {
  2087. LSM6DS3TR_C_ODR_DIV_2_FEED = 0,
  2088. LSM6DS3TR_C_LPF2_FEED = 1,
  2089. LSM6DS3TR_C_6D_FEED_ND = 2, /* ERROR CODE */
  2090. } lsm6ds3tr_c_low_pass_on_6d_t;
  2091. int32_t lsm6ds3tr_c_6d_feed_data_set(stmdev_ctx_t *ctx,
  2092. lsm6ds3tr_c_low_pass_on_6d_t val);
  2093. int32_t lsm6ds3tr_c_6d_feed_data_get(stmdev_ctx_t *ctx,
  2094. lsm6ds3tr_c_low_pass_on_6d_t *val);
  2095. typedef enum
  2096. {
  2097. LSM6DS3TR_C_DEG_80 = 0,
  2098. LSM6DS3TR_C_DEG_70 = 1,
  2099. LSM6DS3TR_C_DEG_60 = 2,
  2100. LSM6DS3TR_C_DEG_50 = 3,
  2101. LSM6DS3TR_C_6D_TH_ND = 4, /* ERROR CODE */
  2102. } lsm6ds3tr_c_sixd_ths_t;
  2103. int32_t lsm6ds3tr_c_6d_threshold_set(stmdev_ctx_t *ctx,
  2104. lsm6ds3tr_c_sixd_ths_t val);
  2105. int32_t lsm6ds3tr_c_6d_threshold_get(stmdev_ctx_t *ctx,
  2106. lsm6ds3tr_c_sixd_ths_t *val);
  2107. int32_t lsm6ds3tr_c_4d_mode_set(stmdev_ctx_t *ctx, uint8_t val);
  2108. int32_t lsm6ds3tr_c_4d_mode_get(stmdev_ctx_t *ctx, uint8_t *val);
  2109. int32_t lsm6ds3tr_c_ff_dur_set(stmdev_ctx_t *ctx, uint8_t val);
  2110. int32_t lsm6ds3tr_c_ff_dur_get(stmdev_ctx_t *ctx, uint8_t *val);
  2111. typedef enum
  2112. {
  2113. LSM6DS3TR_C_FF_TSH_156mg = 0,
  2114. LSM6DS3TR_C_FF_TSH_219mg = 1,
  2115. LSM6DS3TR_C_FF_TSH_250mg = 2,
  2116. LSM6DS3TR_C_FF_TSH_312mg = 3,
  2117. LSM6DS3TR_C_FF_TSH_344mg = 4,
  2118. LSM6DS3TR_C_FF_TSH_406mg = 5,
  2119. LSM6DS3TR_C_FF_TSH_469mg = 6,
  2120. LSM6DS3TR_C_FF_TSH_500mg = 7,
  2121. LSM6DS3TR_C_FF_TSH_ND = 8, /* ERROR CODE */
  2122. } lsm6ds3tr_c_ff_ths_t;
  2123. int32_t lsm6ds3tr_c_ff_threshold_set(stmdev_ctx_t *ctx,
  2124. lsm6ds3tr_c_ff_ths_t val);
  2125. int32_t lsm6ds3tr_c_ff_threshold_get(stmdev_ctx_t *ctx,
  2126. lsm6ds3tr_c_ff_ths_t *val);
  2127. int32_t lsm6ds3tr_c_fifo_watermark_set(stmdev_ctx_t *ctx,
  2128. uint16_t val);
  2129. int32_t lsm6ds3tr_c_fifo_watermark_get(stmdev_ctx_t *ctx,
  2130. uint16_t *val);
  2131. int32_t lsm6ds3tr_c_fifo_data_level_get(stmdev_ctx_t *ctx,
  2132. uint16_t *val);
  2133. int32_t lsm6ds3tr_c_fifo_wtm_flag_get(stmdev_ctx_t *ctx,
  2134. uint8_t *val);
  2135. int32_t lsm6ds3tr_c_fifo_pattern_get(stmdev_ctx_t *ctx,
  2136. uint16_t *val);
  2137. int32_t lsm6ds3tr_c_fifo_temp_batch_set(stmdev_ctx_t *ctx,
  2138. uint8_t val);
  2139. int32_t lsm6ds3tr_c_fifo_temp_batch_get(stmdev_ctx_t *ctx,
  2140. uint8_t *val);
  2141. typedef enum
  2142. {
  2143. LSM6DS3TR_C_TRG_XL_GY_DRDY = 0,
  2144. LSM6DS3TR_C_TRG_STEP_DETECT = 1,
  2145. LSM6DS3TR_C_TRG_SH_DRDY = 2,
  2146. LSM6DS3TR_C_TRG_SH_ND = 3, /* ERROR CODE */
  2147. } lsm6ds3tr_c_trigger_fifo_t;
  2148. int32_t lsm6ds3tr_c_fifo_write_trigger_set(stmdev_ctx_t *ctx,
  2149. lsm6ds3tr_c_trigger_fifo_t val);
  2150. int32_t lsm6ds3tr_c_fifo_write_trigger_get(stmdev_ctx_t *ctx,
  2151. lsm6ds3tr_c_trigger_fifo_t *val);
  2152. int32_t lsm6ds3tr_c_fifo_pedo_and_timestamp_batch_set(
  2153. stmdev_ctx_t *ctx,
  2154. uint8_t val);
  2155. int32_t lsm6ds3tr_c_fifo_pedo_and_timestamp_batch_get(
  2156. stmdev_ctx_t *ctx,
  2157. uint8_t *val);
  2158. typedef enum
  2159. {
  2160. LSM6DS3TR_C_FIFO_XL_DISABLE = 0,
  2161. LSM6DS3TR_C_FIFO_XL_NO_DEC = 1,
  2162. LSM6DS3TR_C_FIFO_XL_DEC_2 = 2,
  2163. LSM6DS3TR_C_FIFO_XL_DEC_3 = 3,
  2164. LSM6DS3TR_C_FIFO_XL_DEC_4 = 4,
  2165. LSM6DS3TR_C_FIFO_XL_DEC_8 = 5,
  2166. LSM6DS3TR_C_FIFO_XL_DEC_16 = 6,
  2167. LSM6DS3TR_C_FIFO_XL_DEC_32 = 7,
  2168. LSM6DS3TR_C_FIFO_XL_DEC_ND = 8, /* ERROR CODE */
  2169. } lsm6ds3tr_c_dec_fifo_xl_t;
  2170. int32_t lsm6ds3tr_c_fifo_xl_batch_set(stmdev_ctx_t *ctx,
  2171. lsm6ds3tr_c_dec_fifo_xl_t val);
  2172. int32_t lsm6ds3tr_c_fifo_xl_batch_get(stmdev_ctx_t *ctx,
  2173. lsm6ds3tr_c_dec_fifo_xl_t *val);
  2174. typedef enum
  2175. {
  2176. LSM6DS3TR_C_FIFO_GY_DISABLE = 0,
  2177. LSM6DS3TR_C_FIFO_GY_NO_DEC = 1,
  2178. LSM6DS3TR_C_FIFO_GY_DEC_2 = 2,
  2179. LSM6DS3TR_C_FIFO_GY_DEC_3 = 3,
  2180. LSM6DS3TR_C_FIFO_GY_DEC_4 = 4,
  2181. LSM6DS3TR_C_FIFO_GY_DEC_8 = 5,
  2182. LSM6DS3TR_C_FIFO_GY_DEC_16 = 6,
  2183. LSM6DS3TR_C_FIFO_GY_DEC_32 = 7,
  2184. LSM6DS3TR_C_FIFO_GY_DEC_ND = 8, /* ERROR CODE */
  2185. } lsm6ds3tr_c_dec_fifo_gyro_t;
  2186. int32_t lsm6ds3tr_c_fifo_gy_batch_set(stmdev_ctx_t *ctx,
  2187. lsm6ds3tr_c_dec_fifo_gyro_t val);
  2188. int32_t lsm6ds3tr_c_fifo_gy_batch_get(stmdev_ctx_t *ctx,
  2189. lsm6ds3tr_c_dec_fifo_gyro_t *val);
  2190. typedef enum
  2191. {
  2192. LSM6DS3TR_C_FIFO_DS3_DISABLE = 0,
  2193. LSM6DS3TR_C_FIFO_DS3_NO_DEC = 1,
  2194. LSM6DS3TR_C_FIFO_DS3_DEC_2 = 2,
  2195. LSM6DS3TR_C_FIFO_DS3_DEC_3 = 3,
  2196. LSM6DS3TR_C_FIFO_DS3_DEC_4 = 4,
  2197. LSM6DS3TR_C_FIFO_DS3_DEC_8 = 5,
  2198. LSM6DS3TR_C_FIFO_DS3_DEC_16 = 6,
  2199. LSM6DS3TR_C_FIFO_DS3_DEC_32 = 7,
  2200. LSM6DS3TR_C_FIFO_DS3_DEC_ND = 8, /* ERROR CODE */
  2201. } lsm6ds3tr_c_dec_ds3_fifo_t;
  2202. int32_t lsm6ds3tr_c_fifo_dataset_3_batch_set(stmdev_ctx_t *ctx,
  2203. lsm6ds3tr_c_dec_ds3_fifo_t val);
  2204. int32_t lsm6ds3tr_c_fifo_dataset_3_batch_get(stmdev_ctx_t *ctx,
  2205. lsm6ds3tr_c_dec_ds3_fifo_t *val);
  2206. typedef enum
  2207. {
  2208. LSM6DS3TR_C_FIFO_DS4_DISABLE = 0,
  2209. LSM6DS3TR_C_FIFO_DS4_NO_DEC = 1,
  2210. LSM6DS3TR_C_FIFO_DS4_DEC_2 = 2,
  2211. LSM6DS3TR_C_FIFO_DS4_DEC_3 = 3,
  2212. LSM6DS3TR_C_FIFO_DS4_DEC_4 = 4,
  2213. LSM6DS3TR_C_FIFO_DS4_DEC_8 = 5,
  2214. LSM6DS3TR_C_FIFO_DS4_DEC_16 = 6,
  2215. LSM6DS3TR_C_FIFO_DS4_DEC_32 = 7,
  2216. LSM6DS3TR_C_FIFO_DS4_DEC_ND = 8, /* ERROR CODE */
  2217. } lsm6ds3tr_c_dec_ds4_fifo_t;
  2218. int32_t lsm6ds3tr_c_fifo_dataset_4_batch_set(stmdev_ctx_t *ctx,
  2219. lsm6ds3tr_c_dec_ds4_fifo_t val);
  2220. int32_t lsm6ds3tr_c_fifo_dataset_4_batch_get(stmdev_ctx_t *ctx,
  2221. lsm6ds3tr_c_dec_ds4_fifo_t *val);
  2222. int32_t lsm6ds3tr_c_fifo_xl_gy_8bit_format_set(stmdev_ctx_t *ctx,
  2223. uint8_t val);
  2224. int32_t lsm6ds3tr_c_fifo_xl_gy_8bit_format_get(stmdev_ctx_t *ctx,
  2225. uint8_t *val);
  2226. int32_t lsm6ds3tr_c_fifo_stop_on_wtm_set(stmdev_ctx_t *ctx,
  2227. uint8_t val);
  2228. int32_t lsm6ds3tr_c_fifo_stop_on_wtm_get(stmdev_ctx_t *ctx,
  2229. uint8_t *val);
  2230. typedef enum
  2231. {
  2232. LSM6DS3TR_C_BYPASS_MODE = 0,
  2233. LSM6DS3TR_C_FIFO_MODE = 1,
  2234. LSM6DS3TR_C_STREAM_TO_FIFO_MODE = 3,
  2235. LSM6DS3TR_C_BYPASS_TO_STREAM_MODE = 4,
  2236. LSM6DS3TR_C_STREAM_MODE = 6,
  2237. LSM6DS3TR_C_FIFO_MODE_ND = 8, /* ERROR CODE */
  2238. } lsm6ds3tr_c_fifo_mode_t;
  2239. int32_t lsm6ds3tr_c_fifo_mode_set(stmdev_ctx_t *ctx,
  2240. lsm6ds3tr_c_fifo_mode_t val);
  2241. int32_t lsm6ds3tr_c_fifo_mode_get(stmdev_ctx_t *ctx,
  2242. lsm6ds3tr_c_fifo_mode_t *val);
  2243. typedef enum
  2244. {
  2245. LSM6DS3TR_C_FIFO_DISABLE = 0,
  2246. LSM6DS3TR_C_FIFO_12Hz5 = 1,
  2247. LSM6DS3TR_C_FIFO_26Hz = 2,
  2248. LSM6DS3TR_C_FIFO_52Hz = 3,
  2249. LSM6DS3TR_C_FIFO_104Hz = 4,
  2250. LSM6DS3TR_C_FIFO_208Hz = 5,
  2251. LSM6DS3TR_C_FIFO_416Hz = 6,
  2252. LSM6DS3TR_C_FIFO_833Hz = 7,
  2253. LSM6DS3TR_C_FIFO_1k66Hz = 8,
  2254. LSM6DS3TR_C_FIFO_3k33Hz = 9,
  2255. LSM6DS3TR_C_FIFO_6k66Hz = 10,
  2256. LSM6DS3TR_C_FIFO_RATE_ND = 11, /* ERROR CODE */
  2257. } lsm6ds3tr_c_odr_fifo_t;
  2258. int32_t lsm6ds3tr_c_fifo_data_rate_set(stmdev_ctx_t *ctx,
  2259. lsm6ds3tr_c_odr_fifo_t val);
  2260. int32_t lsm6ds3tr_c_fifo_data_rate_get(stmdev_ctx_t *ctx,
  2261. lsm6ds3tr_c_odr_fifo_t *val);
  2262. typedef enum
  2263. {
  2264. LSM6DS3TR_C_DEN_ACT_LOW = 0,
  2265. LSM6DS3TR_C_DEN_ACT_HIGH = 1,
  2266. LSM6DS3TR_C_DEN_POL_ND = 2, /* ERROR CODE */
  2267. } lsm6ds3tr_c_den_lh_t;
  2268. int32_t lsm6ds3tr_c_den_polarity_set(stmdev_ctx_t *ctx,
  2269. lsm6ds3tr_c_den_lh_t val);
  2270. int32_t lsm6ds3tr_c_den_polarity_get(stmdev_ctx_t *ctx,
  2271. lsm6ds3tr_c_den_lh_t *val);
  2272. typedef enum
  2273. {
  2274. LSM6DS3TR_C_DEN_DISABLE = 0,
  2275. LSM6DS3TR_C_LEVEL_FIFO = 6,
  2276. LSM6DS3TR_C_LEVEL_LETCHED = 3,
  2277. LSM6DS3TR_C_LEVEL_TRIGGER = 2,
  2278. LSM6DS3TR_C_EDGE_TRIGGER = 4,
  2279. LSM6DS3TR_C_DEN_MODE_ND = 5, /* ERROR CODE */
  2280. } lsm6ds3tr_c_den_mode_t;
  2281. int32_t lsm6ds3tr_c_den_mode_set(stmdev_ctx_t *ctx,
  2282. lsm6ds3tr_c_den_mode_t val);
  2283. int32_t lsm6ds3tr_c_den_mode_get(stmdev_ctx_t *ctx,
  2284. lsm6ds3tr_c_den_mode_t *val);
  2285. typedef enum
  2286. {
  2287. LSM6DS3TR_C_STAMP_IN_GY_DATA = 0,
  2288. LSM6DS3TR_C_STAMP_IN_XL_DATA = 1,
  2289. LSM6DS3TR_C_STAMP_IN_GY_XL_DATA = 2,
  2290. LSM6DS3TR_C_DEN_STAMP_ND = 3, /* ERROR CODE */
  2291. } lsm6ds3tr_c_den_xl_en_t;
  2292. int32_t lsm6ds3tr_c_den_enable_set(stmdev_ctx_t *ctx,
  2293. lsm6ds3tr_c_den_xl_en_t val);
  2294. int32_t lsm6ds3tr_c_den_enable_get(stmdev_ctx_t *ctx,
  2295. lsm6ds3tr_c_den_xl_en_t *val);
  2296. int32_t lsm6ds3tr_c_den_mark_axis_z_set(stmdev_ctx_t *ctx,
  2297. uint8_t val);
  2298. int32_t lsm6ds3tr_c_den_mark_axis_z_get(stmdev_ctx_t *ctx,
  2299. uint8_t *val);
  2300. int32_t lsm6ds3tr_c_den_mark_axis_y_set(stmdev_ctx_t *ctx,
  2301. uint8_t val);
  2302. int32_t lsm6ds3tr_c_den_mark_axis_y_get(stmdev_ctx_t *ctx,
  2303. uint8_t *val);
  2304. int32_t lsm6ds3tr_c_den_mark_axis_x_set(stmdev_ctx_t *ctx,
  2305. uint8_t val);
  2306. int32_t lsm6ds3tr_c_den_mark_axis_x_get(stmdev_ctx_t *ctx,
  2307. uint8_t *val);
  2308. int32_t lsm6ds3tr_c_pedo_step_reset_set(stmdev_ctx_t *ctx,
  2309. uint8_t val);
  2310. int32_t lsm6ds3tr_c_pedo_step_reset_get(stmdev_ctx_t *ctx,
  2311. uint8_t *val);
  2312. int32_t lsm6ds3tr_c_pedo_sens_set(stmdev_ctx_t *ctx, uint8_t val);
  2313. int32_t lsm6ds3tr_c_pedo_sens_get(stmdev_ctx_t *ctx, uint8_t *val);
  2314. int32_t lsm6ds3tr_c_pedo_threshold_set(stmdev_ctx_t *ctx,
  2315. uint8_t val);
  2316. int32_t lsm6ds3tr_c_pedo_threshold_get(stmdev_ctx_t *ctx,
  2317. uint8_t *val);
  2318. typedef enum
  2319. {
  2320. LSM6DS3TR_C_PEDO_AT_2g = 0,
  2321. LSM6DS3TR_C_PEDO_AT_4g = 1,
  2322. LSM6DS3TR_C_PEDO_FS_ND = 2, /* ERROR CODE */
  2323. } lsm6ds3tr_c_pedo_fs_t;
  2324. int32_t lsm6ds3tr_c_pedo_full_scale_set(stmdev_ctx_t *ctx,
  2325. lsm6ds3tr_c_pedo_fs_t val);
  2326. int32_t lsm6ds3tr_c_pedo_full_scale_get(stmdev_ctx_t *ctx,
  2327. lsm6ds3tr_c_pedo_fs_t *val);
  2328. int32_t lsm6ds3tr_c_pedo_debounce_steps_set(stmdev_ctx_t *ctx,
  2329. uint8_t val);
  2330. int32_t lsm6ds3tr_c_pedo_debounce_steps_get(stmdev_ctx_t *ctx,
  2331. uint8_t *val);
  2332. int32_t lsm6ds3tr_c_pedo_timeout_set(stmdev_ctx_t *ctx, uint8_t val);
  2333. int32_t lsm6ds3tr_c_pedo_timeout_get(stmdev_ctx_t *ctx, uint8_t *val);
  2334. int32_t lsm6ds3tr_c_pedo_steps_period_set(stmdev_ctx_t *ctx,
  2335. uint8_t *buff);
  2336. int32_t lsm6ds3tr_c_pedo_steps_period_get(stmdev_ctx_t *ctx,
  2337. uint8_t *buff);
  2338. int32_t lsm6ds3tr_c_motion_sens_set(stmdev_ctx_t *ctx, uint8_t val);
  2339. int32_t lsm6ds3tr_c_motion_sens_get(stmdev_ctx_t *ctx, uint8_t *val);
  2340. int32_t lsm6ds3tr_c_motion_threshold_set(stmdev_ctx_t *ctx,
  2341. uint8_t *buff);
  2342. int32_t lsm6ds3tr_c_motion_threshold_get(stmdev_ctx_t *ctx,
  2343. uint8_t *buff);
  2344. int32_t lsm6ds3tr_c_tilt_sens_set(stmdev_ctx_t *ctx, uint8_t val);
  2345. int32_t lsm6ds3tr_c_tilt_sens_get(stmdev_ctx_t *ctx, uint8_t *val);
  2346. int32_t lsm6ds3tr_c_wrist_tilt_sens_set(stmdev_ctx_t *ctx,
  2347. uint8_t val);
  2348. int32_t lsm6ds3tr_c_wrist_tilt_sens_get(stmdev_ctx_t *ctx,
  2349. uint8_t *val);
  2350. int32_t lsm6ds3tr_c_tilt_latency_set(stmdev_ctx_t *ctx,
  2351. uint8_t *buff);
  2352. int32_t lsm6ds3tr_c_tilt_latency_get(stmdev_ctx_t *ctx,
  2353. uint8_t *buff);
  2354. int32_t lsm6ds3tr_c_tilt_threshold_set(stmdev_ctx_t *ctx,
  2355. uint8_t *buff);
  2356. int32_t lsm6ds3tr_c_tilt_threshold_get(stmdev_ctx_t *ctx,
  2357. uint8_t *buff);
  2358. int32_t lsm6ds3tr_c_tilt_src_set(stmdev_ctx_t *ctx,
  2359. lsm6ds3tr_c_a_wrist_tilt_mask_t *val);
  2360. int32_t lsm6ds3tr_c_tilt_src_get(stmdev_ctx_t *ctx,
  2361. lsm6ds3tr_c_a_wrist_tilt_mask_t *val);
  2362. int32_t lsm6ds3tr_c_mag_soft_iron_set(stmdev_ctx_t *ctx, uint8_t val);
  2363. int32_t lsm6ds3tr_c_mag_soft_iron_get(stmdev_ctx_t *ctx,
  2364. uint8_t *val);
  2365. int32_t lsm6ds3tr_c_mag_hard_iron_set(stmdev_ctx_t *ctx, uint8_t val);
  2366. int32_t lsm6ds3tr_c_mag_hard_iron_get(stmdev_ctx_t *ctx,
  2367. uint8_t *val);
  2368. int32_t lsm6ds3tr_c_mag_soft_iron_mat_set(stmdev_ctx_t *ctx,
  2369. uint8_t *buff);
  2370. int32_t lsm6ds3tr_c_mag_soft_iron_mat_get(stmdev_ctx_t *ctx,
  2371. uint8_t *buff);
  2372. int32_t lsm6ds3tr_c_mag_offset_set(stmdev_ctx_t *ctx, int16_t *val);
  2373. int32_t lsm6ds3tr_c_mag_offset_get(stmdev_ctx_t *ctx, int16_t *val);
  2374. int32_t lsm6ds3tr_c_func_en_set(stmdev_ctx_t *ctx, uint8_t val);
  2375. int32_t lsm6ds3tr_c_sh_sync_sens_frame_set(stmdev_ctx_t *ctx,
  2376. uint8_t val);
  2377. int32_t lsm6ds3tr_c_sh_sync_sens_frame_get(stmdev_ctx_t *ctx,
  2378. uint8_t *val);
  2379. typedef enum
  2380. {
  2381. LSM6DS3TR_C_RES_RATIO_2_11 = 0,
  2382. LSM6DS3TR_C_RES_RATIO_2_12 = 1,
  2383. LSM6DS3TR_C_RES_RATIO_2_13 = 2,
  2384. LSM6DS3TR_C_RES_RATIO_2_14 = 3,
  2385. LSM6DS3TR_C_RES_RATIO_ND = 4, /* ERROR CODE */
  2386. } lsm6ds3tr_c_rr_t;
  2387. int32_t lsm6ds3tr_c_sh_sync_sens_ratio_set(stmdev_ctx_t *ctx,
  2388. lsm6ds3tr_c_rr_t val);
  2389. int32_t lsm6ds3tr_c_sh_sync_sens_ratio_get(stmdev_ctx_t *ctx,
  2390. lsm6ds3tr_c_rr_t *val);
  2391. int32_t lsm6ds3tr_c_sh_master_set(stmdev_ctx_t *ctx, uint8_t val);
  2392. int32_t lsm6ds3tr_c_sh_master_get(stmdev_ctx_t *ctx, uint8_t *val);
  2393. int32_t lsm6ds3tr_c_sh_pass_through_set(stmdev_ctx_t *ctx,
  2394. uint8_t val);
  2395. int32_t lsm6ds3tr_c_sh_pass_through_get(stmdev_ctx_t *ctx,
  2396. uint8_t *val);
  2397. typedef enum
  2398. {
  2399. LSM6DS3TR_C_EXT_PULL_UP = 0,
  2400. LSM6DS3TR_C_INTERNAL_PULL_UP = 1,
  2401. LSM6DS3TR_C_SH_PIN_MODE = 2, /* ERROR CODE */
  2402. } lsm6ds3tr_c_pull_up_en_t;
  2403. int32_t lsm6ds3tr_c_sh_pin_mode_set(stmdev_ctx_t *ctx,
  2404. lsm6ds3tr_c_pull_up_en_t val);
  2405. int32_t lsm6ds3tr_c_sh_pin_mode_get(stmdev_ctx_t *ctx,
  2406. lsm6ds3tr_c_pull_up_en_t *val);
  2407. typedef enum
  2408. {
  2409. LSM6DS3TR_C_XL_GY_DRDY = 0,
  2410. LSM6DS3TR_C_EXT_ON_INT2_PIN = 1,
  2411. LSM6DS3TR_C_SH_SYNCRO_ND = 2, /* ERROR CODE */
  2412. } lsm6ds3tr_c_start_config_t;
  2413. int32_t lsm6ds3tr_c_sh_syncro_mode_set(stmdev_ctx_t *ctx,
  2414. lsm6ds3tr_c_start_config_t val);
  2415. int32_t lsm6ds3tr_c_sh_syncro_mode_get(stmdev_ctx_t *ctx,
  2416. lsm6ds3tr_c_start_config_t *val);
  2417. int32_t lsm6ds3tr_c_sh_drdy_on_int1_set(stmdev_ctx_t *ctx,
  2418. uint8_t val);
  2419. int32_t lsm6ds3tr_c_sh_drdy_on_int1_get(stmdev_ctx_t *ctx,
  2420. uint8_t *val);
  2421. typedef struct
  2422. {
  2423. lsm6ds3tr_c_sensorhub1_reg_t sh_byte_1;
  2424. lsm6ds3tr_c_sensorhub2_reg_t sh_byte_2;
  2425. lsm6ds3tr_c_sensorhub3_reg_t sh_byte_3;
  2426. lsm6ds3tr_c_sensorhub4_reg_t sh_byte_4;
  2427. lsm6ds3tr_c_sensorhub5_reg_t sh_byte_5;
  2428. lsm6ds3tr_c_sensorhub6_reg_t sh_byte_6;
  2429. lsm6ds3tr_c_sensorhub7_reg_t sh_byte_7;
  2430. lsm6ds3tr_c_sensorhub8_reg_t sh_byte_8;
  2431. lsm6ds3tr_c_sensorhub9_reg_t sh_byte_9;
  2432. lsm6ds3tr_c_sensorhub10_reg_t sh_byte_10;
  2433. lsm6ds3tr_c_sensorhub11_reg_t sh_byte_11;
  2434. lsm6ds3tr_c_sensorhub12_reg_t sh_byte_12;
  2435. lsm6ds3tr_c_sensorhub13_reg_t sh_byte_13;
  2436. lsm6ds3tr_c_sensorhub14_reg_t sh_byte_14;
  2437. lsm6ds3tr_c_sensorhub15_reg_t sh_byte_15;
  2438. lsm6ds3tr_c_sensorhub16_reg_t sh_byte_16;
  2439. lsm6ds3tr_c_sensorhub17_reg_t sh_byte_17;
  2440. lsm6ds3tr_c_sensorhub18_reg_t sh_byte_18;
  2441. } lsm6ds3tr_c_emb_sh_read_t;
  2442. int32_t lsm6ds3tr_c_sh_read_data_raw_get(stmdev_ctx_t *ctx,
  2443. lsm6ds3tr_c_emb_sh_read_t *val);
  2444. int32_t lsm6ds3tr_c_sh_cmd_sens_sync_set(stmdev_ctx_t *ctx,
  2445. uint8_t val);
  2446. int32_t lsm6ds3tr_c_sh_cmd_sens_sync_get(stmdev_ctx_t *ctx,
  2447. uint8_t *val);
  2448. int32_t lsm6ds3tr_c_sh_spi_sync_error_set(stmdev_ctx_t *ctx,
  2449. uint8_t val);
  2450. int32_t lsm6ds3tr_c_sh_spi_sync_error_get(stmdev_ctx_t *ctx,
  2451. uint8_t *val);
  2452. typedef enum
  2453. {
  2454. LSM6DS3TR_C_SLV_0 = 0,
  2455. LSM6DS3TR_C_SLV_0_1 = 1,
  2456. LSM6DS3TR_C_SLV_0_1_2 = 2,
  2457. LSM6DS3TR_C_SLV_0_1_2_3 = 3,
  2458. LSM6DS3TR_C_SLV_EN_ND = 4, /* ERROR CODE */
  2459. } lsm6ds3tr_c_aux_sens_on_t;
  2460. int32_t lsm6ds3tr_c_sh_num_of_dev_connected_set(stmdev_ctx_t *ctx,
  2461. lsm6ds3tr_c_aux_sens_on_t val);
  2462. int32_t lsm6ds3tr_c_sh_num_of_dev_connected_get(stmdev_ctx_t *ctx,
  2463. lsm6ds3tr_c_aux_sens_on_t *val);
  2464. typedef struct
  2465. {
  2466. uint8_t slv0_add;
  2467. uint8_t slv0_subadd;
  2468. uint8_t slv0_data;
  2469. } lsm6ds3tr_c_sh_cfg_write_t;
  2470. int32_t lsm6ds3tr_c_sh_cfg_write(stmdev_ctx_t *ctx,
  2471. lsm6ds3tr_c_sh_cfg_write_t *val);
  2472. typedef struct
  2473. {
  2474. uint8_t slv_add;
  2475. uint8_t slv_subadd;
  2476. uint8_t slv_len;
  2477. } lsm6ds3tr_c_sh_cfg_read_t;
  2478. int32_t lsm6ds3tr_c_sh_slv0_cfg_read(stmdev_ctx_t *ctx,
  2479. lsm6ds3tr_c_sh_cfg_read_t *val);
  2480. int32_t lsm6ds3tr_c_sh_slv1_cfg_read(stmdev_ctx_t *ctx,
  2481. lsm6ds3tr_c_sh_cfg_read_t *val);
  2482. int32_t lsm6ds3tr_c_sh_slv2_cfg_read(stmdev_ctx_t *ctx,
  2483. lsm6ds3tr_c_sh_cfg_read_t *val);
  2484. int32_t lsm6ds3tr_c_sh_slv3_cfg_read(stmdev_ctx_t *ctx,
  2485. lsm6ds3tr_c_sh_cfg_read_t *val);
  2486. typedef enum
  2487. {
  2488. LSM6DS3TR_C_SL0_NO_DEC = 0,
  2489. LSM6DS3TR_C_SL0_DEC_2 = 1,
  2490. LSM6DS3TR_C_SL0_DEC_4 = 2,
  2491. LSM6DS3TR_C_SL0_DEC_8 = 3,
  2492. LSM6DS3TR_C_SL0_DEC_ND = 4, /* ERROR CODE */
  2493. } lsm6ds3tr_c_slave0_rate_t;
  2494. int32_t lsm6ds3tr_c_sh_slave_0_dec_set(stmdev_ctx_t *ctx,
  2495. lsm6ds3tr_c_slave0_rate_t val);
  2496. int32_t lsm6ds3tr_c_sh_slave_0_dec_get(stmdev_ctx_t *ctx,
  2497. lsm6ds3tr_c_slave0_rate_t *val);
  2498. typedef enum
  2499. {
  2500. LSM6DS3TR_C_EACH_SH_CYCLE = 0,
  2501. LSM6DS3TR_C_ONLY_FIRST_CYCLE = 1,
  2502. LSM6DS3TR_C_SH_WR_MODE_ND = 2, /* ERROR CODE */
  2503. } lsm6ds3tr_c_write_once_t;
  2504. int32_t lsm6ds3tr_c_sh_write_mode_set(stmdev_ctx_t *ctx,
  2505. lsm6ds3tr_c_write_once_t val);
  2506. int32_t lsm6ds3tr_c_sh_write_mode_get(stmdev_ctx_t *ctx,
  2507. lsm6ds3tr_c_write_once_t *val);
  2508. typedef enum
  2509. {
  2510. LSM6DS3TR_C_SL1_NO_DEC = 0,
  2511. LSM6DS3TR_C_SL1_DEC_2 = 1,
  2512. LSM6DS3TR_C_SL1_DEC_4 = 2,
  2513. LSM6DS3TR_C_SL1_DEC_8 = 3,
  2514. LSM6DS3TR_C_SL1_DEC_ND = 4, /* ERROR CODE */
  2515. } lsm6ds3tr_c_slave1_rate_t;
  2516. int32_t lsm6ds3tr_c_sh_slave_1_dec_set(stmdev_ctx_t *ctx,
  2517. lsm6ds3tr_c_slave1_rate_t val);
  2518. int32_t lsm6ds3tr_c_sh_slave_1_dec_get(stmdev_ctx_t *ctx,
  2519. lsm6ds3tr_c_slave1_rate_t *val);
  2520. typedef enum
  2521. {
  2522. LSM6DS3TR_C_SL2_NO_DEC = 0,
  2523. LSM6DS3TR_C_SL2_DEC_2 = 1,
  2524. LSM6DS3TR_C_SL2_DEC_4 = 2,
  2525. LSM6DS3TR_C_SL2_DEC_8 = 3,
  2526. LSM6DS3TR_C_SL2_DEC_ND = 4, /* ERROR CODE */
  2527. } lsm6ds3tr_c_slave2_rate_t;
  2528. int32_t lsm6ds3tr_c_sh_slave_2_dec_set(stmdev_ctx_t *ctx,
  2529. lsm6ds3tr_c_slave2_rate_t val);
  2530. int32_t lsm6ds3tr_c_sh_slave_2_dec_get(stmdev_ctx_t *ctx,
  2531. lsm6ds3tr_c_slave2_rate_t *val);
  2532. typedef enum
  2533. {
  2534. LSM6DS3TR_C_SL3_NO_DEC = 0,
  2535. LSM6DS3TR_C_SL3_DEC_2 = 1,
  2536. LSM6DS3TR_C_SL3_DEC_4 = 2,
  2537. LSM6DS3TR_C_SL3_DEC_8 = 3,
  2538. LSM6DS3TR_C_SL3_DEC_ND = 4, /* ERROR CODE */
  2539. } lsm6ds3tr_c_slave3_rate_t;
  2540. int32_t lsm6ds3tr_c_sh_slave_3_dec_set(stmdev_ctx_t *ctx,
  2541. lsm6ds3tr_c_slave3_rate_t val);
  2542. int32_t lsm6ds3tr_c_sh_slave_3_dec_get(stmdev_ctx_t *ctx,
  2543. lsm6ds3tr_c_slave3_rate_t *val);
  2544. /**
  2545. * @}
  2546. *
  2547. */
  2548. #ifdef __cplusplus
  2549. }
  2550. #endif
  2551. #endif /* LSM6DS3TR_C_DRIVER_H */
  2552. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/