bcm2835_aux.h 769 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft
  3. * Written by Andrew Baumann
  4. *
  5. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  6. * See the COPYING file in the top-level directory.
  7. */
  8. #ifndef BCM2835_AUX_H
  9. #define BCM2835_AUX_H
  10. #include "hw/sysbus.h"
  11. #include "chardev/char-fe.h"
  12. #include "qom/object.h"
  13. #define TYPE_BCM2835_AUX "bcm2835-aux"
  14. OBJECT_DECLARE_SIMPLE_TYPE(BCM2835AuxState, BCM2835_AUX)
  15. #define BCM2835_AUX_RX_FIFO_LEN 8
  16. struct BCM2835AuxState {
  17. /*< private >*/
  18. SysBusDevice parent_obj;
  19. /*< public >*/
  20. MemoryRegion iomem;
  21. CharBackend chr;
  22. qemu_irq irq;
  23. uint8_t read_fifo[BCM2835_AUX_RX_FIFO_LEN];
  24. uint8_t read_pos, read_count;
  25. uint8_t ier, iir;
  26. };
  27. #endif