lsm6ds0.h 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034
  1. /*
  2. ChibiOS - Copyright (C) 2016..2018 Rocco Marco Guglielmi
  3. This file is part of ChibiOS.
  4. ChibiOS is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. ChibiOS is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. /**
  16. * @file lsm6ds0.h
  17. * @brief LSM6DS0 MEMS interface module header.
  18. *
  19. * @addtogroup LSM6DS0
  20. * @ingroup EX_ST
  21. * @{
  22. */
  23. #ifndef _LSM6DS0_H_
  24. #define _LSM6DS0_H_
  25. #include "hal_accelerometer.h"
  26. #include "hal_gyroscope.h"
  27. /*===========================================================================*/
  28. /* Driver constants. */
  29. /*===========================================================================*/
  30. /**
  31. * @name Version identification
  32. * @{
  33. */
  34. /**
  35. * @brief LSM6DS0 driver version string.
  36. */
  37. #define EX_LSM6DS0_VERSION "1.1.2"
  38. /**
  39. * @brief LSM6DS0 driver version major number.
  40. */
  41. #define EX_LSM6DS0_MAJOR 1
  42. /**
  43. * @brief LSM6DS0 driver version minor number.
  44. */
  45. #define EX_LSM6DS0_MINOR 1
  46. /**
  47. * @brief LSM6DS0 driver version patch number.
  48. */
  49. #define EX_LSM6DS0_PATCH 2
  50. /** @} */
  51. /**
  52. * @brief LSM6DS0 accelerometer subsystem characteristics.
  53. * @note Sensitivity is expressed as milli-G/LSB whereas
  54. * 1 milli-G = 0.00980665 m/s^2.
  55. * @note Bias is expressed as milli-G.
  56. *
  57. * @{
  58. */
  59. #define LSM6DS0_ACC_NUMBER_OF_AXES 3U
  60. #define LSM6DS0_ACC_2G 2.0f
  61. #define LSM6DS0_ACC_4G 4.0f
  62. #define LSM6DS0_ACC_8G 8.0f
  63. #define LSM6DS0_ACC_16G 16.0f
  64. #define LSM6DS0_ACC_SENS_2G 0.061f
  65. #define LSM6DS0_ACC_SENS_4G 0.122f
  66. #define LSM6DS0_ACC_SENS_8G 0.244f
  67. #define LSM6DS0_ACC_SENS_16G 0.732f
  68. #define LSM6DS0_ACC_BIAS 0.0f
  69. /** @} */
  70. /**
  71. * @brief L3GD20 gyroscope system characteristics.
  72. * @note Sensitivity is expressed as DPS/LSB whereas DPS stand for Degree
  73. * per second [°/s].
  74. * @note Bias is expressed as DPS.
  75. *
  76. * @{
  77. */
  78. #define LSM6DS0_GYRO_NUMBER_OF_AXES 3U
  79. #define LSM6DS0_GYRO_245DPS 245.0f
  80. #define LSM6DS0_GYRO_500DPS 500.0f
  81. #define LSM6DS0_GYRO_2000DPS 2000.0f
  82. #define LSM6DS0_GYRO_SENS_245DPS 0.00875f
  83. #define LSM6DS0_GYRO_SENS_500DPS 0.01750f
  84. #define LSM6DS0_GYRO_SENS_2000DPS 0.07000f
  85. #define LSM6DS0_GYRO_BIAS 0.0f
  86. /** @} */
  87. /**
  88. * @name LSM6DS0 communication interfaces related bit masks
  89. * @{
  90. */
  91. #define LSM6DS0_DI_MASK 0xFF
  92. #define LSM6DS0_DI(n) (1 << n)
  93. #define LSM6DS0_AD_MASK 0x7F
  94. #define LSM6DS0_AD(n) (1 << n)
  95. #define LSM6DS0_MS (1 << 7)
  96. /** @} */
  97. /**
  98. * @name LSM6DS0 register addresses
  99. * @{
  100. */
  101. #define LSM6DS0_AD_ACT_THS 0x04
  102. #define LSM6DS0_AD_ACT_DUR 0x05
  103. #define LSM6DS0_AD_INT_GEN_CFG_XL 0x06
  104. #define LSM6DS0_AD_INT_GEN_THS_X_XL 0x07
  105. #define LSM6DS0_AD_INT_GEN_THS_Y_XL 0x08
  106. #define LSM6DS0_AD_INT_GEN_THS_Z_XL 0x09
  107. #define LSM6DS0_AD_INT_GEN_DUR_XL 0x0A
  108. #define LSM6DS0_AD_REFERENCE_G 0x0B
  109. #define LSM6DS0_AD_INT_CTRL 0x0C
  110. #define LSM6DS0_AD_WHO_AM_I 0x0F
  111. #define LSM6DS0_AD_CTRL_REG1_G 0x10
  112. #define LSM6DS0_AD_CTRL_REG2_G 0x11
  113. #define LSM6DS0_AD_CTRL_REG3_G 0x12
  114. #define LSM6DS0_AD_ORIENT_CFG_G 0x13
  115. #define LSM6DS0_AD_INT_GEN_SRC_G 0x14
  116. #define LSM6DS0_AD_OUT_TEMP_L 0x15
  117. #define LSM6DS0_AD_OUT_TEMP_H 0x16
  118. #define LSM6DS0_AD_STATUS_REG1 0x17
  119. #define LSM6DS0_AD_OUT_X_L_G 0x18
  120. #define LSM6DS0_AD_OUT_X_H_G 0x19
  121. #define LSM6DS0_AD_OUT_Y_L_G 0x1A
  122. #define LSM6DS0_AD_OUT_Y_H_G 0x1B
  123. #define LSM6DS0_AD_OUT_Z_L_G 0x1C
  124. #define LSM6DS0_AD_OUT_Z_H_G 0x1D
  125. #define LSM6DS0_AD_CTRL_REG4 0x1E
  126. #define LSM6DS0_AD_CTRL_REG5_XL 0x1F
  127. #define LSM6DS0_AD_CTRL_REG6_XL 0x20
  128. #define LSM6DS0_AD_CTRL_REG7_XL 0x21
  129. #define LSM6DS0_AD_CTRL_REG8 0x22
  130. #define LSM6DS0_AD_CTRL_REG9 0x23
  131. #define LSM6DS0_AD_CTRL_REG10 0x24
  132. #define LSM6DS0_AD_INT_GEN_SRC_XL 0x26
  133. #define LSM6DS0_AD_STATUS_REG2 0x27
  134. #define LSM6DS0_AD_OUT_X_L_XL 0x28
  135. #define LSM6DS0_AD_OUT_X_H_XL 0x29
  136. #define LSM6DS0_AD_OUT_Y_L_XL 0x2A
  137. #define LSM6DS0_AD_OUT_Y_H_XL 0x2B
  138. #define LSM6DS0_AD_OUT_Z_L_XL 0x2C
  139. #define LSM6DS0_AD_OUT_Z_H_XL 0x2D
  140. #define LSM6DS0_AD_FIFO_CTRL 0x2E
  141. #define LSM6DS0_AD_FIFO_SRC 0x2F
  142. #define LSM6DS0_AD_INT_GEN_CFG_G 0x30
  143. #define LSM6DS0_AD_INT_GEN_THS_XH_G 0x31
  144. #define LSM6DS0_AD_INT_GEN_THS_XL_G 0x32
  145. #define LSM6DS0_AD_INT_GEN_THS_YH_G 0x33
  146. #define LSM6DS0_AD_INT_GEN_THS_YL_G 0x34
  147. #define LSM6DS0_AD_INT_GEN_THS_ZH_G 0x35
  148. #define LSM6DS0_AD_INT_GEN_THS_ZL_G 0x36
  149. #define LSM6DS0_AD_INT_GEN_DUR_G 0x37
  150. /** @} */
  151. /**
  152. * @name LSM6DS0_AD_CTRL_REG1_G register bits definitions
  153. * @{
  154. */
  155. #define LSM6DS0_CTRL_REG1_G 0xFA
  156. #define LSM6DS0_CTRL_REG1_G_BW_G0 (1 << 0)
  157. #define LSM6DS0_CTRL_REG1_G_BW_G1 (1 << 1)
  158. #define LSM6DS0_CTRL_REG1_G_FS_MASK 0x1F
  159. #define LSM6DS0_CTRL_REG1_G_FS_G0 (1 << 3)
  160. #define LSM6DS0_CTRL_REG1_G_FS_G1 (1 << 4)
  161. #define LSM6DS0_CTRL_REG1_G_ODR_G0 (1 << 5)
  162. #define LSM6DS0_CTRL_REG1_G_ODR_G1 (1 << 6)
  163. #define LSM6DS0_CTRL_REG1_G_ODR_G2 (1 << 7)
  164. /** @} */
  165. /**
  166. * @name LSM6DS0_AD_CTRL_REG2_G register bits definitions
  167. * @{
  168. */
  169. #define LSM6DS0_CTRL_REG2_G 0x0F
  170. #define LSM6DS0_CTRL_REG2_G_OUT_SEL0 (1 << 0)
  171. #define LSM6DS0_CTRL_REG2_G_OUT_SEL1 (1 << 1)
  172. #define LSM6DS0_CTRL_REG2_G_INT_SEL0 (1 << 2)
  173. #define LSM6DS0_CTRL_REG2_G_INT_SEL1 (1 << 3)
  174. /** @} */
  175. /**
  176. * @name LSM6DS0_AD_CTRL_REG3_G register bits definitions
  177. * @{
  178. */
  179. #define LSM6DS0_CTRL_REG3_G 0x64
  180. #define LSM6DS0_CTRL_REG3_G_HP_CF0_G (1 << 0)
  181. #define LSM6DS0_CTRL_REG3_G_HP_CF1_G (1 << 1)
  182. #define LSM6DS0_CTRL_REG3_G_HP_CF2_G (1 << 2)
  183. #define LSM6DS0_CTRL_REG3_G_HP_CF3_G (1 << 3)
  184. #define LSM6DS0_CTRL_REG3_G_HP_EN (1 << 6)
  185. #define LSM6DS0_CTRL_REG3_G_LP_MODE (1 << 7)
  186. /** @} */
  187. /**
  188. * @name LSM6DS0_AD_CTRL_REG4 register bits definitions
  189. * @{
  190. */
  191. #define LSM6DS0_CTRL_REG4 0x3A
  192. #define LSM6DS0_CTRL_REG4_4D_XL1 (1 << 0)
  193. #define LSM6DS0_CTRL_REG4_LIR_XL1 (1 << 1)
  194. #define LSM6DS0_CTRL_REG4_XEN_G (1 << 3)
  195. #define LSM6DS0_CTRL_REG4_YEN_G (1 << 4)
  196. #define LSM6DS0_CTRL_REG4_ZEN_G (1 << 5)
  197. /** @} */
  198. /**
  199. * @name LSM6DS0_AD_CTRL_REG5_XL register bits definitions
  200. * @{
  201. */
  202. #define LSM6DS0_CTRL_REG5_XL 0xF8
  203. #define LSM6DS0_CTRL_REG5_XL_XEN_XL (1 << 3)
  204. #define LSM6DS0_CTRL_REG5_XL_YEN_XL (1 << 4)
  205. #define LSM6DS0_CTRL_REG5_XL_ZEN_XL (1 << 5)
  206. #define LSM6DS0_CTRL_REG5_XL_DEC0 (1 << 6)
  207. #define LSM6DS0_CTRL_REG5_XL_DEC1 (1 << 7)
  208. /** @} */
  209. /**
  210. * @name LSM6DS0_AD_CTRL_REG6_XL register bits definitions
  211. * @{
  212. */
  213. #define LSM6DS0_CTRL_REG6_XL 0xFF
  214. #define LSM6DS0_CTRL_REG6_XL_BW_XL0 (1 << 0)
  215. #define LSM6DS0_CTRL_REG6_XL_BW_XL1 (1 << 1)
  216. #define LSM6DS0_CTRL_REG6_XL_BW_SCAL_ODR (1 << 2)
  217. #define LSM6DS0_CTRL_REG6_XL_FS_MASK 0x1F
  218. #define LSM6DS0_CTRL_REG6_XL_FS0_XL (1 << 3)
  219. #define LSM6DS0_CTRL_REG6_XL_FS1_XL (1 << 4)
  220. #define LSM6DS0_CTRL_REG6_XL_ODR_XL0 (1 << 5)
  221. #define LSM6DS0_CTRL_REG6_XL_ODR_XL1 (1 << 6)
  222. #define LSM6DS0_CTRL_REG6_XL_ODR_XL2 (1 << 7)
  223. /** @} */
  224. /**
  225. * @name LSM6DS0_AD_CTRL_REG7_XL register bits definitions
  226. * @{
  227. */
  228. #define LSM6DS0_CTRL_REG7_XL 0xE5
  229. #define LSM6DS0_CTRL_REG7_XL_HPIS1 (1 << 0)
  230. #define LSM6DS0_CTRL_REG7_XL_FDS (1 << 2)
  231. #define LSM6DS0_CTRL_REG7_XL_DCF0 (1 << 5)
  232. #define LSM6DS0_CTRL_REG7_XL_DCF1 (1 << 6)
  233. #define LSM6DS0_CTRL_REG7_XL_HR (1 << 7)
  234. /** @} */
  235. /**
  236. * @name LSM6DS0_AD_CTRL_REG8 register bits definitions
  237. * @{
  238. */
  239. #define LSM6DS0_CTRL_REG8 0xFF
  240. #define LSM6DS0_CTRL_REG8_SW_RESET (1 << 0)
  241. #define LSM6DS0_CTRL_REG8_BLE (1 << 1)
  242. #define LSM6DS0_CTRL_REG8_IF_ADD_INC (1 << 2)
  243. #define LSM6DS0_CTRL_REG8_SIM (1 << 3)
  244. #define LSM6DS0_CTRL_REG8_PP_OD (1 << 4)
  245. #define LSM6DS0_CTRL_REG8_H_LACTIVE (1 << 5)
  246. #define LSM6DS0_CTRL_REG8_BDU (1 << 6)
  247. #define LSM6DS0_CTRL_REG8_BOOT (1 << 7)
  248. /** @} */
  249. /**
  250. * @name LSM6DS0_AD_CTRL_REG9 register bits definitions
  251. * @{
  252. */
  253. #define LSM6DS0_CTRL_REG9 0x5F
  254. #define LSM6DS0_CTRL_REG9_STOP_ON_FTH (1 << 0)
  255. #define LSM6DS0_CTRL_REG9_FIFO_EN (1 << 1)
  256. #define LSM6DS0_CTRL_REG9_I2C_DISABLE (1 << 2)
  257. #define LSM6DS0_CTRL_REG9_DRDY_MASK_BIT (1 << 3)
  258. #define LSM6DS0_CTRL_REG9_FIFO_TEMP_EN (1 << 4)
  259. #define LSM6DS0_CTRL_REG9_SLEEP_G (1 << 6)
  260. /** @} */
  261. /**
  262. * @name LSM6DS0_AD_CTRL_REG10 register bits definitions
  263. * @{
  264. */
  265. #define LSM6DS0_CTRL_REG10 0x05
  266. #define LSM6DS0_CTRL_REG10_ST_XL (1 << 0)
  267. #define LSM6DS0_CTRL_REG10_ST_G (1 << 2)
  268. /** @} */
  269. /*===========================================================================*/
  270. /* Driver pre-compile time settings. */
  271. /*===========================================================================*/
  272. /**
  273. * @name Configuration options
  274. * @{
  275. */
  276. /**
  277. * @brief LSM6DS0 SPI interface switch.
  278. * @details If set to @p TRUE the support for SPI is included.
  279. * @note The default is @p FALSE.
  280. */
  281. #if !defined(LSM6DS0_USE_SPI) || defined(__DOXYGEN__)
  282. #define LSM6DS0_USE_SPI FALSE
  283. #endif
  284. /**
  285. * @brief LSM6DS0 shared SPI switch.
  286. * @details If set to @p TRUE the device acquires SPI bus ownership
  287. * on each transaction.
  288. * @note The default is @p FALSE. Requires SPI_USE_MUTUAL_EXCLUSION.
  289. */
  290. #if !defined(LSM6DS0_SHARED_SPI) || defined(__DOXYGEN__)
  291. #define LSM6DS0_SHARED_SPI FALSE
  292. #endif
  293. /**
  294. * @brief LSM6DS0 I2C interface switch.
  295. * @details If set to @p TRUE the support for I2C is included.
  296. * @note The default is @p TRUE.
  297. */
  298. #if !defined(LSM6DS0_USE_I2C) || defined(__DOXYGEN__)
  299. #define LSM6DS0_USE_I2C TRUE
  300. #endif
  301. /**
  302. * @brief LSM6DS0 shared I2C switch.
  303. * @details If set to @p TRUE the device acquires I2C bus ownership
  304. * on each transaction.
  305. * @note The default is @p FALSE. Requires I2C_USE_MUTUAL_EXCLUSION.
  306. */
  307. #if !defined(LSM6DS0_SHARED_I2C) || defined(__DOXYGEN__)
  308. #define LSM6DS0_SHARED_I2C FALSE
  309. #endif
  310. /**
  311. * @brief LSM6DS0 advanced configurations switch.
  312. * @details If set to @p TRUE more configurations are available.
  313. * @note The default is @p FALSE.
  314. */
  315. #if !defined(LSM6DS0_USE_ADVANCED) || defined(__DOXYGEN__)
  316. #define LSM6DS0_USE_ADVANCED FALSE
  317. #endif
  318. /**
  319. * @brief Number of acquisitions for gyroscope bias removal.
  320. * @details This is the number of acquisitions performed to compute the
  321. * bias. A repetition is required in order to remove noise.
  322. */
  323. #if !defined(LSM6DS0_GYRO_BIAS_ACQ_TIMES) || defined(__DOXYGEN__)
  324. #define LSM6DS0_GYRO_BIAS_ACQ_TIMES 50
  325. #endif
  326. /**
  327. * @brief Settling time for gyroscope bias removal.
  328. * @details This is the time between each bias acquisition.
  329. */
  330. #if !defined(LSM6DS0_GYRO_BIAS_SETTLING_US) || defined(__DOXYGEN__)
  331. #define LSM6DS0_GYRO_BIAS_SETTLING_US 5000
  332. #endif
  333. /** @} */
  334. /*===========================================================================*/
  335. /* Derived constants and error checks. */
  336. /*===========================================================================*/
  337. #if !(LSM6DS0_USE_SPI ^ LSM6DS0_USE_I2C)
  338. #error "LSM6DS0_USE_SPI and LSM6DS0_USE_I2C cannot be both true or both false"
  339. #endif
  340. #if LSM6DS0_USE_SPI && !HAL_USE_SPI
  341. #error "LSM6DS0_USE_SPI requires HAL_USE_SPI"
  342. #endif
  343. #if LSM6DS0_SHARED_SPI && !SPI_USE_MUTUAL_EXCLUSION
  344. #error "LSM6DS0_SHARED_SPI requires SPI_USE_MUTUAL_EXCLUSION"
  345. #endif
  346. #if LSM6DS0_USE_I2C && !HAL_USE_I2C
  347. #error "LSM6DS0_USE_I2C requires HAL_USE_I2C"
  348. #endif
  349. #if LSM6DS0_SHARED_I2C && !I2C_USE_MUTUAL_EXCLUSION
  350. #error "LSM6DS0_SHARED_I2C requires I2C_USE_MUTUAL_EXCLUSION"
  351. #endif
  352. /**
  353. * @todo Add support for LSM6DS0 over SPI.
  354. */
  355. #if LSM6DS0_USE_SPI
  356. #error "LSM6DS0 over SPI still not supported"
  357. #endif
  358. /*===========================================================================*/
  359. /* Driver data structures and types. */
  360. /*===========================================================================*/
  361. /**
  362. * @name LSM6DS0 data structures and types.
  363. * @{
  364. */
  365. /**
  366. * @brief Structure representing a LSM6DS0 driver.
  367. */
  368. typedef struct LSM6DS0Driver LSM6DS0Driver;
  369. /**
  370. * @brief Accelerometer and Gyroscope Slave Address.
  371. */
  372. typedef enum {
  373. LSM6DS0_SAD_GND = 0x6A, /**< SAD pin connected to GND. */
  374. LSM6DS0_SAD_VCC = 0x6B /**< SAD pin connected to VCC. */
  375. } lsm6ds0_sad_t;
  376. /**
  377. * @brief LSM6DS0 accelerometer subsystem full scale.
  378. */
  379. typedef enum {
  380. LSM6DS0_ACC_FS_2G = 0x00, /**< Full scale ±2g. */
  381. LSM6DS0_ACC_FS_4G = 0x10, /**< Full scale ±4g. */
  382. LSM6DS0_ACC_FS_8G = 0x18, /**< Full scale ±8g. */
  383. LSM6DS0_ACC_FS_16G = 0x08 /**< Full scale ±16g. */
  384. } lsm6ds0_acc_fs_t;
  385. /**
  386. * @brief LSM6DS0 accelerometer subsystem output data rate.
  387. */
  388. typedef enum {
  389. LSM6DS0_ACC_ODR_PD = 0x00, /**< Power down */
  390. LSM6DS0_ACC_ODR_10Hz = 0x20, /**< ODR 10 Hz */
  391. LSM6DS0_ACC_ODR_50Hz = 0x40, /**< ODR 50 Hz */
  392. LSM6DS0_ACC_ODR_119Hz = 0x60, /**< ODR 119 Hz */
  393. LSM6DS0_ACC_ODR_238Hz = 0x80, /**< ODR 238 Hz */
  394. LSM6DS0_ACC_ODR_476Hz = 0xA0, /**< ODR 476 Hz */
  395. LSM6DS0_ACC_ODR_952Hz = 0xC0 /**< ODR 952 Hz */
  396. } lsm6ds0_acc_odr_t;
  397. /**
  398. * @brief LSM6DS0 accelerometer subsystem decimation mode.
  399. */
  400. typedef enum {
  401. LSM6DS0_ACC_DEC_DISABLED = 0x00, /**< Decimation disabled. */
  402. LSM6DS0_ACC_DEC_X2 = 0x40, /**< Output updated every 2 samples. */
  403. LSM6DS0_ACC_DEC_X4 = 0x80, /**< Output updated every 4 samples. */
  404. LSM6DS0_ACC_DEC_X8 = 0xC0 /**< Output updated every 8 samples. */
  405. } lsm6ds0_acc_dec_t;
  406. /**
  407. * @brief LSM6DS0 gyroscope subsystem full scale.
  408. */
  409. typedef enum {
  410. LSM6DS0_GYRO_FS_245DPS = 0x00, /**< Full scale ±245 degree per second */
  411. LSM6DS0_GYRO_FS_500DPS = 0x08, /**< Full scale ±500 degree per second */
  412. LSM6DS0_GYRO_FS_2000DPS = 0x18 /**< Full scale ±2000 degree per second */
  413. } lsm6ds0_gyro_fs_t;
  414. /**
  415. * @brief LSM6DS0 gyroscope subsystem output data rate.
  416. */
  417. typedef enum {
  418. LSM6DS0_GYRO_ODR_PD = 0x00,
  419. LSM6DS0_GYRO_ODR_95HZ_FC_25 = 0x10,
  420. LSM6DS0_GYRO_ODR_14_9HZ_FC_5 = 0X20,
  421. LSM6DS0_GYRO_ODR_59_5HZ_FC_16 = 0X40,
  422. LSM6DS0_GYRO_ODR_119HZ_FC_14 = 0X60,
  423. LSM6DS0_GYRO_ODR_119HZ_FC_31 = 0X61,
  424. LSM6DS0_GYRO_ODR_238HZ_FC_14 = 0X80,
  425. LSM6DS0_GYRO_ODR_238HZ_FC_29 = 0X81,
  426. LSM6DS0_GYRO_ODR_238HZ_FC_63 = 0X82,
  427. LSM6DS0_GYRO_ODR_238HZ_FC_78 = 0X83,
  428. LSM6DS0_GYRO_ODR_476HZ_FC_21 = 0XA0,
  429. LSM6DS0_GYRO_ODR_476HZ_FC_28 = 0XA1,
  430. LSM6DS0_GYRO_ODR_476HZ_FC_57 = 0XA2,
  431. LSM6DS0_GYRO_ODR_476HZ_FC_100 = 0XA3,
  432. LSM6DS0_GYRO_ODR_952HZ_FC_33 = 0XC0,
  433. LSM6DS0_GYRO_ODR_952HZ_FC_40 = 0XC1,
  434. LSM6DS0_GYRO_ODR_952HZ_FC_58 = 0XC2,
  435. LSM6DS0_GYRO_ODR_952HZ_FC_100 = 0XC3
  436. } lsm6ds0_gyro_odr_t;
  437. /**
  438. * @brief LSM6DS0 gyroscope subsystem low mode configuration.
  439. */
  440. typedef enum {
  441. LSM6DS0_GYRO_LP_DISABLED = 0x00, /**< Low power mode disabled. */
  442. LSM6DS0_GYRO_LP_ENABLED = 0x80 /**< Low power mode enabled. */
  443. } lsm6ds0_gyro_lp_t;
  444. /**
  445. * @brief LSM6DS0 gyroscope subsystem output selection.
  446. */
  447. typedef enum {
  448. LSM6DS0_GYRO_OUT_SEL_0 = 0x00, /**< Low pass filter 1. */
  449. LSM6DS0_GYRO_OUT_SEL_1 = 0x01, /**< High pass filter 1 if enabled. */
  450. LSM6DS0_GYRO_OUT_SEL_2 = 0x02 /**< Low pass filter 2. */
  451. } lsm6ds0_gyro_out_sel_t;
  452. /**
  453. * @brief LSM6DS0 gyroscope subsystem high pass filter.
  454. */
  455. typedef enum {
  456. LSM6DS0_GYRO_HP_DISABLED = 0x00, /**< High pass filter disabled. */
  457. LSM6DS0_GYRO_HP_ENABLED = 0x40 /**< High pass filter enabled. */
  458. } lsm6ds0_gyro_hp_t;
  459. /**
  460. * @brief LSM6DS0 gyroscope subsystem high pass filter configuration.
  461. */
  462. typedef enum {
  463. LSM6DS0_GYRO_HPCF_0 = 0x00, /**< Refer to table 48 of RM */
  464. LSM6DS0_GYRO_HPCF_1 = 0x01,
  465. LSM6DS0_GYRO_HPCF_2 = 0x02,
  466. LSM6DS0_GYRO_HPCF_3 = 0x03,
  467. LSM6DS0_GYRO_HPCF_4 = 0x04,
  468. LSM6DS0_GYRO_HPCF_5 = 0x05,
  469. LSM6DS0_GYRO_HPCF_6 = 0x06,
  470. LSM6DS0_GYRO_HPCF_7 = 0x07,
  471. LSM6DS0_GYRO_HPCF_8 = 0x08,
  472. LSM6DS0_GYRO_HPCF_9 = 0x09
  473. } lsm6ds0_gyro_hpcf_t;
  474. /**
  475. * @brief LSM6DS0 block data update.
  476. */
  477. typedef enum {
  478. LSM6DS0_BDU_CONTINUOUS = 0x00, /**< Block data continuously updated. */
  479. LSM6DS0_BDU_BLOCKED = 0x40 /**< Block data updated after reading. */
  480. } lsm6ds0_bdu_t;
  481. /**
  482. * @brief LSM6DS0 endianness.
  483. */
  484. typedef enum {
  485. LSM6DS0_END_LITTLE = 0x00, /**< Little endian. */
  486. LSM6DS0_END_BIG = 0x20 /**< Big endian. */
  487. } lsm6ds0_end_t;
  488. /**
  489. * @brief Driver state machine possible states.
  490. */
  491. typedef enum {
  492. LSM6DS0_UNINIT = 0, /**< Not initialized. */
  493. LSM6DS0_STOP = 1, /**< Stopped. */
  494. LSM6DS0_READY = 2, /**< Ready. */
  495. } lsm6ds0_state_t;
  496. /**
  497. * @brief LSM6DS0 configuration structure.
  498. */
  499. typedef struct {
  500. #if (LSM6DS0_USE_SPI) || defined(__DOXYGEN__)
  501. /**
  502. * @brief SPI driver associated to this LSM6DS0.
  503. */
  504. SPIDriver *spip;
  505. /**
  506. * @brief SPI configuration associated to this LSM6DS0 accelerometer
  507. * subsystem.
  508. */
  509. const SPIConfig *accspicfg;
  510. #endif /* LSM6DS0_USE_SPI */
  511. #if (LSM6DS0_USE_I2C) || defined(__DOXYGEN__)
  512. /**
  513. * @brief I2C driver associated to this LSM6DS0.
  514. */
  515. I2CDriver *i2cp;
  516. /**
  517. * @brief I2C configuration associated to this LSM6DS0 accelerometer
  518. * subsystem.
  519. */
  520. const I2CConfig *i2ccfg;
  521. /**
  522. * @brief LSM6DS0 Slave Address
  523. */
  524. lsm6ds0_sad_t slaveaddress;
  525. #endif /* LSM6DS0_USE_I2C */
  526. /**
  527. * @brief LSM6DS0 accelerometer subsystem initial sensitivity.
  528. */
  529. float *accsensitivity;
  530. /**
  531. * @brief LSM6DS0 accelerometer subsystem initial bias.
  532. */
  533. float *accbias;
  534. /**
  535. * @brief LSM6DS0 accelerometer subsystem full scale.
  536. */
  537. lsm6ds0_acc_fs_t accfullscale;
  538. /**
  539. * @brief LSM6DS0 accelerometer subsystem output data rate.
  540. */
  541. lsm6ds0_acc_odr_t accoutdatarate;
  542. #if LSM6DS0_USE_ADVANCED || defined(__DOXYGEN__)
  543. /**
  544. * @brief LSM6DS0 accelerometer subsystem decimation mode.
  545. */
  546. lsm6ds0_acc_dec_t accdecmode;
  547. #endif /* LSM6DS0_USE_ADVANCED */
  548. /**
  549. * @brief LSM6DS0 gyroscope subsystem initial sensitivity.
  550. */
  551. float *gyrosensitivity;
  552. /**
  553. * @brief LSM6DS0 gyroscope subsystem initial bias.
  554. */
  555. float *gyrobias;
  556. /**
  557. * @brief LSM6DS0 gyroscope subsystem full scale.
  558. */
  559. lsm6ds0_gyro_fs_t gyrofullscale;
  560. /**
  561. * @brief LSM6DS0 gyroscope subsystem output data rate.
  562. */
  563. lsm6ds0_gyro_odr_t gyrooutdatarate;
  564. #if LSM6DS0_USE_ADVANCED || defined(__DOXYGEN__)
  565. /**
  566. * @brief LSM6DS0 gyroscope subsystem low mode configuration.
  567. */
  568. lsm6ds0_gyro_lp_t gyrolowmodecfg;
  569. /**
  570. * @brief LSM6DS0 gyroscope subsystem output selection.
  571. */
  572. lsm6ds0_gyro_out_sel_t gyrooutsel;
  573. /**
  574. * @brief LSM6DS0 gyroscope subsystem high pass filter.
  575. */
  576. lsm6ds0_gyro_hp_t gyrohpfenable;
  577. /**
  578. * @brief LSM6DS0 gyroscope subsystem high pass filter configuration.
  579. */
  580. lsm6ds0_gyro_hpcf_t gyrohpcfg;
  581. /**
  582. * @brief LSM6DS0 block data update
  583. */
  584. lsm6ds0_bdu_t blockdataupdate;
  585. /**
  586. * @brief LSM6DS0 endianness
  587. */
  588. lsm6ds0_end_t endianness;
  589. #endif /* LSM6DS0_USE_ADVANCED */
  590. } LSM6DS0Config;
  591. /**
  592. * @brief @p LSM6DS0 specific methods.
  593. */
  594. #define _lsm6ds0_methods_alone \
  595. /* Change full scale value of LSM6DS0 accelerometer subsystem .*/ \
  596. msg_t (*acc_set_full_scale)(LSM6DS0Driver *devp, lsm6ds0_acc_fs_t fs); \
  597. /* Change full scale value of LSM6DS0 gyroscope subsystem .*/ \
  598. msg_t (*gyro_set_full_scale)(LSM6DS0Driver *devp, lsm6ds0_gyro_fs_t fs);
  599. /**
  600. * @brief @p LSM6DS0 specific methods with inherited ones.
  601. */
  602. #define _lsm6ds0_methods \
  603. _base_object_methods \
  604. _lsm6ds0_methods_alone
  605. /**
  606. * @extends BaseObjectVMT
  607. *
  608. * @brief @p LSM6DS0 virtual methods table.
  609. */
  610. struct LSM6DS0VMT {
  611. _lsm6ds0_methods
  612. };
  613. /**
  614. * @brief @p LSM6DS0Driver specific data.
  615. */
  616. #define _lsm6ds0_data \
  617. _base_sensor_data \
  618. /* Driver state.*/ \
  619. lsm6ds0_state_t state; \
  620. /* Current configuration data.*/ \
  621. const LSM6DS0Config *config; \
  622. /* Accelerometer subsystem axes number.*/ \
  623. size_t accaxes; \
  624. /* Accelerometer subsystem current sensitivity.*/ \
  625. float accsensitivity[LSM6DS0_ACC_NUMBER_OF_AXES]; \
  626. /* Accelerometer subsystem current bias .*/ \
  627. float accbias[LSM6DS0_ACC_NUMBER_OF_AXES]; \
  628. /* Accelerometer subsystem current full scale value.*/ \
  629. float accfullscale; \
  630. /* Gyroscope subsystem axes number.*/ \
  631. size_t gyroaxes; \
  632. /* Gyroscope subsystem current sensitivity.*/ \
  633. float gyrosensitivity[LSM6DS0_GYRO_NUMBER_OF_AXES]; \
  634. /* Gyroscope subsystem current Bias.*/ \
  635. float gyrobias[LSM6DS0_GYRO_NUMBER_OF_AXES]; \
  636. /* Gyroscope subsystem current full scale value.*/ \
  637. float gyrofullscale;
  638. /**
  639. * @brief LSM6DS0 6-axis accelerometer/gyroscope class.
  640. */
  641. struct LSM6DS0Driver {
  642. /** @brief Virtual Methods Table.*/
  643. const struct LSM6DS0VMT *vmt;
  644. /** @brief Base accelerometer interface.*/
  645. BaseAccelerometer acc_if;
  646. /** @brief Base gyroscope interface.*/
  647. BaseGyroscope gyro_if;
  648. _lsm6ds0_data
  649. };
  650. /** @} */
  651. /*===========================================================================*/
  652. /* Driver macros. */
  653. /*===========================================================================*/
  654. /**
  655. * @brief Return the number of axes of the BaseAccelerometer.
  656. *
  657. * @param[in] devp pointer to @p LSM6DS0Driver.
  658. *
  659. * @return the number of axes.
  660. *
  661. * @api
  662. */
  663. #define lsm6ds0AccelerometerGetAxesNumber(devp) \
  664. accelerometerGetAxesNumber(&((devp)->acc_if))
  665. /**
  666. * @brief Retrieves raw data from the BaseAccelerometer.
  667. * @note This data is retrieved from MEMS register without any algebraical
  668. * manipulation.
  669. * @note The axes array must be at least the same size of the
  670. * BaseAccelerometer axes number.
  671. *
  672. * @param[in] devp pointer to @p LSM6DS0Driver.
  673. * @param[out] axes a buffer which would be filled with raw data.
  674. *
  675. * @return The operation status.
  676. * @retval MSG_OK if the function succeeded.
  677. * @retval MSG_RESET if one or more I2C errors occurred, the errors can
  678. * be retrieved using @p i2cGetErrors().
  679. * @retval MSG_TIMEOUT if a timeout occurred before operation end.
  680. *
  681. * @api
  682. */
  683. #define lsm6ds0AccelerometerReadRaw(devp, axes) \
  684. accelerometerReadRaw(&((devp)->acc_if), axes)
  685. /**
  686. * @brief Retrieves cooked data from the BaseAccelerometer.
  687. * @note This data is manipulated according to the formula
  688. * cooked = (raw * sensitivity) - bias.
  689. * @note Final data is expressed as milli-G.
  690. * @note The axes array must be at least the same size of the
  691. * BaseAccelerometer axes number.
  692. *
  693. * @param[in] devp pointer to @p LSM6DS0Driver.
  694. * @param[out] axes a buffer which would be filled with cooked data.
  695. *
  696. * @return The operation status.
  697. * @retval MSG_OK if the function succeeded.
  698. * @retval MSG_RESET if one or more I2C errors occurred, the errors can
  699. * be retrieved using @p i2cGetErrors().
  700. * @retval MSG_TIMEOUT if a timeout occurred before operation end.
  701. *
  702. * @api
  703. */
  704. #define lsm6ds0AccelerometerReadCooked(devp, axes) \
  705. accelerometerReadCooked(&((devp)->acc_if), axes)
  706. /**
  707. * @brief Set bias values for the BaseAccelerometer.
  708. * @note Bias must be expressed as milli-G.
  709. * @note The bias buffer must be at least the same size of the
  710. * BaseAccelerometer axes number.
  711. *
  712. * @param[in] devp pointer to @p LSM6DS0Driver.
  713. * @param[in] bp a buffer which contains biases.
  714. *
  715. * @return The operation status.
  716. * @retval MSG_OK if the function succeeded.
  717. *
  718. * @api
  719. */
  720. #define lsm6ds0AccelerometerSetBias(devp, bp) \
  721. accelerometerSetBias(&((devp)->acc_if), bp)
  722. /**
  723. * @brief Reset bias values for the BaseAccelerometer.
  724. * @note Default biases value are obtained from device datasheet when
  725. * available otherwise they are considered zero.
  726. *
  727. * @param[in] devp pointer to @p LSM6DS0Driver.
  728. *
  729. * @return The operation status.
  730. * @retval MSG_OK if the function succeeded.
  731. *
  732. * @api
  733. */
  734. #define lsm6ds0AccelerometerResetBias(devp) \
  735. accelerometerResetBias(&((devp)->acc_if))
  736. /**
  737. * @brief Set sensitivity values for the BaseAccelerometer.
  738. * @note Sensitivity must be expressed as milli-G/LSB.
  739. * @note The sensitivity buffer must be at least the same size of the
  740. * BaseAccelerometer axes number.
  741. *
  742. * @param[in] devp pointer to @p LSM6DS0Driver.
  743. * @param[in] sp a buffer which contains sensitivities.
  744. *
  745. * @return The operation status.
  746. * @retval MSG_OK if the function succeeded.
  747. *
  748. * @api
  749. */
  750. #define lsm6ds0AccelerometerSetSensitivity(devp, sp) \
  751. accelerometerSetSensitivity(&((devp)->acc_if), sp)
  752. /**
  753. * @brief Reset sensitivity values for the BaseAccelerometer.
  754. * @note Default sensitivities value are obtained from device datasheet.
  755. *
  756. * @param[in] devp pointer to @p LSM6DS0Driver.
  757. *
  758. * @return The operation status.
  759. * @retval MSG_OK if the function succeeded.
  760. * @retval MSG_RESET otherwise.
  761. *
  762. * @api
  763. */
  764. #define lsm6ds0AccelerometerResetSensitivity(devp) \
  765. accelerometerResetSensitivity(&((devp)->acc_if))
  766. /**
  767. * @brief Changes the LSM6DS0Driver accelerometer fullscale value.
  768. * @note This function also rescale sensitivities and biases based on
  769. * previous and next fullscale value.
  770. * @note A recalibration is highly suggested after calling this function.
  771. *
  772. * @param[in] devp pointer to @p LSM6DS0Driver.
  773. * @param[in] fs new fullscale value.
  774. *
  775. * @return The operation status.
  776. * @retval MSG_OK if the function succeeded.
  777. * @retval MSG_RESET otherwise.
  778. *
  779. * @api
  780. */
  781. #define lsm6ds0AccelerometerSetFullScale(devp, fs) \
  782. (devp)->vmt->acc_set_full_scale(devp, fs)
  783. /**
  784. * @brief Return the number of axes of the BaseGyroscope.
  785. *
  786. * @param[in] devp pointer to @p LSM6DS0Driver.
  787. *
  788. * @return the number of axes.
  789. *
  790. * @api
  791. */
  792. #define lsm6ds0GyroscopeGetAxesNumber(devp) \
  793. gyroscopeGetAxesNumber(&((devp)->gyro_if))
  794. /**
  795. * @brief Retrieves raw data from the BaseGyroscope.
  796. * @note This data is retrieved from MEMS register without any algebraical
  797. * manipulation.
  798. * @note The axes array must be at least the same size of the
  799. * BaseGyroscope axes number.
  800. *
  801. * @param[in] devp pointer to @p LSM6DS0Driver.
  802. * @param[out] axes a buffer which would be filled with raw data.
  803. *
  804. * @return The operation status.
  805. * @retval MSG_OK if the function succeeded.
  806. * @retval MSG_RESET if one or more I2C errors occurred, the errors can
  807. * be retrieved using @p i2cGetErrors().
  808. * @retval MSG_TIMEOUT if a timeout occurred before operation end.
  809. *
  810. * @api
  811. */
  812. #define lsm6ds0GyroscopeReadRaw(devp, axes) \
  813. gyroscopeReadRaw(&((devp)->gyro_if), axes)
  814. /**
  815. * @brief Retrieves cooked data from the BaseGyroscope.
  816. * @note This data is manipulated according to the formula
  817. * cooked = (raw * sensitivity) - bias.
  818. * @note Final data is expressed as DPS.
  819. * @note The axes array must be at least the same size of the
  820. * BaseGyroscope axes number.
  821. *
  822. * @param[in] devp pointer to @p LSM6DS0Driver.
  823. * @param[out] axes a buffer which would be filled with cooked data.
  824. *
  825. * @return The operation status.
  826. * @retval MSG_OK if the function succeeded.
  827. * @retval MSG_RESET if one or more I2C errors occurred, the errors can
  828. * be retrieved using @p i2cGetErrors().
  829. * @retval MSG_TIMEOUT if a timeout occurred before operation end.
  830. *
  831. * @api
  832. */
  833. #define lsm6ds0GyroscopeReadCooked(devp, axes) \
  834. gyroscopeReadCooked(&((devp)->gyro_if), axes)
  835. /**
  836. * @brief Samples bias values for the BaseGyroscope.
  837. * @note The LSM6DS0 shall not be moved during the whole procedure.
  838. * @note After this function internal bias is automatically updated.
  839. * @note The behavior of this function depends on @p LSM6DS0_BIAS_ACQ_TIMES
  840. * and @p LSM6DS0_BIAS_SETTLING_US.
  841. *
  842. * @param[in] devp pointer to @p LSM6DS0Driver.
  843. *
  844. * @return The operation status.
  845. * @retval MSG_OK if the function succeeded.
  846. * @retval MSG_RESET if one or more I2C errors occurred, the errors can
  847. * be retrieved using @p i2cGetErrors().
  848. * @retval MSG_TIMEOUT if a timeout occurred before operation end.
  849. *
  850. * @api
  851. */
  852. #define lsm6ds0GyroscopeSampleBias(devp) \
  853. gyroscopeSampleBias(&((devp)->gyro_if))
  854. /**
  855. * @brief Set bias values for the BaseGyroscope.
  856. * @note Bias must be expressed as DPS.
  857. * @note The bias buffer must be at least the same size of the BaseGyroscope
  858. * axes number.
  859. *
  860. * @param[in] devp pointer to @p LSM6DS0Driver.
  861. * @param[in] bp a buffer which contains biases.
  862. *
  863. * @return The operation status.
  864. * @retval MSG_OK if the function succeeded.
  865. *
  866. * @api
  867. */
  868. #define lsm6ds0GyroscopeSetBias(devp, bp) \
  869. gyroscopeSetBias(&((devp)->gyro_if), bp)
  870. /**
  871. * @brief Reset bias values for the BaseGyroscope.
  872. * @note Default biases value are obtained from device datasheet when
  873. * available otherwise they are considered zero.
  874. *
  875. * @param[in] devp pointer to @p LSM6DS0Driver.
  876. *
  877. * @return The operation status.
  878. * @retval MSG_OK if the function succeeded.
  879. *
  880. * @api
  881. */
  882. #define lsm6ds0GyroscopeResetBias(devp) \
  883. gyroscopeResetBias(&((devp)->gyro_if))
  884. /**
  885. * @brief Set sensitivity values for the BaseGyroscope.
  886. * @note Sensitivity must be expressed as DPS/LSB.
  887. * @note The sensitivity buffer must be at least the same size of the
  888. * BaseGyroscope axes number.
  889. *
  890. * @param[in] devp pointer to @p LSM6DS0Driver.
  891. * @param[in] sp a buffer which contains sensitivities.
  892. *
  893. * @return The operation status.
  894. * @retval MSG_OK if the function succeeded.
  895. *
  896. * @api
  897. */
  898. #define lsm6ds0GyroscopeSetSensitivity(devp, sp) \
  899. gyroscopeSetSensitivity(&((devp)->gyro_if), sp)
  900. /**
  901. * @brief Reset sensitivity values for the BaseGyroscope.
  902. * @note Default sensitivities value are obtained from device datasheet.
  903. *
  904. * @param[in] devp pointer to @p LSM6DS0Driver.
  905. *
  906. * @return The operation status.
  907. * @retval MSG_OK if the function succeeded.
  908. * @retval MSG_RESET otherwise.
  909. *
  910. * @api
  911. */
  912. #define lsm6ds0GyroscopeResetSensitivity(devp) \
  913. gyroscopeResetSensitivity(&((devp)->gyro_if))
  914. /**
  915. * @brief Changes the LSM6DS0Driver gyroscope fullscale value.
  916. * @note This function also rescale sensitivities and biases based on
  917. * previous and next fullscale value.
  918. * @note A recalibration is highly suggested after calling this function.
  919. *
  920. * @param[in] devp pointer to @p LSM6DS0Driver.
  921. * @param[in] fs new fullscale value.
  922. *
  923. * @return The operation status.
  924. * @retval MSG_OK if the function succeeded.
  925. * @retval MSG_RESET otherwise.
  926. *
  927. * @api
  928. */
  929. #define lsm6ds0GyroscopeSetFullScale(devp, fs) \
  930. (devp)->vmt->acc_set_full_scale(devp, fs)
  931. /*===========================================================================*/
  932. /* External declarations. */
  933. /*===========================================================================*/
  934. #ifdef __cplusplus
  935. extern "C" {
  936. #endif
  937. void lsm6ds0ObjectInit(LSM6DS0Driver *devp);
  938. void lsm6ds0Start(LSM6DS0Driver *devp, const LSM6DS0Config *config);
  939. void lsm6ds0Stop(LSM6DS0Driver *devp);
  940. #ifdef __cplusplus
  941. }
  942. #endif
  943. #endif /* _LSM6DS0_H_ */
  944. /** @} */