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-PADS-2511020213301 sensor driver. 10 */ 11 12 #ifndef _WSEN_PADS_2511020213301_H 13 #define _WSEN_PADS_2511020213301_H 14 15 /* Includes */ 16 17 #include <stdint.h> 18 19 #include "../WeSensorsSDK.h" 20 21 22 /* PADS 2511020213301 DEVICE_ID */ 23 24 #define PADS_DEVICE_ID_VALUE 0xB3 /**< Device ID of PADS 2511020213301 Sensor */ 25 26 27 /* Available PADS I2C slave addresses */ 28 29 #define PADS_ADDRESS_I2C_0 0x5C /**< when SAO of PADS is connected to ground */ 30 #define PADS_ADDRESS_I2C_1 0x5D /**< when SAO of PADS is connected to positive supply voltage */ 31 32 33 /* Register address definitions */ 34 35 #define PADS_INT_CFG_REG 0x0B /**< Interrupt configuration register */ 36 #define PADS_THR_P_L_REG 0x0C /**< Pressure threshold LSB register */ 37 #define PADS_THR_P_H_REG 0x0D /**< Pressure threshold MSB register */ 38 #define PADS_INTERFACE_CTRL_REG 0x0E /**< Interface control register */ 39 #define PADS_DEVICE_ID_REG 0x0F /**< Device ID register */ 40 #define PADS_CTRL_1_REG 0x10 /**< Control register 1 */ 41 #define PADS_CTRL_2_REG 0x11 /**< Control register 2 */ 42 #define PADS_CTRL_3_REG 0x12 /**< Control register 3 */ 43 #define PADS_FIFO_CTRL_REG 0x13 /**< FIFO control register */ 44 #define PADS_FIFO_WTM_REG 0x14 /**< FIFO threshold register */ 45 #define PADS_REF_P_L_REG 0x15 /**< Reference pressure LSB value register */ 46 #define PADS_REF_P_H_REG 0x16 /**< Reference pressure MSB value register */ 47 #define PADS_OPC_P_L_REG 0x18 /**< Pressure offset LSB value register */ 48 #define PADS_OPC_P_H_REG 0x19 /**< Pressure offset MSB value register */ 49 #define PADS_INT_SOURCE_REG 0x24 /**< Interrupt source register */ 50 #define PADS_FIFO_STATUS1_REG 0x25 /**< FIFO status register 1 */ 51 #define PADS_FIFO_STATUS2_REG 0x26 /**< FIFO status register 2 */ 52 #define PADS_STATUS_REG 0x27 /**< Status register */ 53 #define PADS_DATA_P_XL_REG 0x28 /**< Pressure output LSB value register */ 54 #define PADS_DATA_P_L_REG 0x29 /**< Pressure output MID value register */ 55 #define PADS_DATA_P_H_REG 0x2A /**< Pressure output MSB value register */ 56 #define PADS_DATA_T_L_REG 0x2B /**< Temperature output LSB value register */ 57 #define PADS_DATA_T_H_REG 0x2C /**< Temperature output MSB value register */ 58 #define PADS_FIFO_DATA_P_XL_REG 0x78 /**< Pressure LSB data in FIFO buffer */ 59 #define PADS_FIFO_DATA_P_L_REG 0x79 /**< Pressure MID data in FIFO buffer */ 60 #define PADS_FIFO_DATA_P_H_REG 0x7A /**< Pressure MSB data in FIFO buffer */ 61 #define PADS_FIFO_DATA_T_L_REG 0x7B /**< Temperature LSB data in FIFO buffer */ 62 #define PADS_FIFO_DATA_T_H_REG 0x7C /**< Temperature MSB data in FIFO buffer */ 63 64 65 /* Misc. defines */ 66 67 #define PADS_FIFO_BUFFER_SIZE 128 68 69 70 /* Register type definitions */ 71 72 /** 73 * @brief Interrupt_CFG 74 * 75 * Address 0x0B 76 * Type R/W 77 * Default value: 0x00 78 */ 79 typedef struct 80 { 81 uint8_t highPresInt : 1; /**< PHE: Enable/disable interrupt on pressure high event (0: disabled; 1: enabled) */ 82 uint8_t lowPresInt : 1; /**< PLE: Enable/disable interrupt on pressure low event (0: disabled; 1: enabled) */ 83 uint8_t latchedInt : 1; /**< LIR: Enable/disable latched interrupt (0: normal; 1: enabled) */ 84 uint8_t diffInt : 1; /**< DIFF_EN: Enable/disable differential interrupt generation (0: disabled; 1: enabled) */ 85 uint8_t resetAutoZero : 1; /**< RESET_AZ: Reset AUTOZERO function; also resets reference pressure register (0: normal mode; 1: reset AUTOZERO) */ 86 uint8_t autoZero : 1; /**< AUTOZERO: Turn on AUTOZERO mode; stores reference pressure in REF_P; enables differential output pressure (0: normal mode; 1: turn on) */ 87 uint8_t resetAutoRefp : 1; /**< RESET_ARP: Reset AUTOREFP mode; also resets reference pressure register (0: normal mode; 1: enabled) */ 88 uint8_t autoRefp : 1; /**< AUTOREFP: Turn on AUTOREFP function; stores reference pressure in REF_P; enables differential output pressure (0: normal mode; 1: turn on) */ 89 } PADS_interruptConfiguration_t; 90 91 92 /** 93 * @brief Pressure threshold LSB register 94 * 95 * Address 0x0C 96 * Type R/W 97 * Default value: 0x00 98 */ 99 typedef struct 100 { 101 uint8_t presThresholdLsb : 8; /**< THR[7:0] This register contains the low part of threshold value for pressure interrupt */ 102 } PADS_thresholdLSB_t; 103 104 105 /** 106 * @brief Pressure threshold MSB register 107 * 108 * Address 0x0D 109 * Type R/W 110 * Default value: 0x00 111 */ 112 typedef struct 113 { 114 uint8_t presThresholdMsb : 7; /**< THR[14:8] This register contains the high part of threshold value for pressure interrupt */ 115 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device */ 116 } PADS_thresholdMSB_t; 117 118 119 /** 120 * @brief Interface control register 121 * 122 * Address 0x0B 123 * Type R/W 124 * Default value: 0x00 125 */ 126 typedef struct 127 { 128 uint8_t disableI2C : 1; /**< I2C_DISABLE: Enable/disable I2C digital Interface (0: I2C enabled; 1: I2C disabled) */ 129 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device */ 130 uint8_t disPullDownOnIntPin : 1; /**< PD_DIS_INT: Enable/disable pull down on the INT pin (0: PD connected; 1: PD disconnected) */ 131 uint8_t pullUpOnSAOPin : 1; /**< SAO_PU_EN: Enable/disable pull-up on the SAO pin (0: disabled; 1: enabled) */ 132 uint8_t pullUpOnSDAPin : 1; /**< SDA_PU_EN: Enable/disable pull-up on the SDA pin (0: disabled; 1: enabled) */ 133 uint8_t notUsed02 : 2; /**< This bit must be set to 0 for proper operation of the device */ 134 uint8_t notUsed03 : 1; /**< This bit must be set to 0 for proper operation of the device */ 135 } PADS_interfaceCtrl_t; 136 137 138 /** 139 * @brief Control register 1 140 * 141 * Address 0x0F 142 * Type R/W 143 * Default value: 0x00 144 * 145 * ODR2 | ODR1 | ODR0 | Pressure/Temperature output data rate (Hz) 146 * ---------------- ---------------------------------------------------- 147 * 0 | 0 | 0 | Single conversion 148 * 0 | 0 | 1 | 1 149 * 0 | 1 | 0 | 10 150 * 0 | 1 | 1 | 25 151 * 1 | 0 | 0 | 50 152 * 1 | 0 | 1 | 75 153 * 1 | 1 | 0 | 100 154 * 1 | 1 | 1 | 200 155 * 156 * ------------------------------------------------------------------- 157 * 158 * EN_LPFP | LPFP_CFG | LPF2 status | Device Bandwidth | Samples to be discarded 159 * -------------------------------------------------------------------------------------------------- 160 * 0 | x (don't care) | Disabled/reset filter | ODR/2 | 0 161 * 1 | 0 | Enabled | ODR/9 | 2 162 * 1 | 1 | Enabled | ODR/20 | 2 163 * 164 */ 165 typedef struct 166 { 167 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device */ 168 uint8_t blockDataUpdate : 1; /**< BDU: Block data update. 0 - continuous update; 1 - output registers are not updated until both MSB and LSB have been read */ 169 uint8_t lowPassFilterConfig : 1; /**< LPFP_CFG: Configure low pass filter for pressure data */ 170 uint8_t enLowPassFilter : 1; /**< EN_LPFP: Enable low pass filter for pressure data */ 171 uint8_t outputDataRate : 3; /**< ODR[2:0]: Output data rate. Default '000' */ 172 uint8_t notUsed02 : 1; /**< This bit must be set to 0 for proper operation of the device */ 173 } PADS_ctrl1_t; 174 175 176 /** 177 * @brief Control register 2 178 * 179 * Address 0x11 180 * Type R/W 181 * Default value: 0x10 182 */ 183 typedef struct 184 { 185 uint8_t oneShotBit : 1; /**< ONE_SHOT: 0: Normal operation; 1: Start single conversion measurement */ 186 uint8_t lowNoiseMode : 1; /**< LOW_NOISE_EN: Enables low noise mode (used only if ODR is lower than 100 Hz). Default value: 0 (0: low-power mode; 1: low-noise mode) */ 187 uint8_t softwareReset : 1; /**< SWRESET: Software reset. 0: normal mode; 1: SW reset; Self-clearing upon completion */ 188 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device */ 189 uint8_t autoAddIncr : 1; /**< IF_ADD_INC: Register address automatically incremented during a multiple byte access with I2C interface. Default value 1 (0: disable; 1: enable) */ 190 uint8_t openDrainOnINTPin : 1; /**< PP_OD: Push-pull/open-drain selection on interrupt pad. Default value: 0 (0: push-pull; 1: open-drain) */ 191 uint8_t intActiveLevel : 1; /**< INT_H_L: Interrupt active high, active low. Default value: 0 (0: active high; 1: active low) */ 192 uint8_t boot : 1; /**< BOOT: Reboot memory content. 0: normal mode; 1: reboot memory content. Self-clearing upon completion */ 193 } PADS_ctrl2_t; 194 195 196 /** 197 * @brief Control register 3 198 * 199 * Address 0x12 200 * Type R/W 201 * Default value: 0x00 202 * 203 * Interrupt configurations 204 * INT_S1 | INT_S0 | INT pin configuration 205 * ------------------------------------------------------ 206 * 0 | 0 | Data signal (in order of priority: DRDY or INT_F_WTM or INT_F_OVR or INT_F_FULL) 207 * 0 | 1 | Pressure high event 208 * 1 | 0 | Pressure low event 209 * 1 | 1 | Pressure low or high event 210 * 211 */ 212 typedef struct 213 { 214 uint8_t intEventCtrl : 2; /**< INT_S: Data signal on INT pad control bits: Default value: 00 */ 215 uint8_t dataReadyInt : 1; /**< DRDY: Data-ready signal on INT pin. Default value: 0 (0: disable; 1: enable) */ 216 uint8_t fifoOverrunInt : 1; /**< INT_F_OVR: Enable FIFO overrun interrupt. Default value: 0 (0: disable; 1: enable) */ 217 uint8_t fifoThresholdInt : 1; /**< INT_F_WTM: Enable FIFO threshold (watermark) interrupt. Default value: 0 (0: disable; 1: enable) */ 218 uint8_t fifoFullInt : 1; /**< INT_F_FULL: Enable FIFO full interrupt. Default value: 0 (0: disable; 1: enable) */ 219 uint8_t notUsed01 : 2; /**< These 2 bits must be set to 0 for proper operation of the device */ 220 } PADS_ctrl3_t; 221 222 223 /** 224 * @brief Control FIFO control register 225 * 226 * Address 0x13 227 * Type R/W 228 * Default value: 0x00 229 * 230 * FIFO mode selection 231 * TRIG_MODES | F_MODE[1:0] | Mode 232 * ------------------------------------------------------- 233 * x | 00 | Bypass 234 * 0 | 01 | FIFO mode 235 * 0 | 1x | Continuous 236 * 1 | 01 | Bypass-to-FIFO 237 * 1 | 10 | Bypass-to-Continuous 238 * 1 | 11 | Continuous-to-FIFO 239 */ 240 typedef struct 241 { 242 uint8_t fifoMode : 3; /**< [TRIG_MODES; FMODE[1:0]]: select FIFO mode */ 243 uint8_t stopOnThreshold : 1; /**< STOP_ON_WTM: When set to true, the FIFO is considered to be full when the user-defined threshold is reached. Default value: 0 (0: disabled; 1: enabled) */ 244 uint8_t notUsed01 : 4; /**< These 4 bits must be set to 0 for proper operation of the device */ 245 } PADS_fifoCtrl_t; 246 247 248 /** 249 * @brief FIFO threshold setting register 250 * 251 * Address 0x14 252 * Type R/W 253 * Default value: 0x00 254 */ 255 typedef struct 256 { 257 uint8_t fifoThreshold : 7; /**< WTM[6:0]: FIFO threshold level setting (value between 0 and 127). Default value: 0x00 */ 258 uint8_t notUsed01 : 1; /**< This bit must be set to 0 for proper operation of the device */ 259 } PADS_fifoThreshold_t; 260 261 262 /** 263 * @brief Interrupt source register 264 * 265 * Address 0x24 266 * Type R 267 * Default value: Output; 0x00 268 */ 269 typedef struct 270 { 271 uint8_t diffPresHighEvent : 1; /**< PH: Differential pressure high (0: no interrupt; 1: high differential pressure event has occurred) */ 272 uint8_t diffPresLowEvent : 1; /**< PL: Differential pressure low (0: no interrupt; 1: low differential pressure event has occurred) */ 273 uint8_t intStatus : 1; /**< IA: Interrupt active (0: no interrupt; 1: one or more interrupt events have been generated) */ 274 uint8_t notUsed01 : 4; /**< These 4 bits must be set to 0 for proper operation of the device */ 275 uint8_t bootOn : 1; /**< BOOT_ON: Indication of boot phase (0: Boot phase has ended; 1: Boot phase is running) */ 276 } PADS_intSource_t; 277 278 279 /** 280 * @brief FIFO Status register 2 281 * 282 * Address 0x26 283 * Type R 284 * Default value: Output; 0x00 285 */ 286 typedef struct 287 { 288 uint8_t notUsed01 : 5; /**< These 5 bits must be set to 0 for proper operation of the device */ 289 uint8_t fifoFull : 1; /**< FIFO_FULL_IA: FIFO full status (0: FIFO not full; 1: FIFO is full, no samples overwritten) */ 290 uint8_t fifoOverrun : 1; /**< FIFO_OVR_IA: FIFO overrun status (0: FIFO is not overrun; 1: FIFO is full and at least one sample has been overwritten) */ 291 uint8_t fifoWtm : 1; /**< FIFO_WTM_IA: Threshold (watermark) status (0: FIFO level below threshold; 1: FIFO level equal or higher than threshold) */ 292 } PADS_fifoStatus2_t; 293 294 295 /** 296 * @brief Status register 297 * 298 * Address 0x27 299 * Type R 300 * Default value: Output; 0x00 301 */ 302 typedef struct 303 { 304 uint8_t presDataAvailable : 1; /**< P_DA: Pressure data available. (0: Pressure sample not yet available; 1: A new pressure sample is available) */ 305 uint8_t tempDataAvailable : 1; /**< T_DA: Temperature data available. (0: Temperature sample not yet available; 1: A new temperature sample is available) */ 306 uint8_t notUsed01 : 2; /**< These 2 bits must be set to 0 for proper operation of the device */ 307 uint8_t presDataOverrun : 1; /**< P_OR: Pressure data overrun. (0: No overrun; 1: Pressure data overwritten) */ 308 uint8_t tempDataOverrun : 1; /**< T_OR: Temperature data overrun. (0: No overrun; 1: Temperature data overwritten) */ 309 uint8_t notUsed02 : 2; /**< These 2 bits must be set to 0 for proper operation of the device */ 310 } PADS_status_t; 311 312 313 /* Functional type definitions */ 314 315 typedef enum 316 { 317 PADS_disable = 0, 318 PADS_enable = 1 319 } PADS_state_t; 320 321 322 typedef enum 323 { 324 PADS_outputDataRatePowerDown = 0, /**< single conversion / power down */ 325 PADS_outputDataRate1Hz = 1, /**< 1Hz */ 326 PADS_outputDataRate10Hz = 2, /**< 10Hz */ 327 PADS_outputDataRate25Hz = 3, /**< 25Hz */ 328 PADS_outputDataRate50Hz = 4, /**< 50Hz */ 329 PADS_outputDataRate75Hz = 5, /**< 75Hz */ 330 PADS_outputDataRate100Hz = 6, /**< 100Hz */ 331 PADS_outputDataRate200Hz = 7 /**< 200Hz */ 332 } PADS_outputDataRate_t; 333 334 335 typedef enum 336 { 337 PADS_lpFilterBW1 = 0, /**< Bandwidth = outputDataRate / 9 */ 338 PADS_lpFilterBW2 = 1 /**< Bandwidth = outputDataRate / 20 */ 339 } PADS_filterConf_t; 340 341 342 typedef enum 343 { 344 PADS_activeHigh = 0, 345 PADS_activeLow = 1 346 } PADS_interruptActiveLevel_t; 347 348 349 typedef enum 350 { 351 PADS_pushPull = 0, 352 PADS_openDrain = 1 353 } PADS_interruptPinConfig_t; 354 355 356 typedef enum 357 { 358 PADS_lowPower = 0, /**< Low power mode */ 359 PADS_lowNoise = 1, /**< Low noise mode */ 360 } PADS_powerMode_t; 361 362 363 typedef enum 364 { 365 PADS_dataReady = 0, /**< Data signal (in order of priority: DRDY or INT_F_WTM or INT_F_OVR or INT_F_FULL) */ 366 PADS_pressureHigh = 1, 367 PADS_pressureLow = 2, 368 PADS_pressureHighOrLow = 3 369 } PADS_interruptEventControl_t; 370 371 372 typedef enum 373 { 374 PADS_bypassMode = 0, 375 PADS_fifoEnabled = 1, 376 PADS_continuousMode = 2, 377 PADS_bypassToFifo = 5, 378 PADS_bypassToContinuous = 6, 379 PADS_continuousToFifo = 7 380 } PADS_fifoMode_t; 381 382 383 #ifdef __cplusplus 384 extern "C" 385 { 386 #endif 387 388 /* Function definitions */ 389 390 int8_t PADS_getDefaultInterface(WE_sensorInterface_t* sensorInterface); 391 392 int8_t PADS_getDeviceID(WE_sensorInterface_t* sensorInterface, uint8_t *deviceID); 393 394 int8_t PADS_enableAutoRefp(WE_sensorInterface_t* sensorInterface, PADS_state_t autoRefp); 395 int8_t PADS_isEnablingAutoRefp(WE_sensorInterface_t* sensorInterface, PADS_state_t *autoRefp); 396 int8_t PADS_resetAutoRefp(WE_sensorInterface_t* sensorInterface, PADS_state_t reset); 397 398 int8_t PADS_enableAutoZeroMode(WE_sensorInterface_t* sensorInterface, PADS_state_t autoZero); 399 int8_t PADS_isEnablingAutoZeroMode(WE_sensorInterface_t* sensorInterface, PADS_state_t *autoZero); 400 int8_t PADS_resetAutoZeroMode(WE_sensorInterface_t* sensorInterface, PADS_state_t reset); 401 402 int8_t PADS_enableDiffPressureInterrupt(WE_sensorInterface_t* sensorInterface, PADS_state_t diffEn); 403 int8_t PADS_isDiffPressureInterruptEnabled(WE_sensorInterface_t* sensorInterface, PADS_state_t *diffIntState); 404 405 int8_t PADS_enableLatchedInterrupt(WE_sensorInterface_t* sensorInterface, PADS_state_t state); 406 int8_t PADS_isLatchedInterruptEnabled(WE_sensorInterface_t* sensorInterface, PADS_state_t *latchInt); 407 408 int8_t PADS_enableLowPressureInterrupt(WE_sensorInterface_t* sensorInterface, PADS_state_t state); 409 int8_t PADS_isLowPressureInterruptEnabled(WE_sensorInterface_t* sensorInterface, PADS_state_t *lpint); 410 int8_t PADS_enableHighPressureInterrupt(WE_sensorInterface_t* sensorInterface, PADS_state_t state); 411 int8_t PADS_isHighPressureInterruptEnabled(WE_sensorInterface_t* sensorInterface, PADS_state_t *hpint); 412 413 int8_t PADS_getInterruptSource(WE_sensorInterface_t* sensorInterface, PADS_intSource_t *intSource); 414 int8_t PADS_getInterruptStatus(WE_sensorInterface_t* sensorInterface, PADS_state_t *intState); 415 int8_t PADS_getLowPressureInterruptStatus(WE_sensorInterface_t* sensorInterface, PADS_state_t *lpState); 416 int8_t PADS_getHighPressureInterruptStatus(WE_sensorInterface_t* sensorInterface, PADS_state_t *hpState); 417 418 int8_t PADS_enableFifoFullInterrupt(WE_sensorInterface_t* sensorInterface, PADS_state_t fullState); 419 int8_t PADS_enableFifoThresholdInterrupt(WE_sensorInterface_t* sensorInterface, PADS_state_t threshState); 420 int8_t PADS_enableFifoOverrunInterrupt(WE_sensorInterface_t* sensorInterface, PADS_state_t ovrState); 421 422 int8_t PADS_isFifoFull(WE_sensorInterface_t* sensorInterface, PADS_state_t *fifoFull); 423 int8_t PADS_isFifoThresholdReached(WE_sensorInterface_t* sensorInterface, PADS_state_t *fifoWtm); 424 int8_t PADS_getFifoOverrunState(WE_sensorInterface_t* sensorInterface, PADS_state_t *fifoOvr); 425 426 int8_t PADS_enableDataReadyInterrupt(WE_sensorInterface_t* sensorInterface, PADS_state_t drdy); 427 int8_t PADS_isDataReadyInterruptEnabled(WE_sensorInterface_t* sensorInterface, PADS_state_t *drdy); 428 429 int8_t PADS_setInterruptEventControl(WE_sensorInterface_t* sensorInterface, PADS_interruptEventControl_t ctr); 430 int8_t PADS_getInterruptEventControl(WE_sensorInterface_t* sensorInterface, PADS_interruptEventControl_t *intEvent); 431 432 int8_t PADS_setPressureThreshold(WE_sensorInterface_t* sensorInterface, uint32_t thresholdPa); 433 int8_t PADS_getPressureThreshold(WE_sensorInterface_t* sensorInterface, uint32_t *thresholdPa); 434 int8_t PADS_setPressureThresholdLSB(WE_sensorInterface_t* sensorInterface, uint8_t thr); 435 int8_t PADS_setPressureThresholdMSB(WE_sensorInterface_t* sensorInterface, uint8_t thr); 436 int8_t PADS_getPressureThresholdLSB(WE_sensorInterface_t* sensorInterface, uint8_t *thrLSB); 437 int8_t PADS_getPressureThresholdMSB(WE_sensorInterface_t* sensorInterface, uint8_t *thrMSB); 438 439 int8_t PADS_disableI2CInterface(WE_sensorInterface_t* sensorInterface, PADS_state_t i2cDisable); 440 int8_t PADS_isI2CInterfaceDisabled(WE_sensorInterface_t* sensorInterface, PADS_state_t *i2cDisabled); 441 int8_t PADS_disablePullDownIntPin(WE_sensorInterface_t* sensorInterface, PADS_state_t pullDown); 442 int8_t PADS_isPullDownIntDisabled(WE_sensorInterface_t* sensorInterface, PADS_state_t *pinState); 443 int8_t PADS_setSAOPullUp(WE_sensorInterface_t* sensorInterface, PADS_state_t saoStatus); 444 int8_t PADS_isSAOPullUp(WE_sensorInterface_t* sensorInterface, PADS_state_t *saoPinState); 445 int8_t PADS_setSDAPullUp(WE_sensorInterface_t* sensorInterface, PADS_state_t sdaStatus); 446 int8_t PADS_isSDAPullUp(WE_sensorInterface_t* sensorInterface, PADS_state_t *sdaPinState); 447 448 int8_t PADS_setOutputDataRate(WE_sensorInterface_t* sensorInterface, PADS_outputDataRate_t odr); 449 int8_t PADS_getOutputDataRate(WE_sensorInterface_t* sensorInterface, PADS_outputDataRate_t* odr); 450 451 int8_t PADS_enableLowPassFilter(WE_sensorInterface_t* sensorInterface, PADS_state_t filterEnabled); 452 int8_t PADS_isLowPassFilterEnabled(WE_sensorInterface_t* sensorInterface, PADS_state_t *filterEnabled); 453 int8_t PADS_setLowPassFilterConfig(WE_sensorInterface_t* sensorInterface, PADS_filterConf_t conf); 454 int8_t PADS_getLowPassFilterConfig(WE_sensorInterface_t* sensorInterface, PADS_filterConf_t *conf); 455 456 int8_t PADS_enableBlockDataUpdate(WE_sensorInterface_t* sensorInterface, PADS_state_t bdu); 457 int8_t PADS_isBlockDataUpdateEnabled(WE_sensorInterface_t* sensorInterface, PADS_state_t *bdu); 458 459 int8_t PADS_reboot(WE_sensorInterface_t* sensorInterface, PADS_state_t reboot); 460 int8_t PADS_isRebooting(WE_sensorInterface_t* sensorInterface, PADS_state_t *reboot); 461 int8_t PADS_getBootStatus(WE_sensorInterface_t* sensorInterface, PADS_state_t *boot); 462 463 int8_t PADS_setInterruptActiveLevel(WE_sensorInterface_t* sensorInterface, PADS_interruptActiveLevel_t level); 464 int8_t PADS_getInterruptActiveLevel(WE_sensorInterface_t* sensorInterface, PADS_interruptActiveLevel_t *level); 465 466 int8_t PADS_setInterruptPinType(WE_sensorInterface_t* sensorInterface, PADS_interruptPinConfig_t pinType); 467 int8_t PADS_getInterruptPinType(WE_sensorInterface_t* sensorInterface, PADS_interruptPinConfig_t *pinType); 468 469 int8_t PADS_enableAutoIncrement(WE_sensorInterface_t* sensorInterface, PADS_state_t inc); 470 int8_t PADS_isAutoIncrementEnabled(WE_sensorInterface_t* sensorInterface, PADS_state_t *inc); 471 472 int8_t PADS_softReset(WE_sensorInterface_t* sensorInterface, PADS_state_t swReset); 473 int8_t PADS_getSoftResetState(WE_sensorInterface_t* sensorInterface, PADS_state_t *swReset); 474 475 int8_t PADS_setPowerMode(WE_sensorInterface_t* sensorInterface, PADS_powerMode_t mode); 476 int8_t PADS_getPowerMode(WE_sensorInterface_t* sensorInterface, PADS_powerMode_t *mode); 477 478 int8_t PADS_enableOneShot(WE_sensorInterface_t* sensorInterface, PADS_state_t oneShot); 479 int8_t PADS_isOneShotEnabled(WE_sensorInterface_t* sensorInterface, PADS_state_t *oneShot); 480 481 int8_t PADS_setPressureOffsetLSB(WE_sensorInterface_t* sensorInterface, uint8_t offset); 482 int8_t PADS_getPressureOffsetLSB(WE_sensorInterface_t* sensorInterface, uint8_t *offset); 483 int8_t PADS_setPressureOffsetMSB(WE_sensorInterface_t* sensorInterface, uint8_t offset); 484 int8_t PADS_getPressureOffsetMSB(WE_sensorInterface_t* sensorInterface, uint8_t *offset); 485 486 int8_t PADS_setFifoMode(WE_sensorInterface_t* sensorInterface, PADS_fifoMode_t fifoMode); 487 int8_t PADS_getFifoMode(WE_sensorInterface_t* sensorInterface, PADS_fifoMode_t *fifoMode); 488 489 int8_t PADS_enableStopOnThreshold(WE_sensorInterface_t* sensorInterface, PADS_state_t state); 490 int8_t PADS_isStopOnThresholdEnabled(WE_sensorInterface_t* sensorInterface, PADS_state_t *state); 491 492 int8_t PADS_setFifoThreshold(WE_sensorInterface_t* sensorInterface, uint8_t fifoThr); 493 int8_t PADS_getFifoThreshold(WE_sensorInterface_t* sensorInterface, uint8_t *fifoThr); 494 495 int8_t PADS_getFifoFillLevel(WE_sensorInterface_t* sensorInterface, uint8_t *fifoLevel); 496 497 int8_t PADS_getReferencePressure(WE_sensorInterface_t* sensorInterface, uint32_t *referencePressurePa); 498 int8_t PADS_getRawReferencePressure(WE_sensorInterface_t* sensorInterface, uint32_t *referencePressure); 499 int8_t PADS_getReferencePressureLSB(WE_sensorInterface_t* sensorInterface, uint8_t *lowReferenceValue); 500 int8_t PADS_getReferencePressureMSB(WE_sensorInterface_t* sensorInterface, uint8_t *highReferenceValue); 501 502 int8_t PADS_getTemperatureOverrunStatus(WE_sensorInterface_t* sensorInterface, PADS_state_t *state); 503 int8_t PADS_getPressureOverrunStatus(WE_sensorInterface_t* sensorInterface, PADS_state_t *state); 504 505 int8_t PADS_isPressureDataAvailable(WE_sensorInterface_t* sensorInterface, PADS_state_t *state); 506 int8_t PADS_isTemperatureDataAvailable(WE_sensorInterface_t* sensorInterface, PADS_state_t *state); 507 int8_t PADS_isDataAvailable(WE_sensorInterface_t* sensorInterface, PADS_state_t *temp_state, PADS_state_t *press_state); 508 509 int8_t PADS_getRawPressure(WE_sensorInterface_t* sensorInterface, int32_t *rawPres); 510 int8_t PADS_getRawTemperature(WE_sensorInterface_t* sensorInterface, int16_t *rawTemp); 511 512 int8_t PADS_getFifoRawPressure(WE_sensorInterface_t* sensorInterface, uint8_t numSamples, int32_t *rawPres); 513 int8_t PADS_getFifoRawTemperature(WE_sensorInterface_t* sensorInterface, uint8_t numSamples, int16_t *rawTemp); 514 int8_t PADS_getFifoRawValues(WE_sensorInterface_t* sensorInterface, uint8_t numSamples, int32_t *rawPres, int16_t *rawTemp); 515 516 int8_t PADS_getPressure_int(WE_sensorInterface_t* sensorInterface, int32_t *pressPa); 517 int8_t PADS_getDifferentialPressure_int(WE_sensorInterface_t* sensorInterface, int32_t *pressPa); 518 int8_t PADS_getTemperature_int(WE_sensorInterface_t* sensorInterface, int16_t *temperature); 519 520 int8_t PADS_getFifoPressure_int(WE_sensorInterface_t* sensorInterface, uint8_t numSamples, int32_t *pressPa); 521 int8_t PADS_getFifoTemperature_int(WE_sensorInterface_t* sensorInterface, uint8_t numSamples, int16_t *temperature); 522 int8_t PADS_getFifoValues_int(WE_sensorInterface_t* sensorInterface, uint8_t numSamples, int32_t *pressPa, int16_t *temperature); 523 524 int32_t PADS_convertPressure_int(int32_t rawPres); 525 int32_t PADS_convertDifferentialPressure_int(int32_t rawPres); 526 527 #ifdef WE_USE_FLOAT 528 int8_t PADS_getPressure_float(WE_sensorInterface_t* sensorInterface, float *presskPa); 529 int8_t PADS_getDifferentialPressure_float(WE_sensorInterface_t* sensorInterface, float *presskPa); 530 int8_t PADS_getTemperature_float(WE_sensorInterface_t* sensorInterface, float *tempDegC); 531 532 int8_t PADS_getFifoPressure_float(WE_sensorInterface_t* sensorInterface, float *presskPa); 533 int8_t PADS_getFifoTemperature_float(WE_sensorInterface_t* sensorInterface, float *tempDegC); 534 535 float PADS_convertPressure_float(int32_t rawPres); 536 float PADS_convertDifferentialPressure_float(int32_t rawPres); 537 #endif /* WE_USE_FLOAT */ 538 539 #ifdef __cplusplus 540 } 541 #endif 542 543 #endif /* _WSEN_PADS_H */ 544