nekromant / esp8266-frankenstein

Alternative firmware for ESP8266 modules
318 stars 71 forks source link

SI7020 temperature/humidity sensor and minor tweaks to i2c_master.c #75

Closed hpeyerl closed 9 years ago

hpeyerl commented 9 years ago

In the process of adding a driver for the SI7020 temp/humidity sensor, I needed to implement clock stretching per the I2C spec. The SI7020 takes a while to gather samples so it will hold SCL low until it's ready. So after issuing the read request, we wait for SCL to go high before reading... This should have zero effect on other devices.

Also when reading multiple bytes, send ACK's after each byte except for the last one.

nekromant commented 9 years ago

Thanks, merged!