mirror of
https://github.com/esphome/esphome.git
synced 2025-10-30 06:33:51 +00:00
[i2c] Use `i2c_master_probe` to scan i2c bus (#9831)
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
#ifdef USE_ESP_IDF
|
||||
|
||||
#include "esp_idf_version.h"
|
||||
#include "esphome/core/component.h"
|
||||
#include "i2c_bus.h"
|
||||
#include "esp_idf_version.h"
|
||||
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 2)
|
||||
#include <driver/i2c_master.h>
|
||||
#else
|
||||
@@ -46,6 +46,7 @@ class IDFI2CBus : public InternalI2CBus, public Component {
|
||||
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 2)
|
||||
i2c_master_dev_handle_t dev_;
|
||||
i2c_master_bus_handle_t bus_;
|
||||
void i2c_scan() override;
|
||||
#endif
|
||||
i2c_port_t port_;
|
||||
uint8_t sda_pin_;
|
||||
|
||||
Reference in New Issue
Block a user