Home | History | Annotate | Line # | Download | only in i2c
      1 /*	$NetBSD: sht4xreg.h,v 1.2 2022/05/24 06:28:01 andvar Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 2021 Brad Spencer <brad (at) anduin.eldar.org>
      5  *
      6  * Permission to use, copy, modify, and distribute this software for any
      7  * purpose with or without fee is hereby granted, provided that the above
      8  * copyright notice and this permission notice appear in all copies.
      9  *
     10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     17  */
     18 
     19 #ifndef _DEV_I2C_SHT4XREG_H_
     20 #define _DEV_I2C_SHT4XREG_H_
     21 
     22 #define SHT4X_TYPICAL_ADDR	0x44
     23 
     24 #define SHT4X_READ_SERIAL 0x89
     25 #define SHT4X_SOFT_RESET 0x94
     26 
     27 /* If you do not use the heater, you can take measurements at a couple
     28    of different precisions */
     29 #define SHT4X_MEASURE_HIGH_PRECISION 0xFD
     30 #define SHT4X_MEASURE_MEDIUM_PRECISION 0xF6
     31 #define SHT4X_MEASURE_LOW_PRECISION 0xE0
     32 
     33 /* The SHT4X chip only support the heater when reading with the
     34    highest precision and then only when the measurement is happening.
     35    You can have the heater on for 1 second or 1 tenth of a second.
     36    After the measurement the heater will switch itself off */
     37 #define SHT4X_MEASURE_HIGH_PRECISION_HIGH_HEAT_1_S 0x39
     38 #define SHT4X_MEASURE_HIGH_PRECISION_HIGH_HEAT_TENTH_S 0x32
     39 #define SHT4X_MEASURE_HIGH_PRECISION_MEDIUM_HEAT_1_S 0x2F
     40 #define SHT4X_MEASURE_HIGH_PRECISION_MEDIUM_HEAT_TENTH_S 0x24
     41 #define SHT4X_MEASURE_HIGH_PRECISION_LOW_HEAT_1_S 0x1E
     42 #define SHT4X_MEASURE_HIGH_PRECISION_LOW_HEAT_TENTH_S 0x15
     43 
     44 #endif
     45