Merge pull request #2712 from misonyo/rttdev
[bsp/lpc54608]write high to scl and sda pin after init
This commit is contained in:
commit
292d88e5e4
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue