Is it possible to use GPIO13 and GPIO12 for I2C communications? I'm not sure if it's working on these pins.
I'm using a ESP12 board and SDK v1.5.1 .
I've changed the SDA pin to 13 and SCL to 12 in i2c_master.h file but no response is received.
Code: Select all
#define PERIPHS_IO_MUX_GPIO13_U (PERIPHS_IO_MUX + 0x8)
#define PERIPHS_IO_MUX_GPIO12_U (PERIPHS_IO_MUX + 0x4)
#define I2C_MASTER_SDA_MUX PERIPHS_IO_MUX_GPIO13_U
#define I2C_MASTER_SCL_MUX PERIPHS_IO_MUX_GPIO12_U
#define I2C_MASTER_SDA_GPIO 13
#define I2C_MASTER_SCL_GPIO 12
#define I2C_MASTER_SDA_FUNC FUNC_GPIO13
#define I2C_MASTER_SCL_FUNC FUNC_GPIO12
Sensor read code on i2c:
Code: Select all
i2c_master_start();
i2c_master_writeByte(_i2caddr);
uint8 ack = i2c_master_getAck();
if (ack) {
char info[50];
os_sprintf(info, "addr %d not ack for reset\r\n", _i2caddr);
uart0_sendStr(info);
i2c_master_stop();
return ;
}