1 /* 2 * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft 3 * Written by Andrew Baumann 4 * 5 * This code is licensed under the GNU GPLv2 and later. 6 */ 7 8 #ifndef BCM2835_AUX_H 9 #define BCM2835_AUX_H 10 11 #include "hw/sysbus.h" 12 #include "chardev/char-fe.h" 13 14 #define TYPE_BCM2835_AUX "bcm2835-aux" 15 #define BCM2835_AUX(obj) OBJECT_CHECK(BCM2835AuxState, (obj), TYPE_BCM2835_AUX) 16 17 #define BCM2835_AUX_RX_FIFO_LEN 8 18 19 typedef struct { 20 /*< private >*/ 21 SysBusDevice parent_obj; 22 /*< public >*/ 23 24 MemoryRegion iomem; 25 CharBackend chr; 26 qemu_irq irq; 27 28 uint8_t read_fifo[BCM2835_AUX_RX_FIFO_LEN]; 29 uint8_t read_pos, read_count; 30 uint8_t ier, iir; 31 } BCM2835AuxState; 32 33 #endif 34