4 * Copyright (c) 2019-2020 Philippe Mathieu-Daudé
6 * This work is licensed under the terms of the GNU GPLv2 or later.
7 * See the COPYING file in the top-level directory.
8 * SPDX-License-Identifier: GPL-2.0-or-later
11 #ifndef HW_AVR_ATMEGA_H
12 #define HW_AVR_ATMEGA_H
14 #include "hw/char/avr_usart.h"
15 #include "hw/timer/avr_timer16.h"
16 #include "hw/misc/avr_power.h"
17 #include "target/avr/cpu.h"
18 #include "qom/object.h"
20 #define TYPE_ATMEGA_MCU "ATmega"
21 #define TYPE_ATMEGA168_MCU "ATmega168"
22 #define TYPE_ATMEGA328_MCU "ATmega328"
23 #define TYPE_ATMEGA1280_MCU "ATmega1280"
24 #define TYPE_ATMEGA2560_MCU "ATmega2560"
26 typedef struct AtmegaMcuState AtmegaMcuState
;
27 DECLARE_INSTANCE_CHECKER(AtmegaMcuState
, ATMEGA_MCU
,
35 struct AtmegaMcuState
{
37 SysBusDevice parent_obj
;
45 AVRMaskState pwr
[POWER_MAX
];
46 AVRUsartState usart
[USART_MAX
];
47 AVRTimer16State timer
[TIMER_MAX
];
48 uint64_t xtal_freq_hz
;
51 #endif /* HW_AVR_ATMEGA_H */