00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef ATMEGA16_32
00027 #define ATMEGA16_32
00028
00029 #include "avrdevice.h"
00030 #include "hardware.h"
00031 #include "rwmem.h"
00032 #include "hwtimer/timerprescaler.h"
00033 #include "hwtimer/timerirq.h"
00034 #include "hwtimer/hwtimer.h"
00035 #include "externalirq.h"
00036 #include "hwuart.h"
00037 #include "hwspi.h"
00038 #include "hwad.h"
00039 #include "pin.h"
00040
00042 class AvrDevice_atmega16_32: public AvrDevice {
00043
00044 public:
00045 Pin aref;
00046 HWPort *porta;
00047 HWPort *portb;
00048 HWPort *portc;
00049 HWPort *portd;
00050 ExternalIRQHandler *extirq;
00051 IOSpecialReg *gicr_reg;
00052 IOSpecialReg *gifr_reg;
00053 IOSpecialReg *mcucr_reg;
00054 IOSpecialReg *mcucsr_reg;
00055
00056 HWAdmux *admux;
00057 HWAd *ad;
00058
00059 IOSpecialReg *assr_reg;
00060 IOSpecialReg *sfior_reg;
00061 HWPrescaler *prescaler01;
00062 HWPrescalerAsync *prescaler2;
00063 ICaptureSource *inputCapture1;
00064 HWTimer8_1C* timer0;
00065 HWTimer16_2C2* timer1;
00066 HWTimer8_1C* timer2;
00067 TimerIRQRegister* timer012irq;
00068 HWSpi *spi;
00069 HWUsart *usart;
00070
00071 AvrDevice_atmega16_32(unsigned ram_bytes,
00072 unsigned flash_bytes,
00073 unsigned ee_bytes,
00074 unsigned nrww_start,
00075 bool atmega16);
00076 ~AvrDevice_atmega16_32();
00077 };
00078
00080 class AvrDevice_atmega16: public AvrDevice_atmega16_32 {
00081 public:
00083 AvrDevice_atmega16() : AvrDevice_atmega16_32(1024, 16 * 1024, 512, 0x1c00, true) {}
00084 };
00085
00087 class AvrDevice_atmega32: public AvrDevice_atmega16_32 {
00088 public:
00090 AvrDevice_atmega32() : AvrDevice_atmega16_32(2 * 1024, 32 * 1024, 1024, 0x3800, false) {}
00091 };
00092
00093 #endif