mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-07 17:42:36 +00:00
i2c io
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
#include "freertos/semphr.h"
|
||||
#include "driver/i2c_master.h"
|
||||
|
||||
#define I2C_GPIO_SCL (22)
|
||||
#define I2C_GPIO_SDA (21)
|
||||
|
||||
typedef struct {
|
||||
SemaphoreHandle_t i2cMutex;
|
||||
uint16_t sda;
|
||||
@@ -15,8 +18,8 @@ typedef struct {
|
||||
i2c_master_bus_config_t bus_config = {
|
||||
.clk_source = I2C_CLK_SRC_DEFAULT,
|
||||
.i2c_port = I2C_NUM_0, // Use I2C_NUM_1 for second port
|
||||
.scl_io_num = 22, // Your SCL pin
|
||||
.sda_io_num = 21, // Your SDA pin
|
||||
.scl_io_num = I2C_GPIO_SCL, // Your SCL pin
|
||||
.sda_io_num = I2C_GPIO_SDA, // Your SDA pin
|
||||
.glitch_ignore_cnt = 7,
|
||||
.flags.enable_internal_pullup = true,
|
||||
};
|
||||
|
Reference in New Issue
Block a user