00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef ATMEGA124ABASE_INCLUDED
00024 #define ATMEGA124ABASE_INCLUDED
00025
00026 #include "avrdevice.h"
00027 #include "hardware.h"
00028 #include "rwmem.h"
00029 #include "externalirq.h"
00030 #include "hwuart.h"
00031 #include "hwad.h"
00032 #include "hwport.h"
00033 #include "hwspi.h"
00034 #include "hwtimer/timerprescaler.h"
00035 #include "hwtimer/hwtimer.h"
00036
00041 class AvrDevice_atmega1284Abase: public AvrDevice {
00042
00043 protected:
00044 Pin aref;
00045 HWPort porta;
00046 HWPort portb;
00047 HWPort portc;
00048 HWPort portd;
00049 IOSpecialReg gtccr_reg;
00050 IOSpecialReg assr_reg;
00051 HWPrescaler prescaler01;
00052 HWPrescalerAsync prescaler2;
00053 ExternalIRQHandler* extirq012;
00054 IOSpecialReg* eicra_reg;
00055 IOSpecialReg* eimsk_reg;
00056 IOSpecialReg* eifr_reg;
00057 ExternalIRQHandler* extirqpc;
00058 IOSpecialReg* pcicr_reg;
00059 IOSpecialReg* pcifr_reg;
00060 IOSpecialReg* pcmsk0_reg;
00061 IOSpecialReg* pcmsk1_reg;
00062 IOSpecialReg* pcmsk2_reg;
00063 IOSpecialReg* pcmsk3_reg;
00064 HWAdmux admux;
00065 HWAd* ad;
00066 HWSpi* spi;
00067 HWUsart* usart0;
00068 HWUsart* usart1;
00069 TimerIRQRegister* timerIrq0;
00070 HWTimer8_2C* timer0;
00071 ICaptureSource* inputCapture1;
00072 TimerIRQRegister* timerIrq1;
00073 HWTimer16_2C3* timer1;
00074 TimerIRQRegister* timerIrq2;
00075 HWTimer8_2C* timer2;
00076 GPIORegister* gpior0_reg;
00077 GPIORegister* gpior1_reg;
00078 GPIORegister* gpior2_reg;
00079
00080 public:
00081 AvrDevice_atmega1284Abase(unsigned ram_bytes, unsigned flash_bytes,
00082 unsigned ee_bytes );
00083 ~AvrDevice_atmega1284Abase();
00084 };
00085
00086 class AvrDevice_atmega1284A: public AvrDevice_atmega1284Abase {
00087 public:
00088 AvrDevice_atmega1284A() : AvrDevice_atmega1284Abase(16 * 1024, 128 * 1024, 4 * 1024) {}
00089 };
00090
00091 class AvrDevice_atmega644A: public AvrDevice_atmega1284Abase {
00092 public:
00093 AvrDevice_atmega644A() : AvrDevice_atmega1284Abase(4 * 1024, 64 * 1024, 2 * 1024) {}
00094 };
00095
00096 class AvrDevice_atmega324A: public AvrDevice_atmega1284Abase {
00097 public:
00098 AvrDevice_atmega324A() : AvrDevice_atmega1284Abase(2 * 1024, 32 * 1024, 1 * 1024) {}
00099 };
00100
00101 class AvrDevice_atmega164A: public AvrDevice_atmega1284Abase {
00102 public:
00103 AvrDevice_atmega164A() : AvrDevice_atmega1284Abase(1 * 1024, 16 * 1024, 512 ) {}
00104 };
00105
00106 #endif