I2C PPOD设置——GPIO模式

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
RNardone
Offline
Last seen:3 years 3 months ago
加入:2017-11-09 15:45
I2C PPOD设置——GPIO模式

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

Device:
MT_dialog
Offline
Last seen:1 month 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi RNardone,

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