- 积分
- 58
贡献306
飞刀106 FD
注册时间2019-6-22
在线时间15 小时
扫一扫,手机访问本帖
|
这是串口操作台返回的信息,注册了一个IO号为105
ok335x login: root
root@ok335x:~# cd /
root@ok335x:/# echo 105 > /sys/class/gpio/export
root@ok335x:/# cat /sys/kernel/debug/gpio
GPIOs 0-31, gpio:
gpio-6 (mmc_cd ) in hi
GPIOs 32-63, gpio:
gpio-48 (usr0 ) out hi
gpio-49 (usr1 ) out hi
gpio-50 (usr2 ) out hi
gpio-51 (usr3 ) out hi
gpio-52 (SW1 ) in hi
gpio-53 (SW2 ) in hi
gpio-54 (SW3 ) in hi
gpio-55 (SW4 ) in hi
gpio-56 (SW5 ) in hi
gpio-57 (SW6 ) in hi
GPIOs 64-95, gpio:
gpio-65 (gpio2_1 ) out hi
GPIOs 96-127, gpio:
gpio-97 (gpio3_1 ) out hi
gpio-104 (heartbeat ) out lo
gpio-105 (sysfs ) in lo
感觉到有问题的地方,故意改了按键的名称在串口信息里还是不变,像board-am335xevm.c没编译一样,因为删了编译也不报错
/* Configure GPIOs for GPIO Keys */
static struct gpio_keys_button am335x_evm_gpio_buttons_forlinx[] = {
#if defined(CONFIG_OK335XD)
{
.code = BTN_0,
.gpio = GPIO_TO_PIN(1, 20),
.desc = "SW1",
},
{
.code = BTN_1,
.gpio = GPIO_TO_PIN(1, 21),
.desc = "SW2",
},
{
.code = BTN_2,
.gpio = GPIO_TO_PIN(1, 22),
.desc = "SW3",
.wakeup = 1,
},
{
.code = BTN_3,
.gpio = GPIO_TO_PIN(1, 23),
.desc = "SW24",
},
{
.code = BTN_4,
.gpio = GPIO_TO_PIN(1, 24),
.desc = "SW5",
.wakeup = 1,
},
{
.code = BTN_5,
.gpio = GPIO_TO_PIN(1, 25),
.desc = "SW12",
},
{
.code = BTN_10,
.gpio = GPIO_TO_PIN(3, 10),
.desc = "SW10",
.wakeup = 1,
},
{
.code = BTN_9,
.gpio = GPIO_TO_PIN(3, 9),
.desc = "SW9",
.wakeup = 1,
},
{
.code = BTN_14,
.gpio = GPIO_TO_PIN(1, 14),
.desc = "SW14",
}, |
|