New
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of X_NUCLEO_IKS01A1 by
Components/hts221/hts221.h@4:566f2c41dc1d, 2015-04-14 (annotated)
- Committer:
- Wolfgang Betz
- Date:
- Tue Apr 14 15:32:06 2015 +0200
- Revision:
- 4:566f2c41dc1d
- Parent:
- 3:088aa5839e0d
- Child:
- 24:92cc9c6e4b2b
X_NUCLEO_IKS01A1: first version of main & hts221 component
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Wolfgang Betz |
3:088aa5839e0d | 1 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 2 | ****************************************************************************** |
Wolfgang Betz |
4:566f2c41dc1d | 3 | * @file hts221.h |
Wolfgang Betz |
4:566f2c41dc1d | 4 | * @author MEMS Application Team |
Wolfgang Betz |
4:566f2c41dc1d | 5 | * @version V1.2.0 |
Wolfgang Betz |
4:566f2c41dc1d | 6 | * @date 28-January-2015 |
Wolfgang Betz |
4:566f2c41dc1d | 7 | * @brief This file contains definitions for the hts221.c |
Wolfgang Betz |
4:566f2c41dc1d | 8 | * firmware driver. |
Wolfgang Betz |
4:566f2c41dc1d | 9 | ****************************************************************************** |
Wolfgang Betz |
4:566f2c41dc1d | 10 | * @attention |
Wolfgang Betz |
4:566f2c41dc1d | 11 | * |
Wolfgang Betz |
4:566f2c41dc1d | 12 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
Wolfgang Betz |
4:566f2c41dc1d | 13 | * |
Wolfgang Betz |
4:566f2c41dc1d | 14 | * Redistribution and use in source and binary forms, with or without modification, |
Wolfgang Betz |
4:566f2c41dc1d | 15 | * are permitted provided that the following conditions are met: |
Wolfgang Betz |
4:566f2c41dc1d | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
Wolfgang Betz |
4:566f2c41dc1d | 17 | * this list of conditions and the following disclaimer. |
Wolfgang Betz |
4:566f2c41dc1d | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Wolfgang Betz |
4:566f2c41dc1d | 19 | * this list of conditions and the following disclaimer in the documentation |
Wolfgang Betz |
4:566f2c41dc1d | 20 | * and/or other materials provided with the distribution. |
Wolfgang Betz |
4:566f2c41dc1d | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Wolfgang Betz |
4:566f2c41dc1d | 22 | * may be used to endorse or promote products derived from this software |
Wolfgang Betz |
4:566f2c41dc1d | 23 | * without specific prior written permission. |
Wolfgang Betz |
4:566f2c41dc1d | 24 | * |
Wolfgang Betz |
4:566f2c41dc1d | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Wolfgang Betz |
4:566f2c41dc1d | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Wolfgang Betz |
4:566f2c41dc1d | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Wolfgang Betz |
4:566f2c41dc1d | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Wolfgang Betz |
4:566f2c41dc1d | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Wolfgang Betz |
4:566f2c41dc1d | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Wolfgang Betz |
4:566f2c41dc1d | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Wolfgang Betz |
4:566f2c41dc1d | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Wolfgang Betz |
4:566f2c41dc1d | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Wolfgang Betz |
4:566f2c41dc1d | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Wolfgang Betz |
4:566f2c41dc1d | 35 | * |
Wolfgang Betz |
4:566f2c41dc1d | 36 | ****************************************************************************** |
Wolfgang Betz |
4:566f2c41dc1d | 37 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 45 | extern "C" { |
Wolfgang Betz |
4:566f2c41dc1d | 46 | #endif |
Wolfgang Betz |
4:566f2c41dc1d | 47 | |
Wolfgang Betz |
4:566f2c41dc1d | 48 | /* Includes ------------------------------------------------------------------*/ |
Wolfgang Betz |
4:566f2c41dc1d | 49 | #include "../Common/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 |
4:566f2c41dc1d | 57 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 58 | |
Wolfgang Betz |
4:566f2c41dc1d | 59 | /** @addtogroup HTS221 |
Wolfgang Betz |
4:566f2c41dc1d | 60 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 61 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 67 | #define NULL (void *) 0 |
Wolfgang Betz |
4:566f2c41dc1d | 68 | #endif |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 89 | |
Wolfgang Betz |
4:566f2c41dc1d | 90 | |
Wolfgang Betz |
4:566f2c41dc1d | 91 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 92 | * @brief Humidity resolution Register |
Wolfgang Betz |
4:566f2c41dc1d | 93 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 94 | * Read/write |
Wolfgang Betz |
4:566f2c41dc1d | 95 | * Default value: 0x1B |
Wolfgang Betz |
4:566f2c41dc1d | 96 | * 7:6 RFU |
Wolfgang Betz |
4:566f2c41dc1d | 97 | * 5:3 AVGT2-AVGT0: Temperature internal average. |
Wolfgang Betz |
4:566f2c41dc1d | 98 | * AVGT2 | AVGT1 | AVGT0 | Nr. Internal Average |
Wolfgang Betz |
4:566f2c41dc1d | 99 | * ------------------------------------------------------ |
Wolfgang Betz |
4:566f2c41dc1d | 100 | * 0 | 0 | 0 | 2 |
Wolfgang Betz |
4:566f2c41dc1d | 101 | * 0 | 0 | 1 | 4 |
Wolfgang Betz |
4:566f2c41dc1d | 102 | * 0 | 1 | 0 | 8 |
Wolfgang Betz |
4:566f2c41dc1d | 103 | * 0 | 1 | 1 | 16 |
Wolfgang Betz |
4:566f2c41dc1d | 104 | * 1 | 0 | 0 | 32 |
Wolfgang Betz |
4:566f2c41dc1d | 105 | * 1 | 0 | 1 | 64 |
Wolfgang Betz |
4:566f2c41dc1d | 106 | * 1 | 1 | 0 | 128 |
Wolfgang Betz |
4:566f2c41dc1d | 107 | * 1 | 1 | 1 | 256 |
Wolfgang Betz |
4:566f2c41dc1d | 108 | * |
Wolfgang Betz |
4:566f2c41dc1d | 109 | * 2:0 AVGH2-AVGH0: Humidity internal average. |
Wolfgang Betz |
4:566f2c41dc1d | 110 | * AVGH2 | AVGH1 | AVGH0 | Nr. Internal Average |
Wolfgang Betz |
4:566f2c41dc1d | 111 | * ------------------------------------------------------ |
Wolfgang Betz |
4:566f2c41dc1d | 112 | * 0 | 0 | 0 | 4 |
Wolfgang Betz |
4:566f2c41dc1d | 113 | * 0 | 0 | 1 | 8 |
Wolfgang Betz |
4:566f2c41dc1d | 114 | * 0 | 1 | 0 | 16 |
Wolfgang Betz |
4:566f2c41dc1d | 115 | * 0 | 1 | 1 | 32 |
Wolfgang Betz |
4:566f2c41dc1d | 116 | * 1 | 0 | 0 | 64 |
Wolfgang Betz |
4:566f2c41dc1d | 117 | * 1 | 0 | 1 | 128 |
Wolfgang Betz |
4:566f2c41dc1d | 118 | * 1 | 1 | 0 | 256 |
Wolfgang Betz |
4:566f2c41dc1d | 119 | * 1 | 1 | 1 | 512 |
Wolfgang Betz |
4:566f2c41dc1d | 120 | * |
Wolfgang Betz |
4:566f2c41dc1d | 121 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 122 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 123 | #define HTS221_RES_CONF_ADDR 0x10 |
Wolfgang Betz |
4:566f2c41dc1d | 124 | |
Wolfgang Betz |
4:566f2c41dc1d | 125 | |
Wolfgang Betz |
4:566f2c41dc1d | 126 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 127 | * @brief INFO Register (LSB data) |
Wolfgang Betz |
4:566f2c41dc1d | 128 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 129 | * Read/write |
Wolfgang Betz |
4:566f2c41dc1d | 130 | * Default value: 0x00 |
Wolfgang Betz |
4:566f2c41dc1d | 131 | * 7:0 INFO7-INFO0: Lower part of the INFO reference |
Wolfgang Betz |
4:566f2c41dc1d | 132 | * used for traceability of the sample. |
Wolfgang Betz |
4:566f2c41dc1d | 133 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 134 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 135 | #define HTS221_INFO_L_ADDR 0x1E |
Wolfgang Betz |
4:566f2c41dc1d | 136 | |
Wolfgang Betz |
4:566f2c41dc1d | 137 | |
Wolfgang Betz |
4:566f2c41dc1d | 138 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 139 | * @brief INFO & Calibration Version Register (LSB data) |
Wolfgang Betz |
4:566f2c41dc1d | 140 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 141 | * Read/write |
Wolfgang Betz |
4:566f2c41dc1d | 142 | * Default value: 0x00 |
Wolfgang Betz |
4:566f2c41dc1d | 143 | * 7:6 CALVER1:CALVER0 |
Wolfgang Betz |
4:566f2c41dc1d | 144 | * 5:0 INFO13-INFO8: Higher part of the INFO reference |
Wolfgang Betz |
4:566f2c41dc1d | 145 | * used for traceability of the sample. |
Wolfgang Betz |
4:566f2c41dc1d | 146 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 147 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 148 | #define HTS221_INFO_H_ADDR 0x1F |
Wolfgang Betz |
4:566f2c41dc1d | 149 | |
Wolfgang Betz |
4:566f2c41dc1d | 150 | |
Wolfgang Betz |
4:566f2c41dc1d | 151 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 152 | * @brief Humidity sensor control register 1 |
Wolfgang Betz |
4:566f2c41dc1d | 153 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 154 | * Read/write |
Wolfgang Betz |
4:566f2c41dc1d | 155 | * Default value: 0x00 |
Wolfgang Betz |
4:566f2c41dc1d | 156 | * 7 PD: power down control. 0 - disable; 1 - enable |
Wolfgang Betz |
4:566f2c41dc1d | 157 | * 6:3 RFU |
Wolfgang Betz |
4:566f2c41dc1d | 158 | * 2 BDU: block data update. 0 - disable; 1 - enable |
Wolfgang Betz |
4:566f2c41dc1d | 159 | * 1:0 RFU |
Wolfgang Betz |
4:566f2c41dc1d | 160 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 166 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 167 | * @brief Humidity sensor control register 2 |
Wolfgang Betz |
4:566f2c41dc1d | 168 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 169 | * Read/write |
Wolfgang Betz |
4:566f2c41dc1d | 170 | * Default value: 0x00 |
Wolfgang Betz |
4:566f2c41dc1d | 171 | * 7 BOOT: Reboot memory content. 0: normal mode; 1: reboot memory content |
Wolfgang Betz |
4:566f2c41dc1d | 172 | * 6:3 Reserved. |
Wolfgang Betz |
4:566f2c41dc1d | 173 | * 2 Reserved. |
Wolfgang Betz |
4:566f2c41dc1d | 174 | * 1 Reserved. |
Wolfgang Betz |
4:566f2c41dc1d | 175 | * 0 ONE_SHOT: One shot enable. 0: waiting for start of conversion; 1: start for a new dataset |
Wolfgang Betz |
4:566f2c41dc1d | 176 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 177 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 178 | #define HTS221_CTRL_REG2_ADDR 0x21 |
Wolfgang Betz |
4:566f2c41dc1d | 179 | |
Wolfgang Betz |
4:566f2c41dc1d | 180 | |
Wolfgang Betz |
4:566f2c41dc1d | 181 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 182 | * @brief Humidity sensor control register 3 |
Wolfgang Betz |
4:566f2c41dc1d | 183 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 184 | * Read/write |
Wolfgang Betz |
4:566f2c41dc1d | 185 | * Default value: 0x00 |
Wolfgang Betz |
4:566f2c41dc1d | 186 | * [7] DRDY_H_L: Data Ready output signal active high, low (0: active high -default;1: active low) |
Wolfgang Betz |
4:566f2c41dc1d | 187 | * [6] PP_OD: Push-pull / Open Drain selection on pin 3 (DRDY) (0: push-pull - default; 1: open drain) |
Wolfgang Betz |
4:566f2c41dc1d | 188 | * [5:3] Reserved |
Wolfgang Betz |
4:566f2c41dc1d | 189 | * [2] DRDY_EN: Data Ready enable (0: Data Ready disabled - default;1: Data Ready signal available on pin 3) |
Wolfgang Betz |
4:566f2c41dc1d | 190 | * [1:0] Reserved |
Wolfgang Betz |
4:566f2c41dc1d | 191 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 192 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 193 | #define HTS221_CTRL_REG3_ADDR 0x22 |
Wolfgang Betz |
4:566f2c41dc1d | 194 | |
Wolfgang Betz |
4:566f2c41dc1d | 195 | |
Wolfgang Betz |
4:566f2c41dc1d | 196 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 197 | * @brief Status Register |
Wolfgang Betz |
4:566f2c41dc1d | 198 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 199 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 200 | * Default value: 0x00 |
Wolfgang Betz |
4:566f2c41dc1d | 201 | * 7:2 RFU |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 204 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 205 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 206 | #define HTS221_STATUS_REG_ADDR 0x27 |
Wolfgang Betz |
4:566f2c41dc1d | 207 | |
Wolfgang Betz |
4:566f2c41dc1d | 208 | |
Wolfgang Betz |
4:566f2c41dc1d | 209 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 210 | * @brief Humidity data (LSB). |
Wolfgang Betz |
4:566f2c41dc1d | 211 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 212 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 213 | * Default value: 0x00. |
Wolfgang Betz |
4:566f2c41dc1d | 214 | * POUT7 - POUT0: Humidity data LSB (2's complement) => signed 16 bits |
Wolfgang Betz |
4:566f2c41dc1d | 215 | * RAW Humidity output data: Hout(%)=(HUMIDITY_OUT_H & HUMIDITY_OUT_L). |
Wolfgang Betz |
4:566f2c41dc1d | 216 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 221 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 222 | * @brief Humidity data (MSB). |
Wolfgang Betz |
4:566f2c41dc1d | 223 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 224 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 225 | * Default value: 0x00. |
Wolfgang Betz |
4:566f2c41dc1d | 226 | * POUT7 - POUT0: Humidity data LSB (2's complement) => signed 16 bits |
Wolfgang Betz |
4:566f2c41dc1d | 227 | * RAW Humidity output data: Hout(%)=(HUMIDITY_OUT_H & HUMIDITY_OUT_L). |
Wolfgang Betz |
4:566f2c41dc1d | 228 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 233 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 234 | * @brief Temperature data (LSB). |
Wolfgang Betz |
4:566f2c41dc1d | 235 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 236 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 237 | * Default value: 0x00. |
Wolfgang Betz |
4:566f2c41dc1d | 238 | * TOUT7 - TOUT0: temperature data LSB (2's complement) => signed 16 bits |
Wolfgang Betz |
4:566f2c41dc1d | 239 | * RAW Temperature output data: Tout (LSB)=(TEMP_OUT_H & TEMP_OUT_L). |
Wolfgang Betz |
4:566f2c41dc1d | 240 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 245 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 246 | * @brief Temperature data (MSB). |
Wolfgang Betz |
4:566f2c41dc1d | 247 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 248 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 249 | * Default value: 0x00. |
Wolfgang Betz |
4:566f2c41dc1d | 250 | * TOUT15 - TOUT8: temperature data MSB (2's complement) => signed 16 bits |
Wolfgang Betz |
4:566f2c41dc1d | 251 | * RAW Temperature output data: Tout (LSB)=(TEMP_OUT_H & TEMP_OUT_L). |
Wolfgang Betz |
4:566f2c41dc1d | 252 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 257 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 258 | *@brief Humidity 0 Register in %RH with sensitivity=2 |
Wolfgang Betz |
4:566f2c41dc1d | 259 | *\code |
Wolfgang Betz |
4:566f2c41dc1d | 260 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 261 | * Value: (Unsigned 8 Bit)/2 |
Wolfgang Betz |
4:566f2c41dc1d | 262 | *\endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 267 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 268 | *@brief Humidity 1 Register in %RH with sensitivity=2 |
Wolfgang Betz |
4:566f2c41dc1d | 269 | *\code |
Wolfgang Betz |
4:566f2c41dc1d | 270 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 271 | * Value: (Unsigned 8 Bit)/2 |
Wolfgang Betz |
4:566f2c41dc1d | 272 | *\endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 277 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 278 | *@brief Temperature 0 Register in deg with sensitivity=8 |
Wolfgang Betz |
4:566f2c41dc1d | 279 | *\code |
Wolfgang Betz |
4:566f2c41dc1d | 280 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 281 | * Value: (Unsigned 16 Bit)/2 |
Wolfgang Betz |
4:566f2c41dc1d | 282 | *\endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 287 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 288 | *@brief Temperature 1 Register in deg with sensitivity=8 |
Wolfgang Betz |
4:566f2c41dc1d | 289 | *\code |
Wolfgang Betz |
4:566f2c41dc1d | 290 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 291 | * Value: (Unsigned 16 Bit)/2 |
Wolfgang Betz |
4:566f2c41dc1d | 292 | *\endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 297 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 298 | *@brief Temperature 1/0 MSB Register in deg with sensitivity=8 |
Wolfgang Betz |
4:566f2c41dc1d | 299 | *\code |
Wolfgang Betz |
4:566f2c41dc1d | 300 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 301 | * Value: (Unsigned 16 Bit)/2 |
Wolfgang Betz |
4:566f2c41dc1d | 302 | * 3:2 T1(9):T1(8) MSB T1_degC_X8 bits |
Wolfgang Betz |
4:566f2c41dc1d | 303 | * 1:0 T0(9):T0(8) MSB T0_degC_X8 bits |
Wolfgang Betz |
4:566f2c41dc1d | 304 | *\endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 309 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 310 | *@brief Humidity LOW CALIBRATION Register |
Wolfgang Betz |
4:566f2c41dc1d | 311 | *\code |
Wolfgang Betz |
4:566f2c41dc1d | 312 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 313 | * Default value: 0x00. |
Wolfgang Betz |
4:566f2c41dc1d | 314 | * H0_T0_TOUT7 - H0_T0_TOUT0: HUMIDITY data lSB (2's complement) => signed 16 bits |
Wolfgang Betz |
4:566f2c41dc1d | 315 | *\endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 320 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 321 | *@brief Humidity LOW CALIBRATION Register |
Wolfgang Betz |
4:566f2c41dc1d | 322 | *\code |
Wolfgang Betz |
4:566f2c41dc1d | 323 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 324 | * Default value: 0x00. |
Wolfgang Betz |
4:566f2c41dc1d | 325 | * H0_T0_TOUT15 - H0_T0_TOUT8: HUMIDITY data mSB (2's complement) => signed 16 bits |
Wolfgang Betz |
4:566f2c41dc1d | 326 | *\endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 331 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 332 | *@brief Humidity HIGH CALIBRATION Register |
Wolfgang Betz |
4:566f2c41dc1d | 333 | *\code |
Wolfgang Betz |
4:566f2c41dc1d | 334 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 335 | * Default value: 0x00. |
Wolfgang Betz |
4:566f2c41dc1d | 336 | * H1_T0_TOUT7 - H1_T0_TOUT0: HUMIDITY data lSB (2's complement) => signed 16 bits |
Wolfgang Betz |
4:566f2c41dc1d | 337 | *\endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 342 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 343 | *@brief Humidity HIGH CALIBRATION Register |
Wolfgang Betz |
4:566f2c41dc1d | 344 | *\code |
Wolfgang Betz |
4:566f2c41dc1d | 345 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 346 | * Default value: 0x00. |
Wolfgang Betz |
4:566f2c41dc1d | 347 | * H1_T0_TOUT15 - H1_T0_TOUT8: HUMIDITY data mSB (2's complement) => signed 16 bits |
Wolfgang Betz |
4:566f2c41dc1d | 348 | *\endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 353 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 354 | * @brief Low Calibration Temperature Register (LSB). |
Wolfgang Betz |
4:566f2c41dc1d | 355 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 356 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 357 | * Default value: 0x00. |
Wolfgang Betz |
4:566f2c41dc1d | 358 | * T0_OUT7 - T0_OUT0: temperature data LSB (2's complement) => signed 16 bits |
Wolfgang Betz |
4:566f2c41dc1d | 359 | * RAW LOW Calibration data: T0_OUT (LSB)=(T0_OUT_H & T0_OUT_L). |
Wolfgang Betz |
4:566f2c41dc1d | 360 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 365 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 366 | * @brief Low Calibration Temperature Register (MSB) |
Wolfgang Betz |
4:566f2c41dc1d | 367 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 368 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 369 | * Default value: 0x00. |
Wolfgang Betz |
4:566f2c41dc1d | 370 | * T0_OUT15 - T0_OUT8: temperature data MSB (2's complement) => signed 16 bits |
Wolfgang Betz |
4:566f2c41dc1d | 371 | * RAW LOW Calibration data: T0_OUT (LSB)=(T0_OUT_H & T0_OUT_L). |
Wolfgang Betz |
4:566f2c41dc1d | 372 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 377 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 378 | * @brief Low Calibration Temperature Register (LSB). |
Wolfgang Betz |
4:566f2c41dc1d | 379 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 380 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 381 | * Default value: 0x00. |
Wolfgang Betz |
4:566f2c41dc1d | 382 | * T1_OUT7 - T1_OUT0: temperature data LSB (2's complement) => signed 16 bits |
Wolfgang Betz |
4:566f2c41dc1d | 383 | * RAW LOW Calibration data: T1_OUT (LSB)=(T1_OUT_H & T1_OUT_L). |
Wolfgang Betz |
4:566f2c41dc1d | 384 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 389 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 390 | * @brief Low Calibration Temperature Register (MSB) |
Wolfgang Betz |
4:566f2c41dc1d | 391 | * \code |
Wolfgang Betz |
4:566f2c41dc1d | 392 | * Read |
Wolfgang Betz |
4:566f2c41dc1d | 393 | * Default value: 0x00. |
Wolfgang Betz |
4:566f2c41dc1d | 394 | * T1_OUT15 - T1_OUT8: temperature data MSB (2's complement) => signed 16 bits |
Wolfgang Betz |
4:566f2c41dc1d | 395 | * RAW LOW Calibration data: T1_OUT (LSB)=(T1_OUT_H & T1_OUT_L). |
Wolfgang Betz |
4:566f2c41dc1d | 396 | * \endcode |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 407 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 408 | #define HTS221_I2C_MULTIPLEBYTE_CMD ((uint8_t)0x80) |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 543 | |
Wolfgang Betz |
4:566f2c41dc1d | 544 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 545 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 546 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 547 | |
Wolfgang Betz |
4:566f2c41dc1d | 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 |
4:566f2c41dc1d | 554 | extern HUM_TEMP_StatusTypeDef HTS221_IO_Write(uint8_t* pBuffer, uint8_t DeviceAddr, uint8_t RegisterAddr, uint16_t NumByteToWrite); |
Wolfgang Betz |
4:566f2c41dc1d | 555 | extern HUM_TEMP_StatusTypeDef HTS221_IO_Read(uint8_t* pBuffer, uint8_t DeviceAddr, uint8_t RegisterAddr, uint16_t NumByteToRead); |
Wolfgang Betz |
4:566f2c41dc1d | 556 | extern void HTS221_IO_ITConfig( void ); |
Wolfgang Betz |
4:566f2c41dc1d | 557 | |
Wolfgang Betz |
4:566f2c41dc1d | 558 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 559 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 560 | */ |
Wolfgang Betz |
3:088aa5839e0d | 561 | |
Wolfgang Betz |
4:566f2c41dc1d | 562 | /* ------------------------------------------------------- */ |
Wolfgang Betz |
4:566f2c41dc1d | 563 | /* Here you should declare the internal struct of */ |
Wolfgang Betz |
4:566f2c41dc1d | 564 | /* extended features of HTS221. See the example of */ |
Wolfgang Betz |
4:566f2c41dc1d | 565 | /* LSM6DS3 in lsm6ds3.h */ |
Wolfgang Betz |
4:566f2c41dc1d | 566 | /* ------------------------------------------------------- */ |
Wolfgang Betz |
4:566f2c41dc1d | 567 | |
Wolfgang Betz |
4:566f2c41dc1d | 568 | /** @addtogroup HTS221_Exported_Variables HTS221_Exported_Variables |
Wolfgang Betz |
4:566f2c41dc1d | 569 | * @{ |
Wolfgang Betz |
4:566f2c41dc1d | 570 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 571 | /* HUM_TEMP sensor driver structure */ |
Wolfgang Betz |
4:566f2c41dc1d | 572 | extern HUM_TEMP_DrvTypeDef Hts221Drv; |
Wolfgang Betz |
4:566f2c41dc1d | 573 | extern HUM_TEMP_DrvExtTypeDef Hts221Drv_ext; |
Wolfgang Betz |
4:566f2c41dc1d | 574 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 575 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 576 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 577 | |
Wolfgang Betz |
4:566f2c41dc1d | 578 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 579 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 580 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 581 | |
Wolfgang Betz |
4:566f2c41dc1d | 582 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 583 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 584 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 585 | |
Wolfgang Betz |
4:566f2c41dc1d | 586 | /** |
Wolfgang Betz |
4:566f2c41dc1d | 587 | * @} |
Wolfgang Betz |
4:566f2c41dc1d | 588 | */ |
Wolfgang Betz |
4:566f2c41dc1d | 589 | |
Wolfgang Betz |
4:566f2c41dc1d | 590 | #ifdef __cplusplus |
Wolfgang Betz |
4:566f2c41dc1d | 591 | } |
Wolfgang Betz |
4:566f2c41dc1d | 592 | #endif |
Wolfgang Betz |
4:566f2c41dc1d | 593 | |
Wolfgang Betz |
4:566f2c41dc1d | 594 | #endif /* __HTS221_H */ |
Wolfgang Betz |
4:566f2c41dc1d | 595 | |
Wolfgang Betz |
4:566f2c41dc1d | 596 | |
Wolfgang Betz |
4:566f2c41dc1d | 597 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |