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