simulavr  1.1.0
atmega668base.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 #ifndef ATMEGA668
24 #define ATMEGA668
25 
26 #include "avrdevice.h"
27 #include "hardware.h"
28 #include "rwmem.h"
29 #include "externalirq.h"
30 #include "hwuart.h"
31 #include "hwad.h"
32 #include "hwacomp.h"
33 #include "hwport.h"
34 #include "hwspi.h"
35 #include "hwtimer/timerprescaler.h"
36 #include "hwtimer/hwtimer.h"
37 
43 
44  protected:
69  HWAd* ad;
85 
86  public:
87 
92  AvrDevice_atmega668base(unsigned ram_bytes, unsigned flash_bytes,
93  unsigned ee_bytes );
94 
96 
97 };
98 
101  public:
103  AvrDevice_atmega328() : AvrDevice_atmega668base(2 * 1024, 32 * 1024, 1024) {}
104 };
105 
108  public:
110  AvrDevice_atmega168() : AvrDevice_atmega668base(1024, 16 * 1024, 512) {}
111 };
112 
115  public:
117  AvrDevice_atmega88() : AvrDevice_atmega668base(1024, 8 * 1024, 512) {}
118 };
119 
122  public:
124  AvrDevice_atmega48() : AvrDevice_atmega668base(512, 4 * 1024, 256) {}
125 };
126 
127 #endif
Basic AVR device, contains the core functionality.
Definition: avrdevice.h:66
HWPrescalerAsync prescaler2
prescaler unit for timer 2
Definition: atmega668base.h:53
Definition: hwad.h:90
GPIORegister * gpior0_reg
general purpose IO register
Definition: atmega668base.h:80
Extends HWPrescaler with a external clock oszillator pin.
AvrDevice_atmega88()
Creates the device for ATMega88, see AvrDevice_atmega668base.
HWTimer8_2C * timer0
timer 0 unit
Definition: atmega668base.h:74
Pin class, handles input and output to external parts.
Definition: pin.h:98
ExternalIRQHandler * extirqpc
external interrupt support for PCINT[0-2]
Definition: atmega668base.h:61
TimerIRQRegister * timerIrq2
timer interrupt unit for timer 2
Definition: atmega668base.h:78
IOSpecialReg * pcifr_reg
PCIFR IO register.
Definition: atmega668base.h:63
Implement CLKPR register.
Definition: rwmem.h:135
ExternalIRQHandler * extirq01
external interrupt support for INT0, INT1
Definition: atmega668base.h:57
ICaptureSource * inputCapture1
input capture source for timer1
Definition: atmega668base.h:75
Pin adc6
adc channel 6 input pin
Definition: atmega668base.h:45
Defines a Port, e.g. a hardware device for GPIO.
Definition: hwport.h:43
IOSpecialReg gtccr_reg
GTCCR IO register.
Definition: atmega668base.h:50
HWAcomp * acomp
analog compare unit
Definition: atmega668base.h:70
HWSpi * spi
spi unit
Definition: atmega668base.h:71
A register in IO register space unrelated to any peripheral. "GPIORx" in datasheets.
Definition: rwmem.h:113
Handler for external IRQ's to communicate with IRQ system and mask/flag registers.
Definition: externalirq.h:41
IOSpecialReg * eicra_reg
EICRA IO register.
Definition: atmega668base.h:58
OSCCALRegister * osccal_reg
OSCCAL IO register.
Definition: atmega668base.h:84
AvrDevice_atmega168()
Creates the device for ATMega168, see AvrDevice_atmega668base.
GPIORegister * gpior1_reg
general purpose IO register
Definition: atmega668base.h:81
AvrDevice_atmega48()
Creates the device for ATMega48, see AvrDevice_atmega668base.
Implements the I/O hardware necessary to do USART transfers.
Definition: hwuart.h:149
HWTimer8_2C * timer2
timer 2 unit
Definition: atmega668base.h:79
Timer unit with 16Bit counter and 2 output compare units, but 3 config registers. ...
Definition: hwtimer.h:593
AVR device class for ATMega168, see AvrDevice_atmega668base.
IOSpecialReg * pcmsk1_reg
PCIMSK1 IO register.
Definition: atmega668base.h:65
IOSpecialReg * eimsk_reg
EIMSK IO register.
Definition: atmega668base.h:59
HWARef * aref
ADC reference unit.
Definition: atmega668base.h:68
IOSpecialReg * pcmsk0_reg
PCIMSK0 IO register.
Definition: atmega668base.h:64
TimerIRQRegister * timerIrq0
timer interrupt unit for timer 0
Definition: atmega668base.h:73
AvrDevice_atmega328()
Creates the device for ATMega328, see AvrDevice_atmega668base.
IOSpecialReg * pcicr_reg
PCICR IO register.
Definition: atmega668base.h:62
Reference source for ADC (base class)
Definition: hwad.h:35
GPIORegister * gpior2_reg
general purpose IO register
Definition: atmega668base.h:82
HWAdmux * admux
adc multiplexer unit
Definition: atmega668base.h:67
CLKPRRegister * clkpr_reg
CLKPR IO register.
Definition: atmega668base.h:83
IOSpecialReg assr_reg
ASSR IO register.
Definition: atmega668base.h:51
PrescalerMultiplexer premux2
prescaler multiplexer for timer 2
Definition: atmega668base.h:56
Provices flag and mask register for timer interrupts and connects irq lines to irqsystem.
Definition: timerirq.h:61
Pin adc7
adc channel 7 input pin
Definition: atmega668base.h:46
HWAd * ad
adc unit
Definition: atmega668base.h:69
IOSpecialReg * eifr_reg
EIFR IO register.
Definition: atmega668base.h:60
Definition: hwspi.h:38
AVR device class for ATMega328, see AvrDevice_atmega668base.
AVR device class for ATMega48, see AvrDevice_atmega668base.
IOSpecialReg * pcmsk2_reg
PCIMSK2 IO register.
Definition: atmega668base.h:66
PrescalerMultiplexerExt premux0
prescaler multiplexer for timer 0
Definition: atmega668base.h:54
HWPrescaler prescaler01
prescaler unit for timer 0 and 1
Definition: atmega668base.h:52
Prescaler unit for support timers with clock.
HWUsart * usart0
usart 0 unit
Definition: atmega668base.h:72
PrescalerMultiplexerExt premux1
prescaler multiplexer for timer 1
Definition: atmega668base.h:55
PrescalerMultiplexer without external count pin.
Definition: prescalermux.h:35
Class, which provides input capture source for 16bit timers.
Definition: icapturesrc.h:34
Timer unit with 8Bit counter and 2 output compare unit.
Definition: hwtimer.h:416
HWTimer16_2C3 * timer1
timer 1 unit
Definition: atmega668base.h:77
Definition: hwad.h:204
AVR device class for ATMega88, see AvrDevice_atmega668base.
AvrDevice_atmega668base(unsigned ram_bytes, unsigned flash_bytes, unsigned ee_bytes)
PrescalerMultiplexer with external count pin.
Definition: prescalermux.h:55
Analog comparator peripheral.
Definition: hwacomp.h:42
Implement OSCCAL register.
Definition: rwmem.h:174
TimerIRQRegister * timerIrq1
timer interrupt unit for timer 1
Definition: atmega668base.h:76