Jamie Satchell
/
JSatchell_SOFT253ReferredCoursework
Finished project.
Fork of ReferredCoursework2016 by
Components/lps25h/lps25h.h@91:cd9fcd45ecf6, 2017-08-17 (annotated)
- Committer:
- J_Satchell
- Date:
- Thu Aug 17 06:58:29 2017 +0000
- Revision:
- 91:cd9fcd45ecf6
- Parent:
- 24:92cc9c6e4b2b
Added mutex
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Wolfgang Betz |
6:8d2abd695c52 | 1 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 2 | ****************************************************************************** |
Wolfgang Betz |
6:8d2abd695c52 | 3 | * @file lps25h.h |
Wolfgang Betz |
6:8d2abd695c52 | 4 | * @author MEMS Application Team |
Wolfgang Betz |
6:8d2abd695c52 | 5 | * @version V1.2.0 |
Wolfgang Betz |
24:92cc9c6e4b2b | 6 | * @date 11-February-2015 |
Wolfgang Betz |
24:92cc9c6e4b2b | 7 | * @brief This file contains definitions for the lps25h.c |
Wolfgang Betz |
6:8d2abd695c52 | 8 | * firmware driver. |
Wolfgang Betz |
6:8d2abd695c52 | 9 | ****************************************************************************** |
Wolfgang Betz |
6:8d2abd695c52 | 10 | * @attention |
Wolfgang Betz |
6:8d2abd695c52 | 11 | * |
Wolfgang Betz |
6:8d2abd695c52 | 12 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
Wolfgang Betz |
6:8d2abd695c52 | 13 | * |
Wolfgang Betz |
6:8d2abd695c52 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
Wolfgang Betz |
6:8d2abd695c52 | 15 | * are permitted provided that the following conditions are met: |
Wolfgang Betz |
6:8d2abd695c52 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
Wolfgang Betz |
6:8d2abd695c52 | 17 | * this list of conditions and the following disclaimer. |
Wolfgang Betz |
6:8d2abd695c52 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Wolfgang Betz |
6:8d2abd695c52 | 19 | * this list of conditions and the following disclaimer in the documentation |
Wolfgang Betz |
6:8d2abd695c52 | 20 | * and/or other materials provided with the distribution. |
Wolfgang Betz |
6:8d2abd695c52 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Wolfgang Betz |
6:8d2abd695c52 | 22 | * may be used to endorse or promote products derived from this software |
Wolfgang Betz |
6:8d2abd695c52 | 23 | * without specific prior written permission. |
Wolfgang Betz |
6:8d2abd695c52 | 24 | * |
Wolfgang Betz |
6:8d2abd695c52 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Wolfgang Betz |
6:8d2abd695c52 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Wolfgang Betz |
6:8d2abd695c52 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Wolfgang Betz |
6:8d2abd695c52 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Wolfgang Betz |
6:8d2abd695c52 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Wolfgang Betz |
6:8d2abd695c52 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Wolfgang Betz |
6:8d2abd695c52 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Wolfgang Betz |
6:8d2abd695c52 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Wolfgang Betz |
6:8d2abd695c52 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Wolfgang Betz |
6:8d2abd695c52 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Wolfgang Betz |
6:8d2abd695c52 | 35 | * |
Wolfgang Betz |
6:8d2abd695c52 | 36 | ****************************************************************************** |
Wolfgang Betz |
6:8d2abd695c52 | 37 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 38 | |
Wolfgang Betz |
6:8d2abd695c52 | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Wolfgang Betz |
6:8d2abd695c52 | 40 | #ifndef __LPS25H_H |
Wolfgang Betz |
6:8d2abd695c52 | 41 | #define __LPS25H_H |
Wolfgang Betz |
6:8d2abd695c52 | 42 | |
Wolfgang Betz |
6:8d2abd695c52 | 43 | #ifdef __cplusplus |
Wolfgang Betz |
6:8d2abd695c52 | 44 | extern "C" { |
Wolfgang Betz |
6:8d2abd695c52 | 45 | #endif |
Wolfgang Betz |
6:8d2abd695c52 | 46 | |
Wolfgang Betz |
6:8d2abd695c52 | 47 | /* Includes ------------------------------------------------------------------*/ |
Wolfgang Betz |
24:92cc9c6e4b2b | 48 | #include "pressure.h" |
Wolfgang Betz |
6:8d2abd695c52 | 49 | |
Wolfgang Betz |
6:8d2abd695c52 | 50 | /** @addtogroup BSP |
Wolfgang Betz |
6:8d2abd695c52 | 51 | * @{ |
Wolfgang Betz |
6:8d2abd695c52 | 52 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 53 | |
Wolfgang Betz |
6:8d2abd695c52 | 54 | /** @addtogroup Components |
Wolfgang Betz |
6:8d2abd695c52 | 55 | * @{ |
Wolfgang Betz |
24:92cc9c6e4b2b | 56 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 57 | |
Wolfgang Betz |
6:8d2abd695c52 | 58 | /** @addtogroup LPS25H |
Wolfgang Betz |
6:8d2abd695c52 | 59 | * @{ |
Wolfgang Betz |
6:8d2abd695c52 | 60 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 61 | |
Wolfgang Betz |
6:8d2abd695c52 | 62 | /** @defgroup LPS25H_Exported_Defines LPS25H_Exported_Defines |
Wolfgang Betz |
6:8d2abd695c52 | 63 | * @{ |
Wolfgang Betz |
6:8d2abd695c52 | 64 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 65 | #ifndef NULL |
Wolfgang Betz |
24:92cc9c6e4b2b | 66 | #define NULL (void *) 0 |
Wolfgang Betz |
6:8d2abd695c52 | 67 | #endif |
Wolfgang Betz |
24:92cc9c6e4b2b | 68 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 69 | |
Wolfgang Betz |
6:8d2abd695c52 | 70 | /******************************************************************************/ |
Wolfgang Betz |
6:8d2abd695c52 | 71 | /*************************** START REGISTER MAPPING **************************/ |
Wolfgang Betz |
6:8d2abd695c52 | 72 | /******************************************************************************/ |
Wolfgang Betz |
6:8d2abd695c52 | 73 | |
Wolfgang Betz |
6:8d2abd695c52 | 74 | |
Wolfgang Betz |
6:8d2abd695c52 | 75 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 76 | * @brief Reference pressure (LSB data) |
Wolfgang Betz |
6:8d2abd695c52 | 77 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 78 | * Read/write |
Wolfgang Betz |
6:8d2abd695c52 | 79 | * Default value: 0x00 |
Wolfgang Betz |
6:8d2abd695c52 | 80 | * 7:0 REF7-ODR0: Lower part of the reference pressure that |
Wolfgang Betz |
6:8d2abd695c52 | 81 | * is sum to the sensor output pressure. |
Wolfgang Betz |
6:8d2abd695c52 | 82 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 83 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 84 | #define LPS25H_REF_P_XL_ADDR 0x08 |
Wolfgang Betz |
6:8d2abd695c52 | 85 | |
Wolfgang Betz |
6:8d2abd695c52 | 86 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 87 | * @brief Reference pressure (middle part) |
Wolfgang Betz |
6:8d2abd695c52 | 88 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 89 | * Read/write |
Wolfgang Betz |
6:8d2abd695c52 | 90 | * Default value: 0x00 |
Wolfgang Betz |
6:8d2abd695c52 | 91 | * 7:0 REF15-ODR8: Middle part of the reference pressure that |
Wolfgang Betz |
6:8d2abd695c52 | 92 | * is sum to the sensor output pressure. |
Wolfgang Betz |
6:8d2abd695c52 | 93 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 94 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 95 | #define LPS25H_REF_P_L_ADDR 0x09 |
Wolfgang Betz |
6:8d2abd695c52 | 96 | |
Wolfgang Betz |
6:8d2abd695c52 | 97 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 98 | * @brief Reference pressure (MSB part) |
Wolfgang Betz |
6:8d2abd695c52 | 99 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 100 | * Read/write |
Wolfgang Betz |
6:8d2abd695c52 | 101 | * Default value: 0x00 |
Wolfgang Betz |
6:8d2abd695c52 | 102 | * 7:0 REF15-ODR8: Higher part of the reference pressure that |
Wolfgang Betz |
6:8d2abd695c52 | 103 | * is sum to the sensor output pressure. |
Wolfgang Betz |
6:8d2abd695c52 | 104 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 105 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 106 | #define LPS25H_REF_P_H_ADDR 0x0A |
Wolfgang Betz |
6:8d2abd695c52 | 107 | |
Wolfgang Betz |
6:8d2abd695c52 | 108 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 109 | * @brief Device identifier register. |
Wolfgang Betz |
6:8d2abd695c52 | 110 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 111 | * Read |
Wolfgang Betz |
6:8d2abd695c52 | 112 | * Default value: 0xBD |
Wolfgang Betz |
6:8d2abd695c52 | 113 | * 7:0 This read-only register contains the device identifier that, |
Wolfgang Betz |
6:8d2abd695c52 | 114 | for LPS25H, is set to 0xCA. |
Wolfgang Betz |
6:8d2abd695c52 | 115 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 116 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 117 | #define LPS25H_WHO_AM_I_ADDR 0x0F |
Wolfgang Betz |
6:8d2abd695c52 | 118 | |
Wolfgang Betz |
6:8d2abd695c52 | 119 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 120 | * @brief Pressure and temperature resolution mode register. |
Wolfgang Betz |
6:8d2abd695c52 | 121 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 122 | * Read |
Wolfgang Betz |
6:8d2abd695c52 | 123 | * Default value: 0x05 |
Wolfgang Betz |
6:8d2abd695c52 | 124 | * [7:4] Reserved |
Wolfgang Betz |
6:8d2abd695c52 | 125 | * [3:2] AVGP1-0: select the pressure internal average. |
Wolfgang Betz |
6:8d2abd695c52 | 126 | * [1:0] AVGT1-0: select the temperature internal average. |
Wolfgang Betz |
6:8d2abd695c52 | 127 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 128 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 129 | #define LPS25H_RES_CONF_ADDR 0x10 |
Wolfgang Betz |
6:8d2abd695c52 | 130 | |
Wolfgang Betz |
6:8d2abd695c52 | 131 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 132 | * @brief Pressure sensor control register 1 |
Wolfgang Betz |
6:8d2abd695c52 | 133 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 134 | * Read/write |
Wolfgang Betz |
6:8d2abd695c52 | 135 | * Default value: 0x00 |
Wolfgang Betz |
6:8d2abd695c52 | 136 | * 7 PD: power down control. 0 - disable; 1 - enable |
Wolfgang Betz |
6:8d2abd695c52 | 137 | * 6:4 ODR2, ODR1, ODR0: output data rate selection. |
Wolfgang Betz |
6:8d2abd695c52 | 138 | * ODR2 | ODR1 | ODR0 | Pressure output data-rate(Hz) | Temperature output data-rate(Hz) |
Wolfgang Betz |
6:8d2abd695c52 | 139 | * ---------------------------------------------------------------------------------- |
Wolfgang Betz |
6:8d2abd695c52 | 140 | * 0 | 0 | 0 | one shot | one shot |
Wolfgang Betz |
6:8d2abd695c52 | 141 | * 0 | 0 | 1 | 1 | 1 |
Wolfgang Betz |
6:8d2abd695c52 | 142 | * 0 | 1 | 0 | 7 | 7 |
Wolfgang Betz |
6:8d2abd695c52 | 143 | * 0 | 1 | 1 | 12.5 | 12.5 |
Wolfgang Betz |
6:8d2abd695c52 | 144 | * 1 | 0 | 0 | 25 | 25 |
Wolfgang Betz |
6:8d2abd695c52 | 145 | * 1 | 0 | 1 | Reserved | Reserved |
Wolfgang Betz |
6:8d2abd695c52 | 146 | * 1 | 1 | 0 | Reserved | Reserved |
Wolfgang Betz |
6:8d2abd695c52 | 147 | * 1 | 1 | 1 | Reserved | Reserved |
Wolfgang Betz |
6:8d2abd695c52 | 148 | * |
Wolfgang Betz |
6:8d2abd695c52 | 149 | * 3 DIFF_EN: Interrupt circuit. 0 - disable; 1 - enable |
Wolfgang Betz |
6:8d2abd695c52 | 150 | * 2 BDU: block data update. 0 - disable; 1 - enable |
Wolfgang Betz |
6:8d2abd695c52 | 151 | * 1 DELTA_EN: delta pressure. 0 - disable; 1 - enable |
Wolfgang Betz |
6:8d2abd695c52 | 152 | * 1 RESET_AZ: reset AutoZero. 0 - disable; 1 - enable ///////ALE REVIEW |
Wolfgang Betz |
6:8d2abd695c52 | 153 | * 0 SIM: SPI Serial Interface Mode selection. 0 - SPI 4-wire; 1 - SPI 3-wire ///////ALE REVIEW |
Wolfgang Betz |
6:8d2abd695c52 | 154 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 155 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 156 | #define LPS25H_CTRL_REG1_ADDR 0x20 |
Wolfgang Betz |
6:8d2abd695c52 | 157 | |
Wolfgang Betz |
6:8d2abd695c52 | 158 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 159 | * @brief Pressure sensor control register 2 |
Wolfgang Betz |
6:8d2abd695c52 | 160 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 161 | * Read/write |
Wolfgang Betz |
6:8d2abd695c52 | 162 | * Default value: 0x00 |
Wolfgang Betz |
6:8d2abd695c52 | 163 | * 7 BOOT: Reboot memory content. 0: normal mode; 1: reboot memory content |
Wolfgang Betz |
6:8d2abd695c52 | 164 | * 6 FIFO_EN: FIFO. 0: disable; 1: enable |
Wolfgang Betz |
6:8d2abd695c52 | 165 | * 5 WTM_EN: FIFO Watermark level use. 0: disable; 1: enable |
Wolfgang Betz |
6:8d2abd695c52 | 166 | * 4:3 Reserved. keep these bits at 0 |
Wolfgang Betz |
6:8d2abd695c52 | 167 | * 2 SWRESET: Software reset. 0: normal mode; 1: SW reset. |
Wolfgang Betz |
6:8d2abd695c52 | 168 | * 1 AUTO_ZERO: Autozero enable. 0: normal mode; 1: autozero enable. |
Wolfgang Betz |
6:8d2abd695c52 | 169 | * 0 ONE_SHOT: One shot enable. 0: waiting for start of conversion; 1: start for a new dataset |
Wolfgang Betz |
6:8d2abd695c52 | 170 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 171 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 172 | #define LPS25H_CTRL_REG2_ADDR 0x21 |
Wolfgang Betz |
6:8d2abd695c52 | 173 | |
Wolfgang Betz |
6:8d2abd695c52 | 174 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 175 | * @brief Pressure sensor control register 3 |
Wolfgang Betz |
6:8d2abd695c52 | 176 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 177 | * Read/write |
Wolfgang Betz |
6:8d2abd695c52 | 178 | * Default value: 0x00 |
Wolfgang Betz |
6:8d2abd695c52 | 179 | * 7 INT_H_L: Interrupt. 0:active high; 1: active low. |
Wolfgang Betz |
6:8d2abd695c52 | 180 | * 6 PP_OD: Push-Pull/OpenDrain selection on interrupt pads. 0: Push-pull; 1: open drain. |
Wolfgang Betz |
6:8d2abd695c52 | 181 | * 5 Reserved |
Wolfgang Betz |
6:8d2abd695c52 | 182 | * 4:3 INT2_S2, INT2_S1: INT2 output signal selection control bits. // TO DO |
Wolfgang Betz |
6:8d2abd695c52 | 183 | * 1:0 INT1_S2, INT1_S1: data signal on INT1 pad control bits. |
Wolfgang Betz |
6:8d2abd695c52 | 184 | * INT1(2)_S2 | INT1(2)_S1 | INT1(2) pin |
Wolfgang Betz |
6:8d2abd695c52 | 185 | * ------------------------------------------------------ |
Wolfgang Betz |
6:8d2abd695c52 | 186 | * 0 | 0 | Data signal |
Wolfgang Betz |
6:8d2abd695c52 | 187 | * 0 | 1 | Pressure high (P_high) |
Wolfgang Betz |
6:8d2abd695c52 | 188 | * 1 | 0 | Pressure low (P_low) |
Wolfgang Betz |
6:8d2abd695c52 | 189 | * 1 | 1 | P_low OR P_high |
Wolfgang Betz |
6:8d2abd695c52 | 190 | |
Wolfgang Betz |
6:8d2abd695c52 | 191 | |
Wolfgang Betz |
6:8d2abd695c52 | 192 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 193 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 194 | #define LPS25H_CTRL_REG3_ADDR 0x22 |
Wolfgang Betz |
6:8d2abd695c52 | 195 | |
Wolfgang Betz |
6:8d2abd695c52 | 196 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 197 | * @brief Pressure sensor control register 4 |
Wolfgang Betz |
6:8d2abd695c52 | 198 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 199 | * Read/write |
Wolfgang Betz |
6:8d2abd695c52 | 200 | * Default value: 0x00 |
Wolfgang Betz |
6:8d2abd695c52 | 201 | * 7 P2_EMPTY: Empty Signal on INT2 pin. |
Wolfgang Betz |
6:8d2abd695c52 | 202 | * 6 P2_WTM: Watermark Signal on INT2 pin. |
Wolfgang Betz |
6:8d2abd695c52 | 203 | * 5 P2_Overrun:Overrun Signal on INT2 pin. |
Wolfgang Betz |
6:8d2abd695c52 | 204 | * 4 P2_DRDY: Data Ready Signal on INT2 pin. |
Wolfgang Betz |
6:8d2abd695c52 | 205 | * 3 P1_EMPTY: Empty Signal on INT1 pin. |
Wolfgang Betz |
6:8d2abd695c52 | 206 | * 2 P1_WTM: Watermark Signal on INT1 pin. |
Wolfgang Betz |
6:8d2abd695c52 | 207 | * 1 P1_Overrunn:Overrun Signal on INT1 pin. |
Wolfgang Betz |
6:8d2abd695c52 | 208 | * 0 P1_DRDY: Data Ready Signal on INT1 pin. |
Wolfgang Betz |
6:8d2abd695c52 | 209 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 210 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 211 | #define LPS25H_CTRL_REG4_ADDR 0x23 |
Wolfgang Betz |
6:8d2abd695c52 | 212 | |
Wolfgang Betz |
6:8d2abd695c52 | 213 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 214 | * @brief Interrupt configuration Register |
Wolfgang Betz |
6:8d2abd695c52 | 215 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 216 | * Read/write |
Wolfgang Betz |
6:8d2abd695c52 | 217 | * Default value: 0x00. |
Wolfgang Betz |
6:8d2abd695c52 | 218 | * 7:3 Reserved. |
Wolfgang Betz |
6:8d2abd695c52 | 219 | * 2 LIR: Latch Interrupt request into INT_SOURCE register. 0 - disable; 1 - enable |
Wolfgang Betz |
6:8d2abd695c52 | 220 | * 1 PL_E: Enable interrupt generation on differential pressure low event. 0 - disable; 1 - enable |
Wolfgang Betz |
6:8d2abd695c52 | 221 | * 0 PH_E: Enable interrupt generation on differential pressure high event. 0 - disable; 1 - enable |
Wolfgang Betz |
6:8d2abd695c52 | 222 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 223 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 224 | #define LPS25H_INT_CFG_REG_ADDR 0x24 |
Wolfgang Betz |
6:8d2abd695c52 | 225 | |
Wolfgang Betz |
6:8d2abd695c52 | 226 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 227 | * @brief Interrupt source Register |
Wolfgang Betz |
6:8d2abd695c52 | 228 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 229 | * Read |
Wolfgang Betz |
6:8d2abd695c52 | 230 | * Default value: 0x00. |
Wolfgang Betz |
6:8d2abd695c52 | 231 | * 7:3 0. |
Wolfgang Betz |
6:8d2abd695c52 | 232 | * 2 IA: Interrupt Active.0: no interrupt has been generated; 1: one or more interrupt events have been generated. |
Wolfgang Betz |
6:8d2abd695c52 | 233 | * 1 PL: Differential pressure Low. 0: no interrupt has been generated; 1: Low differential pressure event has occurred. |
Wolfgang Betz |
6:8d2abd695c52 | 234 | * 0 PH: Differential pressure High. 0: no interrupt has been generated; 1: High differential pressure event has occurred. |
Wolfgang Betz |
6:8d2abd695c52 | 235 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 236 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 237 | #define LPS25H_INT_SOURCE_REG_ADDR 0x25 |
Wolfgang Betz |
6:8d2abd695c52 | 238 | |
Wolfgang Betz |
6:8d2abd695c52 | 239 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 240 | * @brief Threshold pressure (LSB) |
Wolfgang Betz |
6:8d2abd695c52 | 241 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 242 | * Read |
Wolfgang Betz |
6:8d2abd695c52 | 243 | * Default value: 0x00. |
Wolfgang Betz |
6:8d2abd695c52 | 244 | * 7:0 THS7-THS0: Low part of threshold value for pressure interrupt |
Wolfgang Betz |
6:8d2abd695c52 | 245 | * generation. The complete threshold value is given by THS_P_H & THS_P_L and is |
Wolfgang Betz |
6:8d2abd695c52 | 246 | * expressed as unsigned number. P_ths(mbar)=(THS_P_H & THS_P_L)[dec]/16. |
Wolfgang Betz |
6:8d2abd695c52 | 247 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 248 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 249 | #define LPS25H_THS_P_LOW_REG_ADDR 0x30 |
Wolfgang Betz |
6:8d2abd695c52 | 250 | |
Wolfgang Betz |
6:8d2abd695c52 | 251 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 252 | * @brief Threshold pressure (MSB) |
Wolfgang Betz |
6:8d2abd695c52 | 253 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 254 | * Read |
Wolfgang Betz |
6:8d2abd695c52 | 255 | * Default value: 0x00. |
Wolfgang Betz |
6:8d2abd695c52 | 256 | * 7:0 THS15-THS8: High part of threshold value for pressure interrupt |
Wolfgang Betz |
6:8d2abd695c52 | 257 | * generation. The complete threshold value is given by THS_P_H & THS_P_L and is |
Wolfgang Betz |
6:8d2abd695c52 | 258 | * expressed as unsigned number. P_ths(mbar)=(THS_P_H & THS_P_L)[dec]/16. |
Wolfgang Betz |
6:8d2abd695c52 | 259 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 260 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 261 | #define LPS25H_THS_P_HIGH_REG_ADDR 0x31 |
Wolfgang Betz |
6:8d2abd695c52 | 262 | |
Wolfgang Betz |
6:8d2abd695c52 | 263 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 264 | * @brief Status Register |
Wolfgang Betz |
6:8d2abd695c52 | 265 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 266 | * Read |
Wolfgang Betz |
6:8d2abd695c52 | 267 | * Default value: 0x00 |
Wolfgang Betz |
6:8d2abd695c52 | 268 | * 7:6 0 |
Wolfgang Betz |
6:8d2abd695c52 | 269 | * 5 P_OR: Pressure data overrun. 0: no overrun has occurred; 1: new data for pressure has overwritten the previous one. |
Wolfgang Betz |
6:8d2abd695c52 | 270 | * 4 T_OR: Temperature data overrun. 0: no overrun has occurred; 1: a new data for temperature has overwritten the previous one. |
Wolfgang Betz |
6:8d2abd695c52 | 271 | * 3:2 0 |
Wolfgang Betz |
6:8d2abd695c52 | 272 | * 1 P_DA: Pressure data available. 0: new data for pressure is not yet available; 1: new data for pressure is available. |
Wolfgang Betz |
6:8d2abd695c52 | 273 | * 0 T_DA: Temperature data available. 0: new data for temperature is not yet available; 1: new data for temperature is available. |
Wolfgang Betz |
6:8d2abd695c52 | 274 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 275 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 276 | #define LPS25H_STATUS_REG_ADDR 0x27 |
Wolfgang Betz |
6:8d2abd695c52 | 277 | |
Wolfgang Betz |
6:8d2abd695c52 | 278 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 279 | * @brief Pressure data (LSB). |
Wolfgang Betz |
6:8d2abd695c52 | 280 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 281 | * Read |
Wolfgang Betz |
6:8d2abd695c52 | 282 | * Default value: 0x00. |
Wolfgang Betz |
6:8d2abd695c52 | 283 | * POUT7 - POUT0: Pressure data LSB (2's complement). |
Wolfgang Betz |
6:8d2abd695c52 | 284 | * Pressure output data: Pout(mbar)=(PRESS_OUT_H & PRESS_OUT_L & |
Wolfgang Betz |
6:8d2abd695c52 | 285 | * PRESS_OUT_XL)[dec]/4096. |
Wolfgang Betz |
6:8d2abd695c52 | 286 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 287 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 288 | #define LPS25H_PRESS_POUT_XL_ADDR 0x28 |
Wolfgang Betz |
6:8d2abd695c52 | 289 | |
Wolfgang Betz |
6:8d2abd695c52 | 290 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 291 | * @brief Pressure data (Middle part). |
Wolfgang Betz |
6:8d2abd695c52 | 292 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 293 | * Read |
Wolfgang Betz |
6:8d2abd695c52 | 294 | * Default value: 0x80. |
Wolfgang Betz |
6:8d2abd695c52 | 295 | * POUT15 - POUT8: Pressure data middle part (2's complement). |
Wolfgang Betz |
6:8d2abd695c52 | 296 | * Pressure output data: Pout(mbar)=(PRESS_OUT_H & PRESS_OUT_L & |
Wolfgang Betz |
6:8d2abd695c52 | 297 | * PRESS_OUT_XL)[dec]/4096. |
Wolfgang Betz |
6:8d2abd695c52 | 298 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 299 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 300 | #define LPS25H_PRESS_OUT_L_ADDR 0x29 |
Wolfgang Betz |
6:8d2abd695c52 | 301 | |
Wolfgang Betz |
6:8d2abd695c52 | 302 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 303 | * @brief Pressure data (MSB). |
Wolfgang Betz |
6:8d2abd695c52 | 304 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 305 | * Read |
Wolfgang Betz |
6:8d2abd695c52 | 306 | * Default value: 0x2F. |
Wolfgang Betz |
6:8d2abd695c52 | 307 | * POUT23 - POUT16: Pressure data MSB (2's complement). |
Wolfgang Betz |
6:8d2abd695c52 | 308 | * Pressure output data: Pout(mbar)=(PRESS_OUT_H & PRESS_OUT_L & |
Wolfgang Betz |
6:8d2abd695c52 | 309 | * PRESS_OUT_XL)[dec]/4096. |
Wolfgang Betz |
6:8d2abd695c52 | 310 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 311 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 312 | #define LPS25H_PRESS_OUT_H_ADDR 0x2A |
Wolfgang Betz |
6:8d2abd695c52 | 313 | |
Wolfgang Betz |
6:8d2abd695c52 | 314 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 315 | * @brief Temperature data (LSB). |
Wolfgang Betz |
6:8d2abd695c52 | 316 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 317 | * Read |
Wolfgang Betz |
6:8d2abd695c52 | 318 | * Default value: 0x00. |
Wolfgang Betz |
6:8d2abd695c52 | 319 | * TOUT7 - TOUT0: temperature data LSB. |
Wolfgang Betz |
6:8d2abd695c52 | 320 | * T(degC) = 42.5 + (Temp_OUTH & TEMP_OUT_L)[dec]/480. |
Wolfgang Betz |
6:8d2abd695c52 | 321 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 322 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 323 | #define LPS25H_TEMP_OUT_L_ADDR 0x2B |
Wolfgang Betz |
6:8d2abd695c52 | 324 | |
Wolfgang Betz |
6:8d2abd695c52 | 325 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 326 | * @brief Temperature data (MSB). |
Wolfgang Betz |
6:8d2abd695c52 | 327 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 328 | * Read |
Wolfgang Betz |
6:8d2abd695c52 | 329 | * Default value: 0x00. |
Wolfgang Betz |
6:8d2abd695c52 | 330 | * TOUT15 - TOUT8: temperature data MSB. |
Wolfgang Betz |
6:8d2abd695c52 | 331 | * T(degC) = 42.5 + (Temp_OUTH & TEMP_OUT_L)[dec]/480. |
Wolfgang Betz |
6:8d2abd695c52 | 332 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 333 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 334 | #define LPS25H_TEMP_OUT_H_ADDR 0x2C |
Wolfgang Betz |
6:8d2abd695c52 | 335 | |
Wolfgang Betz |
6:8d2abd695c52 | 336 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 337 | * @brief FIFO control register |
Wolfgang Betz |
6:8d2abd695c52 | 338 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 339 | * Read/write |
Wolfgang Betz |
6:8d2abd695c52 | 340 | * Default value: 0x00 |
Wolfgang Betz |
6:8d2abd695c52 | 341 | * 7:5 F_MODE2, F_MODE1, F_MODE0: FIFO mode selection. |
Wolfgang Betz |
6:8d2abd695c52 | 342 | * FM2 | FM1 | FM0 | FIFO MODE |
Wolfgang Betz |
6:8d2abd695c52 | 343 | * --------------------------------------------------- |
Wolfgang Betz |
6:8d2abd695c52 | 344 | * 0 | 0 | 0 | BYPASS MODE |
Wolfgang Betz |
6:8d2abd695c52 | 345 | * 0 | 0 | 1 | FIFO MODE. Stops collecting data when full |
Wolfgang Betz |
6:8d2abd695c52 | 346 | * 0 | 1 | 0 | STREAM MODE: Keep the newest measurements in the FIFO |
Wolfgang Betz |
6:8d2abd695c52 | 347 | * 0 | 1 | 1 | STREAM MODE until trigger deasserted, then change to FIFO MODE |
Wolfgang Betz |
6:8d2abd695c52 | 348 | * 1 | 0 | 0 | BYPASS MODE until trigger deasserted, then STREAM MODE |
Wolfgang Betz |
6:8d2abd695c52 | 349 | * 1 | 0 | 1 | Reserved |
Wolfgang Betz |
6:8d2abd695c52 | 350 | * 1 | 1 | 0 | FIFO_MEAN MODE: Fifo is used to generate a running average filtered pressure |
Wolfgang Betz |
6:8d2abd695c52 | 351 | * 1 | 1 | 1 | BYPASS mode until trigger deasserted, then FIFO MODE |
Wolfgang Betz |
6:8d2abd695c52 | 352 | * |
Wolfgang Betz |
6:8d2abd695c52 | 353 | * 4:0 FIFO Mean Mode Sample size |
Wolfgang Betz |
6:8d2abd695c52 | 354 | * WTM_POINT4 | WTM_POINT4 | WTM_POINT4 | WTM_POINT4 | WTM_POINT4 | Sample Size |
Wolfgang Betz |
6:8d2abd695c52 | 355 | * ---------------------------------------------------------------------------------- |
Wolfgang Betz |
6:8d2abd695c52 | 356 | * 0 | 0 | 0 | 0 | 1 | 2 |
Wolfgang Betz |
6:8d2abd695c52 | 357 | * 0 | 0 | 0 | 1 | 1 | 4 |
Wolfgang Betz |
6:8d2abd695c52 | 358 | * 0 | 0 | 1 | 1 | 1 | 8 |
Wolfgang Betz |
6:8d2abd695c52 | 359 | * 0 | 1 | 1 | 1 | 1 | 16 |
Wolfgang Betz |
6:8d2abd695c52 | 360 | * 1 | 1 | 1 | 1 | 1 | 32 |
Wolfgang Betz |
6:8d2abd695c52 | 361 | * other values operation not guaranteed |
Wolfgang Betz |
6:8d2abd695c52 | 362 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 363 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 364 | #define LPS25H_CTRL_FIFO_ADDR 0x2E |
Wolfgang Betz |
6:8d2abd695c52 | 365 | |
Wolfgang Betz |
6:8d2abd695c52 | 366 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 367 | * @brief FIFO Status register |
Wolfgang Betz |
6:8d2abd695c52 | 368 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 369 | * Read/write |
Wolfgang Betz |
6:8d2abd695c52 | 370 | * Default value: 0x00 |
Wolfgang Betz |
6:8d2abd695c52 | 371 | * 7 WTM_FIFO: Watermark status. 0:FIFO filling is lower than watermark level; 1: FIFO is equal or higher than watermark level. |
Wolfgang Betz |
6:8d2abd695c52 | 372 | * 6 FULL_FIFO: Overrun bit status. 0 - FIFO not full; 1 -FIFO is full. |
Wolfgang Betz |
6:8d2abd695c52 | 373 | * 5 EMPTY_FIFO: Empty FIFO bit. 0 - FIFO not empty; 1 -FIFO is empty. |
Wolfgang Betz |
6:8d2abd695c52 | 374 | * 4:0 DIFF_POINT4...0: FIFOsStored data level. |
Wolfgang Betz |
6:8d2abd695c52 | 375 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 376 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 377 | #define LPS25H_STATUS_FIFO_ADDR 0x2F |
Wolfgang Betz |
6:8d2abd695c52 | 378 | |
Wolfgang Betz |
6:8d2abd695c52 | 379 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 380 | * @brief Pressure offset register |
Wolfgang Betz |
6:8d2abd695c52 | 381 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 382 | * Read/write |
Wolfgang Betz |
6:8d2abd695c52 | 383 | * Default value: 0x00 |
Wolfgang Betz |
6:8d2abd695c52 | 384 | * 7:0 RPDS15...8:Pressure Offset for 1 point calibration after soldering. |
Wolfgang Betz |
6:8d2abd695c52 | 385 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 386 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 387 | #define LPS25H_RPDS_TRIM_L_ADDR 0x39 |
Wolfgang Betz |
6:8d2abd695c52 | 388 | |
Wolfgang Betz |
6:8d2abd695c52 | 389 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 390 | * @brief Pressure offset register |
Wolfgang Betz |
6:8d2abd695c52 | 391 | * \code |
Wolfgang Betz |
6:8d2abd695c52 | 392 | * Read/write |
Wolfgang Betz |
6:8d2abd695c52 | 393 | * Default value: 0x00 |
Wolfgang Betz |
6:8d2abd695c52 | 394 | * 7:0 RPDS23...16:Pressure Offset for 1 point calibration after soldering. |
Wolfgang Betz |
6:8d2abd695c52 | 395 | * \endcode |
Wolfgang Betz |
6:8d2abd695c52 | 396 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 397 | #define LPS25H_RPDS_TRIM_H_ADDR 0x3A |
Wolfgang Betz |
6:8d2abd695c52 | 398 | |
Wolfgang Betz |
6:8d2abd695c52 | 399 | /******************************************************************************/ |
Wolfgang Betz |
6:8d2abd695c52 | 400 | /**************************** END REGISTER MAPPING ***************************/ |
Wolfgang Betz |
6:8d2abd695c52 | 401 | /******************************************************************************/ |
Wolfgang Betz |
6:8d2abd695c52 | 402 | |
Wolfgang Betz |
6:8d2abd695c52 | 403 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 404 | * @brief Multiple Byte. Mask for enabling multiple byte read/write command. |
Wolfgang Betz |
24:92cc9c6e4b2b | 405 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 406 | #define LPS25H_I2C_MULTIPLEBYTE_CMD ((uint8_t)0x80) |
Wolfgang Betz |
24:92cc9c6e4b2b | 407 | |
Wolfgang Betz |
6:8d2abd695c52 | 408 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 409 | * @brief Device Address |
Wolfgang Betz |
6:8d2abd695c52 | 410 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 411 | #define LPS25H_ADDRESS_LOW 0xB8 |
Wolfgang Betz |
6:8d2abd695c52 | 412 | #define LPS25H_ADDRESS_HIGH 0xBA |
Wolfgang Betz |
6:8d2abd695c52 | 413 | |
Wolfgang Betz |
6:8d2abd695c52 | 414 | |
Wolfgang Betz |
6:8d2abd695c52 | 415 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 416 | * @brief Device Identifier. Default value of the WHO_AM_I register. |
Wolfgang Betz |
6:8d2abd695c52 | 417 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 418 | #define I_AM_LPS25H ((uint8_t)0xBD) |
Wolfgang Betz |
6:8d2abd695c52 | 419 | |
Wolfgang Betz |
6:8d2abd695c52 | 420 | /** @defgroup LPS25H_Power_Mode_Selection_CTRL_REG1 LPS25H_Power_Mode_Selection_CTRL_REG1 |
Wolfgang Betz |
6:8d2abd695c52 | 421 | * @{ |
Wolfgang Betz |
6:8d2abd695c52 | 422 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 423 | #define LPS25H_MODE_POWERDOWN ((uint8_t)0x00) |
Wolfgang Betz |
6:8d2abd695c52 | 424 | #define LPS25H_MODE_ACTIVE ((uint8_t)0x80) |
Wolfgang Betz |
6:8d2abd695c52 | 425 | |
Wolfgang Betz |
6:8d2abd695c52 | 426 | #define LPS25H_MODE_MASK ((uint8_t)0x80) |
Wolfgang Betz |
6:8d2abd695c52 | 427 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 428 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 429 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 430 | |
Wolfgang Betz |
6:8d2abd695c52 | 431 | /** @defgroup LPS25H_Output_Data_Rate_Selection_CTRL_REG1 LPS25H_Output_Data_Rate_Selection_CTRL_REG1 |
Wolfgang Betz |
6:8d2abd695c52 | 432 | * @{ |
Wolfgang Betz |
6:8d2abd695c52 | 433 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 434 | #define LPS25H_ODR_ONE_SHOT ((uint8_t)0x00) /*!< Output Data Rate: P - one shot, T - one shot */ |
Wolfgang Betz |
6:8d2abd695c52 | 435 | #define LPS25H_ODR_1Hz ((uint8_t)0x10) /*!< Output Data Rate: P - 1Hz, T - 1Hz */ |
Wolfgang Betz |
6:8d2abd695c52 | 436 | #define LPS25H_ODR_7Hz ((uint8_t)0x20) /*!< Output Data Rate: P - 7Hz, T - 7Hz */ |
Wolfgang Betz |
6:8d2abd695c52 | 437 | #define LPS25H_ODR_12_5Hz ((uint8_t)0x30) /*!< Output Data Rate: P - 12.5Hz, T - 12.5Hz */ |
Wolfgang Betz |
6:8d2abd695c52 | 438 | #define LPS25H_ODR_25Hz ((uint8_t)0x40) /*!< Output Data Rate: P - 25Hz, T - 25Hz */ |
Wolfgang Betz |
6:8d2abd695c52 | 439 | |
Wolfgang Betz |
6:8d2abd695c52 | 440 | #define LPS25H_ODR_MASK ((uint8_t)0x70) |
Wolfgang Betz |
6:8d2abd695c52 | 441 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 442 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 443 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 444 | |
Wolfgang Betz |
6:8d2abd695c52 | 445 | /** @defgroup LPS25H_Interrupt_Circuit_Enable_CTRL_REG1 LPS25H_Interrupt_Circuit_Enable_CTRL_REG1 |
Wolfgang Betz |
6:8d2abd695c52 | 446 | * @{ |
Wolfgang Betz |
6:8d2abd695c52 | 447 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 448 | #define LPS25H_DIFF_DISABLE ((uint8_t)0x00) /*!< interrupt circuit enabled */ |
Wolfgang Betz |
6:8d2abd695c52 | 449 | #define LPS25H_DIFF_ENABLE ((uint8_t)0x08) /*!< interrupt generation disabled */ |
Wolfgang Betz |
6:8d2abd695c52 | 450 | |
Wolfgang Betz |
6:8d2abd695c52 | 451 | #define LPS25H_DIFF_EN_MASK ((uint8_t)0x08) |
Wolfgang Betz |
6:8d2abd695c52 | 452 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 453 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 454 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 455 | |
Wolfgang Betz |
6:8d2abd695c52 | 456 | /** @defgroup LPS25H_Block_Data_Update_CTRL_REG1 LPS25H_Block_Data_Update_CTRL_REG1 |
Wolfgang Betz |
6:8d2abd695c52 | 457 | * @{ |
Wolfgang Betz |
6:8d2abd695c52 | 458 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 459 | #define LPS25H_BDU_CONT ((uint8_t)0x00) /*!< continuous update */ |
Wolfgang Betz |
6:8d2abd695c52 | 460 | #define LPS25H_BDU_READ ((uint8_t)0x04) /*!< output registers not updated until MSB and LSB reading */ |
Wolfgang Betz |
6:8d2abd695c52 | 461 | |
Wolfgang Betz |
6:8d2abd695c52 | 462 | #define LPS25H_BDU_MASK ((uint8_t)0x04) |
Wolfgang Betz |
6:8d2abd695c52 | 463 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 464 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 465 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 466 | |
Wolfgang Betz |
6:8d2abd695c52 | 467 | /** @defgroup LPS25H_SPI_Serial_Interface_Mode_Selection_CTRL_REG1 LPS25H_SPI_Serial_Interface_Mode_Selection_CTRL_REG1 |
Wolfgang Betz |
6:8d2abd695c52 | 468 | * @{ |
Wolfgang Betz |
6:8d2abd695c52 | 469 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 470 | #define LPS25H_SPI_SIM_4W ((uint8_t)0x00) /*!< 4-wire interface */ |
Wolfgang Betz |
6:8d2abd695c52 | 471 | #define LPS25H_SPI_SIM_3W ((uint8_t)0x01) /*!< 3-wire interface */ |
Wolfgang Betz |
6:8d2abd695c52 | 472 | |
Wolfgang Betz |
6:8d2abd695c52 | 473 | #define LPS25H_SPI_SIM_MASK ((uint8_t)0x01) |
Wolfgang Betz |
6:8d2abd695c52 | 474 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 475 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 476 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 477 | |
Wolfgang Betz |
6:8d2abd695c52 | 478 | /** @defgroup LPS25H_Refresh_Registers_Flash_Memory_CTRL_REG2 LPS25H_Refresh_Registers_Flash_Memory_CTRL_REG2 |
Wolfgang Betz |
6:8d2abd695c52 | 479 | * @{ |
Wolfgang Betz |
6:8d2abd695c52 | 480 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 481 | #define LPS25H_NORMAL_MODE ((uint8_t)0x00) |
Wolfgang Betz |
6:8d2abd695c52 | 482 | #define LPS25H_RESET_MEMORY ((uint8_t)0x80) |
Wolfgang Betz |
6:8d2abd695c52 | 483 | |
Wolfgang Betz |
6:8d2abd695c52 | 484 | #define LPS25H_RESET_MEMORY_MASK ((uint8_t)0x80) |
Wolfgang Betz |
6:8d2abd695c52 | 485 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 486 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 487 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 488 | |
Wolfgang Betz |
6:8d2abd695c52 | 489 | /** @defgroup LPS25H_Pressure_Resolution_Selection_RES_CONF LPS25H_Pressure_Resolution_Selection_RES_CONF |
Wolfgang Betz |
6:8d2abd695c52 | 490 | * @{ |
Wolfgang Betz |
6:8d2abd695c52 | 491 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 492 | #define LPS25H_P_RES_AVG_8 ((uint8_t)0x00) |
Wolfgang Betz |
6:8d2abd695c52 | 493 | #define LPS25H_P_RES_AVG_32 ((uint8_t)0x01) |
Wolfgang Betz |
6:8d2abd695c52 | 494 | #define LPS25H_P_RES_AVG_128 ((uint8_t)0x02) |
Wolfgang Betz |
6:8d2abd695c52 | 495 | #define LPS25H_P_RES_AVG_512 ((uint8_t)0x03) |
Wolfgang Betz |
6:8d2abd695c52 | 496 | |
Wolfgang Betz |
6:8d2abd695c52 | 497 | #define LPS25H_P_RES_MASK ((uint8_t)0x03) |
Wolfgang Betz |
6:8d2abd695c52 | 498 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 499 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 500 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 501 | |
Wolfgang Betz |
6:8d2abd695c52 | 502 | /** @defgroup LPS25H_Temperature_Resolution_Selection_RES_CONF LPS25H_Temperature_Resolution_Selection_RES_CONF |
Wolfgang Betz |
6:8d2abd695c52 | 503 | * @{ |
Wolfgang Betz |
6:8d2abd695c52 | 504 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 505 | #define LPS25H_T_RES_AVG_8 ((uint8_t)0x00) |
Wolfgang Betz |
6:8d2abd695c52 | 506 | #define LPS25H_T_RES_AVG_16 ((uint8_t)0x04) |
Wolfgang Betz |
6:8d2abd695c52 | 507 | #define LPS25H_T_RES_AVG_32 ((uint8_t)0x08) |
Wolfgang Betz |
6:8d2abd695c52 | 508 | #define LPS25H_T_RES_AVG_64 ((uint8_t)0x0C) |
Wolfgang Betz |
6:8d2abd695c52 | 509 | |
Wolfgang Betz |
6:8d2abd695c52 | 510 | #define LPS25H_T_RES_MASK ((uint8_t)0x0C) |
Wolfgang Betz |
6:8d2abd695c52 | 511 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 512 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 513 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 514 | |
Wolfgang Betz |
6:8d2abd695c52 | 515 | #define LPS25H_SA0_LOW ((uint8_t)0x00) |
Wolfgang Betz |
6:8d2abd695c52 | 516 | #define LPS25H_SA0_HIGH ((uint8_t)0x01) |
Wolfgang Betz |
6:8d2abd695c52 | 517 | |
Wolfgang Betz |
6:8d2abd695c52 | 518 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 519 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 520 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 521 | |
Wolfgang Betz |
6:8d2abd695c52 | 522 | /** @defgroup LPS25H_Imported_Functions LPS25H_Imported_Functions |
Wolfgang Betz |
6:8d2abd695c52 | 523 | * @{ |
Wolfgang Betz |
6:8d2abd695c52 | 524 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 525 | /* Pressure sensor IO functions */ |
Wolfgang Betz |
6:8d2abd695c52 | 526 | extern PRESSURE_StatusTypeDef LPS25H_IO_Init(void); |
Wolfgang Betz |
24:92cc9c6e4b2b | 527 | extern PRESSURE_StatusTypeDef LPS25H_IO_Write(uint8_t* pBuffer, uint8_t DeviceAddr, uint8_t RegisterAddr, |
Wolfgang Betz |
24:92cc9c6e4b2b | 528 | uint16_t NumByteToWrite); |
Wolfgang Betz |
24:92cc9c6e4b2b | 529 | extern PRESSURE_StatusTypeDef LPS25H_IO_Read(uint8_t* pBuffer, uint8_t DeviceAddr, uint8_t RegisterAddr, |
Wolfgang Betz |
24:92cc9c6e4b2b | 530 | uint16_t NumByteToRead); |
Wolfgang Betz |
6:8d2abd695c52 | 531 | extern void LPS25H_IO_ITConfig( void ); |
Wolfgang Betz |
6:8d2abd695c52 | 532 | |
Wolfgang Betz |
6:8d2abd695c52 | 533 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 534 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 535 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 536 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 537 | /* ------------------------------------------------------- */ |
Wolfgang Betz |
6:8d2abd695c52 | 538 | /* Here you should declare the internal struct of */ |
Wolfgang Betz |
6:8d2abd695c52 | 539 | /* extended features of LPS25H. See the example of */ |
Wolfgang Betz |
6:8d2abd695c52 | 540 | /* LSM6DS3 in lsm6ds3.h */ |
Wolfgang Betz |
6:8d2abd695c52 | 541 | /* ------------------------------------------------------- */ |
Wolfgang Betz |
6:8d2abd695c52 | 542 | |
Wolfgang Betz |
6:8d2abd695c52 | 543 | /** @addtogroup LPS25H_Exported_Variables LPS25H_Exported_Variables |
Wolfgang Betz |
6:8d2abd695c52 | 544 | * @{ |
Wolfgang Betz |
6:8d2abd695c52 | 545 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 546 | /* Pressure sensor driver structure */ |
Wolfgang Betz |
6:8d2abd695c52 | 547 | extern PRESSURE_DrvTypeDef LPS25HDrv; |
Wolfgang Betz |
6:8d2abd695c52 | 548 | extern PRESSURE_DrvExtTypeDef LPS25HDrv_ext; |
Wolfgang Betz |
6:8d2abd695c52 | 549 | |
Wolfgang Betz |
6:8d2abd695c52 | 550 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 551 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 552 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 553 | |
Wolfgang Betz |
6:8d2abd695c52 | 554 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 555 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 556 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 557 | |
Wolfgang Betz |
6:8d2abd695c52 | 558 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 559 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 560 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 561 | |
Wolfgang Betz |
6:8d2abd695c52 | 562 | /** |
Wolfgang Betz |
6:8d2abd695c52 | 563 | * @} |
Wolfgang Betz |
6:8d2abd695c52 | 564 | */ |
Wolfgang Betz |
6:8d2abd695c52 | 565 | |
Wolfgang Betz |
6:8d2abd695c52 | 566 | #ifdef __cplusplus |
Wolfgang Betz |
6:8d2abd695c52 | 567 | } |
Wolfgang Betz |
6:8d2abd695c52 | 568 | #endif |
Wolfgang Betz |
6:8d2abd695c52 | 569 | |
Wolfgang Betz |
6:8d2abd695c52 | 570 | #endif /* __LPS25H_H */ |
Wolfgang Betz |
6:8d2abd695c52 | 571 | |
Wolfgang Betz |
6:8d2abd695c52 | 572 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |