diff --git a/bsp/lpc54608-LPCXpresso/drivers/drv_i2c.c b/bsp/lpc54608-LPCXpresso/drivers/drv_i2c.c index 2d9a3c4d17..39e08af2d3 100644 --- a/bsp/lpc54608-LPCXpresso/drivers/drv_i2c.c +++ b/bsp/lpc54608-LPCXpresso/drivers/drv_i2c.c @@ -56,7 +56,7 @@ static void gpio_set_scl(void *data, rt_int32_t state) else { //bd->scl.base->B[bd->sda.port][bd->sda.pin] = 0; - GPIO_WritePinOutput(bd->scl.base, bd->scl.port, bd->scl.pin, 1); + GPIO_WritePinOutput(bd->scl.base, bd->scl.port, bd->scl.pin, 0); } } @@ -244,6 +244,9 @@ int rt_hw_i2c_init(void) GPIO_PinInit(GPIO, _i2c_bdata.sda.port, _i2c_bdata.sda.pin, &pin_config); GPIO_PinInit(GPIO, _i2c_bdata.scl.port, _i2c_bdata.scl.pin, &pin_config); + GPIO_WritePinOutput(GPIO, _i2c_bdata.sda.port, _i2c_bdata.sda.pin, 1); + GPIO_WritePinOutput(GPIO, _i2c_bdata.scl.port, _i2c_bdata.scl.pin, 1); + i2c_device.priv = (void *)&_i2c_bit_ops; rt_i2c_bit_add_bus(&i2c_device, "i2c2"); } /* register I2C */