whitecatboard / Lua-RTOS-ESP32

Lua RTOS for ESP32
Other
1.19k stars 221 forks source link

hw i2c & sensor module #13

Closed loboris closed 7 years ago

loboris commented 7 years ago

As isp-idf now supports hw i2c, I've changed the i2c module. Software i2c is removed and only the hw i2c is now used. Only i2c master mode is supported for now. The module is tested and works as expected. I've also added the sensor module, for now support for BME280 sensor (in i2c mode) is added. All related patches are in i2c_sensor.patch.zip You can also check my Lua-RTOS-ESP32 fork

Best regards.

jolivepetrus commented 7 years ago

Hi loboris,

We will create a new branch for give support to i2c in Lua RTOS. I took a look at your proposal for i2c driver and I have some comments about it:

The ADC driver is a good example for know more about this.

loboris commented 7 years ago

Thanks for your comments, especially about driver_lock function, I've somehow missed it.

jolivepetrus commented 7 years ago

You have i2c driver and i2c Lua module in master branch see commit https://github.com/whitecatboard/Lua-RTOS-ESP32/commit/bb446ad1a4d75995a4f5d0124151914f65cb6ab4 . We have to write the wiki for this module, but you have an example in (https://github.com/whitecatboard/Lua-RTOS-ESP32/blob/master/components/spiffs_image/image/examples/lua/i2c.lua).

For sensors we are thinking about a more elaborate strategy that fits better with our educational perpectives. Some ideas about that: