- 积分
- 5
贡献30
飞刀2 FD
注册时间2016-12-15
在线时间0 小时
扫一扫,手机访问本帖
|
请教个很基本的问题: 我想把ENET_RXD0当做通用IO GPIO1_IO27使用
配置IOMUXC_SW_MUX_CTL_PAD_ENET_RX_DATA0 为(101 ALT5 — Select signal GPIO1)通用IO 然后GPIO_GDIR, GPIO_DR为1但是这个角并没有输出高电平
帖子不能发数据截图,故复制之
37.4.122 Pad Mux Register
(IOMUXC_SW_MUX_CTL_PAD_ENET_RX_DATA0)
Address: 20E_0000h base + 1F8h offset = 20E_01F8h
MUX_MODE MUX Mode Select Field.
Select 1 of 4 iomux modes to be used for pad: ENET_RXD0.
NOTE: Pad ENET_RXD0 is involved in Daisy Chain.
001 ALT1 — Select signal ENET_RX_DATA0.
- Configure register IOMUXC_ENET_MAC0_RX_DATA0_SELECT_INPUT for mode ALT1.
010 ALT2 — Select signal ESAI_TX_HF_CLK.
- Configure register IOMUXC_ESAI_TX_HF_CLK_SELECT_INPUT for mode ALT2.
011 ALT3 — Select signal SPDIF_OUT.
101 ALT5 — Select signal GPIO1_IO27
代码如下:
//IOMUXC_SW_MUX_CTL_PAD_ENET_RX_DATA0
reg = (unsigned int *)ioremap(0x020E01F8, 4);
*reg = 0x0D; //配置为ALT5 GPIO1_IO27通用IO功能
//GPIO1_IO27: GPIO direction register (GPIO1_GDIR)
/*
0 INPUT — GPIO is configured as input.
1 OUTPUT — GPIO is configured as output.
*/
reg = (unsigned int *)ioremap(0x0209C004, 4);
*reg |= 1 << 17; //配置输出
//GPIO1_IO27: GPIO data register (GPIO1_DR)
reg = (unsigned int *)ioremap(0x0209C000, 4);
*reg |= (unsigned int)(1) << 17; //输出高电平
但是测量并没有高电平输出,是还有寄存器没有配置到吗?谢谢
|
|