Closed loboris closed 7 years ago
Fine!
My comments about owire:
.... your code ....
.... your code ....
==> now is set to 1, tipically is calculated from Kconfig options ...
You are using esp-idf gpio driver functions. It's recommended to use Lua RTOS driver functions. In the future Lua RTOS will be take care about lock resources at gpio level. If you use only Lua RTOS drivers your driver will be ported to other plarforms without any problems.
ets_delay_us ....
It's better to use alternative POSIX functions, such us delay / udelay that are available in Lua RTOS (sys/delay.h).
This is commit in the official Lua RTOS repository (see commit https://github.com/whitecatboard/Lua-RTOS-ESP32/commit/fca04c1887cea9131e0724289a235d66fa9a9bb0).
About sensors module. We are working on in since last week. Maybeit should be better to have our e-mails for work in different things and don't duplicate efforts.
my contact: jolive@iberoxarxa.com
Thanks for the comments. I'm using esp-idf functions because 1-wire timing is critical, I'll try Lua RTOS driver functions to see if there is any difference/problem. I don't think there will be locking problems, the gpio is locked when owire interface is initialized (see _components/lua_rtos/Lua/modules/sensors.c#lsensor_owinit function in my GitHub repo)
I've made some changes since I've posted sensors.patch. DS1820 is now fully tested with multiple sensors on the bus, BME280 is also fully tested. DS1820 fully supports parasite power mode, so that the sensor can be connected with only two wires. I will also add DHT-11/DHT-12 support. I've added WS2812 RGB LED driver and support for it in led module. Kcofig has config options for sensor and led modules
loboris@gmail.com
I've created the sensors module which (for now) has support for BME280 temperature/humidity/pressure sensor and 1-wire devices (for now DS1820 temperature sensors family). I've tried to write the drivers and modules according to your rules and I would appreciate If you could find some time to review the code and possible give some comments.
All patches are in the attached zip and in GitHub repository sensors.patch.zip