Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
lps25h.h
00001 /** 00002 ****************************************************************************** 00003 * @file lps25h.h 00004 * @author AST Robotics Team 00005 * @version V0.0.1 00006 * @date 18-February-2014 00007 * @brief This file contains definitions lps25h.c 00008 * firmware driver. 00009 ****************************************************************************** 00010 * @attention 00011 * 00012 * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> 00013 * 00014 * Redistribution and use in source and binary forms, with or without modification, 00015 * are permitted provided that the following conditions are met: 00016 * 1. Redistributions of source code must retain the above copyright notice, 00017 * this list of conditions and the following disclaimer. 00018 * 2. Redistributions in binary form must reproduce the above copyright notice, 00019 * this list of conditions and the following disclaimer in the documentation 00020 * and/or other materials provided with the distribution. 00021 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00022 * may be used to endorse or promote products derived from this software 00023 * without specific prior written permission. 00024 * 00025 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00026 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00028 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00029 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00030 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00031 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00032 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00033 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00034 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00035 * 00036 ****************************************************************************** 00037 */ 00038 00039 /* Define to prevent recursive inclusion -------------------------------------*/ 00040 #ifndef __LPS25H_H 00041 #define __LPS25H_H 00042 00043 #ifdef __cplusplus 00044 extern "C" { 00045 #endif 00046 00047 /* Includes ------------------------------------------------------------------*/ 00048 #include "../Common/pressure.h" 00049 00050 /** @addtogroup BSP 00051 * @{ 00052 */ 00053 00054 /** @addtogroup LPS25H 00055 * @{ 00056 */ 00057 00058 /** @defgroup LPS25H_Exported_Constants 00059 * @{ 00060 */ 00061 00062 /******************************************************************************/ 00063 /*************************** START REGISTER MAPPING **************************/ 00064 /******************************************************************************/ 00065 00066 00067 /** 00068 * @brief Reference pressure (LSB data) 00069 * \code 00070 * Read/write 00071 * Default value: 0x00 00072 * 7:0 REF7-ODR0: Lower part of the reference pressure that 00073 * is sum to the sensor output pressure. 00074 * \endcode 00075 */ 00076 #define LPS25H_REF_P_XL_ADDR 0x08 00077 00078 /** 00079 * @brief Reference pressure (middle part) 00080 * \code 00081 * Read/write 00082 * Default value: 0x00 00083 * 7:0 REF15-ODR8: Middle part of the reference pressure that 00084 * is sum to the sensor output pressure. 00085 * \endcode 00086 */ 00087 #define LPS25H_REF_P_L_ADDR 0x09 00088 00089 /** 00090 * @brief Reference pressure (MSB part) 00091 * \code 00092 * Read/write 00093 * Default value: 0x00 00094 * 7:0 REF15-ODR8: Higher part of the reference pressure that 00095 * is sum to the sensor output pressure. 00096 * \endcode 00097 */ 00098 #define LPS25H_REF_P_H_ADDR 0x0A 00099 00100 /** 00101 * @brief Device identifier register. 00102 * \code 00103 * Read 00104 * Default value: 0xBD 00105 * 7:0 This read-only register contains the device identifier that, 00106 for LPS25H, is set to 0xCA. 00107 * \endcode 00108 */ 00109 #define LPS25H_WHO_AM_I_ADDR 0x0F 00110 00111 /** 00112 * @brief Pressure and temperature resolution mode register. 00113 * \code 00114 * Read 00115 * Default value: 0x05 00116 * [7:4] Reserved 00117 * [3:2] AVGP1-0: select the pressure internal average. 00118 * [1:0] AVGT1-0: select the temperature internal average. 00119 * \endcode 00120 */ 00121 #define LPS25H_RES_CONF_ADDR 0x10 00122 00123 /** 00124 * @brief Pressure sensor control register 1 00125 * \code 00126 * Read/write 00127 * Default value: 0x00 00128 * 7 PD: power down control. 0 - disable; 1 - enable 00129 * 6:4 ODR2, ODR1, ODR0: output data rate selection. 00130 * ODR2 | ODR1 | ODR0 | Pressure output data-rate(Hz) | Temperature output data-rate(Hz) 00131 * ---------------------------------------------------------------------------------- 00132 * 0 | 0 | 0 | one shot | one shot 00133 * 0 | 0 | 1 | 1 | 1 00134 * 0 | 1 | 0 | 7 | 7 00135 * 0 | 1 | 1 | 12.5 | 12.5 00136 * 1 | 0 | 0 | 25 | 25 00137 * 1 | 0 | 1 | Reserved | Reserved 00138 * 1 | 1 | 0 | Reserved | Reserved 00139 * 1 | 1 | 1 | Reserved | Reserved 00140 * 00141 * 3 DIFF_EN: Interrupt circuit. 0 - disable; 1 - enable 00142 * 2 BDU: block data update. 0 - disable; 1 - enable 00143 * 1 DELTA_EN: delta pressure. 0 - disable; 1 - enable 00144 * 1 RESET_AZ: reset AutoZero. 0 - disable; 1 - enable ///////ALE REVIEW 00145 * 0 SIM: SPI Serial Interface Mode selection. 0 - SPI 4-wire; 1 - SPI 3-wire ///////ALE REVIEW 00146 * \endcode 00147 */ 00148 #define LPS25H_CTRL_REG1_ADDR 0x20 00149 00150 /** 00151 * @brief Pressure sensor control register 2 00152 * \code 00153 * Read/write 00154 * Default value: 0x00 00155 * 7 BOOT: Reboot memory content. 0: normal mode; 1: reboot memory content 00156 * 6 FIFO_EN: FIFO. 0: disable; 1: enable 00157 * 5 WTM_EN: FIFO Watermark level use. 0: disable; 1: enable 00158 * 4:3 Reserved. keep these bits at 0 00159 * 2 SWRESET: Software reset. 0: normal mode; 1: SW reset. 00160 * 1 AUTO_ZERO: Autozero enable. 0: normal mode; 1: autozero enable. 00161 * 0 ONE_SHOT: One shot enable. 0: waiting for start of conversion; 1: start for a new dataset 00162 * \endcode 00163 */ 00164 #define LPS25H_CTRL_REG2_ADDR 0x21 00165 00166 /** 00167 * @brief Pressure sensor control register 3 00168 * \code 00169 * Read/write 00170 * Default value: 0x00 00171 * 7 INT_H_L: Interrupt. 0:active high; 1: active low. 00172 * 6 PP_OD: Push-Pull/OpenDrain selection on interrupt pads. 0: Push-pull; 1: open drain. 00173 * 5 Reserved 00174 * 4:3 INT2_S2, INT2_S1: INT2 output signal selection control bits. // TO DO 00175 * 1:0 INT1_S2, INT1_S1: data signal on INT1 pad control bits. 00176 * INT1(2)_S2 | INT1(2)_S1 | INT1(2) pin 00177 * ------------------------------------------------------ 00178 * 0 | 0 | Data signal 00179 * 0 | 1 | Pressure high (P_high) 00180 * 1 | 0 | Pressure low (P_low) 00181 * 1 | 1 | P_low OR P_high 00182 00183 00184 * \endcode 00185 */ 00186 #define LPS25H_CTRL_REG3_ADDR 0x22 00187 00188 /** 00189 * @brief Pressure sensor control register 4 00190 * \code 00191 * Read/write 00192 * Default value: 0x00 00193 * 7 P2_EMPTY: Empty Signal on INT2 pin. 00194 * 6 P2_WTM: Watermark Signal on INT2 pin. 00195 * 5 P2_Overrun:Overrun Signal on INT2 pin. 00196 * 4 P2_DRDY: Data Ready Signal on INT2 pin. 00197 * 3 P1_EMPTY: Empty Signal on INT1 pin. 00198 * 2 P1_WTM: Watermark Signal on INT1 pin. 00199 * 1 P1_Overrunn:Overrun Signal on INT1 pin. 00200 * 0 P1_DRDY: Data Ready Signal on INT1 pin. 00201 * \endcode 00202 */ 00203 #define LPS25H_CTRL_REG4_ADDR 0x23 00204 00205 /** 00206 * @brief Interrupt configuration Register 00207 * \code 00208 * Read/write 00209 * Default value: 0x00. 00210 * 7:3 Reserved. 00211 * 2 LIR: Latch Interrupt request into INT_SOURCE register. 0 - disable; 1 - enable 00212 * 1 PL_E: Enable interrupt generation on differential pressure low event. 0 - disable; 1 - enable 00213 * 0 PH_E: Enable interrupt generation on differential pressure high event. 0 - disable; 1 - enable 00214 * \endcode 00215 */ 00216 #define LPS25H_INT_CFG_REG_ADDR 0x24 00217 00218 /** 00219 * @brief Interrupt source Register 00220 * \code 00221 * Read 00222 * Default value: 0x00. 00223 * 7:3 0. 00224 * 2 IA: Interrupt Active.0: no interrupt has been generated; 1: one or more interrupt events have been generated. 00225 * 1 PL: Differential pressure Low. 0: no interrupt has been generated; 1: Low differential pressure event has occurred. 00226 * 0 PH: Differential pressure High. 0: no interrupt has been generated; 1: High differential pressure event has occurred. 00227 * \endcode 00228 */ 00229 #define LPS25H_INT_SOURCE_REG_ADDR 0x25 00230 00231 /** 00232 * @brief Threshold pressure (LSB) 00233 * \code 00234 * Read 00235 * Default value: 0x00. 00236 * 7:0 THS7-THS0: Low part of threshold value for pressure interrupt 00237 * generation. The complete threshold value is given by THS_P_H & THS_P_L and is 00238 * expressed as unsigned number. P_ths(mbar)=(THS_P_H & THS_P_L)[dec]/16. 00239 * \endcode 00240 */ 00241 #define LPS25H_THS_P_LOW_REG_ADDR 0x30 00242 00243 /** 00244 * @brief Threshold pressure (MSB) 00245 * \code 00246 * Read 00247 * Default value: 0x00. 00248 * 7:0 THS15-THS8: High part of threshold value for pressure interrupt 00249 * generation. The complete threshold value is given by THS_P_H & THS_P_L and is 00250 * expressed as unsigned number. P_ths(mbar)=(THS_P_H & THS_P_L)[dec]/16. 00251 * \endcode 00252 */ 00253 #define LPS25H_THS_P_HIGH_REG_ADDR 0x31 00254 00255 /** 00256 * @brief Status Register 00257 * \code 00258 * Read 00259 * Default value: 0x00 00260 * 7:6 0 00261 * 5 P_OR: Pressure data overrun. 0: no overrun has occurred; 1: new data for pressure has overwritten the previous one. 00262 * 4 T_OR: Temperature data overrun. 0: no overrun has occurred; 1: a new data for temperature has overwritten the previous one. 00263 * 3:2 0 00264 * 1 P_DA: Pressure data available. 0: new data for pressure is not yet available; 1: new data for pressure is available. 00265 * 0 T_DA: Temperature data available. 0: new data for temperature is not yet available; 1: new data for temperature is available. 00266 * \endcode 00267 */ 00268 #define LPS25H_STATUS_REG_ADDR 0x27 00269 00270 /** 00271 * @brief Pressure data (LSB). 00272 * \code 00273 * Read 00274 * Default value: 0x00. 00275 * POUT7 - POUT0: Pressure data LSB (2's complement). 00276 * Pressure output data: Pout(mbar)=(PRESS_OUT_H & PRESS_OUT_L & 00277 * PRESS_OUT_XL)[dec]/4096. 00278 * \endcode 00279 */ 00280 #define LPS25H_PRESS_POUT_XL_ADDR 0x28 00281 00282 /** 00283 * @brief Pressure data (Middle part). 00284 * \code 00285 * Read 00286 * Default value: 0x80. 00287 * POUT15 - POUT8: Pressure data middle part (2's complement). 00288 * Pressure output data: Pout(mbar)=(PRESS_OUT_H & PRESS_OUT_L & 00289 * PRESS_OUT_XL)[dec]/4096. 00290 * \endcode 00291 */ 00292 #define LPS25H_PRESS_OUT_L_ADDR 0x29 00293 00294 /** 00295 * @brief Pressure data (MSB). 00296 * \code 00297 * Read 00298 * Default value: 0x2F. 00299 * POUT23 - POUT16: Pressure data MSB (2's complement). 00300 * Pressure output data: Pout(mbar)=(PRESS_OUT_H & PRESS_OUT_L & 00301 * PRESS_OUT_XL)[dec]/4096. 00302 * \endcode 00303 */ 00304 #define LPS25H_PRESS_OUT_H_ADDR 0x2A 00305 00306 /** 00307 * @brief Temperature data (LSB). 00308 * \code 00309 * Read 00310 * Default value: 0x00. 00311 * TOUT7 - TOUT0: temperature data LSB. 00312 * T(degC) = 42.5 + (Temp_OUTH & TEMP_OUT_L)[dec]/480. 00313 * \endcode 00314 */ 00315 #define LPS25H_TEMP_OUT_L_ADDR 0x2B 00316 00317 /** 00318 * @brief Temperature data (MSB). 00319 * \code 00320 * Read 00321 * Default value: 0x00. 00322 * TOUT15 - TOUT8: temperature data MSB. 00323 * T(degC) = 42.5 + (Temp_OUTH & TEMP_OUT_L)[dec]/480. 00324 * \endcode 00325 */ 00326 #define LPS25H_TEMP_OUT_H_ADDR 0x2C 00327 00328 /** 00329 * @brief FIFO control register 00330 * \code 00331 * Read/write 00332 * Default value: 0x00 00333 * 7:5 F_MODE2, F_MODE1, F_MODE0: FIFO mode selection. 00334 * FM2 | FM1 | FM0 | FIFO MODE 00335 * --------------------------------------------------- 00336 * 0 | 0 | 0 | BYPASS MODE 00337 * 0 | 0 | 1 | FIFO MODE. Stops collecting data when full 00338 * 0 | 1 | 0 | STREAM MODE: Keep the newest measurements in the FIFO 00339 * 0 | 1 | 1 | STREAM MODE until trigger deasserted, then change to FIFO MODE 00340 * 1 | 0 | 0 | BYPASS MODE until trigger deasserted, then STREAM MODE 00341 * 1 | 0 | 1 | Reserved 00342 * 1 | 1 | 0 | FIFO_MEAN MODE: Fifo is used to generate a running average filtered pressure 00343 * 1 | 1 | 1 | BYPASS mode until trigger deasserted, then FIFO MODE 00344 * 00345 * 4:0 FIFO Mean Mode Sample size 00346 * WTM_POINT4 | WTM_POINT4 | WTM_POINT4 | WTM_POINT4 | WTM_POINT4 | Sample Size 00347 * ---------------------------------------------------------------------------------- 00348 * 0 | 0 | 0 | 0 | 1 | 2 00349 * 0 | 0 | 0 | 1 | 1 | 4 00350 * 0 | 0 | 1 | 1 | 1 | 8 00351 * 0 | 1 | 1 | 1 | 1 | 16 00352 * 1 | 1 | 1 | 1 | 1 | 32 00353 * other values operation not guaranteed 00354 * \endcode 00355 */ 00356 #define LPS25H_CTRL_FIFO_ADDR 0x2E 00357 00358 /** 00359 * @brief FIFO Status register 00360 * \code 00361 * Read/write 00362 * Default value: 0x00 00363 * 7 WTM_FIFO: Watermark status. 0:FIFO filling is lower than watermark level; 1: FIFO is equal or higher than watermark level. 00364 * 6 FULL_FIFO: Overrun bit status. 0 - FIFO not full; 1 -FIFO is full. 00365 * 5 EMPTY_FIFO: Empty FIFO bit. 0 - FIFO not empty; 1 -FIFO is empty. 00366 * 4:0 DIFF_POINT4...0: FIFOsStored data level. 00367 * \endcode 00368 */ 00369 #define LPS25H_STATUS_FIFO_ADDR 0x2F 00370 00371 /** 00372 * @brief Pressure offset register 00373 * \code 00374 * Read/write 00375 * Default value: 0x00 00376 * 7:0 RPDS15...8:Pressure Offset for 1 point calibration after soldering. 00377 * \endcode 00378 */ 00379 #define LPS25H_RPDS_TRIM_L_ADDR 0x39 00380 00381 /** 00382 * @brief Pressure offset register 00383 * \code 00384 * Read/write 00385 * Default value: 0x00 00386 * 7:0 RPDS23...16:Pressure Offset for 1 point calibration after soldering. 00387 * \endcode 00388 */ 00389 #define LPS25H_RPDS_TRIM_H_ADDR 0x3A 00390 00391 /******************************************************************************/ 00392 /**************************** END REGISTER MAPPING ***************************/ 00393 /******************************************************************************/ 00394 00395 /** 00396 * @brief Device Address 00397 */ 00398 #define LPS25H_ADDRESS_LOW 0xB8 00399 #define LPS25H_ADDRESS_HIGH 0xBA 00400 00401 00402 /** 00403 * @brief Device Identifier. Default value of the WHO_AM_I register. 00404 */ 00405 #define I_AM_LPS25H ((uint8_t)0xBD) 00406 00407 /** @defgroup Power_Mode_selection CTRL_REG1 00408 * @{ 00409 */ 00410 #define LPS25H_MODE_POWERDOWN ((uint8_t)0x00) 00411 #define LPS25H_MODE_ACTIVE ((uint8_t)0x80) 00412 00413 #define LPS25H_MODE_MASK ((uint8_t)0x80) 00414 /** 00415 * @} 00416 */ 00417 00418 /** @defgroup LPS25H Output Data Rate selection CTRL_REG1 00419 * @{ 00420 */ 00421 #define LPS25H_ODR_ONE_SHOT ((uint8_t)0x00) /*!< Output Data Rate: P - one shot, T - one shot */ 00422 #define LPS25H_ODR_1Hz ((uint8_t)0x10) /*!< Output Data Rate: P - 1Hz, T - 1Hz */ 00423 #define LPS25H_ODR_7Hz ((uint8_t)0x20) /*!< Output Data Rate: P - 7Hz, T - 7Hz */ 00424 #define LPS25H_ODR_12_5Hz ((uint8_t)0x30) /*!< Output Data Rate: P - 12.5Hz, T - 12.5Hz */ 00425 #define LPS25H_ODR_25Hz ((uint8_t)0x40) /*!< Output Data Rate: P - 25Hz, T - 25Hz */ 00426 00427 #define LPS25H_ODR_MASK ((uint8_t)0x70) 00428 /** 00429 * @} 00430 */ 00431 00432 /** @defgroup LPS25H Interrupt circuit enable CTRL_REG1 00433 * @{ 00434 */ 00435 #define LPS25H_DIFF_DISABLE ((uint8_t)0x00) /*!< interrupt circuit enabled */ 00436 #define LPS25H_DIFF_ENABLE ((uint8_t)0x08) /*!< interrupt generation disabled */ 00437 00438 #define LPS25H_DIFF_EN_MASK ((uint8_t)0x08) 00439 /** 00440 * @} 00441 */ 00442 00443 /** @defgroup LPS25H block data update CTRL_REG1 00444 * @{ 00445 */ 00446 #define LPS25H_BDU_CONT ((uint8_t)0x00) /*!< continuous update */ 00447 #define LPS25H_BDU_READ ((uint8_t)0x04) /*!< output registers not updated until MSB and LSB reading */ 00448 00449 #define LPS25H_BDU_MASK ((uint8_t)0x04) 00450 /** 00451 * @} 00452 */ 00453 00454 /** @defgroup LPS25H SPI Serial Interface Mode selection CTRL_REG1 00455 * @{ 00456 */ 00457 #define LPS25H_SPI_SIM_4W ((uint8_t)0x00) /*!< 4-wire interface */ 00458 #define LPS25H_SPI_SIM_3W ((uint8_t)0x01) /*!< 3-wire interface */ 00459 00460 #define LPS25H_SPI_SIM_MASK ((uint8_t)0x01) 00461 /** 00462 * @} 00463 */ 00464 00465 /** @defgroup LPS25H o refresh the content of the internal registers stored in the Flash memory 00466 block CTRL_REG2 00467 * @{ 00468 */ 00469 #define LPS25H_NORMAL_MODE ((uint8_t)0x00) 00470 #define LPS25H_RESET_MEMORY ((uint8_t)0x80) 00471 00472 #define LPS25H_RESET_MEMORY_MASK ((uint8_t)0x80) 00473 /** 00474 * @} 00475 */ 00476 00477 /** @defgroup LPS25H Pressure resolution selection RES_CONF 00478 * @{ 00479 */ 00480 #define LPS25H_P_RES_AVG_8 ((uint8_t)0x00) 00481 #define LPS25H_P_RES_AVG_32 ((uint8_t)0x01) 00482 #define LPS25H_P_RES_AVG_128 ((uint8_t)0x02) 00483 #define LPS25H_P_RES_AVG_512 ((uint8_t)0x03) 00484 00485 #define LPS25H_P_RES_MASK ((uint8_t)0x03) 00486 /** 00487 * @} 00488 */ 00489 00490 /** @defgroup LPS25H Temperature resolution RES_CONF 00491 * @{ 00492 */ 00493 #define LPS25H_T_RES_AVG_8 ((uint8_t)0x00) 00494 #define LPS25H_T_RES_AVG_16 ((uint8_t)0x04) 00495 #define LPS25H_T_RES_AVG_32 ((uint8_t)0x08) 00496 #define LPS25H_T_RES_AVG_64 ((uint8_t)0x0C) 00497 00498 #define LPS25H_T_RES_MASK ((uint8_t)0x0C) 00499 /** 00500 * @} 00501 */ 00502 00503 #define LPS25H_SA0_LOW ((uint8_t)0x00) 00504 #define LPS25H_SA0_HIGH ((uint8_t)0x01) 00505 00506 ///** 00507 // * @brief LPS25H Output Data Rate 00508 // */ 00509 //typedef enum { 00510 // LPS25H_ODR_P_T_ONE_SHOT = 0x00, /*!< Output Data Rate: P - one shot, T - one shot */ 00511 // LPS25H_ODR_P_1HZ_T_1HZ = 0x10, /*!< Output Data Rate: P - 1Hz, T - 1Hz */ 00512 // LPS25H_ODR_P_7HZ_T_7HZ = 0x20, /*!< Output Data Rate: P - 7Hz, T - 7Hz */ 00513 // LPS25H_ODR_P_12_5HZ_T_12_5HZ = 0x30, /*!< Output Data Rate: P - 12.5Hz, T - 12.5Hz */ 00514 // LPS25H_ODR_P_25HZ_T_25HZ = 0x40 /*!< Output Data Rate: P - 25Hz, T - 25Hz */ 00515 //} LPS25H_OutputDataRate; 00516 00517 ///** 00518 // * @brief LPS25H Pressure resolution 00519 // */ 00520 //typedef enum { 00521 // LPS25H_PRESS_AVG_8 = 0x00, /*!< Internal average on 8 sample */ 00522 // LPS25H_PRESS_AVG_32 = 0x01, /*!< Internal average on 32 sample */ 00523 // LPS25H_PRESS_AVG_128 = 0x02, /*!< Internal average on 128 sample */ 00524 // LPS25H_PRESS_AVG_512 = 0x03 /*!< Internal average on 512 sample */ 00525 //} LPS25H_PressureResolution; 00526 00527 ///** 00528 // * @brief LPS25H Temperature resolution 00529 // */ 00530 //typedef enum { 00531 // LPS25H_TEMP_AVG_8 = 0x00, /*!< Internal average on 8 sample */ 00532 // LPS25H_TEMP_AVG_16 = 0x10, /*!< Internal average on 16 sample */ 00533 // LPS25H_TEMP_AVG_32 = 0x20, /*!< Internal average on 32 sample */ 00534 // LPS25H_TEMP_AVG_64 = 0x30 /*!< Internal average on 64 sample */ 00535 //} LPS25H_TemperatureResolution; 00536 // 00537 ///** 00538 // * @addtogroup LPS25H_Structures 00539 // * @{ 00540 // */ 00541 // 00542 ///** 00543 // * @brief LPS25H Irq list 00544 // */ 00545 //typedef enum { 00546 // LPS25H_DATA = 0x00, 00547 // LPS25H_P_HIGH = 0x01, 00548 // LPS25H_P_LOW = 0x02, 00549 // LPS25H_P_LOW_HIGH = 0x03 00550 //} LPS25H_IrqList; 00551 // 00552 ///** 00553 // * @brief LPS25H Irq pin output configuration 00554 // */ 00555 //typedef enum { 00556 // LPS25H_PP = 0x00, 00557 // LPS25H_OD = 0x40 00558 //} LPS25H_OutputType; 00559 // 00560 ///** 00561 // * @brief LPS25H Irq configuration 00562 // */ 00563 //typedef enum { 00564 // LPS25H_EMPTY = 0x08, 00565 // LPS25H_WTM = 0x04, 00566 // LPS25H_OVR = 0x02, 00567 // LPS25H_DATA_READY = 0x01 00568 //} LPS25H_DataSignalType; 00569 00570 /** 00571 * @} 00572 */ 00573 00574 /** @defgroup LPS25H_Exported_Functions 00575 * @{ 00576 */ 00577 /* Sensor Configuration Functions */ 00578 void LPS25H_Init(PRESSURE_InitTypeDef *LPS25H_Init); 00579 uint8_t LPS25H_ReadID(void); 00580 void LPS25H_RebootCmd(void); 00581 void LPS25H_GetPressure(float* pfData); 00582 void LPS25H_GetTemperature(float* pfData); 00583 void LPS25H_PowerOff(void); 00584 void LPS25H_SlaveAddrRemap(uint8_t); 00585 00586 /* Interrupt Configuration Functions */ 00587 void LPS25H_INT1InterruptConfig(uint16_t Int1Config); 00588 void LPS25H_EnableIT(void); 00589 void LPS25H_DisableIT(void); 00590 00591 /* Pressure sensor driver structure */ 00592 extern PRESSURE_DrvTypeDef LPS25HDrv; 00593 00594 /* Pressure sensor IO functions */ 00595 void PRESSURE_IO_Init(void); 00596 void PRESSURE_IO_DeInit(void); 00597 void PRESSURE_IO_Write(uint8_t* pBuffer, uint8_t DeviceAddr, uint8_t WriteAddr, 00598 uint16_t NumByteToWrite); 00599 void PRESSURE_IO_Read(uint8_t* pBuffer, uint8_t DeviceAddr, 00600 uint8_t RegisterAddr, uint16_t NumByteToRead); 00601 00602 /** 00603 * @} 00604 */ 00605 00606 /** 00607 * @} 00608 */ 00609 00610 /** 00611 * @} 00612 */ 00613 00614 #ifdef __cplusplus 00615 } 00616 #endif 00617 00618 #endif /* __LPS25H_H */ 00619 00620 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 00621
Generated on Tue Jul 12 2022 17:21:52 by
1.7.2