📄 m32hvbdef.inc
字号:
.equ EXTRF = 1 ; External Reset Flag
.equ BODRF = 2 ; Brown-out Reset Flag
.equ WDRF = 3 ; Watchdog Reset Flag
.equ OCDRF = 4 ; OCD Reset Flag
; FOSCCAL - Fast Oscillator Calibration Value
.equ FCAL0 = 0 ; Oscillator Calibration Value Bit0
.equ FCAL1 = 1 ; Oscillator Calibration Value Bit1
.equ FCAL2 = 2 ; Oscillator Calibration Value Bit2
.equ FCAL3 = 3 ; Oscillator Calibration Value Bit3
.equ FCAL4 = 4 ; Oscillator Calibration Value Bit4
.equ FCAL5 = 5 ; Oscillator Calibration Value Bit5
.equ FCAL6 = 6 ; Oscillator Calibration Value Bit6
.equ FCAL7 = 7 ; Oscillator Calibration Value Bit7
; OSICSR - Oscillator Sampling Interface Control and Status Register
.equ OSIEN = 0 ; Oscillator Sampling Interface Enable
.equ OSIST = 1 ; Oscillator Sampling Interface Status
.equ OSISEL0 = 4 ; Oscillator Sampling Interface Select 0
; SMCR - Sleep Mode Control Register
.equ SE = 0 ; Sleep Enable
.equ SM0 = 1 ; Sleep Mode Select bit 0
.equ SM1 = 2 ; Sleep Mode Select bit 1
.equ SM2 = 3 ; Sleep Mode Select bit 2
; GPIOR2 - General Purpose IO Register 2
.equ GPIOR20 = 0 ; General Purpose IO Register 2 bit 0
.equ GPIOR21 = 1 ; General Purpose IO Register 2 bit 1
.equ GPIOR22 = 2 ; General Purpose IO Register 2 bit 2
.equ GPIOR23 = 3 ; General Purpose IO Register 2 bit 3
.equ GPIOR24 = 4 ; General Purpose IO Register 2 bit 4
.equ GPIOR25 = 5 ; General Purpose IO Register 2 bit 5
.equ GPIOR26 = 6 ; General Purpose IO Register 2 bit 6
.equ GPIOR27 = 7 ; General Purpose IO Register 2 bit 7
; GPIOR1 - General Purpose IO Register 1
.equ GPIOR10 = 0 ; General Purpose IO Register 1 bit 0
.equ GPIOR11 = 1 ; General Purpose IO Register 1 bit 1
.equ GPIOR12 = 2 ; General Purpose IO Register 1 bit 2
.equ GPIOR13 = 3 ; General Purpose IO Register 1 bit 3
.equ GPIOR14 = 4 ; General Purpose IO Register 1 bit 4
.equ GPIOR15 = 5 ; General Purpose IO Register 1 bit 5
.equ GPIOR16 = 6 ; General Purpose IO Register 1 bit 6
.equ GPIOR17 = 7 ; General Purpose IO Register 1 bit 7
; GPIOR0 - General Purpose IO Register 0
.equ GPIOR00 = 0 ; General Purpose IO Register 0 bit 0
.equ GPIOR01 = 1 ; General Purpose IO Register 0 bit 1
.equ GPIOR02 = 2 ; General Purpose IO Register 0 bit 2
.equ GPIOR03 = 3 ; General Purpose IO Register 0 bit 3
.equ GPIOR04 = 4 ; General Purpose IO Register 0 bit 4
.equ GPIOR05 = 5 ; General Purpose IO Register 0 bit 5
.equ GPIOR06 = 6 ; General Purpose IO Register 0 bit 6
.equ GPIOR07 = 7 ; General Purpose IO Register 0 bit 7
; DIDR0 - Digital Input Disable Register
.equ PA0DID = 0 ; When this bit is written logic one, the digital input buffer of the corresponding V_ADC pin is disabled.
.equ PA1DID = 1 ; When this bit is written logic one, the digital input buffer of the corresponding V_ADC pin is disabled.
; PRR0 - Power Reduction Register 0
.equ PRVADC = 0 ; Power Reduction V-ADC
.equ PRTIM0 = 1 ; Power Reduction Timer/Counter0
.equ PRTIM1 = 2 ; Power Reduction Timer/Counter1
.equ PRSPI = 3 ; Power reduction SPI
.equ PRVRM = 5 ; Power Reduction Voltage Regulator Monitor
.equ PRTWI = 6 ; Power Reduction TWI
; CLKPR - Clock Prescale Register
.equ CLKPS0 = 0 ; Clock Prescaler Select Bit 0
.equ CLKPS1 = 1 ; Clock Prescaler Select Bit 1
.equ CLKPCE = 7 ; Clock Prescaler Change Enable
; ***** PORTA ************************
; PORTA - Port A Data Register
.equ PORTA0 = 0 ; Port A Data Register bit 0
.equ PA0 = 0 ; For compatibility
.equ PORTA1 = 1 ; Port A Data Register bit 1
.equ PA1 = 1 ; For compatibility
.equ PORTA2 = 2 ; Port A Data Register bit 2
.equ PA2 = 2 ; For compatibility
.equ PORTA3 = 3 ; Port A Data Register bit 3
.equ PA3 = 3 ; For compatibility
; DDRA - Port A Data Direction Register
.equ DDA0 = 0 ; Data Direction Register, Port A, bit 0
.equ DDA1 = 1 ; Data Direction Register, Port A, bit 1
.equ DDA2 = 2 ; Data Direction Register, Port A, bit 2
.equ DDA3 = 3 ; Data Direction Register, Port A, bit 3
; PINA - Port A Input Pins
.equ PINA0 = 0 ; Input Pins, Port A bit 0
.equ PINA1 = 1 ; Input Pins, Port A bit 1
.equ PINA2 = 2 ; Input Pins, Port A bit 2
.equ PINA3 = 3 ; Input Pins, Port A bit 3
; ***** PORTB ************************
; PORTB - Port B Data Register
.equ PORTB0 = 0 ; Port B Data Register bit 0
.equ PB0 = 0 ; For compatibility
.equ PORTB1 = 1 ; Port B Data Register bit 1
.equ PB1 = 1 ; For compatibility
.equ PORTB2 = 2 ; Port B Data Register bit 2
.equ PB2 = 2 ; For compatibility
.equ PORTB3 = 3 ; Port B Data Register bit 3
.equ PB3 = 3 ; For compatibility
.equ PORTB4 = 4 ; Port B Data Register bit 4
.equ PB4 = 4 ; For compatibility
.equ PORTB5 = 5 ; Port B Data Register bit 5
.equ PB5 = 5 ; For compatibility
.equ PORTB6 = 6 ; Port B Data Register bit 6
.equ PB6 = 6 ; For compatibility
.equ PORTB7 = 7 ; Port B Data Register bit 7
.equ PB7 = 7 ; For compatibility
; DDRB - Port B Data Direction Register
.equ DDB0 = 0 ; Port B Data Direction Register bit 0
.equ DDB1 = 1 ; Port B Data Direction Register bit 1
.equ DDB2 = 2 ; Port B Data Direction Register bit 2
.equ DDB3 = 3 ; Port B Data Direction Register bit 3
.equ DDB4 = 4 ; Port B Data Direction Register bit 4
.equ DDB5 = 5 ; Port B Data Direction Register bit 5
.equ DDB6 = 6 ; Port B Data Direction Register bit 6
.equ DDB7 = 7 ; Port B Data Direction Register bit 7
; PINB - Port B Input Pins
.equ PINB0 = 0 ; Port B Input Pins bit 0
.equ PINB1 = 1 ; Port B Input Pins bit 1
.equ PINB2 = 2 ; Port B Input Pins bit 2
.equ PINB3 = 3 ; Port B Input Pins bit 3
.equ PINB4 = 4 ; Port B Input Pins bit 4
.equ PINB5 = 5 ; Port B Input Pins bit 5
.equ PINB6 = 6 ; Port B Input Pins bit 6
.equ PINB7 = 7 ; Port B Input Pins bit 7
; ***** PORTC ************************
; PORTC - Port C Data Register
.equ PORTC0 = 0 ; Port C Data Register bit 0
.equ PC0 = 0 ; For compatibility
.equ PORTC1 = 1 ; Port C Data Register bit 1
.equ PC1 = 1 ; For compatibility
.equ PORTC2 = 2 ; Port C Data Register bit 2
.equ PC2 = 2 ; For compatibility
.equ PORTC3 = 3 ; Port C Data Register bit 3
.equ PC3 = 3 ; For compatibility
.equ PORTC4 = 4 ; Port C Data Register bit 4
.equ PC4 = 4 ; For compatibility
.equ PORTC5 = 5 ; Port C Data Register bit 5
.equ PC5 = 5 ; For compatibility
; PINC - Port C Input Pins
.equ PINC0 = 0 ; Port C Input Pins bit 0
.equ PINC1 = 1 ; Port C Input Pins bit 1
.equ PINC2 = 2 ; Port C Input Pins bit 2
.equ PINC3 = 3 ; Port C Input Pins bit 3
.equ PINC4 = 4 ; Port C Input Pins bit 4
; ***** TIMER_COUNTER_0 **************
; TCCR0A - Timer/Counter 0 Control Register A
.equ WGM00 = 0 ; Waveform Generation Mode
.equ ICS0 = 3 ; Input Capture Select
.equ ICES0 = 4 ; Input Capture Edge Select
.equ ICNC0 = 5 ; Input Capture Noise Canceler
.equ ICEN0 = 6 ; Input Capture Mode Enable
.equ TCW0 = 7 ; Timer/Counter Width
; TCCR0B - Timer/Counter0 Control Register B
.equ CS00 = 0 ; Clock Select0 bit 0
.equ CS01 = 1 ; Clock Select0 bit 1
.equ CS02 = 2 ; Clock Select0 bit 2
; OCR0A - Output Compare Register 0A
.equ OCR0A0 = 0 ;
.equ OCR0A1 = 1 ;
.equ OCR0A2 = 2 ;
.equ OCR0A3 = 3 ;
.equ OCR0A4 = 4 ;
.equ OCR0A5 = 5 ;
.equ OCR0A6 = 6 ;
.equ OCR0A7 = 7 ;
; OCR0B - Output Compare Register B
.equ OCR0B0 = 0 ;
.equ OCR0B1 = 1 ;
.equ OCR0B2 = 2 ;
.equ OCR0B3 = 3 ;
.equ OCR0B4 = 4 ;
.equ OCR0B5 = 5 ;
.equ OCR0B6 = 6 ;
.equ OCR0B7 = 7 ;
; TIMSK0 - Timer/Counter Interrupt Mask Register
.equ TOIE0 = 0 ; Timer/Counter0 Overflow Interrupt Enable
.equ OCIE0A = 1 ; Timer/Counter0 Output Compare A Interrupt Enable
.equ OCIE0B = 2 ; Timer/Counter0 Output Compare B Interrupt Enable
.equ ICIE0 = 3 ; Timer/Counter n Input Capture Interrupt Enable
; TIFR0 - Timer/Counter Interrupt Flag register
.equ TOV0 = 0 ; Timer/Counter0 Overflow Flag
.equ OCF0A = 1 ; Timer/Counter0 Output Compare Flag A
.equ OCF0B = 2 ; Timer/Counter0 Output Compare Flag B
.equ ICF0 = 3 ; Timer/Counter 0 Input Capture Flag
; GTCCR - General Timer/Counter Control Register
;.equ PSRSYNC = 0 ; Prescaler Reset
;.equ TSM = 7 ; Timer/Counter Synchronization Mode
; ***** BOOT_LOAD ********************
; SPMCSR - Store Program Memory Control and Status Register
.equ SPMEN = 0 ; Store Program Memory Enable
.equ PGERS = 1 ; Page Erase
.equ PGWRT = 2 ; Page Write
.equ LBSET = 3 ; Lock Bit Set
.equ RWWSRE = 4 ; Read-While-Write Section Read Enable
.equ SIGRD = 5 ; Signature Row Read
.equ RWWSB = 6 ; Read-While-Write Section Busy
.equ SPMIE = 7 ; SPM Interrupt Enable
; ***** LOCKSBITS ********************************************************
.equ LB1 = 0 ; Lock bit
.equ LB2 = 1 ; Lock bit
.equ BLB01 = 2 ; Boot Lock bit
.equ BLB02 = 3 ; Boot Lock bit
.equ BLB11 = 4 ; Boot lock bit
.equ BLB12 = 5 ; Boot lock bit
; ***** FUSES ************************************************************
; LOW fuse bits
.equ OSCSEL0 = 0 ; Oscillator Select
.equ OSCSEL1 = 1 ; Oscillator Select
.equ SUT0 = 2 ; Select start-up time
.equ SUT1 = 3 ; Select start-up time
.equ SUT2 = 4 ; Select start-up time
.equ SPIEN = 5 ; Enable Serial programming and Data Downloading
.equ EESAVE = 6 ; EEPROM memory is preserved through chip erase
.equ WDTON = 7 ; Watchdog Timer Always On
; HIGH fuse bits
.equ BOOTRST = 0 ; Select Reset Vector
.equ BOOTSZ0 = 1 ; Select Boot Size
.equ BOOTSZ1 = 2 ; Select Boot Size
.equ DWEN = 3 ; Enable debugWire
.equ DUVRDINIT = 4 ; Reset Value of DUVRDRegister
; ***** CPU REGISTER DEFINITIONS *****************************************
.def XH = r27
.def XL = r26
.def YH = r29
.def YL = r28
.def ZH = r31
.def ZL = r30
; ***** DATA MEMORY DECLARATIONS *****************************************
.equ FLASHEND = 0x3fff ; Note: Word address
.equ IOEND = 0x00ff
.equ SRAM_START = 0x0100
.equ SRAM_SIZE = 2048
.equ RAMEND = 0x08ff
.equ XRAMEND = 0x0000
.equ E2END = 0x03ff
.equ EEPROMEND = 0x03ff
.equ EEADRBITS = 10
#pragma AVRPART MEMORY PROG_FLASH 32768
#pragma AVRPART MEMORY EEPROM 1024
#pragma AVRPART MEMORY INT_SRAM SIZE 2048
#pragma AVRPART MEMORY INT_SRAM START_ADDR 0x100
; ***** BOOTLOADER DECLARATIONS ******************************************
.equ NRWW_START_ADDR = 0x3800
.equ NRWW_STOP_ADDR = 0x3fff
.equ RWW_START_ADDR = 0x0
.equ RWW_STOP_ADDR = 0x37ff
.equ PAGESIZE = 64
.equ FIRSTBOOTSTART = 0x3f00
.equ SECONDBOOTSTART = 0x3e00
.equ THIRDBOOTSTART = 0x3c00
.equ FOURTHBOOTSTART = 0x3800
.equ SMALLBOOTSTART = FIRSTBOOTSTART
.equ LARGEBOOTSTART = FOURTHBOOTSTART
; ***** INTERRUPT VECTORS ************************************************
.equ BPINTaddr = 0x0002 ; Battery Protection Interrupt
.equ VREGMONaddr = 0x0004 ; Voltage regulator monitor interrupt
.equ INT0addr = 0x0006 ; External Interrupt Request 0
.equ INT1addr = 0x0008 ; External Interrupt Request 1
.equ INT2addr = 0x000a ; External Interrupt Request 2
.equ INT3addr = 0x000c ; External Interrupt Request 3
.equ PCI0addr = 0x000e ; Pin Change Interrupt 0
.equ PCI1addr = 0x0010 ; Pin Change Interrupt 1
.equ WDTaddr = 0x0012 ; Watchdog Timeout Interrupt
.equ BGSCDaddr = 0x0014 ; Bandgap Buffer Short Circuit Detected
.equ CHDETaddr = 0x0016 ; Charger Detect
.equ TIMER1_ICaddr = 0x0018 ; Timer 1 Input capture
.equ OC1Aaddr = 0x001a ; Timer 1 Compare Match A
.equ OC1Baddr = 0x001c ; Timer 1 Compare Match B
.equ OVF1addr = 0x001e ; Timer 1 overflow
.equ TIMER0_ICaddr = 0x0020 ; Timer 0 Input Capture
.equ OC0Aaddr = 0x0022 ; Timer 0 Comapre Match A
.equ OC0Baddr = 0x0024 ; Timer 0 Compare Match B
.equ OVF0addr = 0x0026 ; Timer 0 Overflow
.equ TWICDaddr = 0x0028 ; Two-Wire Bus Connect/Disconnect
.equ TWIaddr = 0x002a ; Two-Wire Serial Interface
.equ SPIaddr = 0x002c ; SPI Serial transfer complete
.equ VADCaddr = 0x002e ; Voltage ADC Conversion Complete
.equ CADICaddr = 0x0030 ; Coulomb Counter ADC Conversion Complete
.equ CADRCaddr = 0x0032 ; Coloumb Counter ADC Regular Current
.equ CADACaddr = 0x0034 ; Coloumb Counter ADC Accumulator
.equ ERDYaddr = 0x0036 ; EEPROM Ready
.equ SPMRaddr = 0x0038 ; SPM Ready
.equ INT_VECTORS_SIZE = 58 ; size in words
#endif /* _M32HVBDEF_INC_ */
; ***** END OF FILE ******************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -