Pim van Pelt
38500aa8d4
Add public header documentation.
2018-04-02 22:05:53 +02:00
Pim van Pelt
7263edee15
Add Adafruit datasheets
2018-04-02 21:58:01 +02:00
Pim van Pelt
e4ed4d005d
Loop once per 5 seconds.
...
Clean up CRC8 functions (style, no caps).
2018-04-02 21:50:30 +02:00
Pim van Pelt
97310e3e03
Refactor main.
...
Only create sensors once, then loop over them with do_si7021() and
do_sht31().
2018-04-02 21:46:54 +02:00
Pim van Pelt
37838f0062
SI7021: Implement Status
...
This allows us to detect if the I2C device is indeed an Si7021.
By reading status, turning the heater on, reading status, and turning
the heater off, reading status, we will see three different states:
status bit13 is 'heater on' (0=off, 1=on).
In status0, bit13 will be 0,
In status1, bit13 will be 1, (the heater is now on)
In status2, bit13 will be 0.
2018-04-02 21:40:42 +02:00
Pim van Pelt
6b0774033e
SI7021
...
Add mgos_si7021_cmd() mimicking the SHT31 driver.
2018-04-02 21:16:32 +02:00
Pim van Pelt
ff891426ab
Finish Si7021
...
Based on datasheet:
https://cdn.instructables.com/ORIG/FOR/G7DY/IHXRC1XG/FORG7DYIHXRC1XG.pdf
- Add CRC8 (poly 0x31, init 0x00)
- Add Temperature and Humidity data polling.
2018-04-02 21:11:18 +02:00
Pim van Pelt
5b0fcadd9f
Refactor I2C SMBUS
...
Add SI7021 chipset, partially done.
2018-04-02 20:38:26 +02:00
Pim van Pelt
5d92a45b58
Remove dangling file.
2018-04-02 17:59:59 +02:00
Pim van Pelt
2899ee59de
Initial (empty) Si7021 driver
2018-04-02 17:59:41 +02:00
Pim van Pelt
27bba32bd9
Remove unimplemented calls
2018-04-02 17:54:39 +02:00
Pim van Pelt
b1d92a32a8
Include first driver: SHT31
...
Make I2C reads blocking w/ timeout
Add SHT31 driver, roughly :)
Fix mg_time() to return a double.
2018-04-02 17:29:13 +02:00
Pim van Pelt
cef7c5107d
Mock out mgos_i2c.h to work with Linux.
2018-04-02 13:30:45 +02:00