ok335x添加按键不成功,还有就是LED灯IO如何添加
这是串口操作台返回的信息,注册了一个IO号为105ok335x 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 ) inhi
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 ) inhi
gpio-53(SW2 ) inhi
gpio-54(SW3 ) inhi
gpio-55(SW4 ) inhi
gpio-56(SW5 ) inhi
gpio-57(SW6 ) inhi
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 ) inlo
感觉到有问题的地方,故意改了按键的名称在串口信息里还是不变,像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",
}, 现在的结果是手册里面添加的三个按键可以用,但是自己按照手册和知识库里面说的那样添加按键,结果读不到对应的值,注释什么的也已经到位了
board-am335xevm.c是一个总的配置文件,当下面还有板级配置文件的话会将这个文件配置过得内容覆盖,例如335xD的板级配置文件 board-am335xevm-xd.c会将你修改的board-am335xevm.c相同的内容覆盖;另外你添加的按键需要查看硬件手册看是否被使用,被使用的话需要将该引脚相关功能注释掉;按键值的定义在include/input/input.h文件定义
页:
[1]