HTS221
Arduino library for the HTS221 humidity and temperature sensor
Loading...
Searching...
No Matches
Collaboration diagram for HTS221_Registers:

Macros

#define HTS221_WHO_AM_I_REG   (uint8_t)0x0F
 Device Identification register.
 
#define HTS221_WHO_AM_I_VAL   (uint8_t)0xBC
 Device Identification value.
 
#define HTS221_AV_CONF_REG   (uint8_t)0x10
 Humidity and temperature average mode register.
 
#define HTS221_AVGT_BIT   HTS221_BIT(3)
 
#define HTS221_AVGH_BIT   HTS221_BIT(0)
 
#define HTS221_AVGH_MASK   (uint8_t)0x07
 
#define HTS221_AVGT_MASK   (uint8_t)0x38
 
#define HTS221_CTRL_REG1   (uint8_t)0x20
 Control register 1.
 
#define HTS221_PD_BIT   HTS221_BIT(7)
 
#define HTS221_BDU_BIT   HTS221_BIT(2)
 
#define HTS221_ODR_BIT   HTS221_BIT(0)
 
#define HTS221_PD_MASK   (uint8_t)0x80
 
#define HTS221_BDU_MASK   (uint8_t)0x04
 
#define HTS221_ODR_MASK   (uint8_t)0x03
 
#define HTS221_CTRL_REG2   (uint8_t)0x21
 Control register 2.
 
#define HTS221_BOOT_BIT   HTS221_BIT(7)
 
#define HTS221_HEATER_BIT   HTS221_BIT(1)
 
#define HTS221_ONESHOT_BIT   HTS221_BIT(0)
 
#define HTS221_BOOT_MASK   (uint8_t)0x80
 
#define HTS221_HEATER_MASK   (uint8_t)0x02
 
#define HTS221_ONE_SHOT_MASK   (uint8_t)0x01
 
#define HTS221_CTRL_REG3   (uint8_t)0x22
 Control register 3.
 
#define HTS221_DRDY_H_L_BIT   HTS221_BIT(7)
 
#define HTS221_PP_OD_BIT   HTS221_BIT(6)
 
#define HTS221_DRDY_BIT   HTS221_BIT(2)
 
#define HTS221_DRDY_H_L_MASK   (uint8_t)0x80
 
#define HTS221_PP_OD_MASK   (uint8_t)0x40
 
#define HTS221_DRDY_MASK   (uint8_t)0x04
 
#define HTS221_STATUS_REG   (uint8_t)0x27
 Status register.
 
#define HTS221_H_DA_BIT   HTS221_BIT(1)
 
#define HTS221_T_DA_BIT   HTS221_BIT(0)
 
#define HTS221_HDA_MASK   (uint8_t)0x02
 
#define HTS221_TDA_MASK   (uint8_t)0x01
 
#define HTS221_HR_OUT_L_REG   (uint8_t)0x28
 Humidity data (LSB).
 
#define HTS221_HR_OUT_H_REG   (uint8_t)0x29
 Humidity data (MSB).
 
#define HTS221_TEMP_OUT_L_REG   (uint8_t)0x2A
 Temperature data (LSB).
 
#define HTS221_TEMP_OUT_H_REG   (uint8_t)0x2B
 Temperature data (MSB).
 
#define HTS221_H0_RH_X2   (uint8_t)0x30
 Calibration registers.
 
#define HTS221_H1_RH_X2   (uint8_t)0x31
 
#define HTS221_T0_DEGC_X8   (uint8_t)0x32
 
#define HTS221_T1_DEGC_X8   (uint8_t)0x33
 
#define HTS221_T0_T1_DEGC_H2   (uint8_t)0x35
 
#define HTS221_H0_T0_OUT_L   (uint8_t)0x36
 
#define HTS221_H0_T0_OUT_H   (uint8_t)0x37
 
#define HTS221_H1_T0_OUT_L   (uint8_t)0x3A
 
#define HTS221_H1_T0_OUT_H   (uint8_t)0x3B
 
#define HTS221_T0_OUT_L   (uint8_t)0x3C
 
#define HTS221_T0_OUT_H   (uint8_t)0x3D
 
#define HTS221_T1_OUT_L   (uint8_t)0x3E
 
#define HTS221_T1_OUT_H   (uint8_t)0x3F
 

Detailed Description

Macro Definition Documentation

◆ HTS221_AV_CONF_REG

#define HTS221_AV_CONF_REG   (uint8_t)0x10

Humidity and temperature average mode register.

Read/write
Default value: 0x1B
7:6 Reserved.
5:3 AVGT2-AVGT1-AVGT0: Select the temperature internal average.
AVGT2 | AVGT1 | AVGT0 | Nr. Internal Average
----------------------------------------------------
0 | 0 | 0 | 2
0 | 0 | 1 | 4
0 | 1 | 0 | 8
0 | 1 | 1 | 16
1 | 0 | 0 | 32
1 | 0 | 1 | 64
1 | 1 | 0 | 128
1 | 1 | 1 | 256
2:0 AVGH2-AVGH1-AVGH0: Select humidity internal average.
AVGH2 | AVGH1 | AVGH0 | Nr. Internal Average
------------------------------------------------------
0 | 0 | 0 | 4
0 | 0 | 1 | 8
0 | 1 | 0 | 16
0 | 1 | 1 | 32
1 | 0 | 0 | 64
1 | 0 | 1 | 128
1 | 1 | 0 | 256
1 | 1 | 1 | 512

◆ HTS221_AVGH_BIT

#define HTS221_AVGH_BIT   HTS221_BIT(0)

◆ HTS221_AVGH_MASK

#define HTS221_AVGH_MASK   (uint8_t)0x07

◆ HTS221_AVGT_BIT

#define HTS221_AVGT_BIT   HTS221_BIT(3)

◆ HTS221_AVGT_MASK

#define HTS221_AVGT_MASK   (uint8_t)0x38

◆ HTS221_BDU_BIT

#define HTS221_BDU_BIT   HTS221_BIT(2)

◆ HTS221_BDU_MASK

#define HTS221_BDU_MASK   (uint8_t)0x04

◆ HTS221_BOOT_BIT

#define HTS221_BOOT_BIT   HTS221_BIT(7)

◆ HTS221_BOOT_MASK

#define HTS221_BOOT_MASK   (uint8_t)0x80

◆ HTS221_CTRL_REG1

#define HTS221_CTRL_REG1   (uint8_t)0x20

Control register 1.

Read/write
Default value: 0x00
7 PD: power down control. 0 - power down mode; 1 - active mode.
6:3 Reserved.
2 BDU: block data update. 0 - continuous update; 1 - output registers not updated until MSB and LSB reading.
1:0 ODR1, ODR0: output data rate selection.
ODR1 | ODR0 | Humidity output data-rate(Hz) | Temperature output data-rate(Hz)
----------------------------------------------------------------------------------
0 | 0 | one shot | one shot
0 | 1 | 1 | 1
1 | 0 | 7 | 7
1 | 1 | 12.5 | 12.5

◆ HTS221_CTRL_REG2

#define HTS221_CTRL_REG2   (uint8_t)0x21

Control register 2.

Read/write
Default value: 0x00
7 BOOT: Reboot memory content. 0: normal mode; 1: reboot memory content. Self-cleared upon completation.
6:2 Reserved.
1 HEATER: 0: heater disable; 1: heater enable.
0 ONE_SHOT: 0: waiting for start of conversion; 1: start for a new dataset. Self-cleared upon completation.

◆ HTS221_CTRL_REG3

#define HTS221_CTRL_REG3   (uint8_t)0x22

Control register 3.

Read/write
Default value: 0x00
7 DRDY_H_L: Interrupt edge. 0: active high, 1: active low.
6 PP_OD: Push-Pull/OpenDrain selection on interrupt pads. 0: push-pull; 1: open drain.
5:3 Reserved.
2 DRDY: interrupt config. 0: disable, 1: enable.

◆ HTS221_DRDY_BIT

#define HTS221_DRDY_BIT   HTS221_BIT(2)

◆ HTS221_DRDY_H_L_BIT

#define HTS221_DRDY_H_L_BIT   HTS221_BIT(7)

◆ HTS221_DRDY_H_L_MASK

#define HTS221_DRDY_H_L_MASK   (uint8_t)0x80

◆ HTS221_DRDY_MASK

#define HTS221_DRDY_MASK   (uint8_t)0x04

◆ HTS221_H0_RH_X2

#define HTS221_H0_RH_X2   (uint8_t)0x30

Calibration registers.

Read

◆ HTS221_H0_T0_OUT_H

#define HTS221_H0_T0_OUT_H   (uint8_t)0x37

◆ HTS221_H0_T0_OUT_L

#define HTS221_H0_T0_OUT_L   (uint8_t)0x36

◆ HTS221_H1_RH_X2

#define HTS221_H1_RH_X2   (uint8_t)0x31

◆ HTS221_H1_T0_OUT_H

#define HTS221_H1_T0_OUT_H   (uint8_t)0x3B

◆ HTS221_H1_T0_OUT_L

#define HTS221_H1_T0_OUT_L   (uint8_t)0x3A

◆ HTS221_H_DA_BIT

#define HTS221_H_DA_BIT   HTS221_BIT(1)

◆ HTS221_HDA_MASK

#define HTS221_HDA_MASK   (uint8_t)0x02

◆ HTS221_HEATER_BIT

#define HTS221_HEATER_BIT   HTS221_BIT(1)

◆ HTS221_HEATER_MASK

#define HTS221_HEATER_MASK   (uint8_t)0x02

◆ HTS221_HR_OUT_H_REG

#define HTS221_HR_OUT_H_REG   (uint8_t)0x29

Humidity data (MSB).

Read
Default value: 0x00.
HOUT15 - HOUT8: Humidity data MSB (2's complement).

◆ HTS221_HR_OUT_L_REG

#define HTS221_HR_OUT_L_REG   (uint8_t)0x28

Humidity data (LSB).

Read
Default value: 0x00.
HOUT7 - HOUT0: Humidity data LSB (2's complement).

◆ HTS221_ODR_BIT

#define HTS221_ODR_BIT   HTS221_BIT(0)

◆ HTS221_ODR_MASK

#define HTS221_ODR_MASK   (uint8_t)0x03

◆ HTS221_ONE_SHOT_MASK

#define HTS221_ONE_SHOT_MASK   (uint8_t)0x01

◆ HTS221_ONESHOT_BIT

#define HTS221_ONESHOT_BIT   HTS221_BIT(0)

◆ HTS221_PD_BIT

#define HTS221_PD_BIT   HTS221_BIT(7)

◆ HTS221_PD_MASK

#define HTS221_PD_MASK   (uint8_t)0x80

◆ HTS221_PP_OD_BIT

#define HTS221_PP_OD_BIT   HTS221_BIT(6)

◆ HTS221_PP_OD_MASK

#define HTS221_PP_OD_MASK   (uint8_t)0x40

◆ HTS221_STATUS_REG

#define HTS221_STATUS_REG   (uint8_t)0x27

Status register.

Read
Default value: 0x00
7:2 Reserved.
1 H_DA: Humidity data available. 0: new data for humidity is not yet available; 1: new data for humidity is available.
0 T_DA: Temperature data available. 0: new data for temperature is not yet available; 1: new data for temperature is available.

◆ HTS221_T0_DEGC_X8

#define HTS221_T0_DEGC_X8   (uint8_t)0x32

◆ HTS221_T0_OUT_H

#define HTS221_T0_OUT_H   (uint8_t)0x3D

◆ HTS221_T0_OUT_L

#define HTS221_T0_OUT_L   (uint8_t)0x3C

◆ HTS221_T0_T1_DEGC_H2

#define HTS221_T0_T1_DEGC_H2   (uint8_t)0x35

◆ HTS221_T1_DEGC_X8

#define HTS221_T1_DEGC_X8   (uint8_t)0x33

◆ HTS221_T1_OUT_H

#define HTS221_T1_OUT_H   (uint8_t)0x3F

◆ HTS221_T1_OUT_L

#define HTS221_T1_OUT_L   (uint8_t)0x3E

◆ HTS221_T_DA_BIT

#define HTS221_T_DA_BIT   HTS221_BIT(0)

◆ HTS221_TDA_MASK

#define HTS221_TDA_MASK   (uint8_t)0x01

◆ HTS221_TEMP_OUT_H_REG

#define HTS221_TEMP_OUT_H_REG   (uint8_t)0x2B

Temperature data (MSB).

Read
Default value: 0x00.
TOUT15 - TOUT8: temperature data MSB.

◆ HTS221_TEMP_OUT_L_REG

#define HTS221_TEMP_OUT_L_REG   (uint8_t)0x2A

Temperature data (LSB).

Read
Default value: 0x00.
TOUT7 - TOUT0: temperature data LSB.

◆ HTS221_WHO_AM_I_REG

#define HTS221_WHO_AM_I_REG   (uint8_t)0x0F

Device Identification register.

Read
Default value: 0xBC
7:0 This read-only register contains the device identifier for HTS221.

◆ HTS221_WHO_AM_I_VAL

#define HTS221_WHO_AM_I_VAL   (uint8_t)0xBC

Device Identification value.