我想知道X5 某个GPIO口的配置,例如GPIO5口的配置是什么,输入还是输出,高电平还是低电平,是不是推挽,有没有上下拉,请问怎么知道?

我想知道X5 某个GPIO口的配置,例如GPIO5口的配置是什么,输入还是输出,高电平还是低电平,是不是推挽,有没有上下拉,请问怎么知道?

GPIO的使用可以参考手册对应部分:管脚定义与应用 | RDK DOC

使用如下命令查看:

root@ubuntu:~# cat /sys/kernel/debug/gpio
gpiochip5: GPIOs 347-363, parent: platform/34130000.gpio, 34130000.gpio:
gpio-352 ( |enable ) out hi

gpiochip4: GPIOs 379-410, parent: platform/34120000.gpio, 34120000.gpio:
gpio-385 ( |power ) out hi
gpio-386 ( |reset ) out lo

gpiochip3: GPIOs 411-433, parent: platform/32150000.gpio, 32150000.gpio:
gpio-425 ( |ACT ) out hi ACTIVE LOW
gpio-428 ( |sysfs ) out hi
gpio-429 ( |sysfs ) out lo
gpio-431 ( |reset ) out hi ACTIVE LOW

gpiochip2: GPIOs 434-451, parent: platform/35070000.gpio, 35070000.gpio:
gpio-435 ( |voltage ) out lo ACTIVE LOW

gpiochip1: GPIOs 466-496, parent: platform/35060000.gpio, 35060000.gpio:
gpio-489 ( |phyreset ) out hi
gpio-492 ( |power ) out hi

gpiochip0: GPIOs 498-505, parent: platform/31000000.gpio, 31000000.gpio:
gpio-500 ( |GPIO Key Power ) in hi IRQ ACTIVE LOW
gpio-503 ( |id ) in lo IRQ
gpio-504 ( |id ) in hi IRQ

(帖子已被作者删除)

也可以使用如下命令查看:

root@ubuntu:~# hb_gpioinfo
gpiochip0 - 8 lines: @31000000.gpio: @498-505
[Number] [Mode] [Status] [GpioName] [PinName] [PinNum] [PinFunc]
line 0: unnamed input AON_GPIO_PIN0 498 Default
line 1: unnamed input AON_GPIO_PIN1 499 Default
line 2: unnamed input active-low GPIO Key Power AON_GPIO_PIN2 500 aon_gpio_2
line 3: unnamed input interrupt AON_GPIO_PIN3 501 Default
line 4: unnamed input AON_GPIO_PIN4 502 Default
line 5: unnamed input id AON_ENV_VDD 503 aon_gpio_5
line 6: unnamed input id AON_ENV_CNN0 504 aon_gpio_6
line 7: unnamed input AON_ENV_CNN1 505 aon_gpio_7
………….
root@ubuntu:~#