Hi,
I'm working with the demo_i2c_async.c demonstration project from the DA1468x SDK 1.0.10, and have a question about the GPIO pin configuration, specifically the Mode for the I2C signals. I see the mode setting below for the I2C_SCL is OUTPUT, and the I2C_SDA is INPUT. I would expect both of these pins would have a Mode PPOD set to Open Drain (PPOD = 1) for both SDA and SCL.
Code from file periph_setup.c:
#if CFG_DEMO_HW_I2C || CFG_AD_I2C_1
/ *I2C */
HW_GPIO_PINCONFIG(CFG_GPIO_I2C1_SCL_PORT, CFG_GPIO_I2C1_SCL_PIN, OUTPUT, I2C_SCL, true),
HW_GPIO_PINCONFIG(CFG_GPIO_I2C1_SDA_PORT, CFG_GPIO_I2C1_SDA_PIN, INPUT, I2C_SDA, true),
#endif // CFG_DEMO_HW_I2C || CFG_DEMO_HW_I2C_ASYNC || CFG_DEMO_AD_SPI_I2C
Can you tell me if the PXX_MODE_REG[PPOD] should be set to 1, for open drain, on the I2C signals? Any additional information you can provide would be appreciated.
Thanks,
Rick Nardone
Hi RNardone,
You can have a look at the Datasheet for more information regarding the port and pin settings, you can configure the pin using HW_GPIO_MODE_OUTPUT_OPEN_DRAIN enum when using them as GPIO's, but when the pins have I2C functionallity the mode will be ignored and they will be open drain by default from the I2C module (check Table 2:Pin description, I2C bus interface) you dont have to explictly configure them for the I2C functionallity.
Thanks MT_dialog