88b4754e493c93c069216002bd1d090bb3641ab6
AHT20_VER_MAJOR/MINOR/PATCH were only defined via Espressif's cu_pkg_define_version CMake helper (espressif__cmake_utilities), which this fork no longer depends on.
espidf_i2c
Forked/rewritten ESP-IDF I2C sensor drivers, unified onto the native
driver/i2c_master.h API (ESP-IDF >= 5.3) so every sensor shares the same
handle lifecycle instead of each vendor bringing its own I2C abstraction
(i2c_bus, i2cdev, etc.).
Common API convention
Every driver in this repo follows the same shape:
typedef void *xxx_handle_t;
esp_err_t xxx_create(i2c_master_bus_handle_t bus_handle, uint8_t dev_addr, xxx_handle_t *handle_ret);
esp_err_t xxx_delete(xxx_handle_t handle);
// ... device-specific read/measure functions taking xxx_handle_t
Callers create one i2c_master_bus_handle_t via i2c_new_master_bus() and
pass it to each sensor's _create(), which internally calls
i2c_master_bus_add_device(). No sensor wraps the bus a second time.
Components
bh1750/— ambient light sensor. Already used the native API upstream; relocated here unchanged.aht20/— temperature/humidity sensor. Rewritten from Espressif'si2c_buscomponent ontoi2c_master_transmit/i2c_master_receive.sgp40/— VOC index sensor. Rewritten from esp-idf-lib'si2cdevcomponent ontoi2c_master_transmit/i2c_master_receive; the Sensirion VOC algorithm files are carried over unmodified (no I2C dependency).
Using from a project
dependencies:
laz/bh1750:
git: https://git.jeese.fr/laz/espidf_i2c.git
path: bh1750
laz/aht20:
git: https://git.jeese.fr/laz/espidf_i2c.git
path: aht20
laz/sgp40:
git: https://git.jeese.fr/laz/espidf_i2c.git
path: sgp40
Description
Languages
C
99.4%
CMake
0.6%