Added support new I2C driver for ESP32

This commit is contained in:
2024-06-16 14:06:12 +03:00
parent c2aa5f5eeb
commit 319a85be60
2 changed files with 14 additions and 15 deletions

View File

@@ -10,12 +10,6 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#ifdef CONFIG_IDF_TARGET_ESP8266
typedef struct
{
} i2c_master_bus_handle_t;
#endif
/**
* @brief Default values for zh_bh1750_init_config_t structure for initial initialization of the sensor.
*
@@ -25,8 +19,7 @@ typedef struct
.i2c_address = I2C_ADDRESS_LOW, \
.operation_mode = HIGH_RESOLUTION, \
.work_mode = ONE_TIME, \
.i2c_port = 0, \
.i2c_handle = 0 \
.i2c_port = 0 \
}
#ifdef __cplusplus
@@ -59,8 +52,11 @@ extern "C"
CONTINUOUSLY, // Continuously measurement.
ONE_TIME // One time measurement. Sensor is power down after measurement.
} work_mode;
bool i2c_port; // I2C port.
bool i2c_port; // I2C port.
#ifndef CONFIG_IDF_TARGET_ESP8266
i2c_master_bus_handle_t i2c_handle; // Unique I2C bus handle.
#endif
} zh_bh1750_init_config_t;
/**