class IMU nucleo

Dependents:   Coupe-Robotique-FIP-Main

Fork of IMU_FIP by Robotique FIP

Committer:
quentin9696
Date:
Thu May 21 11:21:58 2015 +0000
Revision:
5:e2e603447679
Parent:
0:528e23a13fb7

        

Who changed what in which revision?

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