Skip to contentSkip to conversation

GPIO matrix keyboard implementation

PATCH In review Filip Navara 1 participant 1 message Jul 15, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 2/14 GPIO matrix keyboard implementation

This patch introduces an emulation of the standard 4x4 matrix keyboard that could be connected to GPIO controller.

It doesn't emulate any pull-up resistors connected to the wires and depends on the GPIO controller for their emulation. This requires the GPIO controller to support the notion of special -1 value on the GPIO pins, which signals that the wire is currently disconnected.

The emulation of keys is implemented through standard QEMU keyboard emulation capabilities. An individual key mapping is specified using a device property "keys", which should be set to array of 16 bytes where each byte corresponds to scan code of the key.

---
 Makefile.target  |    2 +-
 hw/gpio_keypad.c |  174 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 175 insertions(+), 1 deletions(-)
 create mode 100644 hw/gpio_keypad.c
Makefile.target +1 -1
index 0e66139..5c1bd4a 100644
@@ -666,7 +666,7 @@ obj-y += framebuffer.o
 obj-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
 obj-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
 obj-y += syborg_virtio.o
-obj-y += gpio_rotary.o
+obj-y += gpio_rotary.o gpio_keypad.o
 CPPFLAGS += -DHAS_AUDIO
 endif
 ifeq ($(TARGET_BASE_ARCH), sh4)
hw/gpio_keypad.c new file +174 -0

174 lines not on this page · raw message

Signature · 1 line
1.6.3.msysgit.0