2019-04-12 19:54:11 +03:00
|
|
|
/*
|
|
|
|
* Gamepad style buttons connected to IRQ/GPIO lines
|
|
|
|
*
|
|
|
|
* Copyright (c) 2007 CodeSourcery.
|
|
|
|
* Written by Paul Brook
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
2023-10-30 14:47:57 +03:00
|
|
|
#ifndef HW_INPUT_STELLARIS_GAMEPAD_H
|
|
|
|
#define HW_INPUT_STELLARIS_GAMEPAD_H
|
2019-04-12 19:54:11 +03:00
|
|
|
|
2023-10-30 14:48:01 +03:00
|
|
|
#include "hw/sysbus.h"
|
|
|
|
#include "qom/object.h"
|
2019-04-12 19:54:11 +03:00
|
|
|
|
2023-10-30 14:48:01 +03:00
|
|
|
/*
|
|
|
|
* QEMU interface:
|
|
|
|
* + QOM array property "keycodes": uint32_t QEMU keycodes to handle
|
2023-10-30 14:48:02 +03:00
|
|
|
* (these are QCodes, ie the Q_KEY_* values)
|
2023-10-30 14:48:01 +03:00
|
|
|
* + unnamed GPIO outputs: one per keycode, in the same order as the
|
|
|
|
* "keycodes" array property entries; asserted when key is down
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define TYPE_STELLARIS_GAMEPAD "stellaris-gamepad"
|
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(StellarisGamepad, STELLARIS_GAMEPAD)
|
|
|
|
|
|
|
|
struct StellarisGamepad {
|
|
|
|
SysBusDevice parent_obj;
|
|
|
|
|
|
|
|
uint32_t num_buttons;
|
|
|
|
qemu_irq *irqs;
|
|
|
|
uint32_t *keycodes;
|
|
|
|
uint8_t *pressed;
|
|
|
|
};
|
2019-04-12 19:54:11 +03:00
|
|
|
|
|
|
|
#endif
|