Skip to content

Commit b6aaf99

Browse files
authored
Make HTS221_DRDY open drain
1 parent 7f0581c commit b6aaf99

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/MKRENV.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define HTS221_WHO_AM_I_REG 0x0f
3131
#define HTS221_CTRL1_REG 0x20
3232
#define HTS221_CTRL2_REG 0x21
33+
#define HTS221_CTRL3_REG 0x22
3334
#define HTS221_STATUS_REG 0x27
3435
#define HTS221_HUMIDITY_OUT_L_REG 0x28
3536
#define HTS221_TEMP_OUT_L_REG 0x2a
@@ -87,6 +88,10 @@ int ENVClass::begin()
8788
// turn on the HTS221 and enable Block Data Update
8889
i2cWrite(HTS221_ADDRESS, HTS221_CTRL1_REG, 0x84);
8990

91+
// Disable HTS221_DRDY by default and make the output open drain
92+
// This allows to use pin D6 for other purposes (e.g. LED_BUILTIN on the Arduino MKR WAN 1300)
93+
i2cWrite(HTS221_ADDRESS, HTS221_CTRL3_REG, 0x40);
94+
9095
// configure VEML6075 for 100 ms
9196
i2cWriteWord(VEML6075_ADDRESS, VEML6075_UV_CONF_REG, 0x0010);
9297

0 commit comments

Comments
 (0)