removed X-NUCLEO-COMMON and ST-INTERFACES
Dependents: unh-hackathon-example unh-hackathon-example-raw
Fork of X_NUCLEO_IKS01A1 by
Components/hts221/hts221.h@24:92cc9c6e4b2b, 2015-06-03 (annotated)
- Committer:
- Wolfgang Betz
- Date:
- Wed Jun 03 14:57:57 2015 +0200
- Revision:
- 24:92cc9c6e4b2b
- Parent:
- 4:566f2c41dc1d
Upgrade to match X-CUBE-MEMS1/trunk, revision #402
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Wolfgang Betz |
3:088aa5839e0d | 1 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 2 | ****************************************************************************** |
Wolfgang Betz |
24:92cc9c6e4b2b | 3 | * @file hts221.h |
Wolfgang Betz |
24:92cc9c6e4b2b | 4 | * @author MEMS Application Team |
Wolfgang Betz |
24:92cc9c6e4b2b | 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 hts221.c |
Wolfgang Betz |
24:92cc9c6e4b2b | 8 | * firmware driver. |
Wolfgang Betz |
24:92cc9c6e4b2b | 9 | ****************************************************************************** |
Wolfgang Betz |
24:92cc9c6e4b2b | 10 | * @attention |
Wolfgang Betz |
24:92cc9c6e4b2b | 11 | * |
Wolfgang Betz |
24:92cc9c6e4b2b | 12 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
Wolfgang Betz |
24:92cc9c6e4b2b | 13 | * |
Wolfgang Betz |
24:92cc9c6e4b2b | 14 | * Redistribution and use in source and binary forms, with or without modification, |
Wolfgang Betz |
24:92cc9c6e4b2b | 15 | * are permitted provided that the following conditions are met: |
Wolfgang Betz |
24:92cc9c6e4b2b | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
Wolfgang Betz |
24:92cc9c6e4b2b | 17 | * this list of conditions and the following disclaimer. |
Wolfgang Betz |
24:92cc9c6e4b2b | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Wolfgang Betz |
24:92cc9c6e4b2b | 19 | * this list of conditions and the following disclaimer in the documentation |
Wolfgang Betz |
24:92cc9c6e4b2b | 20 | * and/or other materials provided with the distribution. |
Wolfgang Betz |
24:92cc9c6e4b2b | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Wolfgang Betz |
24:92cc9c6e4b2b | 22 | * may be used to endorse or promote products derived from this software |
Wolfgang Betz |
24:92cc9c6e4b2b | 23 | * without specific prior written permission. |
Wolfgang Betz |
24:92cc9c6e4b2b | 24 | * |
Wolfgang Betz |
24:92cc9c6e4b2b | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Wolfgang Betz |
24:92cc9c6e4b2b | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Wolfgang Betz |
24:92cc9c6e4b2b | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Wolfgang Betz |
24:92cc9c6e4b2b | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Wolfgang Betz |
24:92cc9c6e4b2b | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Wolfgang Betz |
24:92cc9c6e4b2b | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Wolfgang Betz |
24:92cc9c6e4b2b | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Wolfgang Betz |
24:92cc9c6e4b2b | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Wolfgang Betz |
24:92cc9c6e4b2b | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Wolfgang Betz |
24:92cc9c6e4b2b | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Wolfgang Betz |
24:92cc9c6e4b2b | 35 | * |
Wolfgang Betz |
24:92cc9c6e4b2b | 36 | ****************************************************************************** |
Wolfgang Betz |
24:92cc9c6e4b2b | 37 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 38 | |
Wolfgang Betz |
4:566f2c41dc1d | 39 | |
Wolfgang Betz |
4:566f2c41dc1d | 40 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Wolfgang Betz |
4:566f2c41dc1d | 41 | #ifndef __HTS221_H |
Wolfgang Betz |
4:566f2c41dc1d | 42 | #define __HTS221_H |
Wolfgang Betz |
4:566f2c41dc1d | 43 | |
Wolfgang Betz |
4:566f2c41dc1d | 44 | #ifdef __cplusplus |
Wolfgang Betz |
24:92cc9c6e4b2b | 45 | extern "C" { |
Wolfgang Betz |
4:566f2c41dc1d | 46 | #endif |
Wolfgang Betz |
4:566f2c41dc1d | 47 | |
Wolfgang Betz |
4:566f2c41dc1d | 48 | /* Includes ------------------------------------------------------------------*/ |
Wolfgang Betz |
24:92cc9c6e4b2b | 49 | #include "hum_temp.h" |
Wolfgang Betz |
4:566f2c41dc1d | 50 | |
Wolfgang Betz |
4:566f2c41dc1d | 51 | /** @addtogroup BSP |
Wolfgang Betz |
4:566f2c41dc1d | 52 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 53 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 54 | |
Wolfgang Betz |
4:566f2c41dc1d | 55 | /** @addtogroup Components |
Wolfgang Betz |
4:566f2c41dc1d | 56 | * @{ |
Wolfgang Betz |
24:92cc9c6e4b2b | 57 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 58 | |
Wolfgang Betz |
4:566f2c41dc1d | 59 | /** @addtogroup HTS221 |
Wolfgang Betz |
4:566f2c41dc1d | 60 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 61 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 62 | |
Wolfgang Betz |
4:566f2c41dc1d | 63 | /** @defgroup HTS221_Exported_Defines HTS221_Exported_Defines |
Wolfgang Betz |
4:566f2c41dc1d | 64 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 65 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 66 | #ifndef NULL |
Wolfgang Betz |
24:92cc9c6e4b2b | 67 | #define NULL (void *) 0 |
Wolfgang Betz |
4:566f2c41dc1d | 68 | #endif |
Wolfgang Betz |
24:92cc9c6e4b2b | 69 | |
Wolfgang Betz |
4:566f2c41dc1d | 70 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 71 | * @brief Device Address |
Wolfgang Betz |
4:566f2c41dc1d | 72 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 73 | #define HTS221_ADDRESS 0xBE |
Wolfgang Betz |
4:566f2c41dc1d | 74 | |
Wolfgang Betz |
4:566f2c41dc1d | 75 | /******************************************************************************/ |
Wolfgang Betz |
4:566f2c41dc1d | 76 | /*************************** START REGISTER MAPPING **************************/ |
Wolfgang Betz |
4:566f2c41dc1d | 77 | /******************************************************************************/ |
Wolfgang Betz |
4:566f2c41dc1d | 78 | |
Wolfgang Betz |
4:566f2c41dc1d | 79 | |
Wolfgang Betz |
4:566f2c41dc1d | 80 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 81 | * @brief Device identification register. |
Wolfgang Betz |
4:566f2c41dc1d | 82 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 83 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 84 | * Default value: 0xBC |
Wolfgang Betz |
4:566f2c41dc1d | 85 | * 7:0 This read-only register contains the device identifier that, for HTS221, is set to BCh. |
Wolfgang Betz |
4:566f2c41dc1d | 86 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 87 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 88 | #define HTS221_WHO_AM_I_ADDR 0x0F |
Wolfgang Betz |
24:92cc9c6e4b2b | 89 | |
Wolfgang Betz |
4:566f2c41dc1d | 90 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 91 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 92 | * @brief Humidity resolution Register |
Wolfgang Betz |
24:92cc9c6e4b2b | 93 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 94 | * Read/write |
Wolfgang Betz |
24:92cc9c6e4b2b | 95 | * Default value: 0x1B |
Wolfgang Betz |
24:92cc9c6e4b2b | 96 | * 7:6 RFU |
Wolfgang Betz |
24:92cc9c6e4b2b | 97 | * 5:3 AVGT2-AVGT0: Temperature internal average. |
Wolfgang Betz |
24:92cc9c6e4b2b | 98 | * AVGT2 | AVGT1 | AVGT0 | Nr. Internal Average |
Wolfgang Betz |
24:92cc9c6e4b2b | 99 | * ------------------------------------------------------ |
Wolfgang Betz |
24:92cc9c6e4b2b | 100 | * 0 | 0 | 0 | 2 |
Wolfgang Betz |
24:92cc9c6e4b2b | 101 | * 0 | 0 | 1 | 4 |
Wolfgang Betz |
24:92cc9c6e4b2b | 102 | * 0 | 1 | 0 | 8 |
Wolfgang Betz |
24:92cc9c6e4b2b | 103 | * 0 | 1 | 1 | 16 |
Wolfgang Betz |
24:92cc9c6e4b2b | 104 | * 1 | 0 | 0 | 32 |
Wolfgang Betz |
24:92cc9c6e4b2b | 105 | * 1 | 0 | 1 | 64 |
Wolfgang Betz |
24:92cc9c6e4b2b | 106 | * 1 | 1 | 0 | 128 |
Wolfgang Betz |
24:92cc9c6e4b2b | 107 | * 1 | 1 | 1 | 256 |
Wolfgang Betz |
24:92cc9c6e4b2b | 108 | * |
Wolfgang Betz |
24:92cc9c6e4b2b | 109 | * 2:0 AVGH2-AVGH0: Humidity internal average. |
Wolfgang Betz |
24:92cc9c6e4b2b | 110 | * AVGH2 | AVGH1 | AVGH0 | Nr. Internal Average |
Wolfgang Betz |
24:92cc9c6e4b2b | 111 | * ------------------------------------------------------ |
Wolfgang Betz |
24:92cc9c6e4b2b | 112 | * 0 | 0 | 0 | 4 |
Wolfgang Betz |
24:92cc9c6e4b2b | 113 | * 0 | 0 | 1 | 8 |
Wolfgang Betz |
24:92cc9c6e4b2b | 114 | * 0 | 1 | 0 | 16 |
Wolfgang Betz |
24:92cc9c6e4b2b | 115 | * 0 | 1 | 1 | 32 |
Wolfgang Betz |
24:92cc9c6e4b2b | 116 | * 1 | 0 | 0 | 64 |
Wolfgang Betz |
24:92cc9c6e4b2b | 117 | * 1 | 0 | 1 | 128 |
Wolfgang Betz |
24:92cc9c6e4b2b | 118 | * 1 | 1 | 0 | 256 |
Wolfgang Betz |
24:92cc9c6e4b2b | 119 | * 1 | 1 | 1 | 512 |
Wolfgang Betz |
24:92cc9c6e4b2b | 120 | * |
Wolfgang Betz |
24:92cc9c6e4b2b | 121 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 122 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 123 | #define HTS221_RES_CONF_ADDR 0x10 |
Wolfgang Betz |
4:566f2c41dc1d | 124 | |
Wolfgang Betz |
4:566f2c41dc1d | 125 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 126 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 127 | * @brief INFO Register (LSB data) |
Wolfgang Betz |
24:92cc9c6e4b2b | 128 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 129 | * Read/write |
Wolfgang Betz |
24:92cc9c6e4b2b | 130 | * Default value: 0x00 |
Wolfgang Betz |
24:92cc9c6e4b2b | 131 | * 7:0 INFO7-INFO0: Lower part of the INFO reference |
Wolfgang Betz |
24:92cc9c6e4b2b | 132 | * used for traceability of the sample. |
Wolfgang Betz |
24:92cc9c6e4b2b | 133 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 134 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 135 | #define HTS221_INFO_L_ADDR 0x1E |
Wolfgang Betz |
4:566f2c41dc1d | 136 | |
Wolfgang Betz |
4:566f2c41dc1d | 137 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 138 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 139 | * @brief INFO & Calibration Version Register (LSB data) |
Wolfgang Betz |
24:92cc9c6e4b2b | 140 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 141 | * Read/write |
Wolfgang Betz |
24:92cc9c6e4b2b | 142 | * Default value: 0x00 |
Wolfgang Betz |
24:92cc9c6e4b2b | 143 | * 7:6 CALVER1:CALVER0 |
Wolfgang Betz |
24:92cc9c6e4b2b | 144 | * 5:0 INFO13-INFO8: Higher part of the INFO reference |
Wolfgang Betz |
24:92cc9c6e4b2b | 145 | * used for traceability of the sample. |
Wolfgang Betz |
24:92cc9c6e4b2b | 146 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 147 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 148 | #define HTS221_INFO_H_ADDR 0x1F |
Wolfgang Betz |
4:566f2c41dc1d | 149 | |
Wolfgang Betz |
4:566f2c41dc1d | 150 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 151 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 152 | * @brief Humidity sensor control register 1 |
Wolfgang Betz |
24:92cc9c6e4b2b | 153 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 154 | * Read/write |
Wolfgang Betz |
24:92cc9c6e4b2b | 155 | * Default value: 0x00 |
Wolfgang Betz |
24:92cc9c6e4b2b | 156 | * 7 PD: power down control. 0 - disable; 1 - enable |
Wolfgang Betz |
24:92cc9c6e4b2b | 157 | * 6:3 RFU |
Wolfgang Betz |
24:92cc9c6e4b2b | 158 | * 2 BDU: block data update. 0 - disable; 1 - enable |
Wolfgang Betz |
24:92cc9c6e4b2b | 159 | * 1:0 RFU |
Wolfgang Betz |
24:92cc9c6e4b2b | 160 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 161 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 162 | |
Wolfgang Betz |
4:566f2c41dc1d | 163 | #define HTS221_CTRL_REG1_ADDR 0x20 |
Wolfgang Betz |
4:566f2c41dc1d | 164 | |
Wolfgang Betz |
4:566f2c41dc1d | 165 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 166 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 167 | * @brief Humidity sensor control register 2 |
Wolfgang Betz |
24:92cc9c6e4b2b | 168 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 169 | * Read/write |
Wolfgang Betz |
24:92cc9c6e4b2b | 170 | * Default value: 0x00 |
Wolfgang Betz |
24:92cc9c6e4b2b | 171 | * 7 BOOT: Reboot memory content. 0: normal mode; 1: reboot memory content |
Wolfgang Betz |
24:92cc9c6e4b2b | 172 | * 6:3 Reserved. |
Wolfgang Betz |
24:92cc9c6e4b2b | 173 | * 2 Reserved. |
Wolfgang Betz |
24:92cc9c6e4b2b | 174 | * 1 Reserved. |
Wolfgang Betz |
24:92cc9c6e4b2b | 175 | * 0 ONE_SHOT: One shot enable. 0: waiting for start of conversion; 1: start for a new dataset |
Wolfgang Betz |
24:92cc9c6e4b2b | 176 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 177 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 178 | #define HTS221_CTRL_REG2_ADDR 0x21 |
Wolfgang Betz |
4:566f2c41dc1d | 179 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 180 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 181 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 182 | * @brief Humidity sensor control register 3 |
Wolfgang Betz |
24:92cc9c6e4b2b | 183 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 184 | * Read/write |
Wolfgang Betz |
24:92cc9c6e4b2b | 185 | * Default value: 0x00 |
Wolfgang Betz |
24:92cc9c6e4b2b | 186 | * [7] DRDY_H_L: Data Ready output signal active high, low (0: active high -default;1: active low) |
Wolfgang Betz |
24:92cc9c6e4b2b | 187 | * [6] PP_OD: Push-pull / Open Drain selection on pin 3 (DRDY) (0: push-pull - default; 1: open drain) |
Wolfgang Betz |
24:92cc9c6e4b2b | 188 | * [5:3] Reserved |
Wolfgang Betz |
24:92cc9c6e4b2b | 189 | * [2] DRDY_EN: Data Ready enable (0: Data Ready disabled - default;1: Data Ready signal available on pin 3) |
Wolfgang Betz |
24:92cc9c6e4b2b | 190 | * [1:0] Reserved |
Wolfgang Betz |
24:92cc9c6e4b2b | 191 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 192 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 193 | #define HTS221_CTRL_REG3_ADDR 0x22 |
Wolfgang Betz |
24:92cc9c6e4b2b | 194 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 195 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 196 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 197 | * @brief Status Register |
Wolfgang Betz |
24:92cc9c6e4b2b | 198 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 199 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 200 | * Default value: 0x00 |
Wolfgang Betz |
24:92cc9c6e4b2b | 201 | * 7:2 RFU |
Wolfgang Betz |
24:92cc9c6e4b2b | 202 | * 1 H_DA: Humidity data available. 0: new data for Humidity is not yet available; 1: new data for Humidity is available. |
Wolfgang Betz |
24:92cc9c6e4b2b | 203 | * 0 T_DA: Temperature data available. 0: new data for temperature is not yet available; 1: new data for temperature is available. |
Wolfgang Betz |
24:92cc9c6e4b2b | 204 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 205 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 206 | #define HTS221_STATUS_REG_ADDR 0x27 |
Wolfgang Betz |
4:566f2c41dc1d | 207 | |
Wolfgang Betz |
4:566f2c41dc1d | 208 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 209 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 210 | * @brief Humidity data (LSB). |
Wolfgang Betz |
24:92cc9c6e4b2b | 211 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 212 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 213 | * Default value: 0x00. |
Wolfgang Betz |
24:92cc9c6e4b2b | 214 | * POUT7 - POUT0: Humidity data LSB (2's complement) => signed 16 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 215 | * RAW Humidity output data: Hout(%)=(HUMIDITY_OUT_H & HUMIDITY_OUT_L). |
Wolfgang Betz |
24:92cc9c6e4b2b | 216 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 217 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 218 | #define HTS221_HUMIDITY_OUT_L_ADDR 0x28 |
Wolfgang Betz |
4:566f2c41dc1d | 219 | |
Wolfgang Betz |
4:566f2c41dc1d | 220 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 221 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 222 | * @brief Humidity data (MSB). |
Wolfgang Betz |
24:92cc9c6e4b2b | 223 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 224 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 225 | * Default value: 0x00. |
Wolfgang Betz |
24:92cc9c6e4b2b | 226 | * POUT7 - POUT0: Humidity data LSB (2's complement) => signed 16 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 227 | * RAW Humidity output data: Hout(%)=(HUMIDITY_OUT_H & HUMIDITY_OUT_L). |
Wolfgang Betz |
24:92cc9c6e4b2b | 228 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 229 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 230 | #define HTS221_HUMIDITY_OUT_H_ADDR 0x29 |
Wolfgang Betz |
4:566f2c41dc1d | 231 | |
Wolfgang Betz |
4:566f2c41dc1d | 232 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 233 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 234 | * @brief Temperature data (LSB). |
Wolfgang Betz |
24:92cc9c6e4b2b | 235 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 236 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 237 | * Default value: 0x00. |
Wolfgang Betz |
24:92cc9c6e4b2b | 238 | * TOUT7 - TOUT0: temperature data LSB (2's complement) => signed 16 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 239 | * RAW Temperature output data: Tout (LSB)=(TEMP_OUT_H & TEMP_OUT_L). |
Wolfgang Betz |
24:92cc9c6e4b2b | 240 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 241 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 242 | #define HTS221_TEMP_OUT_L_ADDR 0x2A |
Wolfgang Betz |
4:566f2c41dc1d | 243 | |
Wolfgang Betz |
4:566f2c41dc1d | 244 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 245 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 246 | * @brief Temperature data (MSB). |
Wolfgang Betz |
24:92cc9c6e4b2b | 247 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 248 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 249 | * Default value: 0x00. |
Wolfgang Betz |
24:92cc9c6e4b2b | 250 | * TOUT15 - TOUT8: temperature data MSB (2's complement) => signed 16 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 251 | * RAW Temperature output data: Tout (LSB)=(TEMP_OUT_H & TEMP_OUT_L). |
Wolfgang Betz |
24:92cc9c6e4b2b | 252 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 253 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 254 | #define HTS221_TEMP_OUT_H_ADDR 0x2B |
Wolfgang Betz |
4:566f2c41dc1d | 255 | |
Wolfgang Betz |
4:566f2c41dc1d | 256 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 257 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 258 | *@brief Humidity 0 Register in %RH with sensitivity=2 |
Wolfgang Betz |
24:92cc9c6e4b2b | 259 | *\code |
Wolfgang Betz |
24:92cc9c6e4b2b | 260 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 261 | * Value: (Unsigned 8 Bit)/2 |
Wolfgang Betz |
24:92cc9c6e4b2b | 262 | *\endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 263 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 264 | #define HTS221_H0_RH_X2_ADDR 0x30 |
Wolfgang Betz |
4:566f2c41dc1d | 265 | |
Wolfgang Betz |
4:566f2c41dc1d | 266 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 267 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 268 | *@brief Humidity 1 Register in %RH with sensitivity=2 |
Wolfgang Betz |
24:92cc9c6e4b2b | 269 | *\code |
Wolfgang Betz |
24:92cc9c6e4b2b | 270 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 271 | * Value: (Unsigned 8 Bit)/2 |
Wolfgang Betz |
24:92cc9c6e4b2b | 272 | *\endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 273 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 274 | #define HTS221_H1_RH_X2_ADDR 0x31 |
Wolfgang Betz |
4:566f2c41dc1d | 275 | |
Wolfgang Betz |
4:566f2c41dc1d | 276 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 277 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 278 | *@brief Temperature 0 Register in deg with sensitivity=8 |
Wolfgang Betz |
24:92cc9c6e4b2b | 279 | *\code |
Wolfgang Betz |
24:92cc9c6e4b2b | 280 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 281 | * Value: (Unsigned 16 Bit)/2 |
Wolfgang Betz |
24:92cc9c6e4b2b | 282 | *\endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 283 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 284 | #define HTS221_T0_degC_X8_ADDR 0x32 |
Wolfgang Betz |
4:566f2c41dc1d | 285 | |
Wolfgang Betz |
4:566f2c41dc1d | 286 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 287 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 288 | *@brief Temperature 1 Register in deg with sensitivity=8 |
Wolfgang Betz |
24:92cc9c6e4b2b | 289 | *\code |
Wolfgang Betz |
24:92cc9c6e4b2b | 290 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 291 | * Value: (Unsigned 16 Bit)/2 |
Wolfgang Betz |
24:92cc9c6e4b2b | 292 | *\endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 293 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 294 | #define HTS221_T1_degC_X8_ADDR 0x33 |
Wolfgang Betz |
4:566f2c41dc1d | 295 | |
Wolfgang Betz |
4:566f2c41dc1d | 296 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 297 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 298 | *@brief Temperature 1/0 MSB Register in deg with sensitivity=8 |
Wolfgang Betz |
24:92cc9c6e4b2b | 299 | *\code |
Wolfgang Betz |
24:92cc9c6e4b2b | 300 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 301 | * Value: (Unsigned 16 Bit)/2 |
Wolfgang Betz |
24:92cc9c6e4b2b | 302 | * 3:2 T1(9):T1(8) MSB T1_degC_X8 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 303 | * 1:0 T0(9):T0(8) MSB T0_degC_X8 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 304 | *\endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 305 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 306 | #define HTS221_T1_T0_MSB_X8_ADDR 0x35 |
Wolfgang Betz |
4:566f2c41dc1d | 307 | |
Wolfgang Betz |
4:566f2c41dc1d | 308 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 309 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 310 | *@brief Humidity LOW CALIBRATION Register |
Wolfgang Betz |
24:92cc9c6e4b2b | 311 | *\code |
Wolfgang Betz |
24:92cc9c6e4b2b | 312 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 313 | * Default value: 0x00. |
Wolfgang Betz |
24:92cc9c6e4b2b | 314 | * H0_T0_TOUT7 - H0_T0_TOUT0: HUMIDITY data lSB (2's complement) => signed 16 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 315 | *\endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 316 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 317 | #define HTS221_H0_T0_OUT_L_ADDR 0x36 |
Wolfgang Betz |
4:566f2c41dc1d | 318 | |
Wolfgang Betz |
4:566f2c41dc1d | 319 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 320 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 321 | *@brief Humidity LOW CALIBRATION Register |
Wolfgang Betz |
24:92cc9c6e4b2b | 322 | *\code |
Wolfgang Betz |
24:92cc9c6e4b2b | 323 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 324 | * Default value: 0x00. |
Wolfgang Betz |
24:92cc9c6e4b2b | 325 | * H0_T0_TOUT15 - H0_T0_TOUT8: HUMIDITY data mSB (2's complement) => signed 16 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 326 | *\endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 327 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 328 | #define HTS221_H0_T0_OUT_H_ADDR 0x37 |
Wolfgang Betz |
4:566f2c41dc1d | 329 | |
Wolfgang Betz |
4:566f2c41dc1d | 330 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 331 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 332 | *@brief Humidity HIGH CALIBRATION Register |
Wolfgang Betz |
24:92cc9c6e4b2b | 333 | *\code |
Wolfgang Betz |
24:92cc9c6e4b2b | 334 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 335 | * Default value: 0x00. |
Wolfgang Betz |
24:92cc9c6e4b2b | 336 | * H1_T0_TOUT7 - H1_T0_TOUT0: HUMIDITY data lSB (2's complement) => signed 16 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 337 | *\endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 338 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 339 | #define HTS221_H1_T0_OUT_L_ADDR 0x3A |
Wolfgang Betz |
4:566f2c41dc1d | 340 | |
Wolfgang Betz |
4:566f2c41dc1d | 341 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 342 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 343 | *@brief Humidity HIGH CALIBRATION Register |
Wolfgang Betz |
24:92cc9c6e4b2b | 344 | *\code |
Wolfgang Betz |
24:92cc9c6e4b2b | 345 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 346 | * Default value: 0x00. |
Wolfgang Betz |
24:92cc9c6e4b2b | 347 | * H1_T0_TOUT15 - H1_T0_TOUT8: HUMIDITY data mSB (2's complement) => signed 16 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 348 | *\endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 349 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 350 | #define HTS221_H1_T0_OUT_H_ADDR 0x3B |
Wolfgang Betz |
4:566f2c41dc1d | 351 | |
Wolfgang Betz |
4:566f2c41dc1d | 352 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 353 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 354 | * @brief Low Calibration Temperature Register (LSB). |
Wolfgang Betz |
24:92cc9c6e4b2b | 355 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 356 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 357 | * Default value: 0x00. |
Wolfgang Betz |
24:92cc9c6e4b2b | 358 | * T0_OUT7 - T0_OUT0: temperature data LSB (2's complement) => signed 16 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 359 | * RAW LOW Calibration data: T0_OUT (LSB)=(T0_OUT_H & T0_OUT_L). |
Wolfgang Betz |
24:92cc9c6e4b2b | 360 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 361 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 362 | #define HTS221_T0_OUT_L_ADDR 0x3C |
Wolfgang Betz |
4:566f2c41dc1d | 363 | |
Wolfgang Betz |
4:566f2c41dc1d | 364 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 365 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 366 | * @brief Low Calibration Temperature Register (MSB) |
Wolfgang Betz |
24:92cc9c6e4b2b | 367 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 368 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 369 | * Default value: 0x00. |
Wolfgang Betz |
24:92cc9c6e4b2b | 370 | * T0_OUT15 - T0_OUT8: temperature data MSB (2's complement) => signed 16 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 371 | * RAW LOW Calibration data: T0_OUT (LSB)=(T0_OUT_H & T0_OUT_L). |
Wolfgang Betz |
24:92cc9c6e4b2b | 372 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 373 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 374 | #define HTS221_T0_OUT_H_ADDR 0x3D |
Wolfgang Betz |
4:566f2c41dc1d | 375 | |
Wolfgang Betz |
4:566f2c41dc1d | 376 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 377 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 378 | * @brief Low Calibration Temperature Register (LSB). |
Wolfgang Betz |
24:92cc9c6e4b2b | 379 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 380 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 381 | * Default value: 0x00. |
Wolfgang Betz |
24:92cc9c6e4b2b | 382 | * T1_OUT7 - T1_OUT0: temperature data LSB (2's complement) => signed 16 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 383 | * RAW LOW Calibration data: T1_OUT (LSB)=(T1_OUT_H & T1_OUT_L). |
Wolfgang Betz |
24:92cc9c6e4b2b | 384 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 385 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 386 | #define HTS221_T1_OUT_L_ADDR 0x3E |
Wolfgang Betz |
4:566f2c41dc1d | 387 | |
Wolfgang Betz |
4:566f2c41dc1d | 388 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 389 | /** |
Wolfgang Betz |
24:92cc9c6e4b2b | 390 | * @brief Low Calibration Temperature Register (MSB) |
Wolfgang Betz |
24:92cc9c6e4b2b | 391 | * \code |
Wolfgang Betz |
24:92cc9c6e4b2b | 392 | * Read |
Wolfgang Betz |
24:92cc9c6e4b2b | 393 | * Default value: 0x00. |
Wolfgang Betz |
24:92cc9c6e4b2b | 394 | * T1_OUT15 - T1_OUT8: temperature data MSB (2's complement) => signed 16 bits |
Wolfgang Betz |
24:92cc9c6e4b2b | 395 | * RAW LOW Calibration data: T1_OUT (LSB)=(T1_OUT_H & T1_OUT_L). |
Wolfgang Betz |
24:92cc9c6e4b2b | 396 | * \endcode |
Wolfgang Betz |
24:92cc9c6e4b2b | 397 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 398 | #define HTS221_T1_OUT_H_ADDR 0x3F |
Wolfgang Betz |
4:566f2c41dc1d | 399 | |
Wolfgang Betz |
4:566f2c41dc1d | 400 | |
Wolfgang Betz |
4:566f2c41dc1d | 401 | /******************************************************************************/ |
Wolfgang Betz |
4:566f2c41dc1d | 402 | /**************************** END REGISTER MAPPING ***************************/ |
Wolfgang Betz |
4:566f2c41dc1d | 403 | /******************************************************************************/ |
Wolfgang Betz |
4:566f2c41dc1d | 404 | |
Wolfgang Betz |
4:566f2c41dc1d | 405 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 406 | * @brief Multiple Byte. Mask for enabling multiple byte read/write command. |
Wolfgang Betz |
24:92cc9c6e4b2b | 407 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 408 | #define HTS221_I2C_MULTIPLEBYTE_CMD ((uint8_t)0x80) |
Wolfgang Betz |
24:92cc9c6e4b2b | 409 | |
Wolfgang Betz |
4:566f2c41dc1d | 410 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 411 | * @brief Device Identifier. Default value of the WHO_AM_I register. |
Wolfgang Betz |
4:566f2c41dc1d | 412 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 413 | #define I_AM_HTS221 ((uint8_t)0xBC) |
Wolfgang Betz |
4:566f2c41dc1d | 414 | |
Wolfgang Betz |
4:566f2c41dc1d | 415 | |
Wolfgang Betz |
4:566f2c41dc1d | 416 | /** @defgroup HTS221_Power_Mode_Selection_CTRL_REG1 HTS221_Power_Mode_Selection_CTRL_REG1 |
Wolfgang Betz |
4:566f2c41dc1d | 417 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 418 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 419 | #define HTS221_MODE_POWERDOWN ((uint8_t)0x00) |
Wolfgang Betz |
4:566f2c41dc1d | 420 | #define HTS221_MODE_ACTIVE ((uint8_t)0x80) |
Wolfgang Betz |
4:566f2c41dc1d | 421 | |
Wolfgang Betz |
4:566f2c41dc1d | 422 | #define HTS221_MODE_MASK ((uint8_t)0x80) |
Wolfgang Betz |
4:566f2c41dc1d | 423 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 424 | * @} |
Wolfgang Betz |
24:92cc9c6e4b2b | 425 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 426 | |
Wolfgang Betz |
4:566f2c41dc1d | 427 | |
Wolfgang Betz |
4:566f2c41dc1d | 428 | /** @defgroup HTS221_Block_Data_Update_Mode_Selection_CTRL_REG1 HTS221_Block_Data_Update_Mode_Selection_CTRL_REG1 |
Wolfgang Betz |
4:566f2c41dc1d | 429 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 430 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 431 | #define HTS221_BDU_CONTINUOUS ((uint8_t)0x00) |
Wolfgang Betz |
4:566f2c41dc1d | 432 | #define HTS221_BDU_NOT_UNTIL_READING ((uint8_t)0x04) |
Wolfgang Betz |
4:566f2c41dc1d | 433 | |
Wolfgang Betz |
4:566f2c41dc1d | 434 | #define HTS221_BDU_MASK ((uint8_t)0x04) |
Wolfgang Betz |
4:566f2c41dc1d | 435 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 436 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 437 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 438 | |
Wolfgang Betz |
4:566f2c41dc1d | 439 | /** @defgroup HTS221_Output_Data_Rate_Selection_CTRL_REG1 HTS221_Output_Data_Rate_Selection_CTRL_REG1 |
Wolfgang Betz |
4:566f2c41dc1d | 440 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 441 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 442 | #define HTS221_ODR_ONE_SHOT ((uint8_t)0x00) /*!< Output Data Rate: H - one shot, T - one shot */ |
Wolfgang Betz |
4:566f2c41dc1d | 443 | #define HTS221_ODR_1Hz ((uint8_t)0x01) /*!< Output Data Rate: H - 1Hz, T - 1Hz */ |
Wolfgang Betz |
4:566f2c41dc1d | 444 | #define HTS221_ODR_7Hz ((uint8_t)0x02) /*!< Output Data Rate: H - 7Hz, T - 7Hz */ |
Wolfgang Betz |
4:566f2c41dc1d | 445 | #define HTS221_ODR_12_5Hz ((uint8_t)0x03) /*!< Output Data Rate: H - 12.5Hz, T - 12.5Hz */ |
Wolfgang Betz |
4:566f2c41dc1d | 446 | |
Wolfgang Betz |
4:566f2c41dc1d | 447 | #define HTS221_ODR_MASK ((uint8_t)0x03) |
Wolfgang Betz |
4:566f2c41dc1d | 448 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 449 | * @} |
Wolfgang Betz |
3:088aa5839e0d | 450 | */ |
Wolfgang Betz |
3:088aa5839e0d | 451 | |
Wolfgang Betz |
4:566f2c41dc1d | 452 | |
Wolfgang Betz |
4:566f2c41dc1d | 453 | /** @defgroup HTS221_Boot_Mode_Selection_CTRL_REG2 HTS221_Boot_Mode_Selection_CTRL_REG2 |
Wolfgang Betz |
4:566f2c41dc1d | 454 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 455 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 456 | #define HTS221_BOOT_NORMALMODE ((uint8_t)0x00) |
Wolfgang Betz |
4:566f2c41dc1d | 457 | #define HTS221_BOOT_REBOOTMEMORY ((uint8_t)0x80) |
Wolfgang Betz |
3:088aa5839e0d | 458 | |
Wolfgang Betz |
4:566f2c41dc1d | 459 | #define HTS221_BOOT_MASK ((uint8_t)0x80) |
Wolfgang Betz |
4:566f2c41dc1d | 460 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 461 | * @} |
Wolfgang Betz |
24:92cc9c6e4b2b | 462 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 463 | |
Wolfgang Betz |
3:088aa5839e0d | 464 | |
Wolfgang Betz |
4:566f2c41dc1d | 465 | /** @defgroup HTS221_One_Shot_Selection_CTRL_REG2 HTS221_One_Shot_Selection_CTRL_REG2 |
Wolfgang Betz |
4:566f2c41dc1d | 466 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 467 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 468 | #define HTS221_ONE_SHOT_START ((uint8_t)0x01) |
Wolfgang Betz |
4:566f2c41dc1d | 469 | |
Wolfgang Betz |
4:566f2c41dc1d | 470 | #define HTS221_ONE_SHOT_MASK ((uint8_t)0x01) |
Wolfgang Betz |
4:566f2c41dc1d | 471 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 472 | * @} |
Wolfgang Betz |
3:088aa5839e0d | 473 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 474 | |
Wolfgang Betz |
4:566f2c41dc1d | 475 | /** @defgroup HTS221_PushPull_OpenDrain_Selection_CTRL_REG3 HTS221_PushPull_OpenDrain_Selection_CTRL_REG3 |
Wolfgang Betz |
4:566f2c41dc1d | 476 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 477 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 478 | #define HTS221_PP_OD_PUSH_PULL ((uint8_t)0x00) |
Wolfgang Betz |
4:566f2c41dc1d | 479 | #define HTS221_PP_OD_OPEN_DRAIN ((uint8_t)0x40) |
Wolfgang Betz |
4:566f2c41dc1d | 480 | |
Wolfgang Betz |
4:566f2c41dc1d | 481 | #define HTS221_PP_OD_MASK ((uint8_t)0x40) |
Wolfgang Betz |
4:566f2c41dc1d | 482 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 483 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 484 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 485 | |
Wolfgang Betz |
4:566f2c41dc1d | 486 | |
Wolfgang Betz |
4:566f2c41dc1d | 487 | /** @defgroup HTS221_Data_Ready_Selection_CTRL_REG3 HTS221_Data_Ready_Selection_CTRL_REG3 |
Wolfgang Betz |
4:566f2c41dc1d | 488 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 489 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 490 | #define HTS221_DRDY_DISABLE ((uint8_t)0x00) |
Wolfgang Betz |
4:566f2c41dc1d | 491 | #define HTS221_DRDY_AVAILABLE ((uint8_t)0x04) |
Wolfgang Betz |
4:566f2c41dc1d | 492 | |
Wolfgang Betz |
4:566f2c41dc1d | 493 | #define HTS221_DRDY_MASK ((uint8_t)0x04) |
Wolfgang Betz |
4:566f2c41dc1d | 494 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 495 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 496 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 497 | |
Wolfgang Betz |
4:566f2c41dc1d | 498 | |
Wolfgang Betz |
4:566f2c41dc1d | 499 | /** @defgroup HTS221_Humidity_Resolution_Selection_RES_CONF HTS221_Humidity_Resolution_Selection_RES_CONF |
Wolfgang Betz |
4:566f2c41dc1d | 500 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 501 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 502 | #define HTS221_H_RES_AVG_4 ((uint8_t)0x00) |
Wolfgang Betz |
4:566f2c41dc1d | 503 | #define HTS221_H_RES_AVG_8 ((uint8_t)0x01) |
Wolfgang Betz |
4:566f2c41dc1d | 504 | #define HTS221_H_RES_AVG_16 ((uint8_t)0x02) |
Wolfgang Betz |
4:566f2c41dc1d | 505 | #define HTS221_H_RES_AVG_32 ((uint8_t)0x03) |
Wolfgang Betz |
4:566f2c41dc1d | 506 | #define HTS221_H_RES_AVG_64 ((uint8_t)0x04) |
Wolfgang Betz |
4:566f2c41dc1d | 507 | #define HTS221_H_RES_AVG_128 ((uint8_t)0x05) |
Wolfgang Betz |
4:566f2c41dc1d | 508 | |
Wolfgang Betz |
4:566f2c41dc1d | 509 | #define HTS221_H_RES_MASK ((uint8_t)0x07) |
Wolfgang Betz |
4:566f2c41dc1d | 510 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 511 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 512 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 513 | |
Wolfgang Betz |
4:566f2c41dc1d | 514 | |
Wolfgang Betz |
4:566f2c41dc1d | 515 | /** @defgroup HTS221_Temperature_Resolution_Selection_RES_CONF HTS221_Temperature_Resolution_Selection_RES_CONF |
Wolfgang Betz |
4:566f2c41dc1d | 516 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 517 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 518 | #define HTS221_T_RES_AVG_2 ((uint8_t)0x00) |
Wolfgang Betz |
4:566f2c41dc1d | 519 | #define HTS221_T_RES_AVG_4 ((uint8_t)0x08) |
Wolfgang Betz |
4:566f2c41dc1d | 520 | #define HTS221_T_RES_AVG_8 ((uint8_t)0x10) |
Wolfgang Betz |
4:566f2c41dc1d | 521 | #define HTS221_T_RES_AVG_16 ((uint8_t)0x18) |
Wolfgang Betz |
4:566f2c41dc1d | 522 | #define HTS221_T_RES_AVG_32 ((uint8_t)0x20) |
Wolfgang Betz |
4:566f2c41dc1d | 523 | #define HTS221_T_RES_AVG_64 ((uint8_t)0x28) |
Wolfgang Betz |
3:088aa5839e0d | 524 | |
Wolfgang Betz |
4:566f2c41dc1d | 525 | #define HTS221_T_RES_MASK ((uint8_t)0x38) |
Wolfgang Betz |
4:566f2c41dc1d | 526 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 527 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 528 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 529 | |
Wolfgang Betz |
4:566f2c41dc1d | 530 | |
Wolfgang Betz |
4:566f2c41dc1d | 531 | /** @defgroup HTS221_Temperature_Humidity_Data_Available_STATUS_REG HTS221_Temperature_Humidity_Data_Available_STATUS_REG |
Wolfgang Betz |
4:566f2c41dc1d | 532 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 533 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 534 | #define HTS221_H_DATA_AVAILABLE_MASK ((uint8_t)0x02) |
Wolfgang Betz |
4:566f2c41dc1d | 535 | #define HTS221_T_DATA_AVAILABLE_MASK ((uint8_t)0x01) |
Wolfgang Betz |
4:566f2c41dc1d | 536 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 537 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 538 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 539 | |
Wolfgang Betz |
4:566f2c41dc1d | 540 | /* Data resolution */ |
Wolfgang Betz |
4:566f2c41dc1d | 541 | #define HUM_DECIMAL_DIGITS (2) |
Wolfgang Betz |
4:566f2c41dc1d | 542 | #define TEMP_DECIMAL_DIGITS (2) |
Wolfgang Betz |
24:92cc9c6e4b2b | 543 | |
Wolfgang Betz |
4:566f2c41dc1d | 544 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 545 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 546 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 547 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 548 | |
Wolfgang Betz |
4:566f2c41dc1d | 549 | /** @defgroup HTS221_Imported_Functions HTS221_Imported_Functions |
Wolfgang Betz |
4:566f2c41dc1d | 550 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 551 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 552 | /* HUM_TEMP sensor IO functions */ |
Wolfgang Betz |
4:566f2c41dc1d | 553 | extern HUM_TEMP_StatusTypeDef HTS221_IO_Init(void); |
Wolfgang Betz |
24:92cc9c6e4b2b | 554 | extern HUM_TEMP_StatusTypeDef HTS221_IO_Write(uint8_t* pBuffer, uint8_t DeviceAddr, uint8_t RegisterAddr, |
Wolfgang Betz |
24:92cc9c6e4b2b | 555 | uint16_t NumByteToWrite); |
Wolfgang Betz |
24:92cc9c6e4b2b | 556 | extern HUM_TEMP_StatusTypeDef HTS221_IO_Read(uint8_t* pBuffer, uint8_t DeviceAddr, uint8_t RegisterAddr, |
Wolfgang Betz |
24:92cc9c6e4b2b | 557 | uint16_t NumByteToRead); |
Wolfgang Betz |
4:566f2c41dc1d | 558 | extern void HTS221_IO_ITConfig( void ); |
Wolfgang Betz |
4:566f2c41dc1d | 559 | |
Wolfgang Betz |
4:566f2c41dc1d | 560 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 561 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 562 | */ |
Wolfgang Betz |
3:088aa5839e0d | 563 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 564 | /* ------------------------------------------------------- */ |
Wolfgang Betz |
4:566f2c41dc1d | 565 | /* Here you should declare the internal struct of */ |
Wolfgang Betz |
4:566f2c41dc1d | 566 | /* extended features of HTS221. See the example of */ |
Wolfgang Betz |
4:566f2c41dc1d | 567 | /* LSM6DS3 in lsm6ds3.h */ |
Wolfgang Betz |
4:566f2c41dc1d | 568 | /* ------------------------------------------------------- */ |
Wolfgang Betz |
4:566f2c41dc1d | 569 | |
Wolfgang Betz |
4:566f2c41dc1d | 570 | /** @addtogroup HTS221_Exported_Variables HTS221_Exported_Variables |
Wolfgang Betz |
4:566f2c41dc1d | 571 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 572 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 573 | /* HUM_TEMP sensor driver structure */ |
Wolfgang Betz |
4:566f2c41dc1d | 574 | extern HUM_TEMP_DrvTypeDef Hts221Drv; |
Wolfgang Betz |
4:566f2c41dc1d | 575 | extern HUM_TEMP_DrvExtTypeDef Hts221Drv_ext; |
Wolfgang Betz |
4:566f2c41dc1d | 576 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 577 | * @} |
Wolfgang Betz |
24:92cc9c6e4b2b | 578 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 579 | |
Wolfgang Betz |
4:566f2c41dc1d | 580 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 581 | * @} |
Wolfgang Betz |
24:92cc9c6e4b2b | 582 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 583 | |
Wolfgang Betz |
4:566f2c41dc1d | 584 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 585 | * @} |
Wolfgang Betz |
24:92cc9c6e4b2b | 586 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 587 | |
Wolfgang Betz |
4:566f2c41dc1d | 588 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 589 | * @} |
Wolfgang Betz |
24:92cc9c6e4b2b | 590 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 591 | |
Wolfgang Betz |
4:566f2c41dc1d | 592 | #ifdef __cplusplus |
Wolfgang Betz |
24:92cc9c6e4b2b | 593 | } |
Wolfgang Betz |
4:566f2c41dc1d | 594 | #endif |
Wolfgang Betz |
24:92cc9c6e4b2b | 595 | |
Wolfgang Betz |
4:566f2c41dc1d | 596 | #endif /* __HTS221_H */ |
Wolfgang Betz |
4:566f2c41dc1d | 597 | |
Wolfgang Betz |
4:566f2c41dc1d | 598 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 599 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |