4 * Copyright (c) 2018 University of Kent
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, see
19 * <http://www.gnu.org/licenses/lgpl-2.1.html>
23 * Driver for 16 bit timers on 8 bit AVR devices.
25 * On ATmega640/V-1280/V-1281/V-2560/V-2561/V timers 1, 3, 4 and 5 are 16 bit
28 #ifndef HW_TIMER_AVR_TIMER16_H
29 #define HW_TIMER_AVR_TIMER16_H
31 #include "hw/sysbus.h"
32 #include "qemu/timer.h"
33 #include "qom/object.h"
43 #define TYPE_AVR_TIMER16 "avr-timer16"
44 OBJECT_DECLARE_SIMPLE_TYPE(AVRTimer16State
, AVR_TIMER16
)
46 struct AVRTimer16State
{
48 SysBusDevice parent_obj
;
52 MemoryRegion imsk_iomem
;
53 MemoryRegion ifr_iomem
;
78 * Reads and writes to CNT and ICR utilise a bizarre temporary
79 * register, which we emulate
89 uint64_t reset_time_ns
;
90 enum NextInterrupt next_interrupt
;
93 #endif /* HW_TIMER_AVR_TIMER16_H */