Statistics: Posted by eriksl — Mon Oct 10, 2016 9:37 pm
Statistics: Posted by gemborow — Thu Sep 22, 2016 6:33 am
Statistics: Posted by ESP_Vincent — Fri May 13, 2016 3:11 pm
Code:
#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
Code:
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 ;
}
Statistics: Posted by systemsconnect — Mon Jan 18, 2016 7:51 pm