lsm6ds3tr-c_reg.h 102 KB

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