LSM303C_ACC_driver.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. /******************** (C) COPYRIGHT 2016 STMicroelectronics ********************
  2. * File Name : LSM303C_ACC_driver.h
  3. * Author : MEMS Application Team
  4. * Version : v1.1
  5. * Date : 22 Nov 2016
  6. * Description : LSM303C header driver file
  7. *
  8. ********************************************************************************
  9. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  10. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
  11. * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
  12. * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
  13. * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
  14. * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  15. *
  16. * THIS SOFTWARE IS SPECIFICALLY DESIGNED FOR EXCLUSIVE USE WITH ST PARTS.
  17. *******************************************************************************/
  18. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef __LSM303C_ACC_DRIVER__H
  20. #define __LSM303C_ACC_DRIVER__H
  21. /* Includes ------------------------------------------------------------------*/
  22. /* Exported types ------------------------------------------------------------*/
  23. //these could change accordingly with the architecture
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #ifndef __ARCHDEP__TYPES
  28. #define __ARCHDEP__TYPES
  29. //typedef unsigned char u8_t;
  30. //typedef unsigned short int u16_t;
  31. //typedef unsigned int u32_t;
  32. typedef int i32_t;
  33. typedef short int i16_t;
  34. typedef signed char i8_t;
  35. #endif /*__ARCHDEP__TYPES*/
  36. /* Exported common structure --------------------------------------------------------*/
  37. #ifndef __SHARED__TYPES
  38. #define __SHARED__TYPES
  39. typedef union{
  40. i16_t i16bit[3];
  41. u8_t u8bit[6];
  42. } Type3Axis16bit_U;
  43. typedef union{
  44. i16_t i16bit;
  45. u8_t u8bit[2];
  46. } Type1Axis16bit_U;
  47. typedef union{
  48. i32_t i32bit;
  49. u8_t u8bit[4];
  50. } Type1Axis32bit_U;
  51. typedef enum {
  52. MEMS_SUCCESS = 0x01,
  53. MEMS_ERROR = 0x00
  54. } status_t;
  55. #endif /*__SHARED__TYPES*/
  56. //#ifndef __SHARED__TYPES
  57. //#define __SHARED__TYPES
  58. //
  59. //typedef struct {
  60. // i16_t AXIS_X;
  61. // i16_t AXIS_Y;
  62. // i16_t AXIS_Z;
  63. //} AxesRaw_t;
  64. //
  65. //typedef u8_t IntPinConf_t;
  66. //typedef u8_t Axis_t;
  67. //typedef u8_t IntConf_t;
  68. //
  69. //#endif /*__SHARED__TYPES*/
  70. /* Exported device structure --------------------------------------------------------*/
  71. //You can use LSM303C_ACC_AXIS_EN_t with or condition
  72. typedef enum {
  73. LSM303C_ACC_DISABLE_ALL = 0x00,
  74. LSM303C_ACC_X_ENABLE = 0x01,
  75. LSM303C_ACC_Y_ENABLE = 0x02,
  76. LSM303C_ACC_Z_ENABLE = 0x04
  77. } LSM303C_ACC_AXIS_EN_t;
  78. typedef enum {
  79. LSM303C_ACC_BDU_DISABLE = 0x00,
  80. LSM303C_ACC_BDU_ENABLE = 0x08
  81. } LSM303C_ACC_BDU_t;
  82. typedef enum {
  83. LSM303C_ACC_ODR_POWER_DOWN = 0x00,
  84. LSM303C_ACC_ODR_10_Hz = 0x10,
  85. LSM303C_ACC_ODR_50_Hz = 0x20,
  86. LSM303C_ACC_ODR_100_Hz = 0x30,
  87. LSM303C_ACC_ODR_200_Hz = 0x40,
  88. LSM303C_ACC_ODR_400_Hz = 0x50,
  89. LSM303C_ACC_ODR_800_Hz = 0x60,
  90. LSM303C_ACC_ODR_MASK = 0x60
  91. } LSM303C_ACC_ODR_t;
  92. typedef enum {
  93. LSM303C_ACC_HIGH_RES_OFF = 0x00,
  94. LSM303C_ACC_HIGH_RES_ON = 0x80
  95. } LSM303C_ACC_HR_t;
  96. typedef enum {
  97. LSM303C_ACC_HP_INT1_DIS = 0x00,
  98. LSM303C_ACC_HP_INT1_EN = 0x01
  99. } LSM303C_ACC_HPIS_INT1_t;
  100. typedef enum {
  101. LSM303C_ACC_HP_INT2_DIS = 0x00,
  102. LSM303C_ACC_HP_INT2_EN = 0x02
  103. } LSM303C_ACC_HPIS_INT2_t;
  104. typedef enum {
  105. LSM303C_ACC_FDS_BYPASS = 0x00,
  106. LSM303C_ACC_FDS_FILTER = 0x04
  107. } LSM303C_ACC_FDS_t;
  108. //Referring DS to HP filter Usage
  109. typedef enum {
  110. LSM303C_ACC_HPM_NORMAL_MODE = 0x00,
  111. LSM303C_ACC_HPM_REF_FOR_FILT = 0x08
  112. } LSM303C_ACC_HPM_t;
  113. //Referring DS to HP filter Usage
  114. typedef enum {
  115. LSM303C_ACC_DFC_ODR_DIV_50 = 0x00,
  116. LSM303C_ACC_DFC_ODR_DIV_100 = 0x20,
  117. LSM303C_ACC_DFC_ODR_DIV_9 = 0x40,
  118. LSM303C_ACC_DFC_ODR_DIV_400 = 0x60
  119. } LSM303C_ACC_DFC_t;
  120. typedef enum {
  121. LSM303C_ACC_INT1_DISABLE = 0x00,
  122. LSM303C_ACC_INT1_DRDY = 0x01,
  123. LSM303C_ACC_INT1_FIFO_TH = 0x02,
  124. LSM303C_ACC_INT1_FIFO_OVR = 0x00,
  125. LSM303C_ACC_INT1_INTGEN1 = 0x08,
  126. LSM303C_ACC_INT1_INTGEN2 = 0x10,
  127. LSM303C_ACC_INT1_INACTIVITY = 0x20
  128. } LSM303C_ACC_INT1_DRDY_t;
  129. typedef enum {
  130. LSM303C_ACC_INT2_DISABLE = 0x00,
  131. LSM303C_ACC_INT2_DRDY = 0x01,
  132. LSM303C_ACC_INT2_FIFO_TH = 0x02,
  133. LSM303C_ACC_INT2_FIFO_EMPTY = 0x00,
  134. LSM303C_ACC_INT2_INTGEN1 = 0x08,
  135. LSM303C_ACC_INT2_INTGEN2 = 0x10,
  136. LSM303C_ACC_INT2_BOOT = 0x20
  137. } LSM303C_ACC_INT2_DRDY_t;
  138. typedef enum {
  139. LSM303C_ACC_REBOOT = 0x80
  140. } LSM303C_ACC_INT2_INTGEN2_t;
  141. typedef enum {
  142. LSM303C_ACC_SIM_4WIRE_INTERFACE = 0x00,
  143. LSM303C_ACC_SIM_3WIRE_INTERFACE = 0x01
  144. } LSM303C_ACC_SIM_t;
  145. typedef enum {
  146. LSM303C_ACC_I2C_ENABLE = 0x00,
  147. LSM303C_ACC_I2C_DISABLE = 0x02
  148. } LSM303C_ACC_I2C_t;
  149. typedef enum {
  150. LSM303C_ACC_IF_ADD_INC_DISABLE = 0x00,
  151. LSM303C_ACC_IF_ADD_INC_ENABLE = 0x04
  152. } LSM303C_ACC_IF_ADD_INC_t;
  153. typedef enum {
  154. LSM303C_ACC_FS_2g = 0x00,
  155. LSM303C_ACC_FS_4g = 0x20,
  156. LSM303C_ACC_FS_8g = 0x30
  157. } LSM303C_ACC_FS_t;
  158. typedef enum {
  159. LSM303C_ACC_BW_400_Hz = 0x08,
  160. LSM303C_ACC_BW_200_Hz = 0x48,
  161. LSM303C_ACC_BW_100_Hz = 0x88,
  162. LSM303C_ACC_BW_50_Hz = 0xC8
  163. } LSM303C_ACC_BW_t;
  164. typedef enum {
  165. LSM303C_ACC_PUSH_PULL_ACTIVE_HIGH = 0x00,
  166. LSM303C_ACC_OPEN_DRAIN_ACTIVE_HIGH = 0x01,
  167. LSM303C_ACC_PUSH_PULL_ACTIVE_LOW = 0x02,
  168. LSM303C_ACC_OPEN_DRAIN_ACTIVE_LOW = 0x03
  169. } LSM303C_ACC_INT_PIN_CFG_t;
  170. typedef enum {
  171. LSM303C_ACC_ST_DISABLE = 0x00,
  172. LSM303C_ACC_ST_POSITIVE = 0x04,
  173. LSM303C_ACC_ST_NEGATIVE = 0x08,
  174. LSM303C_ACC_ST_NA = 0x0C
  175. } LSM303C_ACC_ST_t;
  176. typedef enum {
  177. LSM303C_ACC_DEC_DISABLE = 0x00,
  178. LSM303C_ACC_DEC_2_SAMPLES = 0x10,
  179. LSM303C_ACC_DEC_4_SAMPLES = 0x20,
  180. LSM303C_ACC_DEC_8_SAMPLES = 0x30
  181. } LSM303C_ACC_DEC_t;
  182. typedef enum {
  183. LSM303C_ACC_SOFT_RESET_DISABLE = 0x00,
  184. LSM303C_ACC_SOFT_RESET_ENABLE = 0x40
  185. } LSM303C_ACC_SOFT_RESET_t;
  186. typedef enum {
  187. LSM303C_ACC_DEBUG_DISABLE = 0x00,
  188. LSM303C_ACC_DEBUG_ENABLE = 0x80
  189. } LSM303C_ACC_DEBUG_t;
  190. typedef enum {
  191. LSM303C_ACC_INT1_PULS_INT2_PULS = 0x00,
  192. LSM303C_ACC_INT1_LAT_INT2_PULS = 0x04,
  193. LSM303C_ACC_INT1_PULS_INT2_LAT = 0x08,
  194. LSM303C_ACC_INT1_LAT_INT2_LAT = 0x0C
  195. } LSM303C_ACC_LAT_SIG_t;
  196. typedef enum {
  197. LSM303C_ACC_DUR1_NORST_DUR2_NORST = 0x00,
  198. LSM303C_ACC_DUR1_RST_DUR2_NORST = 0x10,
  199. LSM303C_ACC_DUR1_NORST_DUR2_RST = 0x20,
  200. LSM303C_ACC_DUR1_RST_DUR2_RST = 0x30
  201. } LSM303C_ACC_RESET_DUR_t;
  202. //You can use this typedef with or condition
  203. typedef enum {
  204. LSM303C_ACC_IG1_ON_LOW_X_FLAG_UP = 0x01,
  205. LSM303C_ACC_IG1_ON_HIGH_X_FLAG_UP = 0x02,
  206. LSM303C_ACC_IG1_ON_LOW_Y_FLAG_UP = 0x04,
  207. LSM303C_ACC_IG1_ON_HIGH_Y_FLAG_UP = 0x08,
  208. LSM303C_ACC_IG1_ON_LOW_Z_FLAG_UP = 0x10,
  209. LSM303C_ACC_IG1_ON_HIGH_Z_FLAG_UP = 0x20,
  210. LSM303C_ACC_IA_IG1_FLAG_UP = 0x40
  211. } LSM303C_ACC_IG_FLAGS_t;
  212. typedef enum {
  213. LSM303C_ACC_X_NEW_DATA_AVAILABLE = 0x01,
  214. LSM303C_ACC_Y_NEW_DATA_AVAILABLE = 0x02,
  215. LSM303C_ACC_Z_NEW_DATA_AVAILABLE = 0x04,
  216. LSM303C_ACC_ZYX_NEW_DATA_AVAILABLE = 0x08,
  217. LSM303C_ACC_X_OVERRUN = 0x10,
  218. LSM303C_ACC_Y_OVERRUN = 0x20,
  219. LSM303C_ACC_Z_OVERRUN = 0x40,
  220. LSM303C_ACC_ZYX_OVERRUN = 0x80
  221. } LSM303C_ACC_STATUS_FLAGS_t;
  222. //You can use this typedef with or condition see DS 4D and 6D interrupt
  223. typedef enum {
  224. LSM303C_ACC_IG_DIS = 0x00,
  225. LSM303C_ACC_IG_LOW_X = 0x01,
  226. LSM303C_ACC_IG_HIGH_X = 0x02,
  227. LSM303C_ACC_IG_LOW_Y_ = 0x04,
  228. LSM303C_ACC_IG_HIGH_Y = 0x08,
  229. LSM303C_ACC_IG_LOW_Z = 0x10,
  230. LSM303C_ACC_IG_HIGH_Z = 0x20,
  231. LSM303C_ACC_IG_6D = 0x40,
  232. LSM303C_ACC_IG_4D = 0x80
  233. } LSM303C_ACC_IG_CONFIG_t;
  234. typedef enum {
  235. LSM303C_ACC_4D_INTGEN1_DIS = 0x00,
  236. LSM303C_ACC_4D_INTGEN1_EN = 0x01
  237. } LSM303C_ACC_4D_INTGEN1_t;
  238. typedef enum {
  239. LSM303C_ACC_4D_INTGEN2_DIS = 0x00,
  240. LSM303C_ACC_4D_INTGEN2_EN = 0x02
  241. } LSM303C_ACC_4D_INTGEN2_t;
  242. typedef enum {
  243. LSM303C_ACC_AOI_IG_OR = 0x00,
  244. LSM303C_ACC_AOI_IG_AND = 0x80
  245. } LSM303C_ACC_AOI_IG_t;
  246. typedef enum {
  247. LSM303C_ACC_WAIT_IG_OFF = 0x00,
  248. LSM303C_ACC_WAIT_IG_ON = 0x80
  249. } LSM303C_ACC_WAIT_IG_t;
  250. typedef enum {
  251. LSM303C_ACC_FMODE_BYPASS = 0x00,
  252. LSM303C_ACC_FMODE_STOP_WHEN_FULL = 0x20,
  253. LSM303C_ACC_FMODE_STREAM = 0x40,
  254. LSM303C_ACC_FMODE_STREAM_TO_FIFO = 0x60,
  255. LSM303C_ACC_FMODE_BYPASS_TO_STREAM = 0x80,
  256. LSM303C_ACC_FMODE_BYPASS_TO_FIFO = 0xE0
  257. } LSM303C_ACC_FMODE_t;
  258. typedef enum {
  259. LSM303C_ACC_FIFO_EMPTY_TRUE = 0x20,
  260. LSM303C_ACC_OVR_FIFO_TRUE = 0x40,
  261. LSM303C_ACC_FTH_PASS = 0x80
  262. } LSM303C_ACC_FIFO_FLAGS_t;
  263. typedef enum {
  264. LSM303C_ACC_STOP_FTH_DIS_FIFO_TH = 0x00,
  265. LSM303C_ACC_STOP_FTH_EN_FIFO_TH = 0x40
  266. } LSM303C_ACC_STOP_FTH_t;
  267. typedef enum {
  268. LSM303C_ACC_FIFO_DISABLE = 0x00,
  269. LSM303C_ACC_FIFO_ENABLE = 0x80
  270. } LSM303C_ACC_FIFO_EN_t;
  271. #define LSM303C_ACC_WHO_AM_I 0x41
  272. #define LSM303C_ACC_MEMS_I2C_ADDRESS 0x3A
  273. /* Registers Name ------------------------------------------------------------------------*/
  274. #define LSM303C_ACC_TEMP_L 0x0B
  275. #define LSM303C_ACC_TEMP_H 0x0C
  276. #define LSM303C_ACC_ACT_TSH 0x1E
  277. #define LSM303C_ACC_ACT_DUR 0x1F
  278. #define LSM303C_ACC_WHO_AM_I_REG 0x0F
  279. #define LSM303C_ACC_CTRL1 0x20
  280. #define LSM303C_ACC_CTRL2 0x21
  281. #define LSM303C_ACC_CTRL3 0x22
  282. #define LSM303C_ACC_CTRL4 0x23
  283. #define LSM303C_ACC_CTRL5 0x24
  284. #define LSM303C_ACC_CTRL6 0x25
  285. #define LSM303C_ACC_CTRL7 0x26
  286. #define LSM303C_ACC_STATUS 0x27
  287. #define LSM303C_ACC_OUT_X_L 0x28
  288. #define LSM303C_ACC_OUT_X_H 0x29
  289. #define LSM303C_ACC_OUT_Y_L 0x2A
  290. #define LSM303C_ACC_OUT_Y_H 0x2B
  291. #define LSM303C_ACC_OUT_Z_L 0x2C
  292. #define LSM303C_ACC_OUT_Z_H 0x2D
  293. #define LSM303C_ACC_FIFO_CTRL 0x2E
  294. #define LSM303C_ACC_FIFO_SRC 0x2F
  295. #define LSM303C_ACC_IG_CFG1 0x30
  296. #define LSM303C_ACC_IG_SRC1 0x31
  297. #define LSM303C_ACC_IG_THS_X1 0x32
  298. #define LSM303C_ACC_IG_THS_Y1 0x33
  299. #define LSM303C_ACC_IG_THS_Z1 0x34
  300. #define LSM303C_ACC_IG_DUR1 0x35
  301. #define LSM303C_ACC_IG_CFG2 0x36
  302. #define LSM303C_ACC_IG_SRC2 0x37
  303. #define LSM303C_ACC_IG_THS2 0x38
  304. #define LSM303C_ACC_IG_DUR2 0x39
  305. #define LSM303C_ACC_XL_REFERENCE 0x3A
  306. #define LSM303C_ACC_XH_REFERENCE 0x3B
  307. #define LSM303C_ACC_YL_REFERENCE 0x3C
  308. #define LSM303C_ACC_YH_REFERENCE 0x3D
  309. #define LSM303C_ACC_ZL_REFERENCE 0x3E
  310. #define LSM303C_ACC_ZH_REFERENCE 0x3F
  311. /* Exported macro ------------------------------------------------------------*/
  312. #ifndef __SHARED__MACROS
  313. #define __SHARED__MACROS
  314. #define ValBit(VAR,Place) (VAR & (1<<Place))
  315. #define BIT(x) ( (x) )
  316. #endif /*__SHARED__MACROS*/
  317. /* Exported constants --------------------------------------------------------*/
  318. #ifndef __SHARED__CONSTANTS
  319. #define __SHARED__CONSTANTS
  320. #define MEMS_SET 0x01
  321. #define MEMS_RESET 0x00
  322. #endif /*__SHARED__CONSTANTS*/
  323. /* Exported functions --------------------------------------------------------*/
  324. /**********Sensor Configuration Functions***********/
  325. status_t LSM303C_ACC_SetODR(void *handle, LSM303C_ACC_ODR_t ov);
  326. status_t LSM303C_ACC_SetFullScale(void *handle, LSM303C_ACC_FS_t ov);
  327. status_t LSM303C_ACC_EnableAxis(void *handle, u8_t ov);
  328. /***************Filtering Functions****************/
  329. status_t LSM303C_ACC_HighPassFilterMode(void *handle, LSM303C_ACC_HPM_t ov);
  330. status_t LSM303C_ACC_Select_Bandwidth(void *handle, LSM303C_ACC_BW_t ov);
  331. /***************Interrupt Functions****************/
  332. status_t LSM303C_ACC_EnableInterruptGeneratorOne(void *handle, LSM303C_ACC_IG_CONFIG_t ov);
  333. status_t LSM303C_ACC_EnableInterruptGeneratorTwo(void *handle, LSM303C_ACC_IG_CONFIG_t ov);
  334. status_t LSM303C_ACC_InterruptGeneratorOne_Wait(void *handle, LSM303C_ACC_WAIT_IG_t ov);
  335. status_t LSM303C_ACC_InterruptGeneratorTwo_Wait(void *handle, LSM303C_ACC_WAIT_IG_t ov);
  336. status_t LSM303C_ACC_InterruptGeneratorOne_LogicCondition(void *handle, LSM303C_ACC_AOI_IG_t ov);
  337. status_t LSM303C_ACC_InterruptGeneratorTwo_LogicCondition(void *handle, LSM303C_ACC_AOI_IG_t ov);
  338. status_t LSM303C_ACC_InterruptGeneratorOne_Flag(void *handle, LSM303C_ACC_IG_FLAGS_t *value);
  339. status_t LSM303C_ACC_InterruptGeneratorTwo_Flag(void *handle, LSM303C_ACC_IG_FLAGS_t *value);
  340. status_t LSM303C_ACC_IntPin_Mode(void *handle, LSM303C_ACC_INT_PIN_CFG_t ov);
  341. status_t LSM303C_ACC_EnableInterruptPinOne(void *handle, LSM303C_ACC_INT1_DRDY_t ov);
  342. status_t LSM303C_ACC_EnableInterruptPinTwo(void *handle, LSM303C_ACC_INT2_DRDY_t ov);
  343. status_t LSM303C_ACC_InterruptSignalsMode(void *handle, LSM303C_ACC_LAT_SIG_t ov);
  344. status_t LSM303C_ACC_ResetInterruptDuration(void *handle, LSM303C_ACC_RESET_DUR_t ov);
  345. status_t LSM303C_ACC_Status_Flags(void *handle, u8_t *value);
  346. status_t LSM303C_ACC_SetInterrupt1_Threshold_X(void *handle, u8_t buff);
  347. status_t LSM303C_ACC_SetInterrupt1_Threshold_Y(void *handle, u8_t buff);
  348. status_t LSM303C_ACC_SetInterrupt1_Threshold_Z(void *handle, u8_t buff);
  349. status_t LSM303C_ACC_SetInterrupt2_Threshold_ZYX(void *handle, u8_t buff);
  350. status_t LSM303C_ACC_SetInterrupt1_Duration(void *handle, u8_t buff);
  351. status_t LSM303C_ACC_SetInterrupt2_Duration(void *handle, u8_t buff);
  352. status_t LSM303C_ACC_SetReferenceValue(void *handle, u8_t* buff);
  353. status_t LSM303C_ACC_GetReferenceValue(void *handle, u8_t* buff);
  354. /*****************FIFO Functions******************/
  355. status_t LSM303C_ACC_FIFO_Mode(void *handle, LSM303C_ACC_FMODE_t ov);
  356. status_t LSM303C_ACC_FIFO_Flags(void *handle, LSM303C_ACC_FIFO_FLAGS_t *value);
  357. status_t LSM303C_ACC_FIFO_StopAtTh(void *handle, LSM303C_ACC_STOP_FTH_t ov);
  358. status_t LSM303C_ACC_FIFO(void *handle, LSM303C_ACC_FIFO_EN_t ov);
  359. status_t LSM303C_ACC_SetFIFO_threshold(void *handle, u8_t buff);
  360. status_t LSM303C_ACC_GetFIFO_StoredData(void *handle, u8_t buff);
  361. /***************Utility Functions****************/
  362. status_t LSM303C_ACC_BlockDataUpdate(void *handle, LSM303C_ACC_BDU_t ov);
  363. status_t LSM303C_ACC_SetActivity_Duration(void *handle, u8_t buff);
  364. status_t LSM303C_ACC_SetActivity_Threshold(void *handle, u8_t buff);
  365. status_t LSM303C_ACC_SelfTest(void *handle, LSM303C_ACC_ST_t ov);
  366. status_t LSM303C_ACC_AxOperativeMode(void *handle, LSM303C_ACC_HR_t ov);
  367. status_t LSM303C_ACC_I2C_Mode(void *handle, LSM303C_ACC_I2C_t ov);
  368. status_t LSM303C_ACC_AuotoInc(void *handle, LSM303C_ACC_IF_ADD_INC_t ov);
  369. status_t LSM303C_ACC_SerialInterfaceMode(void *handle, LSM303C_ACC_SIM_t ov);
  370. status_t LSM303C_ACC_DebugMode(void *handle, LSM303C_ACC_DEBUG_t ov);
  371. status_t LSM303C_ACC_SoftReset(void *handle, LSM303C_ACC_SOFT_RESET_t ov);
  372. status_t LSM303C_ACC_Reboot(void *handle);
  373. /****************Reading Functions*****************/
  374. status_t LSM303C_ACC_GetAccRaw(void *handle, u8_t* buff);
  375. status_t LSM303C_ACC_GetTemperatureRaw(void *handle, u16_t* buff);
  376. /*********************Generic*********************/
  377. status_t LSM303C_ACC_ReadReg(void *handle, u8_t Reg, u8_t *Bufp, u16_t len);
  378. status_t LSM303C_ACC_WriteReg(void *handle, u8_t Reg, u8_t *Bufp, u16_t len);
  379. #ifdef __cplusplus
  380. }
  381. #endif
  382. #endif /* __LSM303C_ACC_H */
  383. /******************* (C) COPYRIGHT 2016 STMicroelectronics *****END OF FILE****/