Browse Source

fix some problem for OrangePi 4

pull/8/head
baiywt 5 years ago
parent
commit
76034aa4ad
  1. 4
      gpio/OrangePi.c
  2. 8
      wiringPi/OrangePi.c

4
gpio/OrangePi.c

@ -690,11 +690,11 @@ char *physNames[64] =
" 3.3v", "GPIO1_C7",
"SPI1_TXD", "0v ",
"SPI1_RXD", "GPIO1_D0",
"SPI1_CLK", "SPI1_CSn0",
"SPI1_CLK", "SPI1_CS ",
" 0v", "GPIO4_C5",
"I2C2_SDA", "I2C2_SCL",
" I2S0_RX", "0v ",
" I2S0_TX", "I2S_CLK",
" I2S0_TX", "I2S_CLK ",
"I2S0_SCK", "0v ",
"I2S0_SI0", "I2S0_SO0",
"I2S0_SI1", "I2S0_SI2",

8
wiringPi/OrangePi.c

@ -1378,8 +1378,8 @@ int OrangePi_set_gpio_mode(int pin, int mode)
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4)
writeR(0xffff0180, cru_phyaddr);
regval = readR(grf_phyaddr);
regval |= 0xffff << 16;
regval &= ~(0x3) << (offset << 1);
regval |= 0x3 << ((offset << 1) | 0x10);
regval &= ~(0x3 << (offset << 1));
writeR(regval, grf_phyaddr);
regval = readR(gpio_phyaddr);
regval &= ~(1 << index);
@ -1403,8 +1403,8 @@ int OrangePi_set_gpio_mode(int pin, int mode)
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4)
writeR(0xffff0180, cru_phyaddr);
regval = readR(grf_phyaddr);
regval |= 0xffff << 16;
regval &= ~(0x3) << (offset << 1);
regval |= 0x3 << ((offset << 1) | 0x10);
regval &= ~(0x3 << (offset << 1));
writeR(regval, grf_phyaddr);
regval = readR(gpio_phyaddr);
regval |= 1 << index;

Loading…
Cancel
Save