Page | 42
6.5
Driver Development
6.5.1
Driver for the gpio_keys
1.
Device definition
Linux-3.2.0-psp04.06.00.08.sdk/arch/arm/mach-omap2/board-am335xev
m.c
Setup GPIO 0.2 as a “menu” key, return value as “KEY_F1”, triggered on low
level; set GPIO 2.1 as a ”back”key, return value as ”KEY_ESC”, triggered on
low level, the structure template is shown below.
static struct gpio_keys_button gpio_key_buttons[] = {
{
.code = KEY_F1,
.gpio = GPIO_TO_PIN(0, 20),
.active_low = true,
.desc = "menu",
.type = EV_KEY,
// .wakeup = 1,
},
{
.code = KEY_ESC,
.gpio = GPIO_TO_PIN(2, 1),
.active_low = true,
.desc = "back",
.type = EV_KEY,
// .wakeup = 1,
},
};
static struct gpio_keys_platform_data gpio_key_info = {
.buttons = gpio_key_buttons,
.nbuttons = ARRAY_SIZE(gpio_key_buttons),
};
static struct platform_device gpio_keys = {
.name = "gpio-keys",
.id = -1,
.dev = {
.platform_data = &gpio_key_info,
},
};
Summary of Contents for SBC8600B
Page 1: ...SBC8600B Single Board Computer Quick Start Guide Version 1 1 23rd Jan 2014...
Page 9: ...Page 2 1 3 Board Interfaces Figure 1 SBC8600B Interfaces...
Page 10: ...Page 3 1 4 System Block Diagram Figure 2 SBC8600B System Block Diagram...
Page 11: ...Page 4 1 5 Physical Dimensions Figure 3 MINI8600B Physical Dimensions...
Page 12: ...Page 5 Figure 4 SBC8600B Physical Dimensions...
Page 114: ...Page 107...