Browse Source

Fixed the problem that pin values could not be read for RK3399

pull/8/head
baiywt 6 years ago
parent
commit
569aed843b
  1. 6
      wiringPi/OrangePi.c
  2. 1
      wiringPi/OrangePi.h

6
wiringPi/OrangePi.c

@ -1511,11 +1511,11 @@ int OrangePi_digitalRead(int pin)
#elif CONFIG_ORANGEPI_RK3399
unsigned int phyaddr;
if(bank == 1)
phyaddr = GPIO1_BASE + GPIO_SWPORTA_DR_OFFSET;
phyaddr = GPIO1_BASE + GPIO_EXT_PORTA_OFFSET;
else if(bank == 2)
phyaddr = GPIO2_BASE + GPIO_SWPORTA_DR_OFFSET;
phyaddr = GPIO2_BASE + GPIO_EXT_PORTA_OFFSET;
else if(bank == 4)
phyaddr = GPIO4_BASE + GPIO_SWPORTA_DR_OFFSET;
phyaddr = GPIO4_BASE + GPIO_EXT_PORTA_OFFSET;
else;
#endif

1
wiringPi/OrangePi.h

@ -86,6 +86,7 @@
#define GPIO_BIT(x) (1UL << (x))
#define GPIO_SWPORTA_DR_OFFSET 0x00
#define GPIO_SWPORTA_DDR_OFFSET 0x04
#define GPIO_EXT_PORTA_OFFSET 0x50
#define PMUGRF_BASE 0xff320000
#define PMUGRF_GPIO1A_IOMUX 0x00010

Loading…
Cancel
Save