Add support for HTS221 capacitive digital sensor for relative humidity and temperature (#295)

hts221: Add support for hts221.go
This commit is contained in:
Alan Wang
2021-11-06 18:02:30 +08:00
committed by GitHub
parent 734adb6df8
commit cd2694e85f
6 changed files with 285 additions and 1 deletions
+27
View File
@@ -0,0 +1,27 @@
package hts221
const (
// I2C address
HTS221_ADDRESS = 0x5F
// control/status registers
HTS221_WHO_AM_I_REG = 0x0F
HTS221_AV_CONF_REG = 0x10
HTS221_CTRL1_REG = 0x20
HTS221_CTRL2_REG = 0x21
HTS221_STATUS_REG = 0x27
HTS221_HUMID_OUT_REG = 0x28
HTS221_TEMP_OUT_REG = 0x2A
// calibration registers
HTS221_H0_rH_x2_REG = 0x30
HTS221_H1_rH_x2_REG = 0x31
HTS221_T0_degC_x8_REG = 0x32
HTS221_T1_degC_x8_REG = 0x33
HTS221_T1_T0_MSB_REG = 0x35
HTS221_H0_T0_OUT_REG = 0x36
HTS221_H1_T0_OUT_REG = 0x3A
HTS221_T0_OUT_REG = 0x3C
HTS221_T1_OUT_REG = 0x3E
)