simulavr  1.1.0
atmega16_32.h
Go to the documentation of this file.
1  /*
2  ****************************************************************************
3  *
4  * simulavr - A simulator for the Atmel AVR family of microcontrollers.
5  * Copyright (C) 2001, 2002, 2003 Klaus Rudolph
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program 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
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  ****************************************************************************
22  *
23  * $Id$
24  */
25 
26 #ifndef ATMEGA16_32
27 #define ATMEGA16_32
28 
29 #include "avrdevice.h"
30 #include "hardware.h"
31 #include "rwmem.h"
32 #include "hwtimer/timerprescaler.h"
33 #include "hwtimer/timerirq.h"
34 #include "hwtimer/hwtimer.h"
35 #include "externalirq.h"
36 #include "hwuart.h"
37 #include "hwspi.h"
38 #include "hwad.h"
39 #include "hwacomp.h"
40 #include "pin.h"
41 
44 
45  public:
56 
59  HWAd *ad;
61 
76 
77  AvrDevice_atmega16_32(unsigned ram_bytes,
78  unsigned flash_bytes,
79  unsigned ee_bytes,
80  unsigned nrww_start,
81  bool atmega16);
83 };
84 
87  public:
89  AvrDevice_atmega16() : AvrDevice_atmega16_32(1024, 16 * 1024, 512, 0x1c00, true) {}
90 };
91 
94  public:
96  AvrDevice_atmega32() : AvrDevice_atmega16_32(2 * 1024, 32 * 1024, 1024, 0x3800, false) {}
97 };
98 
99 #endif
Basic AVR device, contains the core functionality.
Definition: avrdevice.h:66
AvrDevice_atmega32()
Creates the device for ATMega32, see AvrDevice_atmega16_32.
Definition: atmega16_32.h:96
AVR device class for ATMega16, see AvrDevice_atmega16_32.
Definition: atmega16_32.h:86
AVR device class for ATMega32, see AvrDevice_atmega16_32.
Definition: atmega16_32.h:93
HWAd * ad
adc unit
Definition: atmega16_32.h:59
Definition: hwad.h:90
PrescalerMultiplexer premux2
prescaler multiplexer for timer 2
Definition: atmega16_32.h:68
Extends HWPrescaler with a external clock oszillator pin.
TimerIRQRegister * timer012irq
timer interrupt unit for timer 0 to 2
Definition: atmega16_32.h:73
IOSpecialReg assr_reg
ASSR IO register.
Definition: atmega16_32.h:62
HWARef * aref
adc reference unit
Definition: atmega16_32.h:58
IOSpecialReg sfior_reg
SFIOR IO register.
Definition: atmega16_32.h:63
HWAdmux * admux
adc multiplexer unit
Definition: atmega16_32.h:57
Timer unit with 8Bit counter and one output compare unit.
Definition: hwtimer.h:377
Defines a Port, e.g. a hardware device for GPIO.
Definition: hwport.h:43
OSCCALRegister * osccal_reg
OSCCAL IO register.
Definition: atmega16_32.h:55
Handler for external IRQ's to communicate with IRQ system and mask/flag registers.
Definition: externalirq.h:41
AvrDevice_atmega16_32(unsigned ram_bytes, unsigned flash_bytes, unsigned ee_bytes, unsigned nrww_start, bool atmega16)
Definition: atmega16_32.cpp:68
HWUsart * usart
usart unit
Definition: atmega16_32.h:75
HWPrescaler prescaler01
prescaler unit for timer 0 and 1
Definition: atmega16_32.h:64
AVRDevice class for ATMega16 and ATMega32.
Definition: atmega16_32.h:43
HWTimer8_1C * timer2
timer 2 unit
Definition: atmega16_32.h:72
IOSpecialReg * gifr_reg
GIFR IO register.
Definition: atmega16_32.h:52
Implements the I/O hardware necessary to do USART transfers.
Definition: hwuart.h:149
IOSpecialReg * mcucr_reg
MCUCR IO register.
Definition: atmega16_32.h:53
HWSpi * spi
spi unit
Definition: atmega16_32.h:74
IOSpecialReg * gicr_reg
GICR IO register.
Definition: atmega16_32.h:51
HWPort portc
port C
Definition: atmega16_32.h:48
HWTimer16_2C2 * timer1
timer 1 unit
Definition: atmega16_32.h:71
Timer unit with 16Bit counter and 2 output compare units and 2 config registers.
Definition: hwtimer.h:528
Reference source for ADC (base class)
Definition: hwad.h:35
HWPort porta
port A
Definition: atmega16_32.h:46
HWPrescalerAsync prescaler2
prescaler unit for timer 2
Definition: atmega16_32.h:65
Provices flag and mask register for timer interrupts and connects irq lines to irqsystem.
Definition: timerirq.h:61
Definition: hwspi.h:38
HWAcomp * acomp
analog compare unit
Definition: atmega16_32.h:60
HWTimer8_1C * timer0
timer 0 unit
Definition: atmega16_32.h:70
Prescaler unit for support timers with clock.
PrescalerMultiplexerExt premux0
prescaler multiplexer for timer 0
Definition: atmega16_32.h:66
PrescalerMultiplexer without external count pin.
Definition: prescalermux.h:35
HWPort portd
port D
Definition: atmega16_32.h:49
IOSpecialReg * mcucsr_reg
MCUCSR IO register.
Definition: atmega16_32.h:54
HWPort portb
port B
Definition: atmega16_32.h:47
Class, which provides input capture source for 16bit timers.
Definition: icapturesrc.h:34
PrescalerMultiplexerExt premux1
prescaler multiplexer for timer 1
Definition: atmega16_32.h:67
Definition: hwad.h:204
ExternalIRQHandler * extirq
external interrupt support
Definition: atmega16_32.h:50
AvrDevice_atmega16()
Creates the device for ATMega16, see AvrDevice_atmega16_32.
Definition: atmega16_32.h:89
PrescalerMultiplexer with external count pin.
Definition: prescalermux.h:55
Analog comparator peripheral.
Definition: hwacomp.h:42
Implement OSCCAL register.
Definition: rwmem.h:174
ICaptureSource * inputCapture1
input capture source for timer1
Definition: atmega16_32.h:69