1 /* 2 * Copyright (c) 2023 Wuerth Elektronik eiSos GmbH & Co. KG 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /** 8 * @file 9 * @brief Header file for the WSEN-ISDS sensor driver. 10 */ 11 12 #ifndef _WSEN_ISDS_H 13 #define _WSEN_ISDS_H 14 15 /* Includes */ 16 17 #include <stdint.h> 18 19 #include <WeSensorsSDK.h> 20 21 22 /* ISDS 2536030320001 DEVICE_ID */ 23 24 #define ISDS_DEVICE_ID_VALUE 0x6A /**< This is the expected answer when requesting the ISDS_DEVICE_ID_REG */ 25 26 27 /* Available ISDS I2C slave addresses */ 28 29 #define ISDS_ADDRESS_I2C_0 0x6A /**< When SAO of ISDS is connected to ground */ 30 #define ISDS_ADDRESS_I2C_1 0x6B /**< When SAO of ISDS is connected to positive supply voltage */ 31 32 33 /* Register address definitions */ 34 35 #define ISDS_FIFO_CTRL_1_REG 0x06 /**< FIFO configuration register 1 */ 36 #define ISDS_FIFO_CTRL_2_REG 0x07 /**< FIFO configuration register 2 */ 37 #define ISDS_FIFO_CTRL_3_REG 0x08 /**< FIFO configuration register 3 */ 38 #define ISDS_FIFO_CTRL_4_REG 0x09 /**< FIFO configuration register 4 */ 39 #define ISDS_FIFO_CTRL_5_REG 0x0A /**< FIFO configuration register 5 */ 40 #define ISDS_DRDY_PULSE_CFG_REG 0x0B /**< Data ready configuration register */ 41 #define ISDS_INT0_CTRL_REG 0x0D /**< INT0 pin control */ 42 #define ISDS_INT1_CTRL_REG 0x0E /**< INT1 pin control */ 43 #define ISDS_DEVICE_ID_REG 0x0F /**< Device ID register */ 44 #define ISDS_CTRL_1_REG 0x10 /**< Control register 1 (linear acceleration sensor) */ 45 #define ISDS_CTRL_2_REG 0x11 /**< Control register 2 (angular rate sensor) */ 46 #define ISDS_CTRL_3_REG 0x12 /**< Control register 3 */ 47 #define ISDS_CTRL_4_REG 0x13 /**< Control register 4 */ 48 #define ISDS_CTRL_5_REG 0x14 /**< Control register 5 */ 49 #define ISDS_CTRL_6_REG 0x15 /**< Control register 6 (angular rate sensor) */ 50 #define ISDS_CTRL_7_REG 0x16 /**< Control register 7 (angular rate sensor) */ 51 #define ISDS_CTRL_8_REG 0x17 /**< Control register 8 (linear acceleration sensor) */ 52 #define ISDS_CTRL_9_REG 0x18 /**< Control register 9 (linear acceleration sensor) */ 53 #define ISDS_CTRL_10_REG 0x19 /**< Control register 10 */ 54 #define ISDS_WAKE_UP_EVENT_REG 0x1B /**< Wake-up interrupt source register */ 55 #define ISDS_TAP_EVENT_REG 0x1C /**< Tap source register */ 56 #define ISDS_6D_EVENT_REG 0x1D /**< 6D orientation source register */ 57 #define ISDS_STATUS_REG 0x1E /**< Status data register */ 58 #define ISDS_OUT_TEMP_L_REG 0x20 /**< Temperature output value LSB */ 59 #define ISDS_OUT_TEMP_H_REG 0x21 /**< Temperature output value MSB */ 60 #define ISDS_X_OUT_L_GYRO_REG 0x22 /**< Angular rate output value X (pitch) LSB */ 61 #define ISDS_X_OUT_H_GYRO_REG 0x23 /**< Angular rate output value X (pitch) MSB */ 62 #define ISDS_Y_OUT_L_GYRO_REG 0x24 /**< Angular rate output value Y (roll) LSB */ 63 #define ISDS_Y_OUT_H_GYRO_REG 0x25 /**< Angular rate output value Y (roll) MSB */ 64 #define ISDS_Z_OUT_L_GYRO_REG 0x26 /**< Angular rate output value Z (yaw) LSB */ 65 #define ISDS_Z_OUT_H_GYRO_REG 0x27 /**< Angular rate output value Z (yaw) MSB */ 66 #define ISDS_X_OUT_L_ACC_REG 0x28 /**< Linear acceleration output value X LSB */ 67 #define ISDS_X_OUT_H_ACC_REG 0x29 /**< Linear acceleration output value X MSB */ 68 #define ISDS_Y_OUT_L_ACC_REG 0x2A /**< Linear acceleration output value Y LSB */ 69 #define ISDS_Y_OUT_H_ACC_REG 0x2B /**< Linear acceleration output value Y MSB */ 70 #define ISDS_Z_OUT_L_ACC_REG 0x2C /**< Linear acceleration output value Z LSB */ 71 #define ISDS_Z_OUT_H_ACC_REG 0x2D /**< Linear acceleration output value Z MSB */ 72 #define ISDS_FIFO_STATUS_1_REG 0x3A /**< FIFO status register 1 */ 73 #define ISDS_FIFO_STATUS_2_REG 0x3B /**< FIFO status register 2 */ 74 #define ISDS_FIFO_STATUS_3_REG 0x3C /**< FIFO status register 3 */ 75 #define ISDS_FIFO_STATUS_4_REG 0x3D /**< FIFO status register 4 */ 76 #define ISDS_FIFO_DATA_OUT_L_REG 0x3E /**< FIFO data output register LSB */ 77 #define ISDS_FIFO_DATA_OUT_H_REG 0x3F /**< FIFO data output register MSB */ 78 #define ISDS_FUNC_SRC_1_REG 0x53 /**< Tilt interrupt source register */ 79 #define ISDS_TAP_CFG_REG 0x58 /**< Enables interrupt and inactivity functions, configuration of filtering and tap recognition functions */ 80 #define ISDS_TAP_THS_6D_REG 0x59 /**< Portrait/landscape position and tap function threshold register */ 81 #define ISDS_INT_DUR2_REG 0x5A /**< Tap recognition function setting register */ 82 #define ISDS_WAKE_UP_THS_REG 0x5B /**< Single and double-tap function threshold register */ 83 #define ISDS_WAKE_UP_DUR_REG 0x5C /**< Free-fall, wake-up and sleep mode functions duration setting register */ 84 #define ISDS_FREE_FALL_REG 0x5D /**< Free-fall function duration setting register */ 85 #define ISDS_MD1_CFG_REG 0x5E /**< Functions routing on INT0 register */ 86 #define ISDS_MD2_CFG_REG 0x5F /**< Functions routing on INT1 register */ 87 #define ISDS_X_OFS_USR_REG 0x73 /**< Accelerometer X-axis user offset correction */ 88 #define ISDS_Y_OFS_USR_REG 0x74 /**< Accelerometer Y-axis user offset correction */ 89 #define ISDS_Z_OFS_USR_REG 0x75 /**< Accelerometer Z-axis user offset correction */ 90 91 92 /* Register type definitions */ 93 94 /** 95 * @brief ISDS_FIFO_CTRL_1_REG 96 * 97 * Address 0x06 98 * Type R/W 99 * Default value: 0x00 100 */ 101 typedef struct 102 { 103 uint8_t fifoThresholdLsb : 8; /**< FIFO threshold level setting LSB. Default value: 0. Watermark flag rises when the number of bytes written to FIFO after the next write is greater than or equal to the threshold level. Minimum resolution for the FIFO is 1 LSB = 2 bytes (1 word) in FIFO. */ 104 } ISDS_fifoCtrl1_t; 105 106 /** 107 * @brief ISDS_FIFO_CTRL_2_REG 108 * 109 * Address 0x07 110 * Type R/W 111 * Default value: 0x00 112 */ 113 typedef struct 114 { 115 uint8_t fifoThresholdMsb : 3; /**< FIFO threshold level setting MSB. Default value: 0. Watermark flag rises when the number of bytes written to FIFO after the next write is greater than or equal to the threshold level. Minimum resolution for the FIFO is 1LSB = 2 bytes (1 word) in FIFO. */ 116 uint8_t enFifoTemperature : 1; /**< Enables the temperature data storage in FIFO. Default: 0. 0: temperature not included in FIFO; 1: temperature included in FIFO. */ 117 uint8_t notUsed01 : 4; /**< These bits must be set to 0 for proper operation of the device. */ 118 } ISDS_fifoCtrl2_t; 119 120 /** 121 * @brief ISDS_FIFO_CTRL_3_REG 122 * 123 * Address 0x08 124 * Type R/W 125 * Default value: 0x00 126 */ 127 typedef struct 128 { 129 uint8_t fifoAccDecimation : 3; /**< Accelerometer FIFO (second data set) decimation setting. Default: 0. See ISDS_fifoDecimation_t. */ 130 uint8_t fifoGyroDecimation : 3; /**< Gyro FIFO (first data set) decimation setting. Default: 0. See ISDS_fifoDecimation_t. */ 131 uint8_t notUsed01 : 2; /**< These bits must be set to 0 for proper operation of the device. */ 132 } ISDS_fifoCtrl3_t; 133 134 /** 135 * @brief ISDS_FIFO_CTRL_4_REG 136 * 137 * Address 0x09 138 * Type R/W 139 * Default value: 0x00 140 */ 141 typedef struct 142 { 143 uint8_t fifoThirdDecimation : 3; /**< Third FIFO data set decimation setting. Default: 0. See ISDS_fifoDecimation_t. */ 144 uint8_t fifoFourthDecimation : 3; /**< Fourth FIFO data set decimation setting. Default: 0. See ISDS_fifoDecimation_t. */ 145 uint8_t enOnlyHighData : 1; /**< 8-bit data storage in FIFO. Default: 0. 0: disable MSB only memorization in FIFO for XL and Gyro; 1: enable MSB only memorization in FIFO for XL and Gyro in FIFO. */ 146 uint8_t enStopOnThreshold : 1; /**< Enable FIFO threshold level use. Default value: 0. 0: FIFO depth is not limited; 1: FIFO depth is limited to threshold level. */ 147 } ISDS_fifoCtrl4_t; 148 149 /** 150 * @brief ISDS_FIFO_CTRL_5_REG 151 * 152 * Address 0x0A 153 * Type R/W 154 * Default value: 0x00 155 */ 156 typedef struct 157 { 158 uint8_t fifoMode : 3; /**< FIFO mode. See ISDS_fifoMode_t. */ 159 uint8_t fifoOdr : 4; /**< FIFO output data rate. See ISDS_fifoOutputDataRate_t. */ 160 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 161 } ISDS_fifoCtrl5_t; 162 163 /** 164 * @brief ISDS_DRDY_PULSE_CFG_REG 165 * 166 * Address 0x0B 167 * Type R/W 168 * Default value: 0x00 169 */ 170 typedef struct 171 { 172 uint8_t notUsed01 : 7; /**< These bits must be set to 0 for proper operation of the device. */ 173 uint8_t enDataReadyPulsed : 1; /**< Enable pulsed data-ready mode. Default value: 0. 0: data-ready latched mode. Returns to 0 only after output data has been read; 1: data-ready pulsed mode. The data-ready pulses are 75 μs long. */ 174 } ISDS_dataReadyPulseCfg_t; 175 176 /** 177 * @brief ISDS_INT0_CTRL_REG 178 * 179 * Address 0x0D 180 * Type R/W 181 * Default value: 0x00 182 */ 183 typedef struct 184 { 185 uint8_t int0AccDataReady : 1; /**< Accelerometer data-ready on INT0 pin. Default value: 0. */ 186 uint8_t int0GyroDataReady : 1; /**< Gyroscope data-ready on INT0 pin. Default value: 0. */ 187 uint8_t int0Boot : 1; /**< Boot status on INT0 pin. Default value: 0. */ 188 uint8_t int0FifoThreshold : 1; /**< FIFO threshold interrupt on INT0 pin. Default value: 0. */ 189 uint8_t int0FifoOverrun : 1; /**< FIFO overrun interrupt on INT0 pin. Default value: 0. */ 190 uint8_t int0FifoFull : 1; /**< FIFO full interrupt on INT0 pin. Default value: 0. */ 191 uint8_t notUsed01 : 2; /**< These bits must be set to 0 for proper operation of the device. */ 192 } ISDS_int0Ctrl_t; 193 194 /** 195 * @brief ISDS_INT1_CTRL_REG 196 * 197 * Address 0x0E 198 * Type R/W 199 * Default value: 0x00 200 */ 201 typedef struct 202 { 203 uint8_t int1AccDataReady : 1; /**< Accelerometer data-ready on INT1 pin. Default value: 0. */ 204 uint8_t int1GyroDataReady : 1; /**< Gyroscope data-ready on INT1 pin. Default value: 0. */ 205 uint8_t int1TempDataReady : 1; /**< Temperature data-ready on INT1 pin. Default value: 0. */ 206 uint8_t int1FifoThreshold : 1; /**< FIFO threshold interrupt on INT1 pin. Default value: 0. */ 207 uint8_t int1FifoOverrun : 1; /**< FIFO overrun interrupt on INT1 pin. Default value: 0. */ 208 uint8_t int1FifoFull : 1; /**< FIFO full interrupt on INT1 pin. Default value: 0. */ 209 uint8_t notUsed01 : 2; /**< These bits must be set to 0 for proper operation of the device. */ 210 } ISDS_int1Ctrl_t; 211 212 /** 213 * @brief ISDS_CTRL_1_REG 214 * 215 * Address 0x10 216 * Type R/W 217 * Default value: 0x00 218 */ 219 typedef struct 220 { 221 uint8_t accAnalogBandwidth : 1; /**< Accelerometer analog chain bandwidth selection (only for accelerometer ODR ≥ 1.67 kHz). See ISDS_accAnalogChainBandwidth_t. */ 222 uint8_t accDigitalBandwidth : 1; /**< Accelerometer digital LPF (LPF1) bandwidth selection. See ISDS_accDigitalLpfBandwidth_t. */ 223 uint8_t accFullScale : 2; /**< Accelerometer full-scale selection. Default value: 0. See ISDS_accFullScale_t. */ 224 uint8_t accOutputDataRate : 4; /**< Output data rate and power mode selection. Default value: 0. See ISDS_accOutputDataRate_t. */ 225 } ISDS_ctrl1_t; 226 227 /** 228 * @brief ISDS_CTRL_2_REG 229 * 230 * Address 0x11 231 * Type R/W 232 * Default value: 0x00 233 */ 234 typedef struct 235 { 236 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 237 uint8_t gyroFullScale : 3; /**< Gyroscope full-scale selection. Default value: 0. See ISDS_gyroFullScale_t. */ 238 uint8_t gyroOutputDataRate : 4; /**< Output data rate and power mode selection. Default value: 0. See ISDS_gyroOutputDataRate_t. */ 239 } ISDS_ctrl2_t; 240 241 /** 242 * @brief ISDS_CTRL_3_REG 243 * 244 * Address 0x12 245 * Type R/W 246 * Default value: 0x04 247 */ 248 typedef struct 249 { 250 uint8_t softReset : 1; /**< Software reset. 0: normal mode; 1: SW reset; Self-clearing upon completion. */ 251 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 252 uint8_t autoAddIncr : 1; /**< Register address automatically incremented during a multiple byte access with I2C/SPI interface. Default: 1. 0: disable; 1: enable. */ 253 uint8_t spiMode : 1; /**< SPI serial interface mode. 0: 4-wire interface; 1: 3-wire interface. See ISDS_spiMode_t.*/ 254 uint8_t intPinConf : 1; /**< Push-pull/open-drain selection on INT0 and INT1 pads. Default value: 0. 0: push-pull mode; 1: open-drain mode. See ISDS_interruptPinConfig_t. */ 255 uint8_t intActiveLevel : 1; /**< Interrupt activation level. Default value: 0. 0: interrupt output pads active high; 1: interrupt output pads active low. See ISDS_interruptActiveLevel_t. */ 256 uint8_t blockDataUpdate : 1; /**< Block data update. 0: continuous update; 1: output registers are not updated until MSB and LSB have been read. */ 257 uint8_t boot : 1; /**< Set this bit to 1 to initiate boot sequence. 0: normal mode; 1: Execute boot sequence. Self-clearing upon completion. */ 258 } ISDS_ctrl3_t; 259 260 /** 261 * @brief ISDS_CTRL_4_REG 262 * 263 * Address 0x13 264 * Type R/W 265 * Default value: 0x00 266 */ 267 typedef struct 268 { 269 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 270 uint8_t enGyroLPF1 : 1; /**< Enable gyroscope digital LPF1. 0: disabled; 1: enabled. */ 271 uint8_t i2cDisable : 1; /**< Disable I2C interface. Default value: 0. 0: both I2C and SPI enabled; 1: I2C disabled, SPI only. */ 272 uint8_t dataReadyMask : 1; /**< Enables masking of the accelerometer and gyroscope data-ready signals until the settling of the sensor filters is completed. Default value: 0. 0: Masking disabled; 1: Masking enabled. */ 273 uint8_t dataEnableDataReadyOnInt0 : 1; /**< Data enable (DEN) data ready signal on INT0 pad. Default value: 0. 0: disabled; 1: enabled. */ 274 uint8_t int1OnInt0 : 1; /**< All interrupt signals available on INT0 pad enable. Default value: 0. 0: interrupt signals divided between INT0 and INT1 pads; 1: all interrupt signals in logic or on INT0 pad. */ 275 uint8_t enGyroSleepMode : 1; /**< Gyroscope sleep mode enable. Default value: 0. 0: disabled; 1: enabled. */ 276 uint8_t dataEnableExtendToAcc : 1; /**< Extend data enable (DEN) functionality to accelerometer sensor. Default value: 0. 0: disabled; 1: enabled. */ 277 } ISDS_ctrl4_t; 278 279 /** 280 * @brief ISDS_CTRL_5_REG 281 * 282 * Address 0x14 283 * Type R/W 284 * Default value: 0x00 285 */ 286 typedef struct 287 { 288 uint8_t accSelfTest : 2; /**< Accelerometer self-test enable. Default value: 0. See ISDS_accSelfTestMode_t. */ 289 uint8_t gyroSelfTest : 2; /**< Gyroscope self-test enable. Default value: 0. See ISDS_gyroSelfTestMode_t. */ 290 uint8_t dataEnableActiveLevel : 1; /**< Data enable (DEN) active level configuration. Default value: 0. 0: active low; 1: active high. */ 291 uint8_t rounding : 3; /**< Circular burst-mode (rounding) read from output registers through the primary interface. Default value: 0. See ISDS_roundingPattern_t. */ 292 } ISDS_ctrl5_t; 293 294 /** 295 * @brief ISDS_CTRL_6_REG 296 * 297 * Address 0x15 298 * Type R/W 299 * Default value: 0x00 300 */ 301 typedef struct 302 { 303 uint8_t gyroLowPassFilterType : 2; /**< Gyroscope low-pass filter (LPF1) bandwidth selection. See ISDS_gyroLPF_t. */ 304 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 305 uint8_t userOffsetsWeight : 1; /**< Weight of accelerometer user offset bits in registers ISDS_X_OFS_USR_REG, ISDS_Y_OFS_USR_REG, ISDS_Z_OFS_USR_REG. 0: 2^-10 g/LSB; 1: 2^-6 g/LSB. */ 306 uint8_t accHighPerformanceModeDisable : 1; /**< High-performance operating mode disable for accelerometer. Default value: 0. 0: high-performance operating mode enabled; 1: high-performance operating mode disabled. */ 307 uint8_t dataEnableTriggerMode : 3; /**< Data enable (DEN) trigger mode. See ISDS_dataEnableTriggerMode_t. */ 308 } ISDS_ctrl6_t; 309 310 /** 311 * @brief ISDS_CTRL_7_REG 312 * 313 * Address 0x16 314 * Type R/W 315 * Default value: 0x00 316 */ 317 typedef struct 318 { 319 uint8_t notUsed01 : 2; /**< These bits must be set to 0 for proper operation of the device. */ 320 uint8_t enRounding : 1; /**< Source register rounding function on ISDS_WAKE_UP_EVENT_REG, ISDS_TAP_EVENT_REG, ISDS_6D_EVENT_REG, ISDS_STATUS_REG and ISDS_FUNC_SRC_1_REG registers in the primary interface. Default value: 0. 0: rounding disabled; 1: rounding enabled. */ 321 uint8_t notUsed02 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 322 uint8_t gyroDigitalHighPassCutoff : 2; /**< Gyroscope digital HP filter cutoff selection. Default: 0. See ISDS_gyroDigitalHighPassCutoff_t. */ 323 uint8_t gyroDigitalHighPassEnable : 1; /**< Gyroscope digital high-pass filter enable. The filter is enabled only if the gyro is in HP mode. Default value: 0. 0: HPF disabled; 1: HPF enabled. */ 324 uint8_t gyroHighPerformanceModeDisable : 1; /**< High-performance operating mode disable for gyroscope. Default: 0. 0: high-performance operating mode enabled; 1: high-performance operating mode disabled. */ 325 } ISDS_ctrl7_t; 326 327 /** 328 * @brief ISDS_CTRL_8_REG 329 * 330 * Address 0x17 331 * Type R/W 332 * Default value: 0x00 333 */ 334 typedef struct 335 { 336 uint8_t en6dLowPass: 1; /**< LPF2 on 6D function selection. */ 337 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 338 uint8_t enAccHighPassSlopeFilter : 1; /**< Accelerometer slope filter / high-pass filter selection. 0: the low-pass path of the composite filter block is selected; 1: the high-pass path of the composite filter block is selected. */ 339 uint8_t inputComposite : 1; /**< Composite filter input selection. See ISDS_inputCompositeFilter_t. Default: 0. 0: ODR/2 low pass filtered sent to composite filter (default); 1: ODR/4 low pass filtered sent to composite filter. */ 340 uint8_t highPassFilterRefMode : 1; /**< Enable HP filter reference mode (when enabled, the first output data has to be discarded). Default value: 0. 0: disabled; 1: enabled. */ 341 uint8_t accFilterConfig : 2; /**< Accelerometer LPF2 and high-pass filter configuration and cutoff setting. See ISDS_accFilterConfig_t. */ 342 uint8_t enAccLowPass : 1; /**< Accelerometer low-pass filter LPF2 selection. */ 343 } ISDS_ctrl8_t; 344 345 /** 346 * @brief ISDS_CTRL_9_REG 347 * 348 * Address 0x18 349 * Type R/W 350 * Default value: 0xE0 351 */ 352 typedef struct 353 { 354 uint8_t notUsed01 : 4; /**< These bits must be set to 0 for proper operation of the device. */ 355 uint8_t dataEnableStampingSensor : 1; /**< Data enable (DEN) stamping sensor selection. See ISDS_dataEnableStampingSensor_t. Default value: 0. 0: DEN pin info stamped in the gyroscope axis selected by bits [7:5]; 1: DEN pin info stamped in the accelerometer axis selected by bits [7:5]. */ 356 uint8_t dataEnableValueZ : 1; /**< Data enable (DEN) value stored in LSB of Z-axis. Default value: 1. 0: DEN not stored in Z-axis LSB; 1: DEN stored in Z-axis LSB. */ 357 uint8_t dataEnableValueY : 1; /**< Data enable (DEN) value stored in LSB of Y-axis. Default value: 1. 0: DEN not stored in Y-axis LSB; 1: DEN stored in Y-axis LSB. */ 358 uint8_t dataEnableValueX : 1; /**< Data enable (DEN) value stored in LSB of X-axis. Default value: 1. 0: DEN not stored in X-axis LSB; 1: DEN stored in X-axis LSB. */ 359 } ISDS_ctrl9_t; 360 361 /** 362 * @brief ISDS_CTRL_10_REG 363 * 364 * Address 0x19 365 * Type R/W 366 * Default value: 0x00 367 */ 368 typedef struct 369 { 370 uint8_t notUsed01 : 2; /**< These bits must be set to 0 for proper operation of the device. */ 371 uint8_t enEmbeddedFunc : 1; /**< Enable embedded functionalities (tilt). Default value: 0. 0: disable functionalities of embedded functions and accelerometer filters; 1: enable functionalities of embedded functions and accelerometer filters. */ 372 uint8_t enTiltCalculation : 1; /**< Enable tilt calculation. */ 373 uint8_t notUsed02 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 374 uint8_t notUsed03 : 3; /**< These bits must be set to 0 for proper operation of the device. */ 375 } ISDS_ctrl10_t; 376 377 /** 378 * @brief ISDS_WAKE_UP_EVENT_REG 379 * 380 * Address 0x1B 381 * Type R 382 * Default value: 0x00 383 */ 384 typedef struct 385 { 386 uint8_t wakeUpZ : 1; /**< Wake-up event on Z-axis status. 0: Wake-up event on Z-axis not detected; 1: Wake-up event on Z-axis detected. */ 387 uint8_t wakeUpY : 1; /**< Wake-up event on Y-axis status. 0: Wake-up event on Y-axis not detected; 1: Wake-up event on Y-axis detected. */ 388 uint8_t wakeUpX : 1; /**< Wake-up event on X-axis status. 0: Wake-up event on X-axis not detected; 1: Wake-up event on X-axis detected. */ 389 uint8_t wakeUpState : 1; /**< Wake-up event detection status. 0: Wake-up event not detected; 1: Wake-up event detected. */ 390 uint8_t sleepState : 1; /**< Sleep event status. 0: Sleep event not detected; 1: Sleep event detected. */ 391 uint8_t freeFallState : 1; /**< Free-fall event detection status. 0: FF event not detected; 1: FF event detected. */ 392 uint8_t notUsed01 : 2; /**< These bits must be set to 0 for proper operation of the device. */ 393 } ISDS_wakeUpEvent_t; 394 395 /** 396 * @brief ISDS_TAP_EVENT_REG 397 * 398 * Address 0x1C 399 * Type R 400 * Default value: 0x00 401 */ 402 typedef struct 403 { 404 uint8_t tapZAxis : 1; /**< Tap event detection on Z-axis status. 0: Tap event on Z-axis not detected; 1: Tap event on Z-axis detected. */ 405 uint8_t tapYAxis : 1; /**< Tap event detection on Y-axis status. 0: Tap event on Y-axis not detected; 1: Tap event on Y-axis detected. */ 406 uint8_t tapXAxis : 1; /**< Tap event detection on X-axis status. 0: Tap event on X-axis not detected; 1: Tap event on X-axis detected. */ 407 uint8_t tapSign : 1; /**< Sign of acceleration detected by tap event. 0: Tap in positive direction; 1: Tap in negative direction. */ 408 uint8_t doubleState : 1; /**< Double-tap event status. 0: Double-tap event not detected; 1: Double-tap event detected. */ 409 uint8_t singleState : 1; /**< Single-tap event status. 0: Single-tap event not detected; 1: Single-tap event detected. */ 410 uint8_t tapEventState : 1; /**< Tap event status. 0: Tap event not detected; 1: Tap event detected. */ 411 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 412 } ISDS_tapEvent_t; 413 414 /** 415 * @brief ISDS_6D_EVENT_REG 416 * 417 * Address 0x1D 418 * Type R 419 * Default value: 0x00 420 */ 421 typedef struct 422 { 423 uint8_t xlOverThreshold : 1; /**< 1: XL threshold exceeded; 0: XL threshold not exceeded */ 424 uint8_t xhOverThreshold : 1; /**< 1: XH threshold exceeded; 0: XH threshold not exceeded */ 425 uint8_t ylOverThreshold : 1; /**< 1: YL threshold exceeded; 0: YL threshold not exceeded */ 426 uint8_t yhOverThreshold : 1; /**< 1: YH threshold exceeded; 0: YH threshold not exceeded */ 427 uint8_t zlOverThreshold : 1; /**< 1: ZL threshold exceeded; 0: ZL threshold not exceeded */ 428 uint8_t zhOverThreshold : 1; /**< 1: ZH threshold exceeded; 0: ZH threshold not exceeded */ 429 uint8_t sixDChange : 1; /**< Orientation change detection status (0: No event detected; 1: A change in orientation has been detected) */ 430 uint8_t dataEnableDataReady : 1; /**< Data enable (DEN) data-ready signal. It is set high when data output is related to the data coming from a DEN active condition. */ 431 } ISDS_6dEvent_t; 432 433 /** 434 * @brief ISDS_STATUS_REG 435 * 436 * Address 0x1E 437 * Type R 438 * Default value: 0x00 439 */ 440 typedef struct 441 { 442 uint8_t accDataReady : 1; /**< 1: New acceleration data available; 0: No new data available. */ 443 uint8_t gyroDataReady : 1; /**< 1: New gyroscope data available; 0: No new data available. */ 444 uint8_t tempDataReady: 1; /**< 1: New temperature data available; 0: No new data available. */ 445 uint8_t notUsed01 : 5; /**< These bits must be set to 0 for proper operation of the device. */ 446 } ISDS_status_t; 447 448 /** 449 * @brief ISDS_FIFO_STATUS_1_REG 450 * 451 * Address 0x3A 452 * Type R 453 * Default value: 0x00 454 */ 455 typedef struct 456 { 457 uint8_t fifoFillLevelLsb : 8; /**< Current fill level of FIFO (0-2047) i.e. the number of unread samples (16-bit values). */ 458 } ISDS_fifoStatus1_t; 459 460 /** 461 * @brief ISDS_FIFO_STATUS_2_REG 462 * 463 * Address 0x3B 464 * Type R 465 * Default value: 0x00 466 */ 467 typedef struct 468 { 469 uint8_t fifoFillLevelMsb : 3; /**< Current fill level of FIFO (0-2047) i.e. the number of unread samples (16-bit values). */ 470 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 471 uint8_t fifoEmptyState : 1; /**< FIFO empty bit. Default value: 0. 0: FIFO contains data; 1: FIFO is empty. */ 472 uint8_t fifoFullSmartState : 1; /**< Smart FIFO full status. Default value: 0. 0: FIFO is not full; 1: FIFO will be full at the next ODR. */ 473 uint8_t fifoOverrunState : 1; /**< FIFO overrun status. Default value: 0. 0: FIFO is not completely filled; 1: FIFO is completely filled. */ 474 uint8_t fifoThresholdState : 1; /**< FIFO threshold status bit. 0: FIFO filling is lower than threshold level, 1: FIFO filling is equal to or higher than the threshold level. */ 475 } ISDS_fifoStatus2_t; 476 477 /** 478 * @brief ISDS_FIFO_STATUS_3_REG 479 * 480 * Address 0x3C 481 * Type R 482 * Default value: 0x00 483 */ 484 typedef struct 485 { 486 uint8_t fifoPatternLsb : 8; /**< Word of recursive pattern read at the next read. */ 487 } ISDS_fifoStatus3_t; 488 489 /** 490 * @brief ISDS_FIFO_STATUS_4_REG 491 * 492 * Address 0x3D 493 * Type R 494 * Default value: 0x00 495 */ 496 typedef struct 497 { 498 uint8_t fifoPatternMsb : 2; /**< Word of recursive pattern read at the next read. */ 499 uint8_t notUsed01 : 6; /**< These bits must be set to 0 for proper operation of the device. */ 500 } ISDS_fifoStatus4_t; 501 502 /** 503 * @brief ISDS_FUNC_SRC_1_REG 504 * 505 * Address 0x53 506 * Type R 507 * Default value: 0x00 508 */ 509 typedef struct 510 { 511 uint8_t notUsed01 : 5; /**< These bits must be set to 0 for proper operation of the device. */ 512 uint8_t tiltState : 1; /**< Tilt event detection status. Default value: 0. 0: tilt event not detected; 1: tilt event detected. */ 513 uint8_t notUsed02 : 2; /**< These bits must be set to 0 for proper operation of the device. */ 514 } ISDS_funcSrc1_t; 515 516 /** 517 * @brief ISDS_TAP_CFG_REG 518 * 519 * Address 0x58 520 * Type R/W 521 * Default value: 0x00 522 */ 523 typedef struct 524 { 525 uint8_t latchedInterrupt : 1; /**< Latched Interrupt. Default value: 0. 0: interrupt request not latched; 1: interrupt request latched. */ 526 uint8_t enTapZ : 1; /**< Enable Z direction in tap recognition. Default value: 0. 0: Z direction disabled; 1: Z direction enabled. */ 527 uint8_t enTapY : 1; /**< Enable Y direction in tap recognition. Default value: 0. 0: Y direction disabled; 1: Y direction enabled. */ 528 uint8_t enTapX : 1; /**< Enable X direction in tap recognition. Default value: 0. 0: X direction disabled; 1: X direction enabled. */ 529 uint8_t filterSelection : 1; /**< HPF or SLOPE filter selection on wake-up and activity/inactivity functions. See ISDS_activityFilter_t. Default value: 0. 0: SLOPE filter applied; 1: HPF applied. */ 530 uint8_t enInactivity : 2; /**< Enable inactivity function. Default value: 0. See ISDS_inactivityFunction_t. */ 531 uint8_t enInterrupts : 1; /**< Enable basic interrupts (6D/4D, free-fall, wake-up, tap, inactivity). Default value: 0. 0: interrupt disabled; 1: interrupt enabled. */ 532 } ISDS_tapCfg_t; 533 534 /** 535 * @brief ISDS_TAP_THS_6D_REG 536 * 537 * Address 0x59 538 * Type R/W 539 * Default value: 0x00 540 */ 541 typedef struct 542 { 543 uint8_t tapThreshold : 5; /**< Threshold for tap recognition. Default value: 0. 1 LSB corresponds to FS/32. */ 544 uint8_t sixDThreshold : 2; /**< Threshold for 4D/6D function. Default value: 0. See ISDS_sixDThreshold_t. */ 545 uint8_t fourDDetectionEnabled : 1; /**< Enable 4D portrait/landscape detection. 0: 4D mode disabled; 1: portrait/landscape detection and face-up/face-down detection enabled. */ 546 } ISDS_tapThs6d_t; 547 548 /** 549 * @brief ISDS_INT_DUR2_REG 550 * 551 * Address 0x5A 552 * Type R/W 553 * Default value: 0x00 554 */ 555 typedef struct 556 { 557 uint8_t shock : 2; /**< Defines the maximum duration of over-threshold event when detecting taps. */ 558 uint8_t quiet : 2; /**< Defines the expected quiet time after a tap detection. */ 559 uint8_t latency : 4; /**< Defines the maximum duration time gap for double-tap recognition. */ 560 } ISDS_intDur2_t; 561 562 /** 563 * @brief ISDS_WAKE_UP_THS_REG 564 * 565 * Address 0x5B 566 * Type R/W 567 * Default value: 0x00 568 */ 569 typedef struct 570 { 571 uint8_t wakeUpThreshold : 6; /**< Defines wake-up threshold, 6-bit unsigned 1 LSB = 1/64 of FS. Default value: 0. */ 572 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 573 uint8_t enDoubleTapEvent : 1; /**< Enable double-tap event. Default value: 0. 0: enable only single-tap; 1: enable both (single and double-tap). */ 574 } ISDS_wakeUpThs_t; 575 576 /** 577 * @brief ISDS_WAKE_UP_DUR_REG 578 * 579 * Address 0x5C 580 * Type R/W 581 * Default value: 0x00 582 */ 583 typedef struct 584 { 585 uint8_t sleepDuration : 4; /**< Defines the sleep mode duration. Default value is 0 (which is 16 * 1/ODR). 1 LSB = 512 * 1/ODR */ 586 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 587 uint8_t wakeUpDuration : 2; /**< This parameter defines the wake-up duration. 1 LSB = 1 * 1/ODR. */ 588 uint8_t freeFallDurationMSB : 1; /**< This bit defines the free-fall duration. Combined with FF_DUR [4:0] bit in ISDS_FREE_FALL_REG register. 1 LSB = 1 * 1/ODR. */ 589 } ISDS_wakeUpDur_t; 590 591 /** 592 * @brief ISDS_FREE_FALL_REG 593 * 594 * Address 0x5D 595 * Type R/W 596 * Default value: 0x00 597 * 598 * freeFallThreshold | Decoded threshold 599 * ---------------------------------------- 600 * 000 | 5 601 * 001 | 7 602 * 010 | 8 603 * 011 | 10 604 * 100 | 11 605 * 101 | 13 606 * 110 | 15 607 * 111 | 16 608 */ 609 typedef struct 610 { 611 uint8_t freeFallThreshold : 3; /**< Encoded free-fall threshold value. See ISDS_freeFallThreshold_t. The decoded value can be multiplied with 31.25mg to get the used threshold. */ 612 uint8_t freeFallDurationLSB: 5; /**< Defines free-fall duration. Is combined with FF_DUR5 bit in ISDS_WAKE_UP_DUR_REG register. 1 LSB = 1 * 1/ODR. */ 613 } ISDS_freeFall_t; 614 615 /** 616 * @brief ISDS_MD1_CFG_REG 617 * 618 * Address 0x5E 619 * Type R/W 620 * Default value: 0x00 621 */ 622 typedef struct 623 { 624 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 625 uint8_t int0Tilt : 1; /**< Routing of tilt event on INT0. Default value: 0. 0: routing disabled; 1: routing enabled. */ 626 uint8_t int06d : 1; /**< Routing of 6D event on INT0. Default value: 0. 0: routing disabled; 1: routing enabled. */ 627 uint8_t int0DoubleTap : 1; /**< Routing of double tap event on INT0. Default value: 0. 0: routing disabled; 1: routing enabled. */ 628 uint8_t int0FreeFall : 1; /**< Routing of free fall event on INT0. Default value: 0. 0: routing disabled; 1: routing enabled. */ 629 uint8_t int0WakeUp : 1; /**< Routing of wake-up event on INT0. Default value: 0. 0: routing disabled; 1: routing enabled. */ 630 uint8_t int0SingleTap : 1; /**< Routing of single tap event on INT0. Default value: 0. 0: routing disabled; 1: routing enabled. */ 631 uint8_t int0InactivityState : 1; /**< Routing of inactivity on INT0. Default value: 0. 0: routing disabled; 1: routing enabled. */ 632 } ISDS_mde1Cfg_t; 633 634 /** 635 * @brief ISDS_MD2_CFG_REG 636 * 637 * Address 0x5F 638 * Type R/W 639 * Default value: 0x00 640 */ 641 typedef struct 642 { 643 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device. */ 644 uint8_t int1Tilt : 1; /**< Routing of tilt event on INT1. Default value: 0. 0: routing disabled; 1: routing enabled. */ 645 uint8_t int16d : 1; /**< Routing of 6D event on INT1. Default value: 0. 0: routing disabled; 1: routing enabled. */ 646 uint8_t int1DoubleTap : 1; /**< Routing of double tap event on INT1. Default value: 0. 0: routing disabled; 1: routing enabled. */ 647 uint8_t int1FreeFall : 1; /**< Routing of free fall event on INT1. Default value: 0. 0: routing disabled; 1: routing enabled. */ 648 uint8_t int1WakeUp : 1; /**< Routing of wake-up event on INT1. Default value: 0. 0: routing disabled; 1: routing enabled. */ 649 uint8_t int1SingleTap : 1; /**< Routing of single tap event on INT1. Default value: 0. 0: routing disabled; 1: routing enabled. */ 650 uint8_t int1InactivityState : 1; /**< Routing of inactivity on INT1. Default value: 0. 0: routing disabled; 1: routing enabled. */ 651 } ISDS_mde2Cfg_t; 652 653 654 /* Functional type definitions */ 655 656 typedef enum 657 { 658 ISDS_disable = 0, 659 ISDS_enable = 1 660 } ISDS_state_t; 661 662 typedef enum 663 { 664 ISDS_positive = 0, 665 ISDS_negative = 1 666 } ISDS_tapSign_t; 667 668 typedef enum 669 { 670 ISDS_fifoDecimationNoFifo = 0, 671 ISDS_fifoDecimationDisabled = 1, 672 ISDS_fifoDecimationFactor2 = 2, 673 ISDS_fifoDecimationFactor3 = 3, 674 ISDS_fifoDecimationFactor4 = 4, 675 ISDS_fifoDecimationFactor8 = 5, 676 ISDS_fifoDecimationFactor16 = 6, 677 ISDS_fifoDecimationFactor32 = 7 678 } ISDS_fifoDecimation_t; 679 680 typedef enum 681 { 682 ISDS_bypassMode = 0, 683 ISDS_fifoEnabled = 1, 684 ISDS_continuousToFifo = 3, 685 ISDS_bypassToContinuous = 4, 686 ISDS_continuousMode = 6 687 } ISDS_fifoMode_t; 688 689 typedef enum 690 { 691 ISDS_fifoOdrOff = 0, 692 ISDS_fifoOdr12Hz5 = 1, 693 ISDS_fifoOdr26Hz = 2, 694 ISDS_fifoOdr52Hz = 3, 695 ISDS_fifoOdr104Hz = 4, 696 ISDS_fifoOdr208Hz = 5, 697 ISDS_fifoOdr416Hz = 6, 698 ISDS_fifoOdr833Hz = 7, 699 ISDS_fifoOdr1k66Hz = 8, 700 ISDS_fifoOdr3k33Hz = 9, 701 ISDS_fifoOdr6k66Hz = 10 702 } ISDS_fifoOutputDataRate_t; 703 704 typedef enum 705 { 706 ISDS_accAnalogChainBandwidth1k5Hz = 0, /**< 1.5 kHz */ 707 ISDS_accAnalogChainBandwidth400Hz = 1 /**< 400 Hz */ 708 } ISDS_accAnalogChainBandwidth_t; 709 710 typedef enum 711 { 712 ISDS_accDigitalLpfBandwidthOdrDiv2 = 0, /**< ODR / 2 */ 713 ISDS_accDigitalLpfBandwidthOdrDiv4 = 1 /**< ODR / 4 */ 714 } ISDS_accDigitalLpfBandwidth_t; 715 716 typedef enum 717 { 718 ISDS_inputCompositeFilterOdrDiv2 = 0, /**< ODR / 2 */ 719 ISDS_inputCompositeFilterOdrDiv4 = 1 /**< ODR / 4 */ 720 } ISDS_inputCompositeFilter_t; 721 722 typedef enum 723 { 724 ISDS_accFullScaleTwoG = 0, 725 ISDS_accFullScaleSixteenG = 1, 726 ISDS_accFullScaleFourG = 2, 727 ISDS_accFullScaleEightG = 3, 728 ISDS_accFullScaleInvalid = 4 729 } ISDS_accFullScale_t; 730 731 typedef enum 732 { 733 ISDS_accOdrOff = 0, 734 ISDS_accOdr12Hz5 = 1, 735 ISDS_accOdr26Hz = 2, 736 ISDS_accOdr52Hz = 3, 737 ISDS_accOdr104Hz = 4, 738 ISDS_accOdr208Hz = 5, 739 ISDS_accOdr416Hz = 6, 740 ISDS_accOdr833Hz = 7, 741 ISDS_accOdr1k66Hz = 8, 742 ISDS_accOdr3k33Hz = 9, 743 ISDS_accOdr6k66Hz = 10, 744 ISDS_accOdr1Hz6 = 11 745 } ISDS_accOutputDataRate_t; 746 747 typedef enum 748 { 749 ISDS_gyroFullScale250dps = 0, 750 ISDS_gyroFullScale125dps = 1, 751 ISDS_gyroFullScale500dps = 2, 752 ISDS_gyroFullScale1000dps = 4, 753 ISDS_gyroFullScale2000dps = 6 754 } ISDS_gyroFullScale_t; 755 756 typedef enum 757 { 758 ISDS_gyroOdrOff = 0, 759 ISDS_gyroOdr12Hz5 = 1, 760 ISDS_gyroOdr26Hz = 2, 761 ISDS_gyroOdr52Hz = 3, 762 ISDS_gyroOdr104Hz = 4, 763 ISDS_gyroOdr208Hz = 5, 764 ISDS_gyroOdr416Hz = 6, 765 ISDS_gyroOdr833Hz = 7, 766 ISDS_gyroOdr1k66Hz = 8, 767 ISDS_gyroOdr3k33Hz = 9, 768 ISDS_gyroOdr6k66Hz = 10 769 } ISDS_gyroOutputDataRate_t; 770 771 typedef enum 772 { 773 ISDS_spiModeFourWire = 0, 774 ISDS_spiModeThreeWire = 1 775 } ISDS_spiMode_t; 776 777 typedef enum 778 { 779 ISDS_pushPull = 0, 780 ISDS_openDrain = 1 781 } ISDS_interruptPinConfig_t; 782 783 typedef enum 784 { 785 ISDS_activeHigh = 0, 786 ISDS_activeLow = 1 787 } ISDS_interruptActiveLevel_t; 788 789 typedef enum 790 { 791 ISDS_accSelfTestModeOff = 0, 792 ISDS_accSelfTestModePositive = 1, 793 ISDS_accSelfTestModeNegative = 2 794 } ISDS_accSelfTestMode_t; 795 796 typedef enum 797 { 798 ISDS_gyroSelfTestModeOff = 0, 799 ISDS_gyroSelfTestModePositive = 1, 800 ISDS_gyroSelfTestModeNegative = 3 801 } ISDS_gyroSelfTestMode_t; 802 803 typedef enum 804 { 805 ISDS_roundingPatternNoRounding = 0, /**< No rounding */ 806 ISDS_roundingPatternAccOnly = 1, /**< Accelerometer only */ 807 ISDS_roundingPatternGyroOnly = 2, /**< Gyroscope only */ 808 ISDS_roundingPatternGyroAndAcc = 3 /**< Gyroscope and accelerometer */ 809 } ISDS_roundingPattern_t; 810 811 typedef enum 812 { 813 ISDS_dataEnableTriggerModeDisabled = 0, 814 ISDS_dataEnableTriggerModeEdgeSensitiveTrigger = 4, 815 ISDS_dataEnableTriggerModeLevelSensitiveTrigger = 2, 816 ISDS_dataEnableTriggerModeLevelSensitiveLatched = 3, 817 ISDS_dataEnableTriggerModeLevelSensitiveFifo = 6 818 } ISDS_dataEnableTriggerMode_t; 819 820 typedef enum 821 { 822 ISDS_gyroLPF_ODR800Hz_BW245Hz_PhaseDelay14Deg = 0, 823 ISDS_gyroLPF_ODR800Hz_BW195Hz_PhaseDelay17Deg = 1, 824 ISDS_gyroLPF_ODR800Hz_BW155Hz_PhaseDelay19Deg = 2, 825 ISDS_gyroLPF_ODR800Hz_BW293Hz_PhaseDelay13Deg = 3, 826 ISDS_gyroLPF_ODR1k6Hz_BW315Hz_PhaseDelay10Deg = 0, 827 ISDS_gyroLPF_ODR1k6Hz_BW224Hz_PhaseDelay12Deg = 1, 828 ISDS_gyroLPF_ODR1k6Hz_BW168Hz_PhaseDelay15Deg = 2, 829 ISDS_gyroLPF_ODR1k6Hz_BW505Hz_PhaseDelay8Deg = 3, 830 ISDS_gyroLPF_ODR3k3Hz_BW343Hz_PhaseDelay8Deg = 0, 831 ISDS_gyroLPF_ODR3k3Hz_BW234Hz_PhaseDelay10Deg = 1, 832 ISDS_gyroLPF_ODR3k3Hz_BW172Hz_PhaseDelay12Deg = 2, 833 ISDS_gyroLPF_ODR3k3Hz_BW925Hz_PhaseDelay6Deg = 3, 834 ISDS_gyroLPF_ODR6k6Hz_BW351Hz_PhaseDelay7Deg = 0, 835 ISDS_gyroLPF_ODR6k6Hz_BW237Hz_PhaseDelay9Deg = 1, 836 ISDS_gyroLPF_ODR6k6Hz_BW173Hz_PhaseDelay11Deg = 2, 837 ISDS_gyroLPF_ODR6k6Hz_BW937Hz_PhaseDelay5Deg = 3 838 } ISDS_gyroLPF_t; 839 840 typedef enum 841 { 842 ISDS_gyroDigitalHighPassCutoff16mHz = 0, 843 ISDS_gyroDigitalHighPassCutoff65mHz = 1, 844 ISDS_gyroDigitalHighPassCutoff260mHz = 2, 845 ISDS_gyroDigitalHighPassCutoff1Hz04 = 3 846 } ISDS_gyroDigitalHighPassCutoff_t; 847 848 typedef enum 849 { 850 ISDS_accFilterConfig_LowPassPath_ODRDiv50 = 0, 851 ISDS_accFilterConfig_LowPassPath_ODRDiv100 = 1, 852 ISDS_accFilterConfig_LowPassPath_ODRDiv9 = 2, 853 ISDS_accFilterConfig_LowPassPath_ODRDiv400 = 3, 854 ISDS_accFilterConfig_HighPassPath_ODRDiv4 = 0, 855 ISDS_accFilterConfig_HighPassPath_ODRDiv100 = 1, 856 ISDS_accFilterConfig_HighPassPath_ODRDiv9 = 2, 857 ISDS_accFilterConfig_HighPassPath_ODRDiv400 = 3 858 } ISDS_accFilterConfig_t; 859 860 typedef enum 861 { 862 ISDS_dataEnableStampingSensorGyro = 0, 863 ISDS_dataEnableStampingSensorAcc = 1 864 } ISDS_dataEnableStampingSensor_t; 865 866 typedef enum 867 { 868 ISDS_activityFilterSlope = 0, 869 ISDS_activityFilterHighPass = 1 870 } ISDS_activityFilter_t; 871 872 typedef enum 873 { 874 ISDS_inactivityFunctionDisabled = 0, 875 ISDS_inactivityFunctionAcc12Hz5GyroUnchanged = 1, 876 ISDS_inactivityFunctionAcc12Hz5GyroSleep = 2, 877 ISDS_inactivityFunctionAcc12Hz5GyroPowerDown = 3 878 } ISDS_inactivityFunction_t; 879 880 typedef enum 881 { 882 ISDS_sixDThresholdEightyDeg = 0, 883 ISDS_sixDThresholdSeventyDeg = 1, 884 ISDS_sixDThresholdSixtyDeg = 2, 885 ISDS_sixDThresholdFiftyDeg = 3 886 } ISDS_sixDThreshold_t; 887 888 typedef enum 889 { 890 ISDS_freeFallThreshold156mg = 0, 891 ISDS_freeFallThreshold219mg = 1, 892 ISDS_freeFallThreshold250mg = 2, 893 ISDS_freeFallThreshold312mg = 3, 894 ISDS_freeFallThreshold344mg = 4, 895 ISDS_freeFallThreshold406mg = 5, 896 ISDS_freeFallThreshold469mg = 6, 897 ISDS_freeFallThreshold500mg = 7 898 } ISDS_freeFallThreshold_t; 899 900 901 902 #ifdef __cplusplus 903 extern "C" 904 { 905 #endif 906 907 /* Function definitions */ 908 909 int8_t ISDS_getDefaultInterface(WE_sensorInterface_t* sensorInterface); 910 911 int8_t ISDS_getDeviceID(WE_sensorInterface_t* sensorInterface, uint8_t *deviceID); 912 913 /* ISDS_FIFO_CTRL_1_REG */ 914 /* ISDS_FIFO_CTRL_2_REG */ 915 int8_t ISDS_setFifoThreshold(WE_sensorInterface_t* sensorInterface, uint16_t threshold); 916 int8_t ISDS_getFifoThreshold(WE_sensorInterface_t* sensorInterface, uint16_t *threshold); 917 int8_t ISDS_enableFifoTemperature(WE_sensorInterface_t* sensorInterface, ISDS_state_t fifoTemp); 918 int8_t ISDS_isFifoTemperatureEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *fifoTemp); 919 920 /* ISDS_FIFO_CTRL_3_REG */ 921 int8_t ISDS_setFifoAccDecimation(WE_sensorInterface_t* sensorInterface, ISDS_fifoDecimation_t decimation); 922 int8_t ISDS_getFifoAccDecimation(WE_sensorInterface_t* sensorInterface, ISDS_fifoDecimation_t *decimation); 923 int8_t ISDS_setFifoGyroDecimation(WE_sensorInterface_t* sensorInterface, ISDS_fifoDecimation_t decimation); 924 int8_t ISDS_getFifoGyroDecimation(WE_sensorInterface_t* sensorInterface, ISDS_fifoDecimation_t *decimation); 925 926 /* ISDS_FIFO_CTRL_4_REG */ 927 int8_t ISDS_setFifoDataset3Decimation(WE_sensorInterface_t* sensorInterface, ISDS_fifoDecimation_t decimation); 928 int8_t ISDS_getFifoDataset3Decimation(WE_sensorInterface_t* sensorInterface, ISDS_fifoDecimation_t *decimation); 929 int8_t ISDS_setFifoDataset4Decimation(WE_sensorInterface_t* sensorInterface, ISDS_fifoDecimation_t decimation); 930 int8_t ISDS_getFifoDataset4Decimation(WE_sensorInterface_t* sensorInterface, ISDS_fifoDecimation_t *decimation); 931 int8_t ISDS_enableFifoOnlyHighData(WE_sensorInterface_t* sensorInterface, ISDS_state_t onlyHighData); 932 int8_t ISDS_isFifoOnlyHighDataEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *onlyHighData); 933 int8_t ISDS_enableFifoStopOnThreshold(WE_sensorInterface_t* sensorInterface, ISDS_state_t stopOnThreshold); 934 int8_t ISDS_isFifoStopOnThresholdEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *stopOnThreshold); 935 936 /* ISDS_FIFO_CTRL_5_REG */ 937 int8_t ISDS_setFifoMode(WE_sensorInterface_t* sensorInterface, ISDS_fifoMode_t fifoMode); 938 int8_t ISDS_getFifoMode(WE_sensorInterface_t* sensorInterface, ISDS_fifoMode_t *fifoMode); 939 int8_t ISDS_setFifoOutputDataRate(WE_sensorInterface_t* sensorInterface, ISDS_fifoOutputDataRate_t fifoOdr); 940 int8_t ISDS_getFifoOutputDataRate(WE_sensorInterface_t* sensorInterface, ISDS_fifoOutputDataRate_t *fifoOdr); 941 942 /* ISDS_DRDY_PULSE_CFG_REG */ 943 int8_t ISDS_enableDataReadyPulsed(WE_sensorInterface_t* sensorInterface, ISDS_state_t dataReadyPulsed); 944 int8_t ISDS_isDataReadyPulsedEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *dataReadyPulsed); 945 946 /* ISDS_INT0_CTRL_REG */ 947 int8_t ISDS_enableAccDataReadyINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int0AccDataReady); 948 int8_t ISDS_isAccDataReadyINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int0AccDataReady); 949 int8_t ISDS_enableGyroDataReadyINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int0GyroDataReady); 950 int8_t ISDS_isGyroDataReadyINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int0GyroDataReady); 951 int8_t ISDS_enableBootStatusINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int0BootStatus); 952 int8_t ISDS_isBootStatusINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int0BootStatus); 953 int8_t ISDS_enableFifoThresholdINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int0FifoThreshold); 954 int8_t ISDS_isFifoThresholdINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int0FifoThreshold); 955 int8_t ISDS_enableFifoOverrunINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int0FifoOverrun); 956 int8_t ISDS_isFifoOverrunINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int0FifoOverrun); 957 int8_t ISDS_enableFifoFullINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int0FifoFull); 958 int8_t ISDS_isFifoFullINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int0FifoFull); 959 960 /* ISDS_INT1_CTRL_REG */ 961 int8_t ISDS_enableAccDataReadyINT1(WE_sensorInterface_t* sensorInterface, ISDS_state_t int1AccDataReady); 962 int8_t ISDS_isAccDataReadyINT1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int1AccDataReady); 963 int8_t ISDS_enableGyroDataReadyINT1(WE_sensorInterface_t* sensorInterface, ISDS_state_t int1GyroDataReady); 964 int8_t ISDS_isGyroDataReadyINT1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int1GyroDataReady); 965 int8_t ISDS_enableTemperatureDataReadyINT1(WE_sensorInterface_t* sensorInterface, ISDS_state_t int1TempDataReady); 966 int8_t ISDS_isTemperatureDataReadyINT1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int1TempDataReady); 967 int8_t ISDS_enableFifoThresholdINT1(WE_sensorInterface_t* sensorInterface, ISDS_state_t int1FifoThreshold); 968 int8_t ISDS_isFifoThresholdINT1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int1FifoThreshold); 969 int8_t ISDS_enableFifoOverrunINT1(WE_sensorInterface_t* sensorInterface, ISDS_state_t int1FifoOverrun); 970 int8_t ISDS_isFifoOverrunINT1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int1FifoOverrun); 971 int8_t ISDS_enableFifoFullINT1(WE_sensorInterface_t* sensorInterface, ISDS_state_t int1FifoFull); 972 int8_t ISDS_isFifoFullINT1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int1FifoFull); 973 974 /* ISDS_DEVICE_ID_REG */ 975 976 /* ISDS_CTRL_1_REG */ 977 int8_t ISDS_setAccAnalogChainBandwidth(WE_sensorInterface_t* sensorInterface, ISDS_accAnalogChainBandwidth_t bandwidth); 978 int8_t ISDS_getAccAnalogChainBandwidth(WE_sensorInterface_t* sensorInterface, ISDS_accAnalogChainBandwidth_t *bandwidth); 979 int8_t ISDS_setAccDigitalLpfBandwidth(WE_sensorInterface_t* sensorInterface, ISDS_accDigitalLpfBandwidth_t bandwidth); 980 int8_t ISDS_getAccDigitalLpfBandwidth(WE_sensorInterface_t* sensorInterface, ISDS_accDigitalLpfBandwidth_t *bandwidth); 981 int8_t ISDS_setAccFullScale(WE_sensorInterface_t* sensorInterface, ISDS_accFullScale_t fullScale); 982 int8_t ISDS_getAccFullScale(WE_sensorInterface_t* sensorInterface, ISDS_accFullScale_t *fullScale); 983 int8_t ISDS_setAccOutputDataRate(WE_sensorInterface_t* sensorInterface, ISDS_accOutputDataRate_t odr); 984 int8_t ISDS_getAccOutputDataRate(WE_sensorInterface_t* sensorInterface, ISDS_accOutputDataRate_t *odr); 985 986 /* ISDS_CTRL_2_REG */ 987 int8_t ISDS_setGyroFullScale(WE_sensorInterface_t* sensorInterface, ISDS_gyroFullScale_t fullScale); 988 int8_t ISDS_getGyroFullScale(WE_sensorInterface_t* sensorInterface, ISDS_gyroFullScale_t *fullScale); 989 int8_t ISDS_setGyroOutputDataRate(WE_sensorInterface_t* sensorInterface, ISDS_gyroOutputDataRate_t odr); 990 int8_t ISDS_getGyroOutputDataRate(WE_sensorInterface_t* sensorInterface, ISDS_gyroOutputDataRate_t *odr); 991 992 /* ISDS_CTRL_3_REG */ 993 int8_t ISDS_softReset(WE_sensorInterface_t* sensorInterface, ISDS_state_t swReset); 994 int8_t ISDS_getSoftResetState(WE_sensorInterface_t* sensorInterface, ISDS_state_t *swReset); 995 int8_t ISDS_enableAutoIncrement(WE_sensorInterface_t* sensorInterface, ISDS_state_t autoIncr); 996 int8_t ISDS_isAutoIncrementEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *autoIncr); 997 int8_t ISDS_setSpiMode(WE_sensorInterface_t* sensorInterface, ISDS_spiMode_t spiMode); 998 int8_t ISDS_getSpiMode(WE_sensorInterface_t* sensorInterface, ISDS_spiMode_t *spiMode); 999 int8_t ISDS_setInterruptPinType(WE_sensorInterface_t* sensorInterface, ISDS_interruptPinConfig_t pinType); 1000 int8_t ISDS_getInterruptPinType(WE_sensorInterface_t* sensorInterface, ISDS_interruptPinConfig_t *pinType); 1001 int8_t ISDS_setInterruptActiveLevel(WE_sensorInterface_t* sensorInterface, ISDS_interruptActiveLevel_t level); 1002 int8_t ISDS_getInterruptActiveLevel(WE_sensorInterface_t* sensorInterface, ISDS_interruptActiveLevel_t *level); 1003 int8_t ISDS_enableBlockDataUpdate(WE_sensorInterface_t* sensorInterface, ISDS_state_t bdu); 1004 int8_t ISDS_isBlockDataUpdateEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *bdu); 1005 int8_t ISDS_reboot(WE_sensorInterface_t* sensorInterface, ISDS_state_t reboot); 1006 int8_t ISDS_isRebooting(WE_sensorInterface_t* sensorInterface, ISDS_state_t *rebooting); 1007 1008 /* ISDS_CTRL_4_REG */ 1009 int8_t ISDS_enableGyroDigitalLpf1(WE_sensorInterface_t* sensorInterface, ISDS_state_t enable); 1010 int8_t ISDS_isGyroDigitalLpf1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *enable); 1011 int8_t ISDS_disableI2CInterface(WE_sensorInterface_t* sensorInterface, ISDS_state_t i2cDisable); 1012 int8_t ISDS_isI2CInterfaceDisabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *i2cDisabled); 1013 int8_t ISDS_enableDataReadyMask(WE_sensorInterface_t* sensorInterface, ISDS_state_t dataReadyMask); 1014 int8_t ISDS_isDataReadyMaskEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *dataReadyMask); 1015 int8_t ISDS_enableDataEnableDataReadyINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int0DataReady); 1016 int8_t ISDS_isDataEnableDataReadyINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int0DataReady); 1017 int8_t ISDS_setInt1OnInt0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int1OnInt0); 1018 int8_t ISDS_getInt1OnInt0(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int1OnInt0); 1019 int8_t ISDS_enableGyroSleepMode(WE_sensorInterface_t* sensorInterface, ISDS_state_t gyroSleepMode); 1020 int8_t ISDS_isGyroSleepModeEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *gyroSleepMode); 1021 int8_t ISDS_extendDataEnableToAcc(WE_sensorInterface_t* sensorInterface, ISDS_state_t extendToAcc); 1022 int8_t ISDS_isDataEnableExtendedToAcc(WE_sensorInterface_t* sensorInterface, ISDS_state_t *extendToAcc); 1023 1024 /* ISDS_CTRL_5_REG */ 1025 int8_t ISDS_setAccSelfTestMode(WE_sensorInterface_t* sensorInterface, ISDS_accSelfTestMode_t selfTest); 1026 int8_t ISDS_getAccSelfTestMode(WE_sensorInterface_t* sensorInterface, ISDS_accSelfTestMode_t *selfTest); 1027 int8_t ISDS_setGyroSelfTestMode(WE_sensorInterface_t* sensorInterface, ISDS_gyroSelfTestMode_t selfTest); 1028 int8_t ISDS_getGyroSelfTestMode(WE_sensorInterface_t* sensorInterface, ISDS_gyroSelfTestMode_t *selfTest); 1029 int8_t ISDS_setDataEnableActiveHigh(WE_sensorInterface_t* sensorInterface, ISDS_state_t activeHigh); 1030 int8_t ISDS_isDataEnableActiveHigh(WE_sensorInterface_t* sensorInterface, ISDS_state_t *activeHigh); 1031 int8_t ISDS_setRoundingPattern(WE_sensorInterface_t* sensorInterface, ISDS_roundingPattern_t roundingPattern); 1032 int8_t ISDS_getRoundingPattern(WE_sensorInterface_t* sensorInterface, ISDS_roundingPattern_t *roundingPattern); 1033 1034 /* ISDS_CTRL_6_REG */ 1035 int8_t ISDS_setGyroLowPassFilterBandwidth(WE_sensorInterface_t* sensorInterface, ISDS_gyroLPF_t bandwidth); 1036 int8_t ISDS_getGyroLowPassFilterBandwidth(WE_sensorInterface_t* sensorInterface, ISDS_gyroLPF_t *bandwidth); 1037 int8_t ISDS_setOffsetWeight(WE_sensorInterface_t* sensorInterface, ISDS_state_t offsetWeight); 1038 int8_t ISDS_getOffsetWeight(WE_sensorInterface_t* sensorInterface, ISDS_state_t *offsetWeight); 1039 int8_t ISDS_disableAccHighPerformanceMode(WE_sensorInterface_t* sensorInterface, ISDS_state_t disable); 1040 int8_t ISDS_isAccHighPerformanceModeDisabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *disable); 1041 int8_t ISDS_setDataEnableTriggerMode(WE_sensorInterface_t* sensorInterface, ISDS_dataEnableTriggerMode_t triggerMode); 1042 int8_t ISDS_getDataEnableTriggerMode(WE_sensorInterface_t* sensorInterface, ISDS_dataEnableTriggerMode_t *triggerMode); 1043 1044 /* ISDS_CTRL_7_REG */ 1045 int8_t ISDS_enableRounding(WE_sensorInterface_t* sensorInterface, ISDS_state_t rounding); 1046 int8_t ISDS_isRoundingEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *rounding); 1047 int8_t ISDS_setGyroDigitalHighPassCutoff(WE_sensorInterface_t* sensorInterface, ISDS_gyroDigitalHighPassCutoff_t cutoff); 1048 int8_t ISDS_getGyroDigitalHighPassCutoff(WE_sensorInterface_t* sensorInterface, ISDS_gyroDigitalHighPassCutoff_t *cutoff); 1049 int8_t ISDS_enableGyroDigitalHighPass(WE_sensorInterface_t* sensorInterface, ISDS_state_t highPass); 1050 int8_t ISDS_isGyroDigitalHighPassEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *highPass); 1051 int8_t ISDS_disableGyroHighPerformanceMode(WE_sensorInterface_t* sensorInterface, ISDS_state_t disable); 1052 int8_t ISDS_isGyroHighPerformanceModeDisabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *disable); 1053 1054 /* ISDS_CTRL_8_REG */ 1055 int8_t ISDS_enable6dLowPass(WE_sensorInterface_t* sensorInterface, ISDS_state_t lowPass); 1056 int8_t ISDS_is6dLowPassEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *lowPass); 1057 int8_t ISDS_enableAccHighPassSlopeFilter(WE_sensorInterface_t* sensorInterface, ISDS_state_t filterEnable); 1058 int8_t ISDS_isAccHighPassSlopeFilterEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *filterEnable); 1059 int8_t ISDS_setInputCompositeFilter(WE_sensorInterface_t* sensorInterface, ISDS_inputCompositeFilter_t inputCompositeFilter); 1060 int8_t ISDS_getInputCompositeFilter(WE_sensorInterface_t* sensorInterface, ISDS_inputCompositeFilter_t *inputCompositeFilter); 1061 int8_t ISDS_enableHighPassFilterRefMode(WE_sensorInterface_t* sensorInterface, ISDS_state_t refMode); 1062 int8_t ISDS_isHighPassFilterRefModeEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *refMode); 1063 int8_t ISDS_setAccFilterConfig(WE_sensorInterface_t* sensorInterface, ISDS_accFilterConfig_t filterConfig); 1064 int8_t ISDS_getAccFilterConfig(WE_sensorInterface_t* sensorInterface, ISDS_accFilterConfig_t *filterConfig); 1065 int8_t ISDS_enableAccLowPass(WE_sensorInterface_t* sensorInterface, ISDS_state_t lowPass); 1066 int8_t ISDS_isAccLowPassEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *lowPass); 1067 1068 /* ISDS_CTRL_9_REG */ 1069 int8_t ISDS_setDataEnableStampingSensor(WE_sensorInterface_t* sensorInterface, ISDS_dataEnableStampingSensor_t sensor); 1070 int8_t ISDS_getDataEnableStampingSensor(WE_sensorInterface_t* sensorInterface, ISDS_dataEnableStampingSensor_t *sensor); 1071 int8_t ISDS_storeDataEnableValueInZAxisLSB(WE_sensorInterface_t* sensorInterface, ISDS_state_t enable); 1072 int8_t ISDS_isStoreDataEnableValueInZAxisLSB(WE_sensorInterface_t* sensorInterface, ISDS_state_t *enable); 1073 int8_t ISDS_storeDataEnableValueInYAxisLSB(WE_sensorInterface_t* sensorInterface, ISDS_state_t enable); 1074 int8_t ISDS_isStoreDataEnableValueInYAxisLSB(WE_sensorInterface_t* sensorInterface, ISDS_state_t *enable); 1075 int8_t ISDS_storeDataEnableValueInXAxisLSB(WE_sensorInterface_t* sensorInterface, ISDS_state_t enable); 1076 int8_t ISDS_isStoreDataEnableValueInXAxisLSB(WE_sensorInterface_t* sensorInterface, ISDS_state_t *enable); 1077 1078 /* ISDS_CTRL_10_REG */ 1079 int8_t ISDS_enableEmbeddedFunctionalities(WE_sensorInterface_t* sensorInterface, ISDS_state_t embeddedFuncEnable); 1080 int8_t ISDS_areEmbeddedFunctionalitiesEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *embeddedFuncEnable); 1081 int8_t ISDS_enableTiltCalculation(WE_sensorInterface_t* sensorInterface, ISDS_state_t tiltCalc); 1082 int8_t ISDS_isTiltCalculationEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *tiltCalc); 1083 1084 /* ISDS_WAKE_UP_EVENT_REG */ 1085 int8_t ISDS_getWakeUpEventRegister(WE_sensorInterface_t* sensorInterface, ISDS_wakeUpEvent_t *status); 1086 int8_t ISDS_isWakeUpXEvent(WE_sensorInterface_t* sensorInterface, ISDS_state_t *wakeUpX); 1087 int8_t ISDS_isWakeUpYEvent(WE_sensorInterface_t* sensorInterface, ISDS_state_t *wakeUpY); 1088 int8_t ISDS_isWakeUpZEvent(WE_sensorInterface_t* sensorInterface, ISDS_state_t *wakeUpZ); 1089 int8_t ISDS_isWakeUpEvent(WE_sensorInterface_t* sensorInterface, ISDS_state_t *wakeUpState); 1090 int8_t ISDS_getSleepState(WE_sensorInterface_t* sensorInterface, ISDS_state_t *sleepState); 1091 int8_t ISDS_isFreeFallEvent(WE_sensorInterface_t* sensorInterface, ISDS_state_t *freeFall); 1092 1093 /* ISDS_TAP_EVENT_REG */ 1094 int8_t ISDS_getTapEventRegister(WE_sensorInterface_t* sensorInterface, ISDS_tapEvent_t *status); 1095 int8_t ISDS_isTapEvent(WE_sensorInterface_t* sensorInterface, ISDS_state_t *tapEventState); 1096 int8_t ISDS_isTapEventXAxis(WE_sensorInterface_t* sensorInterface, ISDS_state_t *tapXAxis); 1097 int8_t ISDS_isTapEventYAxis(WE_sensorInterface_t* sensorInterface, ISDS_state_t *tapYAxis); 1098 int8_t ISDS_isTapEventZAxis(WE_sensorInterface_t* sensorInterface, ISDS_state_t *tapZAxis); 1099 int8_t ISDS_isDoubleTapEvent(WE_sensorInterface_t* sensorInterface, ISDS_state_t *doubleTap); 1100 int8_t ISDS_isSingleTapEvent(WE_sensorInterface_t* sensorInterface, ISDS_state_t *singleTap); 1101 int8_t ISDS_getTapSign(WE_sensorInterface_t* sensorInterface, ISDS_tapSign_t *tapSign); 1102 1103 /* ISDS_6D_EVENT_REG */ 1104 int8_t ISDS_get6dEventRegister(WE_sensorInterface_t* sensorInterface, ISDS_6dEvent_t *status); 1105 int8_t ISDS_has6dOrientationChanged(WE_sensorInterface_t* sensorInterface, ISDS_state_t *orientationChanged); 1106 int8_t ISDS_isXLOverThreshold(WE_sensorInterface_t* sensorInterface, ISDS_state_t *xlOverThreshold); 1107 int8_t ISDS_isXHOverThreshold(WE_sensorInterface_t* sensorInterface, ISDS_state_t *xhOverThreshold); 1108 int8_t ISDS_isYLOverThreshold(WE_sensorInterface_t* sensorInterface, ISDS_state_t *ylOverThreshold); 1109 int8_t ISDS_isYHOverThreshold(WE_sensorInterface_t* sensorInterface, ISDS_state_t *yhOverThreshold); 1110 int8_t ISDS_isZLOverThreshold(WE_sensorInterface_t* sensorInterface, ISDS_state_t *zlOverThreshold); 1111 int8_t ISDS_isZHOverThreshold(WE_sensorInterface_t* sensorInterface, ISDS_state_t *zhOverThreshold); 1112 int8_t ISDS_isDataEnableDataReady(WE_sensorInterface_t* sensorInterface, ISDS_state_t *dataReady); 1113 1114 /* ISDS_STATUS_REG */ 1115 int8_t ISDS_getStatusRegister(WE_sensorInterface_t* sensorInterface, ISDS_status_t *status); 1116 int8_t ISDS_isAccelerationDataReady(WE_sensorInterface_t* sensorInterface, ISDS_state_t *dataReady); 1117 int8_t ISDS_isGyroscopeDataReady(WE_sensorInterface_t* sensorInterface, ISDS_state_t *dataReady); 1118 int8_t ISDS_isTemperatureDataReady(WE_sensorInterface_t* sensorInterface, ISDS_state_t *dataReady); 1119 1120 /* ISDS_FIFO_STATUS_#_REG */ 1121 int8_t ISDS_getFifoStatus(WE_sensorInterface_t* sensorInterface, ISDS_fifoStatus2_t *status, uint16_t *fillLevel, uint16_t *fifoPattern); 1122 int8_t ISDS_getFifoStatus2Register(WE_sensorInterface_t* sensorInterface, ISDS_fifoStatus2_t *status); 1123 int8_t ISDS_getFifoFillLevel(WE_sensorInterface_t* sensorInterface, uint16_t *fillLevel); 1124 int8_t ISDS_isFifoEmpty(WE_sensorInterface_t* sensorInterface, ISDS_state_t *empty); 1125 int8_t ISDS_isFifoFull(WE_sensorInterface_t* sensorInterface, ISDS_state_t *full); 1126 int8_t ISDS_getFifoOverrunState(WE_sensorInterface_t* sensorInterface, ISDS_state_t *overrun); 1127 int8_t ISDS_isFifoThresholdReached(WE_sensorInterface_t* sensorInterface, ISDS_state_t *threshReached); 1128 int8_t ISDS_getFifoPattern(WE_sensorInterface_t* sensorInterface, uint16_t *fifoPattern); 1129 1130 /* ISDS_FUNC_SRC_1_REG */ 1131 int8_t ISDS_isTiltEvent(WE_sensorInterface_t* sensorInterface, ISDS_state_t *tiltEvent); 1132 1133 /* ISDS_TAP_CFG_REG */ 1134 int8_t ISDS_enableLatchedInterrupt(WE_sensorInterface_t* sensorInterface, ISDS_state_t lir); 1135 int8_t ISDS_isLatchedInterruptEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *lir); 1136 int8_t ISDS_enableTapX(WE_sensorInterface_t* sensorInterface, ISDS_state_t tapX); 1137 int8_t ISDS_isTapXEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *tapX); 1138 int8_t ISDS_enableTapY(WE_sensorInterface_t* sensorInterface, ISDS_state_t tapY); 1139 int8_t ISDS_isTapYEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *tapY); 1140 int8_t ISDS_enableTapZ(WE_sensorInterface_t* sensorInterface, ISDS_state_t tapZ); 1141 int8_t ISDS_isTapZEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *tapZ); 1142 int8_t ISDS_setActivityFilter(WE_sensorInterface_t* sensorInterface, ISDS_activityFilter_t filter); 1143 int8_t ISDS_getActivityFilter(WE_sensorInterface_t* sensorInterface, ISDS_activityFilter_t *filter); 1144 int8_t ISDS_setInactivityFunction(WE_sensorInterface_t* sensorInterface, ISDS_inactivityFunction_t function); 1145 int8_t ISDS_getInactivityFunction(WE_sensorInterface_t* sensorInterface, ISDS_inactivityFunction_t *function); 1146 int8_t ISDS_enableInterrupts(WE_sensorInterface_t* sensorInterface, ISDS_state_t interruptsEnable); 1147 int8_t ISDS_areInterruptsEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *interruptsEnable); 1148 1149 /* ISDS_TAP_THS_6D_REG */ 1150 int8_t ISDS_setTapThreshold(WE_sensorInterface_t* sensorInterface, uint8_t tapThreshold); 1151 int8_t ISDS_getTapThreshold(WE_sensorInterface_t* sensorInterface, uint8_t *tapThreshold); 1152 int8_t ISDS_set6DThreshold(WE_sensorInterface_t* sensorInterface, ISDS_sixDThreshold_t threshold6D); 1153 int8_t ISDS_get6DThreshold(WE_sensorInterface_t* sensorInterface, ISDS_sixDThreshold_t *threshold6D); 1154 int8_t ISDS_enable4DDetection(WE_sensorInterface_t* sensorInterface, ISDS_state_t detection4D); 1155 int8_t ISDS_is4DDetectionEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *detection4D); 1156 1157 /* ISDS_INT_DUR2_REG */ 1158 int8_t ISDS_setTapLatencyTime(WE_sensorInterface_t* sensorInterface, uint8_t latencyTime); 1159 int8_t ISDS_getTapLatencyTime(WE_sensorInterface_t* sensorInterface, uint8_t *latencyTime); 1160 int8_t ISDS_setTapQuietTime(WE_sensorInterface_t* sensorInterface, uint8_t quietTime); 1161 int8_t ISDS_getTapQuietTime(WE_sensorInterface_t* sensorInterface, uint8_t *quietTime); 1162 int8_t ISDS_setTapShockTime(WE_sensorInterface_t* sensorInterface, uint8_t shockTime); 1163 int8_t ISDS_getTapShockTime(WE_sensorInterface_t* sensorInterface, uint8_t *shockTime); 1164 1165 /* ISDS_WAKE_UP_THS_REG */ 1166 int8_t ISDS_setWakeUpThreshold(WE_sensorInterface_t* sensorInterface, uint8_t thresh); 1167 int8_t ISDS_getWakeUpThreshold(WE_sensorInterface_t* sensorInterface, uint8_t *thresh); 1168 int8_t ISDS_enableDoubleTapEvent(WE_sensorInterface_t* sensorInterface, ISDS_state_t doubleTapEnable); 1169 int8_t ISDS_isDoubleTapEventEnabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *doubleTapEnable); 1170 1171 /* ISDS_WAKE_UP_DUR_REG */ 1172 int8_t ISDS_setSleepDuration(WE_sensorInterface_t* sensorInterface, uint8_t duration); 1173 int8_t ISDS_getSleepDuration(WE_sensorInterface_t* sensorInterface, uint8_t *duration); 1174 int8_t ISDS_setWakeUpDuration(WE_sensorInterface_t* sensorInterface, uint8_t duration); 1175 int8_t ISDS_getWakeUpDuration(WE_sensorInterface_t* sensorInterface, uint8_t *duration); 1176 1177 /* ISDS_FREE_FALL_REG */ 1178 int8_t ISDS_setFreeFallThreshold(WE_sensorInterface_t* sensorInterface, ISDS_freeFallThreshold_t thresh); 1179 int8_t ISDS_getFreeFallThreshold(WE_sensorInterface_t* sensorInterface, ISDS_freeFallThreshold_t *thresh); 1180 int8_t ISDS_setFreeFallDuration(WE_sensorInterface_t* sensorInterface, uint8_t duration); 1181 int8_t ISDS_getFreeFallDuration(WE_sensorInterface_t* sensorInterface, uint8_t *duration); 1182 1183 /* ISDS_MD1_CFG_REG */ 1184 int8_t ISDS_enableTiltINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int0Tilt); 1185 int8_t ISDS_isTiltINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int0Tilt); 1186 int8_t ISDS_enable6dINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int06d); 1187 int8_t ISDS_is6dINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int06d); 1188 int8_t ISDS_enableDoubleTapINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int0DoubleTap); 1189 int8_t ISDS_isDoubleTapINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int0DoubleTap); 1190 int8_t ISDS_enableFreeFallINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int0FreeFall); 1191 int8_t ISDS_isFreeFallINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int0FreeFall); 1192 int8_t ISDS_enableWakeUpINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int0WakeUp); 1193 int8_t ISDS_isWakeUpINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int0WakeUp); 1194 int8_t ISDS_enableSingleTapINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int0SingleTap); 1195 int8_t ISDS_isSingleTapINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int0SingleTap); 1196 int8_t ISDS_enableInactivityStateINT0(WE_sensorInterface_t* sensorInterface, ISDS_state_t int0InactivityState); 1197 int8_t ISDS_isInactivityStateINT0Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int0InactivityState); 1198 1199 /* ISDS_MD2_CFG_REG */ 1200 int8_t ISDS_enableTiltINT1(WE_sensorInterface_t* sensorInterface, ISDS_state_t int1Tilt); 1201 int8_t ISDS_isTiltINT1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int1Tilt); 1202 int8_t ISDS_enable6dINT1(WE_sensorInterface_t* sensorInterface, ISDS_state_t int16d); 1203 int8_t ISDS_is6dINT1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int16d); 1204 int8_t ISDS_enableDoubleTapINT1(WE_sensorInterface_t* sensorInterface, ISDS_state_t int1DoubleTap); 1205 int8_t ISDS_isDoubleTapINT1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int1DoubleTap); 1206 int8_t ISDS_enableFreeFallINT1(WE_sensorInterface_t* sensorInterface, ISDS_state_t int1FreeFall); 1207 int8_t ISDS_isFreeFallINT1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int1FreeFall); 1208 int8_t ISDS_enableWakeUpINT1(WE_sensorInterface_t* sensorInterface, ISDS_state_t int1WakeUp); 1209 int8_t ISDS_isWakeUpINT1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int1WakeUp); 1210 int8_t ISDS_enableSingleTapINT1(WE_sensorInterface_t* sensorInterface, ISDS_state_t int1SingleTap); 1211 int8_t ISDS_isSingleTapINT1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int1SingleTap); 1212 int8_t ISDS_enableInactivityStateINT1(WE_sensorInterface_t* sensorInterface, ISDS_state_t int1InactivityState); 1213 int8_t ISDS_isInactivityStateINT1Enabled(WE_sensorInterface_t* sensorInterface, ISDS_state_t *int1InactivityState); 1214 1215 /* ISDS_#_OFS_USR_REG */ 1216 int8_t ISDS_setOffsetValueX(WE_sensorInterface_t* sensorInterface, int8_t offsetValueXAxis); 1217 int8_t ISDS_getOffsetValueX(WE_sensorInterface_t* sensorInterface, int8_t *offsetValueXAxis); 1218 int8_t ISDS_setOffsetValueY(WE_sensorInterface_t* sensorInterface, int8_t offsetValueYAxis); 1219 int8_t ISDS_getOffsetValueY(WE_sensorInterface_t* sensorInterface, int8_t *offsetValueYAxis); 1220 int8_t ISDS_setOffsetValueZ(WE_sensorInterface_t* sensorInterface, int8_t offsetValueZAxis); 1221 int8_t ISDS_getOffsetValueZ(WE_sensorInterface_t* sensorInterface, int8_t *offsetValueZAxis); 1222 1223 /* ISDS_FIFO_DATA_OUT_L_REG */ 1224 /* ISDS_FIFO_DATA_OUT_H_REG */ 1225 int8_t ISDS_getFifoData(WE_sensorInterface_t* sensorInterface, uint16_t numSamples, uint16_t *fifoData); 1226 1227 /* Gyroscope output */ 1228 int8_t ISDS_getAngularRateX_float(WE_sensorInterface_t* sensorInterface, float *xRate); 1229 int8_t ISDS_getAngularRateY_float(WE_sensorInterface_t* sensorInterface, float *yRate); 1230 int8_t ISDS_getAngularRateZ_float(WE_sensorInterface_t* sensorInterface, float *zRate); 1231 int8_t ISDS_getAngularRates_float(WE_sensorInterface_t* sensorInterface, float *xRate, float *yRate, float *zRate); 1232 int8_t ISDS_getAngularRateX_int(WE_sensorInterface_t* sensorInterface, int32_t *xRate); 1233 int8_t ISDS_getAngularRateY_int(WE_sensorInterface_t* sensorInterface, int32_t *yRate); 1234 int8_t ISDS_getAngularRateZ_int(WE_sensorInterface_t* sensorInterface, int32_t *zRate); 1235 int8_t ISDS_getAngularRates_int(WE_sensorInterface_t* sensorInterface, int32_t *xRate, int32_t *yRate, int32_t *zRate); 1236 int8_t ISDS_getRawAngularRateX(WE_sensorInterface_t* sensorInterface, int16_t *xRawRate); 1237 int8_t ISDS_getRawAngularRateY(WE_sensorInterface_t* sensorInterface, int16_t *yRawRate); 1238 int8_t ISDS_getRawAngularRateZ(WE_sensorInterface_t* sensorInterface, int16_t *zRawRate); 1239 int8_t ISDS_getRawAngularRates(WE_sensorInterface_t* sensorInterface, int16_t *xRawRate, int16_t *yRawRate, int16_t *zRawRate); 1240 1241 /* Accelerometer output */ 1242 int8_t ISDS_getAccelerationX_float(WE_sensorInterface_t* sensorInterface, float *xAcc); 1243 int8_t ISDS_getAccelerationY_float(WE_sensorInterface_t* sensorInterface, float *yAcc); 1244 int8_t ISDS_getAccelerationZ_float(WE_sensorInterface_t* sensorInterface, float *zAcc); 1245 int8_t ISDS_getAccelerations_float(WE_sensorInterface_t* sensorInterface, float *xAcc, float *yAcc, float *zAcc); 1246 int8_t ISDS_getAccelerationX_int(WE_sensorInterface_t* sensorInterface, int16_t *xAcc); 1247 int8_t ISDS_getAccelerationY_int(WE_sensorInterface_t* sensorInterface, int16_t *yAcc); 1248 int8_t ISDS_getAccelerationZ_int(WE_sensorInterface_t* sensorInterface, int16_t *zAcc); 1249 int8_t ISDS_getAccelerations_int(WE_sensorInterface_t* sensorInterface, int16_t *xAcc, int16_t *yAcc, int16_t *zAcc); 1250 int8_t ISDS_getRawAccelerationX(WE_sensorInterface_t* sensorInterface, int16_t *xRawAcc); 1251 int8_t ISDS_getRawAccelerationY(WE_sensorInterface_t* sensorInterface, int16_t *yRawAcc); 1252 int8_t ISDS_getRawAccelerationZ(WE_sensorInterface_t* sensorInterface, int16_t *zRawAcc); 1253 int8_t ISDS_getRawAccelerations(WE_sensorInterface_t* sensorInterface, int16_t *xRawAcc, int16_t *yRawAcc, int16_t *zRawAcc); 1254 1255 /* Temperature sensor output */ 1256 int8_t ISDS_getTemperature_float(WE_sensorInterface_t* sensorInterface, float *temperature); 1257 int8_t ISDS_getTemperature_int(WE_sensorInterface_t* sensorInterface, int16_t *temperature); 1258 int8_t ISDS_getRawTemperature(WE_sensorInterface_t* sensorInterface, int16_t *temperature); 1259 1260 float ISDS_convertAcceleration_float(int16_t acc, ISDS_accFullScale_t fullScale); 1261 float ISDS_convertAccelerationFs2g_float(int16_t acc); 1262 float ISDS_convertAccelerationFs4g_float(int16_t acc); 1263 float ISDS_convertAccelerationFs8g_float(int16_t acc); 1264 float ISDS_convertAccelerationFs16g_float(int16_t acc); 1265 1266 float ISDS_convertAngularRate_float(int16_t rate, ISDS_gyroFullScale_t fullScale); 1267 float ISDS_convertAngularRateFs125dps_float(int16_t rate); 1268 float ISDS_convertAngularRateFs250dps_float(int16_t rate); 1269 float ISDS_convertAngularRateFs500dps_float(int16_t rate); 1270 float ISDS_convertAngularRateFs1000dps_float(int16_t rate); 1271 float ISDS_convertAngularRateFs2000dps_float(int16_t rate); 1272 1273 float ISDS_convertTemperature_float(int16_t temperature); 1274 1275 int16_t ISDS_convertAcceleration_int(int16_t acc, ISDS_accFullScale_t fullScale); 1276 int16_t ISDS_convertAccelerationFs2g_int(int16_t acc); 1277 int16_t ISDS_convertAccelerationFs4g_int(int16_t acc); 1278 int16_t ISDS_convertAccelerationFs8g_int(int16_t acc); 1279 int16_t ISDS_convertAccelerationFs16g_int(int16_t acc); 1280 1281 int32_t ISDS_convertAngularRate_int(int16_t rate, ISDS_gyroFullScale_t fullScale); 1282 int32_t ISDS_convertAngularRateFs125dps_int(int16_t rate); 1283 int32_t ISDS_convertAngularRateFs250dps_int(int16_t rate); 1284 int32_t ISDS_convertAngularRateFs500dps_int(int16_t rate); 1285 int32_t ISDS_convertAngularRateFs1000dps_int(int16_t rate); 1286 int32_t ISDS_convertAngularRateFs2000dps_int(int16_t rate); 1287 1288 int16_t ISDS_convertTemperature_int(int16_t temperature); 1289 1290 #ifdef __cplusplus 1291 } 1292 #endif 1293 1294 #endif /* _WSEN_ISDS_H */ 1295