1c45460deSPeter Maydell /* 2c45460deSPeter Maydell * Gamepad style buttons connected to IRQ/GPIO lines 3c45460deSPeter Maydell * 4c45460deSPeter Maydell * Copyright (c) 2007 CodeSourcery. 5c45460deSPeter Maydell * Written by Paul Brook 6c45460deSPeter Maydell * 7c45460deSPeter Maydell * This work is licensed under the terms of the GNU GPL, version 2 or later. 8c45460deSPeter Maydell * See the COPYING file in the top-level directory. 9c45460deSPeter Maydell */ 10c45460deSPeter Maydell 11c45460deSPeter Maydell #ifndef HW_INPUT_STELLARIS_GAMEPAD_H 12c45460deSPeter Maydell #define HW_INPUT_STELLARIS_GAMEPAD_H 13c45460deSPeter Maydell 14a75f336bSPeter Maydell #include "hw/sysbus.h" 15a75f336bSPeter Maydell #include "qom/object.h" 16c45460deSPeter Maydell 17a75f336bSPeter Maydell /* 18a75f336bSPeter Maydell * QEMU interface: 19a75f336bSPeter Maydell * + QOM array property "keycodes": uint32_t QEMU keycodes to handle 20*7c76f397SPeter Maydell * (these are QCodes, ie the Q_KEY_* values) 21a75f336bSPeter Maydell * + unnamed GPIO outputs: one per keycode, in the same order as the 22a75f336bSPeter Maydell * "keycodes" array property entries; asserted when key is down 23a75f336bSPeter Maydell */ 24a75f336bSPeter Maydell 25a75f336bSPeter Maydell #define TYPE_STELLARIS_GAMEPAD "stellaris-gamepad" 26a75f336bSPeter Maydell OBJECT_DECLARE_SIMPLE_TYPE(StellarisGamepad, STELLARIS_GAMEPAD) 27a75f336bSPeter Maydell 28a75f336bSPeter Maydell struct StellarisGamepad { 29a75f336bSPeter Maydell SysBusDevice parent_obj; 30a75f336bSPeter Maydell 31a75f336bSPeter Maydell uint32_t num_buttons; 32a75f336bSPeter Maydell qemu_irq *irqs; 33a75f336bSPeter Maydell uint32_t *keycodes; 34a75f336bSPeter Maydell uint8_t *pressed; 35a75f336bSPeter Maydell }; 36c45460deSPeter Maydell 37c45460deSPeter Maydell #endif 38