新手一枚,我在使用M4B板子,配置RK3399的GPIO1的寄存器时,单独配置*GRF_GPIO1A_IOMUX与*GRF_GPIO1B_IOMUX时均可以实现端口的读取。但是在同时配置这两个寄存器后,运行程序后板子直接黑屏死机。请问有没有大佬能够指出一下问题。寄存器配置如下:
static void board_rk3399_button_init (int which) /* 初始化button, which-哪个button */
{ if (which == 0)
{ if (!PMUCRU_CLKGATE_CON1)
{
PMUCRU_CLKGATE_CON1 = ioremap(0xFF310000+ 0x0104, 4);
GRF_GPIO1A_IOMUX = ioremap(0xFF310000+0x0010, 4);
GPIO1_SWPORTA_DDR = ioremap(0xFF730000 + 0x0004, 4);
GPIO1_EXT_PORTA = ioremap(0xFF730000 + 0x0050, 4); /*GPIO1_B*/
GRF_GPIO1B_IOMUX = ioremap(0xFF310000+0x0014, 4); }
*PMUCRU_CLKGATE_CON1 = (1<<(4+16)) | (0<<4);
*GRF_GPIO1A_IOMUXSSS =(15<<(0+16))|(0<<4)|(15<<(6+16))|(0<<10)|(3<<(15+16))|(0<<15);
*GRF_GPIO1B_IOMUX =(0x3F<<(0+16))|(0<<5);
*GPIO1_SWPORTA_DDR &= ~((0x1B<<0)|(1<<7)); } }
static int board_rk3399_button_read (int which) /* 读button, which-哪个 */
{
if (which==0)
return (*GPIO1_EXT_PORTA & ((0x1B<<0)|(1<<7)));
else
return 0;
}