lsm6ds3tr-c_reg.h 100 KB

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