|
发表于 2023-4-28 15:06:52
|
显示全部楼层
你好,最近我也在捣鼓 rt1176 的片子,目前遇到一个问题请教下,
如下:
1. 捣鼓 i2c1 硬件驱动 失败,具体:
管脚配置使用 r15, r16 这 2个管脚
2. 配置 方法 1
IOMUXC_SetPinMux(
IOMUXC_GPIO_AD_08_GPIO_MUX3_IO07, /* GPIO_AD_08 is configured as GPIO_MUX3_IO07 */
0U); /* Software Input On Field: Force input path of pad GPIO_AD_08 */
IOMUXC_SetPinMux(
IOMUXC_GPIO_AD_09_GPIO_MUX3_IO08, /* GPIO_AD_09 is configured as GPIO_MUX3_IO08 */
0U); /* Software Input On Field: Force input path of pad GPIO_AD_09 */
IOMUXC_GPR->GPR42 = ((IOMUXC_GPR->GPR42 &
(~(I2C1_INITPINS_IOMUXC_GPR_GPR42_GPIO_MUX3_GPIO_SEL_LOW_MASK))) /* Mask bits to zero which are setting */
| IOMUXC_GPR_GPR42_GPIO_MUX3_GPIO_SEL_LOW(0x0180U) /* GPIO3 and CM7_GPIO3 share same IO MUX function, GPIO_MUX3 selects one GPIO function: 0x00U */
);
IOMUXC_SetPinConfig(
IOMUXC_GPIO_AD_08_GPIO_MUX3_IO07, /* GPIO_AD_08 PAD functional properties : */
0x06U); /* Slew Rate Field: Slow Slew Rate
Drive Strength Field: high drive strength
Pull / Keep Select Field: Pull Enable
Pull Up / Down Config. Field: Weak pull down
Open Drain Field: Enabled
Domain write protection: Both cores are allowed
Domain write protection lock: Neither of DWP bits is locked */
IOMUXC_SetPinConfig(
IOMUXC_GPIO_AD_09_GPIO_MUX3_IO08, /* GPIO_AD_09 PAD functional properties : */
0x06U); /* Slew Rate Field: Slow Slew Rate
Drive Strength Field: high drive strength
Pull / Keep Select Field: Pull Enable
Pull Up / Down Config. Field: Weak pull down
Open Drain Field: Enabled
Domain write protection: Both cores are allowed
Domain write protection lock: Neither of DWP bits is locked */
配置方法 2
IOMUXC_SetPinMux(
IOMUXC_GPIO_AD_08_LPI2C1_SCL, /* GPIO_AD_08 is configured as LPI2C1_SCL */
1U); /* Software Input On Field: Force input path of pad GPIO_AD_08 */
IOMUXC_SetPinMux(
IOMUXC_GPIO_AD_09_LPI2C1_SDA, /* GPIO_AD_09 is configured as LPI2C1_SDA */
1U); /* Software Input On Field: Force input path of pad GPIO_AD_09 */
IOMUXC_SetPinConfig(
IOMUXC_GPIO_AD_08_LPI2C1_SCL, /* GPIO_AD_08 PAD functional properties : */
0x22U); /* Slew Rate Field: Slow Slew Rate
Drive Strength Field: normal drive strength
Pull / Keep Select Field: Pull Disable, Highz
Pull Up / Down Config. Field: Weak pull down
Open Drain Field: Enabled
Domain write protection: Both cores are allowed
Domain write protection lock: Neither of DWP bits is locked */
IOMUXC_SetPinConfig(
IOMUXC_GPIO_AD_09_LPI2C1_SDA, /* GPIO_AD_09 PAD functional properties : */
0x22U); /* Slew Rate Field: Slow Slew Rate
Drive Strength Field: normal drive strength
Pull / Keep Select Field: Pull Disable, Highz
Pull Up / Down Config. Field: Weak pull down
Open Drain Field: Enabled
Domain write protection: Both cores are allowed
Domain write protection lock: Neither of DWP bits is locked */
上述 2个方法配置都不行,
我又配置为普通的 io 模式,输出高低电平测试,可这个 r16 口始终都是没有任何变化 ?? 电平一直都是高电平 3.3v
很是纠结啊
你那边有空可以帮我测试一下看看吗 ??
|
|