Icm20948Defs.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. /*
  2. * ________________________________________________________________________________________________________
  3. * Copyright © 2014-2015 InvenSense Inc. Portions Copyright © 2014-2015 Movea. All rights reserved.
  4. * This software, related documentation and any modifications thereto (collectively “Software”) is subject
  5. * to InvenSense and its licensors' intellectual property rights under U.S. and international copyright and
  6. * other intellectual property rights laws.
  7. * InvenSense and its licensors retain all intellectual property and proprietary rights in and to the Software
  8. * and any use, reproduction, disclosure or distribution of the Software without an express license
  9. * agreement from InvenSense is strictly prohibited.
  10. * ________________________________________________________________________________________________________
  11. */
  12. #ifndef _INV_ICM20948_DEFINES_H_
  13. #define _INV_ICM20948_DEFINES_H_
  14. #include <string.h>
  15. #include <stdlib.h>
  16. #include "Icm20948Dmp3Driver.h"
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. // compass chip list
  21. #define HW_AK8963 0x20
  22. #define HW_AK8975 0x21
  23. #define HW_AK8972 0x22
  24. #define HW_AK09911 0x23
  25. #define HW_AK09912 0x24
  26. #define HW_AK09916 0x25
  27. #define HW_ICM20648 0x01
  28. #define HW_ICM20948 0x02
  29. #define USE_ICM20948 1
  30. #if defined USE_ICM20648
  31. #define MEMS_CHIP HW_ICM20648
  32. #endif
  33. #if defined USE_ICM20948
  34. #define MEMS_CHIP HW_ICM20948
  35. #endif
  36. #if !defined(MEMS_CHIP)
  37. #error "MEMS_CHIP is not defined"
  38. #elif MEMS_CHIP != HW_ICM20648 \
  39. && MEMS_CHIP != HW_ICM20948
  40. #error "Unknown value for MEMS_CHIP"
  41. #endif
  42. #define DMP_LOAD_START 0x90
  43. #define MPU_SUCCESS (0)
  44. #define MPU_COMPASS_NOT_FOUND (int)0x00ABCDEF
  45. #define MSEC_PER_SEC 1000
  46. #define NSEC_PER_MSEC 1000000
  47. #define NSEC_PER_SEC NSEC_PER_MSEC * MSEC_PER_SEC
  48. #define FIFO_DIVIDER 19
  49. #define REG_BANK_0 0x00
  50. #define REG_BANK_1 0x01
  51. #define DIAMOND_I2C_ADDRESS 0x68
  52. #define BANK_0 (0 << 7)
  53. #define BANK_1 (1 << 7)
  54. #define BANK_2 (2 << 7)
  55. #define BANK_3 (3 << 7)
  56. /*register and associated bit definition*/
  57. /* bank 0 register map */
  58. #define REG_WHO_AM_I (BANK_0 | 0x00)
  59. #define REG_LPF (BANK_0 | 0x01)
  60. #define REG_USER_CTRL (BANK_0 | 0x03)
  61. #define BIT_DMP_EN 0x80
  62. #define BIT_FIFO_EN 0x40
  63. #define BIT_I2C_MST_EN 0x20
  64. #define BIT_I2C_IF_DIS 0x10
  65. #define BIT_DMP_RST 0x08
  66. #define BIT_DIAMOND_DMP_RST 0x04
  67. #define REG_LP_CONFIG (BANK_0 | 0x05)
  68. #define BIT_I2C_MST_CYCLE 0x40
  69. #define BIT_ACCEL_CYCLE 0x20
  70. #define BIT_GYRO_CYCLE 0x10
  71. #define REG_PWR_MGMT_1 (BANK_0 | 0x06)
  72. #define BIT_H_RESET 0x80
  73. #define BIT_SLEEP 0x40
  74. #define BIT_LP_EN 0x20
  75. #define BIT_CLK_PLL 0x01
  76. #define REG_PWR_MGMT_2 (BANK_0 | 0x07)
  77. #define BIT_PWR_PRESSURE_STBY 0x40
  78. #define BIT_PWR_ACCEL_STBY 0x38
  79. #define BIT_PWR_GYRO_STBY 0x07
  80. #define BIT_PWR_ALL_OFF 0x7f
  81. #define REG_INT_PIN_CFG (BANK_0 | 0x0F)
  82. #define BIT_INT_LATCH_EN 0x20
  83. #define BIT_BYPASS_EN 0x02
  84. #define REG_INT_ENABLE (BANK_0 | 0x10)
  85. #define BIT_DMP_INT_EN 0x02
  86. #define REG_INT_ENABLE_1 (BANK_0 | 0x11)
  87. #define BIT_DATA_RDY_3_EN 0x08
  88. #define BIT_DATA_RDY_2_EN 0x04
  89. #define BIT_DATA_RDY_1_EN 0x02
  90. #define BIT_DATA_RDY_0_EN 0x01
  91. #define REG_INT_ENABLE_2 (BANK_0 | 0x12)
  92. #define BIT_FIFO_OVERFLOW_EN_0 0x1
  93. #define REG_INT_ENABLE_3 (BANK_0 | 0x13)
  94. #define REG_DMP_INT_STATUS (BANK_0 | 0x18)
  95. #define BIT_WAKE_ON_MOTION_INT 0x08
  96. #define BIT_MSG_DMP_INT 0x0002
  97. #define BIT_MSG_DMP_INT_0 0x0100 // CI Command
  98. #define BIT_MSG_DMP_INT_2 0x0200 // CIM Command - SMD
  99. #define BIT_MSG_DMP_INT_3 0x0400 // CIM Command - Pedometer
  100. #define BIT_MSG_DMP_INT_4 0x1000 // CIM Command - Pedometer binning
  101. #define BIT_MSG_DMP_INT_5 0x2000 // CIM Command - Bring To See Gesture
  102. #define BIT_MSG_DMP_INT_6 0x4000 // CIM Command - Look To See Gesture
  103. #define REG_INT_STATUS (BANK_0 | 0x19)
  104. #define BIT_DMP_INT 0x02
  105. #define REG_INT_STATUS_1 (BANK_0 | 0x1A)
  106. #define REG_INT_STATUS_2 (BANK_0 | 0x1B)
  107. #define REG_SINGLE_FIFO_PRIORITY_SEL (BANK_0 | 0x26)
  108. #define REG_GYRO_XOUT_H_SH (BANK_0 | 0x33)
  109. #define REG_TEMPERATURE (BANK_0 | 0x39)
  110. #define REG_TEMP_CONFIG (BANK_0 | 0x53)
  111. #define REG_EXT_SLV_SENS_DATA_00 (BANK_0 | 0x3B)
  112. #define REG_EXT_SLV_SENS_DATA_08 (BANK_0 | 0x43)
  113. #define REG_EXT_SLV_SENS_DATA_09 (BANK_0 | 0x44)
  114. #define REG_EXT_SLV_SENS_DATA_10 (BANK_0 | 0x45)
  115. #define REG_FIFO_EN (BANK_0 | 0x66)
  116. #define BIT_SLV_0_FIFO_EN 0x01
  117. #define REG_FIFO_EN_2 (BANK_0 | 0x67)
  118. #define BIT_PRS_FIFO_EN 0x20
  119. #define BIT_ACCEL_FIFO_EN 0x10
  120. #define BITS_GYRO_FIFO_EN 0x0E
  121. #define REG_FIFO_RST (BANK_0 | 0x68)
  122. #define REG_FIFO_COUNT_H (BANK_0 | 0x70)
  123. #define REG_FIFO_COUNT_L (BANK_0 | 0x71)
  124. #define REG_FIFO_R_W (BANK_0 | 0x72)
  125. #define REG_HW_FIX_DISABLE (BANK_0 | 0x75)
  126. #define REG_FIFO_CFG (BANK_0 | 0x76)
  127. #define BIT_MULTI_FIFO_CFG 0x01
  128. #define BIT_SINGLE_FIFO_CFG 0x00
  129. #define REG_ACCEL_XOUT_H_SH (BANK_0 | 0x2D)
  130. #define REG_ACCEL_XOUT_L_SH (BANK_0 | 0x2E)
  131. #define REG_ACCEL_YOUT_H_SH (BANK_0 | 0x2F)
  132. #define REG_ACCEL_YOUT_L_SH (BANK_0 | 0x30)
  133. #define REG_ACCEL_ZOUT_H_SH (BANK_0 | 0x31)
  134. #define REG_ACCEL_ZOUT_L_SH (BANK_0 | 0x32)
  135. #define REG_MEM_START_ADDR (BANK_0 | 0x7C)
  136. #define REG_MEM_R_W (BANK_0 | 0x7D)
  137. #define REG_MEM_BANK_SEL (BANK_0 | 0x7E)
  138. /* bank 1 register map */
  139. #define REG_TIMEBASE_CORRECTION_PLL (BANK_1 | 0x28)
  140. #define REG_TIMEBASE_CORRECTION_RCOSC (BANK_1 | 0x29)
  141. #define REG_SELF_TEST1 (BANK_1 | 0x02)
  142. #define REG_SELF_TEST2 (BANK_1 | 0x03)
  143. #define REG_SELF_TEST3 (BANK_1 | 0x04)
  144. #define REG_SELF_TEST4 (BANK_1 | 0x0E)
  145. #define REG_SELF_TEST5 (BANK_1 | 0x0F)
  146. #define REG_SELF_TEST6 (BANK_1 | 0x10)
  147. #define REG_XA_OFFS_H (BANK_1 | 0x14)
  148. #define REG_XA_OFFS_L (BANK_1 | 0x15)
  149. #define REG_YA_OFFS_H (BANK_1 | 0x17)
  150. #define REG_YA_OFFS_L (BANK_1 | 0x18)
  151. #define REG_ZA_OFFS_H (BANK_1 | 0x1A)
  152. #define REG_ZA_OFFS_L (BANK_1 | 0x1B)
  153. /* bank 2 register map */
  154. #define REG_GYRO_SMPLRT_DIV (BANK_2 | 0x00)
  155. #define REG_GYRO_CONFIG_1 (BANK_2 | 0x01)
  156. #define SHIFT_GYRO_FS_SEL 1
  157. #define SHIFT_GYRO_DLPCFG 3
  158. #define REG_GYRO_CONFIG_2 (BANK_2 | 0x02)
  159. #define BIT_GYRO_CTEN 0x38
  160. #define REG_XG_OFFS_USRH (BANK_2 | 0x03)
  161. #define REG_XG_OFFS_USRL (BANK_2 | 0x04)
  162. #define REG_YG_OFFS_USRH (BANK_2 | 0x05)
  163. #define REG_YG_OFFS_USRL (BANK_2 | 0x06)
  164. #define REG_ZG_OFFS_USRH (BANK_2 | 0x07)
  165. #define REG_ZG_OFFS_USRL (BANK_2 | 0x08)
  166. #define REG_ACCEL_SMPLRT_DIV_1 (BANK_2 | 0x10)
  167. #define REG_ACCEL_SMPLRT_DIV_2 (BANK_2 | 0x11)
  168. #define REG_ACCEL_CONFIG (BANK_2 | 0x14)
  169. #define SHIFT_ACCEL_FS 1
  170. #define REG_ACCEL_CONFIG_2 (BANK_2 | 0x15)
  171. #define BIT_ACCEL_CTEN 0x1C
  172. #define REG_PRS_ODR_CONFIG (BANK_2 | 0x20)
  173. #define REG_PRGM_START_ADDRH (BANK_2 | 0x50)
  174. #define REG_MOD_CTRL_USR (BANK_2 | 0x54)
  175. #define BIT_ODR_SYNC 0x7
  176. /* bank 3 register map */
  177. #define REG_I2C_MST_ODR_CONFIG (BANK_3 | 0x0)
  178. #define REG_I2C_MST_CTRL (BANK_3 | 0x01)
  179. #define BIT_I2C_MST_P_NSR 0x10
  180. #define REG_I2C_MST_DELAY_CTRL (BANK_3 | 0x02)
  181. #define BIT_SLV0_DLY_EN 0x01
  182. #define BIT_SLV1_DLY_EN 0x02
  183. #define BIT_SLV2_DLY_EN 0x04
  184. #define BIT_SLV3_DLY_EN 0x08
  185. #define REG_I2C_SLV0_ADDR (BANK_3 | 0x03)
  186. #define REG_I2C_SLV0_REG (BANK_3 | 0x04)
  187. #define REG_I2C_SLV0_CTRL (BANK_3 | 0x05)
  188. #define REG_I2C_SLV0_DO (BANK_3 | 0x06)
  189. #define REG_I2C_SLV1_ADDR (BANK_3 | 0x07)
  190. #define REG_I2C_SLV1_REG (BANK_3 | 0x08)
  191. #define REG_I2C_SLV1_CTRL (BANK_3 | 0x09)
  192. #define REG_I2C_SLV1_DO (BANK_3 | 0x0A)
  193. #define REG_I2C_SLV2_ADDR (BANK_3 | 0x0B)
  194. #define REG_I2C_SLV2_REG (BANK_3 | 0x0C)
  195. #define REG_I2C_SLV2_CTRL (BANK_3 | 0x0D)
  196. #define REG_I2C_SLV2_DO (BANK_3 | 0x0E)
  197. #define REG_I2C_SLV3_ADDR (BANK_3 | 0x0F)
  198. #define REG_I2C_SLV3_REG (BANK_3 | 0x10)
  199. #define REG_I2C_SLV3_CTRL (BANK_3 | 0x11)
  200. #define REG_I2C_SLV3_DO (BANK_3 | 0x12)
  201. #define REG_I2C_SLV4_CTRL (BANK_3 | 0x15)
  202. #define INV_MPU_BIT_SLV_EN 0x80
  203. #define INV_MPU_BIT_BYTE_SW 0x40
  204. #define INV_MPU_BIT_REG_DIS 0x20
  205. #define INV_MPU_BIT_GRP 0x10
  206. #define INV_MPU_BIT_I2C_READ 0x80
  207. /* register for all banks */
  208. #define REG_BANK_SEL 0x7F
  209. /* data definitions */
  210. #define BYTES_PER_SENSOR 6
  211. #define FIFO_COUNT_BYTE 2
  212. #define HARDWARE_FIFO_SIZE 1024
  213. #define FIFO_SIZE (HARDWARE_FIFO_SIZE * 7 / 8)
  214. #define POWER_UP_TIME 100
  215. #define REG_UP_TIME_USEC 100
  216. #define DMP_RESET_TIME 20
  217. #define GYRO_ENGINE_UP_TIME 50
  218. #define MPU_MEM_BANK_SIZE 256
  219. #define IIO_BUFFER_BYTES 8
  220. #define HEADERED_NORMAL_BYTES 8
  221. #define HEADERED_Q_BYTES 16
  222. #define LEFT_OVER_BYTES 128
  223. #define BASE_SAMPLE_RATE 1125
  224. #ifdef FREQ_225
  225. #define MPU_DEFAULT_DMP_FREQ 225
  226. #define PEDOMETER_FREQ (MPU_DEFAULT_DMP_FREQ >> 2)
  227. #define DEFAULT_ACCEL_GAIN (33554432L * 5 / 11)
  228. #else
  229. #define MPU_DEFAULT_DMP_FREQ 102
  230. #define PEDOMETER_FREQ (MPU_DEFAULT_DMP_FREQ >> 1)
  231. #define DEFAULT_ACCEL_GAIN 33554432L
  232. #endif
  233. #define PED_ACCEL_GAIN 67108864L
  234. #define ALPHA_FILL_PED 858993459
  235. #define A_FILL_PED 214748365
  236. #define MIN_MST_ODR_CONFIG 4
  237. #define THREE_AXES 3
  238. #define NINE_ELEM (THREE_AXES * THREE_AXES)
  239. #define MPU_TEMP_SHIFT 16
  240. #define SOFT_IRON_MATRIX_SIZE (4 * 9)
  241. #define DMP_DIVIDER (BASE_SAMPLE_RATE / MPU_DEFAULT_DMP_FREQ)
  242. #define MAX_5_BIT_VALUE 0x1F
  243. #define BAD_COMPASS_DATA 0x7FFF
  244. #define DEFAULT_BATCH_RATE 400
  245. #define DEFAULT_BATCH_TIME (MSEC_PER_SEC / DEFAULT_BATCH_RATE)
  246. #define MAX_COMPASS_RATE 115
  247. #define MAX_PRESSURE_RATE 30
  248. #define MAX_ALS_RATE 5
  249. #define DATA_AKM_99_BYTES_DMP 10
  250. #define DATA_AKM_89_BYTES_DMP 9
  251. #define DATA_ALS_BYTES_DMP 8
  252. #define APDS9900_AILTL_REG 0x04
  253. #define BMP280_DIG_T1_LSB_REG 0x88
  254. #define COVARIANCE_SIZE 14
  255. #define ACCEL_COVARIANCE_SIZE (COVARIANCE_SIZE * sizeof(int))
  256. #define COMPASS_COVARIANCE_SIZE (COVARIANCE_SIZE * sizeof(int))
  257. #define TEMPERATURE_SCALE 3340827L
  258. #define TEMPERATURE_OFFSET 1376256L
  259. #define SECONDARY_INIT_WAIT 60
  260. #define MPU_SOFT_UPDT_ADDR 0x86
  261. #define MPU_SOFT_UPTD_MASK 0x0F
  262. #define AK99XX_SHIFT 23
  263. #define AK89XX_SHIFT 22
  264. #define OPERATE_GYRO_IN_DUTY_CYCLED_MODE (1<<4)
  265. #define OPERATE_ACCEL_IN_DUTY_CYCLED_MODE (1<<5)
  266. #define OPERATE_I2C_MASTER_IN_DUTY_CYCLED_MODE (1<<6)
  267. /* this is derived from 1000 divided by 55, which is the pedometer
  268. running frequency */
  269. #define MS_PER_PED_TICKS 18
  270. /* data limit definitions */
  271. #define MIN_FIFO_RATE 4
  272. #define MAX_FIFO_RATE MPU_DEFAULT_DMP_FREQ
  273. #define MAX_DMP_OUTPUT_RATE MPU_DEFAULT_DMP_FREQ
  274. #define MAX_READ_SIZE 128
  275. #define MAX_MPU_MEM 8192
  276. #define MAX_PRS_RATE 281
  277. /* data header defines */
  278. #define PRESSURE_HDR 0x8000
  279. #define ACCEL_HDR 0x4000
  280. #define ACCEL_ACCURACY_HDR 0x4080
  281. #define GYRO_HDR 0x2000
  282. #define GYRO_ACCURACY_HDR 0x2080
  283. #define COMPASS_HDR 0x1000
  284. #define COMPASS_HDR_2 0x1800
  285. #define CPASS_ACCURACY_HDR 0x1080
  286. #define ALS_HDR 0x0800
  287. #define SIXQUAT_HDR 0x0400
  288. #define PEDQUAT_HDR 0x0200
  289. #define STEP_DETECTOR_HDR 0x0100
  290. #define COMPASS_CALIB_HDR 0x0080
  291. #define GYRO_CALIB_HDR 0x0040
  292. #define EMPTY_MARKER 0x0020
  293. #define END_MARKER 0x0010
  294. #define NINEQUAT_HDR 0x0008
  295. #define LPQ_HDR 0x0004
  296. #define STEP_INDICATOR_MASK 0x000f
  297. /* init parameters */
  298. #define MPU_INIT_SMD_THLD 1500
  299. #define MPU_INIT_SENSOR_RATE 5
  300. #define MPU_INIT_GYRO_SCALE 3
  301. #define MPU_INIT_ACCEL_SCALE 0
  302. #define MPU_INIT_PED_INT_THRESH 2
  303. #define MPU_INIT_PED_STEP_THRESH 6
  304. #define COMPASS_SLAVEADDR_AKM_BASE 0x0C
  305. #define COMPASS_SLAVEADDR_AKM 0x0E
  306. #define BIT(x) ( 1 << x )
  307. #define ENABLE 1
  308. #define DISABLE 0
  309. // interrupt configurations related to HW register
  310. #define FSYNC_INT BIT(7)
  311. #define MOTION_INT BIT(3)
  312. #define PLL_INT BIT(2)
  313. #define DMP_INT BIT(1)
  314. #define I2C_INT BIT(0)
  315. #define CHIP_AWAKE (0x01)
  316. #define CHIP_LP_ENABLE (0x02)
  317. //ACC_REQUESTED_FREQ
  318. #define DMP_ALGO_FREQ_56 56
  319. #define DMP_ALGO_FREQ_112 112
  320. #define DMP_ALGO_FREQ_225 225
  321. #define DMP_ALGO_FREQ_450 450
  322. #define DMP_ALGO_FREQ_900 900
  323. enum SMARTSENSOR_SERIAL_INTERFACE {
  324. SERIAL_INTERFACE_I2C = 1,
  325. SERIAL_INTERFACE_SPI,
  326. SERIAL_INTERFACE_INVALID
  327. };
  328. enum mpu_accel_fs {
  329. MPU_FS_2G = 0,
  330. MPU_FS_4G,
  331. MPU_FS_8G,
  332. MPU_FS_16G,
  333. NUM_MPU_AFS
  334. };
  335. enum mpu_gyro_fs {
  336. MPU_FS_250dps = 0,
  337. MPU_FS_500dps,
  338. MPU_FS_1000dps,
  339. MPU_FS_2000dps,
  340. NUM_MPU_GFS
  341. };
  342. enum INV_ENGINE {
  343. ENGINE_GYRO = 0,
  344. ENGINE_ACCEL,
  345. ENGINE_I2C,
  346. ENGINE_NUM_MAX,
  347. };
  348. /* enum for android sensor*/
  349. enum ANDROID_SENSORS {
  350. ANDROID_SENSOR_META_DATA = 0,
  351. ANDROID_SENSOR_ACCELEROMETER,
  352. ANDROID_SENSOR_GEOMAGNETIC_FIELD,
  353. ANDROID_SENSOR_ORIENTATION,
  354. ANDROID_SENSOR_GYROSCOPE,
  355. ANDROID_SENSOR_LIGHT,
  356. ANDROID_SENSOR_PRESSURE,
  357. ANDROID_SENSOR_TEMPERATURE,
  358. ANDROID_SENSOR_WAKEUP_PROXIMITY,
  359. ANDROID_SENSOR_GRAVITY,
  360. ANDROID_SENSOR_LINEAR_ACCELERATION,
  361. ANDROID_SENSOR_ROTATION_VECTOR,
  362. ANDROID_SENSOR_HUMIDITY,
  363. ANDROID_SENSOR_AMBIENT_TEMPERATURE,
  364. ANDROID_SENSOR_MAGNETIC_FIELD_UNCALIBRATED,
  365. ANDROID_SENSOR_GAME_ROTATION_VECTOR,
  366. ANDROID_SENSOR_GYROSCOPE_UNCALIBRATED,
  367. ANDROID_SENSOR_WAKEUP_SIGNIFICANT_MOTION,
  368. ANDROID_SENSOR_STEP_DETECTOR,
  369. ANDROID_SENSOR_STEP_COUNTER,
  370. ANDROID_SENSOR_GEOMAGNETIC_ROTATION_VECTOR,
  371. ANDROID_SENSOR_HEART_RATE,
  372. ANDROID_SENSOR_PROXIMITY,
  373. ANDROID_SENSOR_WAKEUP_ACCELEROMETER,
  374. ANDROID_SENSOR_WAKEUP_MAGNETIC_FIELD,
  375. ANDROID_SENSOR_WAKEUP_ORIENTATION,
  376. ANDROID_SENSOR_WAKEUP_GYROSCOPE,
  377. ANDROID_SENSOR_WAKEUP_LIGHT,
  378. ANDROID_SENSOR_WAKEUP_PRESSURE,
  379. ANDROID_SENSOR_WAKEUP_GRAVITY,
  380. ANDROID_SENSOR_WAKEUP_LINEAR_ACCELERATION,
  381. ANDROID_SENSOR_WAKEUP_ROTATION_VECTOR,
  382. ANDROID_SENSOR_WAKEUP_RELATIVE_HUMIDITY,
  383. ANDROID_SENSOR_WAKEUP_AMBIENT_TEMPERATURE,
  384. ANDROID_SENSOR_WAKEUP_MAGNETIC_FIELD_UNCALIBRATED,
  385. ANDROID_SENSOR_WAKEUP_GAME_ROTATION_VECTOR,
  386. ANDROID_SENSOR_WAKEUP_GYROSCOPE_UNCALIBRATED,
  387. ANDROID_SENSOR_WAKEUP_STEP_DETECTOR,
  388. ANDROID_SENSOR_WAKEUP_STEP_COUNTER,
  389. ANDROID_SENSOR_WAKEUP_GEOMAGNETIC_ROTATION_VECTOR,
  390. ANDROID_SENSOR_WAKEUP_HEART_RATE,
  391. ANDROID_SENSOR_WAKEUP_TILT_DETECTOR,
  392. ANDROID_SENSOR_RAW_ACCELEROMETER,
  393. ANDROID_SENSOR_RAW_GYROSCOPE,
  394. ANDROID_SENSOR_NUM_MAX,
  395. ANDROID_SENSOR_B2S,
  396. ANDROID_SENSOR_FLIP_PICKUP,
  397. ANDROID_SENSOR_ACTIVITY_CLASSIFICATON,
  398. ANDROID_SENSOR_SCREEN_ROTATION,
  399. SELF_TEST,
  400. SETUP,
  401. GENERAL_SENSORS_MAX
  402. };
  403. enum SENSOR_ACCURACY {
  404. SENSOR_ACCEL_ACCURACY = 0,
  405. SENSOR_GYRO_ACCURACY,
  406. SENSOR_COMPASS_ACCURACY,
  407. SENSOR_ACCURACY_NUM_MAX,
  408. };
  409. #ifndef min
  410. #define min(x,y) (((x)<(y))?(x):(y))
  411. #endif
  412. #ifndef max
  413. #define max(x,y) (((x)>(y))?(x):(y))
  414. #endif
  415. #ifdef __cplusplus
  416. }
  417. #endif
  418. #endif /* #ifndef _INV_ICM20948_DEFINES_H_ */