// Automatically generated file. DO NOT EDIT.
// Generated by gen-device-avr.go from ATmega64HVE2.atdf, see http://packs.download.atmel.com/

// +build avr,atmega64hve2

// Device information for the ATmega64HVE2.
package avr

import (
	"runtime/interrupt"
	"runtime/volatile"
	"unsafe"
)

// Some information about this device.
const (
	DEVICE = "ATmega64HVE2"
	ARCH   = "AVR8"
	FAMILY = "megaAVR"
)

// Interrupts
const (
	IRQ_RESET        = 0  // External Pin, Power-on Reset, Brown-out Reset and Watchdog Reset
	IRQ_INT0         = 1  // External Interrupt 0
	IRQ_PCINT0       = 2  // Pin Change Interrupt 0
	IRQ_PCINT1       = 3  // Pin Change Interrupt 1
	IRQ_WDT          = 4  // Watchdog Timeout Interrupt
	IRQ_WAKEUP       = 5  // Wakeup Timer Overflow
	IRQ_TIMER1_IC    = 6  // Timer 1 Input capture
	IRQ_TIMER1_COMPA = 7  // Timer 1 Compare Match A
	IRQ_TIMER1_COMPB = 8  // Timer 1 Compare Match B
	IRQ_TIMER1_OVF   = 9  // Timer 1 overflow
	IRQ_TIMER0_IC    = 10 // Timer 0 Input Capture
	IRQ_TIMER0_COMPA = 11 // Timer 0 Comapre Match A
	IRQ_TIMER0_COMPB = 12 // Timer 0 Compare Match B
	IRQ_TIMER0_OVF   = 13 // Timer 0 Overflow
	IRQ_LIN_STATUS   = 14 // LIN Status Interrupt
	IRQ_LIN_ERROR    = 15 // LIN Error Interrupt
	IRQ_SPI_STC      = 16 // SPI Serial transfer complete
	IRQ_VADC_CONV    = 17 // Voltage ADC Instantaneous Conversion Complete
	IRQ_VADC_ACC     = 18 // Voltage ADC Accumulated Conversion Complete
	IRQ_CADC_CONV    = 19 // C-ADC Instantaneous Conversion Complete
	IRQ_CADC_REG_CUR = 20 // C-ADC Regular Current
	IRQ_CADC_ACC     = 21 // C-ADC Accumulated Conversion Complete
	IRQ_EE_READY     = 22 // EEPROM Ready
	IRQ_SPM          = 23 // SPM Ready
	IRQ_PLL          = 24 // PLL Lock Change Interrupt
	IRQ_max          = 24 // Highest interrupt number on this device.
)

// Map interrupt numbers to function names.
// These aren't real calls, they're removed by the compiler.
var (
	_ = interrupt.Register(IRQ_RESET, "__vector_RESET")
	_ = interrupt.Register(IRQ_INT0, "__vector_INT0")
	_ = interrupt.Register(IRQ_PCINT0, "__vector_PCINT0")
	_ = interrupt.Register(IRQ_PCINT1, "__vector_PCINT1")
	_ = interrupt.Register(IRQ_WDT, "__vector_WDT")
	_ = interrupt.Register(IRQ_WAKEUP, "__vector_WAKEUP")
	_ = interrupt.Register(IRQ_TIMER1_IC, "__vector_TIMER1_IC")
	_ = interrupt.Register(IRQ_TIMER1_COMPA, "__vector_TIMER1_COMPA")
	_ = interrupt.Register(IRQ_TIMER1_COMPB, "__vector_TIMER1_COMPB")
	_ = interrupt.Register(IRQ_TIMER1_OVF, "__vector_TIMER1_OVF")
	_ = interrupt.Register(IRQ_TIMER0_IC, "__vector_TIMER0_IC")
	_ = interrupt.Register(IRQ_TIMER0_COMPA, "__vector_TIMER0_COMPA")
	_ = interrupt.Register(IRQ_TIMER0_COMPB, "__vector_TIMER0_COMPB")
	_ = interrupt.Register(IRQ_TIMER0_OVF, "__vector_TIMER0_OVF")
	_ = interrupt.Register(IRQ_LIN_STATUS, "__vector_LIN_STATUS")
	_ = interrupt.Register(IRQ_LIN_ERROR, "__vector_LIN_ERROR")
	_ = interrupt.Register(IRQ_SPI_STC, "__vector_SPI_STC")
	_ = interrupt.Register(IRQ_VADC_CONV, "__vector_VADC_CONV")
	_ = interrupt.Register(IRQ_VADC_ACC, "__vector_VADC_ACC")
	_ = interrupt.Register(IRQ_CADC_CONV, "__vector_CADC_CONV")
	_ = interrupt.Register(IRQ_CADC_REG_CUR, "__vector_CADC_REG_CUR")
	_ = interrupt.Register(IRQ_CADC_ACC, "__vector_CADC_ACC")
	_ = interrupt.Register(IRQ_EE_READY, "__vector_EE_READY")
	_ = interrupt.Register(IRQ_SPM, "__vector_SPM")
	_ = interrupt.Register(IRQ_PLL, "__vector_PLL")
)

// Peripherals.
var (
	// Fuses
	LOW  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x0)))
	HIGH = (*volatile.Register8)(unsafe.Pointer(uintptr(0x1)))

	// Lockbits
	LOCKBIT = (*volatile.Register8)(unsafe.Pointer(uintptr(0x0)))

	// Serial Peripheral Interface
	SPCR = (*volatile.Register8)(unsafe.Pointer(uintptr(0x4c)))
	SPSR = (*volatile.Register8)(unsafe.Pointer(uintptr(0x4d)))
	SPDR = (*volatile.Register8)(unsafe.Pointer(uintptr(0x4e)))

	// EEPROM
	EEARL = (*volatile.Register8)(unsafe.Pointer(uintptr(0x41)))
	EEARH = (*volatile.Register8)(unsafe.Pointer(uintptr(0x42)))
	EEDR  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x40)))
	EECR  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x3f)))

	// Timer/Counter, 16-bit
	TCCR1B = (*volatile.Register8)(unsafe.Pointer(uintptr(0x81)))
	TCCR1A = (*volatile.Register8)(unsafe.Pointer(uintptr(0x80)))
	TCNT1L = (*volatile.Register8)(unsafe.Pointer(uintptr(0x84)))
	TCNT1H = (*volatile.Register8)(unsafe.Pointer(uintptr(0x85)))
	OCR1A  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x88)))
	OCR1B  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x89)))
	TIMSK1 = (*volatile.Register8)(unsafe.Pointer(uintptr(0x6f)))
	TIFR1  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x36)))
	TCCR0B = (*volatile.Register8)(unsafe.Pointer(uintptr(0x45)))
	TCCR0A = (*volatile.Register8)(unsafe.Pointer(uintptr(0x44)))
	TCNT0L = (*volatile.Register8)(unsafe.Pointer(uintptr(0x46)))
	TCNT0H = (*volatile.Register8)(unsafe.Pointer(uintptr(0x47)))
	OCR0A  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x48)))
	OCR0B  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x49)))
	TIMSK0 = (*volatile.Register8)(unsafe.Pointer(uintptr(0x6e)))
	TIFR0  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x35)))

	// I/O Port
	PORTB = (*volatile.Register8)(unsafe.Pointer(uintptr(0x25)))
	DDRB  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x24)))
	PINB  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x23)))
	PBOV  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xdc)))
	PORTA = (*volatile.Register8)(unsafe.Pointer(uintptr(0x22)))
	DDRA  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x21)))
	PINA  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x20)))

	// Bootloader
	SPMCSR = (*volatile.Register8)(unsafe.Pointer(uintptr(0x57)))

	// Analog-to-Digital Converter
	ADSCSRA = (*volatile.Register8)(unsafe.Pointer(uintptr(0xe0)))
	ADSCSRB = (*volatile.Register8)(unsafe.Pointer(uintptr(0xe1)))
	ADCRA   = (*volatile.Register8)(unsafe.Pointer(uintptr(0xe2)))
	ADCRB   = (*volatile.Register8)(unsafe.Pointer(uintptr(0xe3)))
	ADCRC   = (*volatile.Register8)(unsafe.Pointer(uintptr(0xe4)))
	ADCRD   = (*volatile.Register8)(unsafe.Pointer(uintptr(0xe5)))
	ADCRE   = (*volatile.Register8)(unsafe.Pointer(uintptr(0xe6)))
	ADIFR   = (*volatile.Register8)(unsafe.Pointer(uintptr(0xe7)))
	ADIMR   = (*volatile.Register8)(unsafe.Pointer(uintptr(0xe8)))
	CADRCLL = (*volatile.Register8)(unsafe.Pointer(uintptr(0xe9)))
	CADRCLH = (*volatile.Register8)(unsafe.Pointer(uintptr(0xea)))
	VADICL  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xf1)))
	VADICH  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xf2)))
	VADAC3  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xf6)))
	VADAC2  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xf5)))
	VADAC1  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xf4)))
	VADAC0  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xf3)))
	CADICL  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xeb)))
	CADICH  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xec)))
	CADAC3  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xf0)))
	CADAC2  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xef)))
	CADAC1  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xee)))
	CADAC0  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xed)))

	// Bandgap
	BGCSRA = (*volatile.Register8)(unsafe.Pointer(uintptr(0xd1)))
	BGCRA  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xd3)))
	BGCRB  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xd2)))
	BGLR   = (*volatile.Register8)(unsafe.Pointer(uintptr(0xd4)))

	// Local Interconnect Network
	LINCR   = (*volatile.Register8)(unsafe.Pointer(uintptr(0xc0)))
	LINSIR  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xc1)))
	LINENIR = (*volatile.Register8)(unsafe.Pointer(uintptr(0xc2)))
	LINERR  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xc3)))
	LINBTR  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xc4)))
	LINBRRL = (*volatile.Register8)(unsafe.Pointer(uintptr(0xc5)))
	LINBRRH = (*volatile.Register8)(unsafe.Pointer(uintptr(0xc6)))
	LINDLR  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xc7)))
	LINIDR  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xc8)))
	LINSEL  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xc9)))
	LINDAT  = (*volatile.Register8)(unsafe.Pointer(uintptr(0xca)))

	// CPU Registers
	SREG     = (*volatile.Register8)(unsafe.Pointer(uintptr(0x5f)))
	SPL      = (*volatile.Register8)(unsafe.Pointer(uintptr(0x5d)))
	SPH      = (*volatile.Register8)(unsafe.Pointer(uintptr(0x5e)))
	MCUCR    = (*volatile.Register8)(unsafe.Pointer(uintptr(0x55)))
	MCUSR    = (*volatile.Register8)(unsafe.Pointer(uintptr(0x54)))
	SOSCCALA = (*volatile.Register8)(unsafe.Pointer(uintptr(0x66)))
	SOSCCALB = (*volatile.Register8)(unsafe.Pointer(uintptr(0x67)))
	PLLCSR   = (*volatile.Register8)(unsafe.Pointer(uintptr(0xd8)))
	SMCR     = (*volatile.Register8)(unsafe.Pointer(uintptr(0x53)))
	GPIOR2   = (*volatile.Register8)(unsafe.Pointer(uintptr(0x4b)))
	GPIOR1   = (*volatile.Register8)(unsafe.Pointer(uintptr(0x4a)))
	GPIOR0   = (*volatile.Register8)(unsafe.Pointer(uintptr(0x3e)))
	DIDR0    = (*volatile.Register8)(unsafe.Pointer(uintptr(0x7e)))
	PRR0     = (*volatile.Register8)(unsafe.Pointer(uintptr(0x64)))
	CLKPR    = (*volatile.Register8)(unsafe.Pointer(uintptr(0x61)))

	// External Interrupts
	EICRA  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x69)))
	EIMSK  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x3d)))
	EIFR   = (*volatile.Register8)(unsafe.Pointer(uintptr(0x3c)))
	PCICR  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x68)))
	PCIFR  = (*volatile.Register8)(unsafe.Pointer(uintptr(0x3b)))
	PCMSK1 = (*volatile.Register8)(unsafe.Pointer(uintptr(0x6c)))
	PCMSK0 = (*volatile.Register8)(unsafe.Pointer(uintptr(0x6b)))

	// Watchdog Timer
	WDTCSR = (*volatile.Register8)(unsafe.Pointer(uintptr(0x60)))
	WDTCLR = (*volatile.Register8)(unsafe.Pointer(uintptr(0x63)))

	// Wakeup Timer
	WUTCSR = (*volatile.Register8)(unsafe.Pointer(uintptr(0x62)))
)

// Bitfields for FUSE: Fuses
const (
	// LOW
	LOW_WDTON   = 0x80 // Watch-dog Timer always on
	LOW_EESAVE  = 0x40 // Preserve EEPROM through the Chip Erase cycle
	LOW_SPIEN   = 0x20 // Serial program downloading (SPI) enabled
	LOW_BODEN   = 0x10 // Brown-out detection enabled
	LOW_CKDIV8  = 0x8  // Divide clock by 8
	LOW_SUT0    = 0x2  // Select start-up time
	LOW_SUT1    = 0x4  // Select start-up time
	LOW_OSCSEL0 = 0x1  // Oscillator select

	// HIGH
	HIGH_DWEN    = 0x8 // Debug Wire enable
	HIGH_BOOTSZ0 = 0x2 // Select Boot Size
	HIGH_BOOTSZ1 = 0x4 // Select Boot Size
	HIGH_BOOTRST = 0x1 // Boot Reset vector Enabled
)

// Bitfields for LOCKBIT: Lockbits
const (
	// LOCKBIT
	LOCKBIT_LB0   = 0x1  // Memory Lock
	LOCKBIT_LB1   = 0x2  // Memory Lock
	LOCKBIT_BLB00 = 0x4  // Boot Loader Protection Mode
	LOCKBIT_BLB01 = 0x8  // Boot Loader Protection Mode
	LOCKBIT_BLB10 = 0x10 // Boot Loader Protection Mode
	LOCKBIT_BLB11 = 0x20 // Boot Loader Protection Mode
)

// Bitfields for SPI: Serial Peripheral Interface
const (
	// SPCR: SPI Control Register
	SPCR_SPIE = 0x80 // SPI Interrupt Enable
	SPCR_SPE  = 0x40 // SPI Enable
	SPCR_DORD = 0x20 // Data Order
	SPCR_MSTR = 0x10 // Master/Slave Select
	SPCR_CPOL = 0x8  // Clock polarity
	SPCR_CPHA = 0x4  // Clock Phase
	SPCR_SPR0 = 0x1  // SPI Clock Rate Selects
	SPCR_SPR1 = 0x2  // SPI Clock Rate Selects

	// SPSR: SPI Status Register
	SPSR_SPIF  = 0x80 // SPI Interrupt Flag
	SPSR_WCOL  = 0x40 // Write Collision Flag
	SPSR_SPI2X = 0x1  // Double SPI Speed Bit
)

// Bitfields for EEPROM: EEPROM
const (
	// EECR: EEPROM Control Register
	EECR_EEPM0 = 0x10
	EECR_EEPM1 = 0x20
	EECR_EERIE = 0x8 // EEProm Ready Interrupt Enable
	EECR_EEMPE = 0x4 // EEPROM Master Write Enable
	EECR_EEPE  = 0x2 // EEPROM Write Enable
	EECR_EERE  = 0x1 // EEPROM Read Enable
)

// Bitfields for TC16: Timer/Counter, 16-bit
const (
	// TCCR1B: Timer/Counter1 Control Register B
	TCCR1B_CS0 = 0x1 // Clock Select1 bis
	TCCR1B_CS1 = 0x2 // Clock Select1 bis
	TCCR1B_CS2 = 0x4 // Clock Select1 bis

	// TCCR1A: Timer/Counter 1 Control Register A
	TCCR1A_TCW1  = 0x80 // Timer/Counter Width
	TCCR1A_ICEN1 = 0x40 // Input Capture Mode Enable
	TCCR1A_ICNC1 = 0x20 // Input Capture Noise Canceler
	TCCR1A_ICES1 = 0x10 // Input Capture Edge Select
	TCCR1A_ICS1  = 0x8  // Input Capture Select
	TCCR1A_WGM10 = 0x1  // Waveform Generation Mode

	// TIMSK1: Timer/Counter Interrupt Mask Register
	TIMSK1_ICIE1  = 0x8 // Timer/Counter n Input Capture Interrupt Enable
	TIMSK1_OCIE1B = 0x4 // Timer/Counter1 Output Compare B Interrupt Enable
	TIMSK1_OCIE1A = 0x2 // Timer/Counter1 Output Compare A Interrupt Enable
	TIMSK1_TOIE1  = 0x1 // Timer/Counter1 Overflow Interrupt Enable

	// TIFR1: Timer/Counter Interrupt Flag register
	TIFR1_ICF1  = 0x8 // Timer/Counter 1 Input Capture Flag
	TIFR1_OCF1B = 0x4 // Timer/Counter1 Output Compare Flag B
	TIFR1_OCF1A = 0x2 // Timer/Counter1 Output Compare Flag A
	TIFR1_TOV1  = 0x1 // Timer/Counter1 Overflow Flag

	// TCCR0B: Timer/Counter0 Control Register B
	TCCR0B_CS02 = 0x4 // Clock Select0 bit 2
	TCCR0B_CS01 = 0x2 // Clock Select0 bit 1
	TCCR0B_CS00 = 0x1 // Clock Select0 bit 0

	// TCCR0A: Timer/Counter 0 Control Register A
	TCCR0A_TCW0  = 0x80 // Timer/Counter Width
	TCCR0A_ICEN0 = 0x40 // Input Capture Mode Enable
	TCCR0A_ICNC0 = 0x20 // Input Capture Noise Canceler
	TCCR0A_ICES0 = 0x10 // Input Capture Edge Select
	TCCR0A_ICS0  = 0x8  // Input Capture Select
	TCCR0A_WGM00 = 0x1  // Waveform Generation Mode

	// TIMSK0: Timer/Counter Interrupt Mask Register
	TIMSK0_ICIE0  = 0x8 // Timer/Counter n Input Capture Interrupt Enable
	TIMSK0_OCIE0B = 0x4 // Timer/Counter0 Output Compare B Interrupt Enable
	TIMSK0_OCIE0A = 0x2 // Timer/Counter0 Output Compare A Interrupt Enable
	TIMSK0_TOIE0  = 0x1 // Timer/Counter0 Overflow Interrupt Enable

	// TIFR0: Timer/Counter Interrupt Flag register
	TIFR0_ICF0  = 0x8 // Timer/Counter 0 Input Capture Flag
	TIFR0_OCF0B = 0x4 // Timer/Counter0 Output Compare Flag B
	TIFR0_OCF0A = 0x2 // Timer/Counter0 Output Compare Flag A
	TIFR0_TOV0  = 0x1 // Timer/Counter0 Overflow Flag
)

// Bitfields for PORT: I/O Port
const (
	// PBOV: Port B Override
	PBOV_PBOVCE = 0x80 // Port B Override Change Enable
	PBOV_PBOE3  = 0x8  // Port B Override Enable 3
	PBOV_PBOE0  = 0x1  // Port B Override Enable 0
)

// Bitfields for BOOT_LOAD: Bootloader
const (
	// SPMCSR: Store Program Memory Control and Status Register
	SPMCSR_SPMIE  = 0x80 // SPM Interrupt Enable
	SPMCSR_RWWSB  = 0x40 // Read-While-Write Section Busy
	SPMCSR_SIGRD  = 0x20 // Signature Row Read
	SPMCSR_RWWSRE = 0x10 // Read-While-Write Section Read Enable
	SPMCSR_LBSET  = 0x8  // Lock Bit Set
	SPMCSR_PGWRT  = 0x4  // Page Write
	SPMCSR_PGERS  = 0x2  // Page Erase
	SPMCSR_SPMEN  = 0x1  // Store Program Memory Enable
)

// Bitfields for ADC: Analog-to-Digital Converter
const (
	// ADSCSRA: ADC Synchronization Control and Status Register
	ADSCSRA_SBSY  = 0x4 // Synchronization Busy
	ADSCSRA_SCMD0 = 0x1 // Synchronization Command
	ADSCSRA_SCMD1 = 0x2 // Synchronization Command

	// ADSCSRB: ADC Synchronization Control and Status Register
	ADSCSRB_VADICPS = 0x40 // V-ADC Instantaneous Conversion Polarity Status
	ADSCSRB_VADACRB = 0x20 // VADAC Data Read Out Busy
	ADSCSRB_VADICRB = 0x10 // VADIC Data Read Out Busy
	ADSCSRB_CADICPS = 0x4  // C-ADC Instantaneous Conversion Polarity Status
	ADSCSRB_CADACRB = 0x2  // CADAC Data Read Out Busy
	ADSCSRB_CADICRB = 0x1  // CADIC Data Read Out Busy

	// ADCRA: ADC Control Register A
	ADCRA_ADPSEL = 0x8 // ADC Polarity Select
	ADCRA_ADCMS0 = 0x2 // C-ADC Chopper Mode Select
	ADCRA_ADCMS1 = 0x4 // C-ADC Chopper Mode Select
	ADCRA_CKSEL  = 0x1 // Sampling Clock Select

	// ADCRB: ADC Control Register B
	ADCRB_ADIDES0 = 0x8  // Instantaneous Decimation Ratio Select
	ADCRB_ADIDES1 = 0x10 // Instantaneous Decimation Ratio Select
	ADCRB_ADADES0 = 0x1  // Accumulated Decimation Ratio Select
	ADCRB_ADADES1 = 0x2  // Accumulated Decimation Ratio Select
	ADCRB_ADADES2 = 0x4  // Accumulated Decimation Ratio Select

	// ADCRC: ADC Control Register B
	ADCRC_CADEN   = 0x80 // C-ADC Enable
	ADCRC_CADRCM0 = 0x10 // C-ADC Regular Current Comparator Mode
	ADCRC_CADRCM1 = 0x20 // C-ADC Regular Current Comparator Mode
	ADCRC_CADRCT0 = 0x1  // C-ADC Regular Current Count Threshold
	ADCRC_CADRCT1 = 0x2  // C-ADC Regular Current Count Threshold
	ADCRC_CADRCT2 = 0x4  // C-ADC Regular Current Count Threshold
	ADCRC_CADRCT3 = 0x8  // C-ADC Regular Current Count Threshold

	// ADCRD: ADC Control Register D
	ADCRD_CADG0   = 0x8  // C-ADC Gain
	ADCRD_CADG1   = 0x10 // C-ADC Gain
	ADCRD_CADG2   = 0x20 // C-ADC Gain
	ADCRD_CADPDM0 = 0x2  // C-ADC Pin Diagnostics Mode
	ADCRD_CADPDM1 = 0x4  // C-ADC Pin Diagnostics Mode
	ADCRD_CADDSEL = 0x1  // C-ADC Diagnostics Channel Select

	// ADCRE: ADC Control Register E
	ADCRE_VADEN   = 0x80 // V-ADC Enable
	ADCRE_VADREFS = 0x20 // V-ADC Reference Select
	ADCRE_VADPDM0 = 0x8  // V-ADC Pin Diagnostics Mode
	ADCRE_VADPDM1 = 0x10 // V-ADC Pin Diagnostics Mode
	ADCRE_VADMUX0 = 0x1  // V-ADC Channel Select
	ADCRE_VADMUX1 = 0x2  // V-ADC Channel Select
	ADCRE_VADMUX2 = 0x4  // V-ADC Channel Select

	// ADIFR: ADC Interrupt Flag Register
	ADIFR_VADACIF = 0x20 // V-ADC Accumulated Voltage Interrupt Flag
	ADIFR_VADICIF = 0x10 // V-DAC Instantaneous Voltage Interrupt Flag
	ADIFR_CADRCIF = 0x4  // C-ADC Regulator Current Interrupt Flag
	ADIFR_CADACIF = 0x2  // C-ADC Accumulated Current Interrupt Flag
	ADIFR_CADICIF = 0x1  // C-ADC Instantaneous Current Interrupt Flag

	// ADIMR: ADC Interrupt Mask Register
	ADIMR_VADACIE = 0x20 // V-ADC Accumulated Voltage Interrupt Enable
	ADIMR_VADICIE = 0x10 // V-DAC Instantaneous Voltage Interrupt Enable
	ADIMR_CADRCIE = 0x4  // C-ADC Regulator Current Interrupt Enable
	ADIMR_CADACIE = 0x2  // C-ADC Accumulated Current Interrupt Enable
	ADIMR_CADICIE = 0x1  // C-ADC Instantaneous Current Interrupt Enable
)

// Bitfields for BANDGAP: Bandgap
const (
	// BGCSRA: Bandgap Control and Status Register A
	BGCSRA_BGSC0 = 0x1 // Band Gap Sample Configuration
	BGCSRA_BGSC1 = 0x2 // Band Gap Sample Configuration
	BGCSRA_BGSC2 = 0x4 // Band Gap Sample Configuration

	// BGCRA: Band Gap Calibration Register A
	BGCRA_BGCN0 = 0x1  // Band Gap Calibration Nominal
	BGCRA_BGCN1 = 0x2  // Band Gap Calibration Nominal
	BGCRA_BGCN2 = 0x4  // Band Gap Calibration Nominal
	BGCRA_BGCN3 = 0x8  // Band Gap Calibration Nominal
	BGCRA_BGCN4 = 0x10 // Band Gap Calibration Nominal
	BGCRA_BGCN5 = 0x20 // Band Gap Calibration Nominal
	BGCRA_BGCN6 = 0x40 // Band Gap Calibration Nominal
	BGCRA_BGCN7 = 0x80 // Band Gap Calibration Nominal

	// BGCRB: Band Gap Calibration Register B
	BGCRB_BGCL0 = 0x1  // Band Gap Calibration Linear
	BGCRB_BGCL1 = 0x2  // Band Gap Calibration Linear
	BGCRB_BGCL2 = 0x4  // Band Gap Calibration Linear
	BGCRB_BGCL3 = 0x8  // Band Gap Calibration Linear
	BGCRB_BGCL4 = 0x10 // Band Gap Calibration Linear
	BGCRB_BGCL5 = 0x20 // Band Gap Calibration Linear
	BGCRB_BGCL6 = 0x40 // Band Gap Calibration Linear
	BGCRB_BGCL7 = 0x80 // Band Gap Calibration Linear

	// BGLR: Band Gap Lock Register
	BGLR_BGPLE = 0x2 // Band Gap Lock Enable
	BGLR_BGPL  = 0x1 // Band Gap Lock
)

// Bitfields for LINUART: Local Interconnect Network
const (
	// LINCR: LIN Control Register
	LINCR_LSWRES = 0x80 // Software Reset
	LINCR_LIN13  = 0x40 // LIN Standard
	LINCR_LCONF0 = 0x10 // LIN Configuration bits
	LINCR_LCONF1 = 0x20 // LIN Configuration bits
	LINCR_LENA   = 0x8  // LIN or UART Enable
	LINCR_LCMD0  = 0x1  // LIN Command and Mode bits
	LINCR_LCMD1  = 0x2  // LIN Command and Mode bits
	LINCR_LCMD2  = 0x4  // LIN Command and Mode bits

	// LINSIR: LIN Status and Interrupt Register
	LINSIR_LIDST0 = 0x20 // Identifier Status bits
	LINSIR_LIDST1 = 0x40 // Identifier Status bits
	LINSIR_LIDST2 = 0x80 // Identifier Status bits
	LINSIR_LBUSY  = 0x10 // Busy Signal
	LINSIR_LERR   = 0x8  // Error Interrupt
	LINSIR_LIDOK  = 0x4  // Identifier Interrupt
	LINSIR_LTXOK  = 0x2  // Transmit Performed Interrupt
	LINSIR_LRXOK  = 0x1  // Receive Performed Interrupt

	// LINENIR: LIN Enable Interrupt Register
	LINENIR_LENERR  = 0x8 // Enable Error Interrupt
	LINENIR_LENIDOK = 0x4 // Enable Identifier Interrupt
	LINENIR_LENTXOK = 0x2 // Enable Transmit Performed Interrupt
	LINENIR_LENRXOK = 0x1 // Enable Receive Performed Interrupt

	// LINERR: LIN Error Register
	LINERR_LABORT = 0x80 // Abort Flag
	LINERR_LTOERR = 0x40 // Frame Time Out Error Flag
	LINERR_LOVERR = 0x20 // Overrun Error Flag
	LINERR_LFERR  = 0x10 // Framing Error Flag
	LINERR_LSERR  = 0x8  // Synchronization Error Flag
	LINERR_LPERR  = 0x4  // Parity Error Flag
	LINERR_LCERR  = 0x2  // Checksum Error Flag
	LINERR_LBERR  = 0x1  // Bit Error Flag

	// LINBTR: LIN Bit Timing Register
	LINBTR_LDISR = 0x80 // Disable Bit Timing Resynchronization
	LINBTR_LBT0  = 0x1  // LIN Bit Timing bits
	LINBTR_LBT1  = 0x2  // LIN Bit Timing bits
	LINBTR_LBT2  = 0x4  // LIN Bit Timing bits
	LINBTR_LBT3  = 0x8  // LIN Bit Timing bits
	LINBTR_LBT4  = 0x10 // LIN Bit Timing bits
	LINBTR_LBT5  = 0x20 // LIN Bit Timing bits

	// LINBRRL: LIN Baud Rate Low Register
	LINBRRL_LDIV0 = 0x1
	LINBRRL_LDIV1 = 0x2
	LINBRRL_LDIV2 = 0x4
	LINBRRL_LDIV3 = 0x8
	LINBRRL_LDIV4 = 0x10
	LINBRRL_LDIV5 = 0x20
	LINBRRL_LDIV6 = 0x40
	LINBRRL_LDIV7 = 0x80

	// LINBRRH: LIN Baud Rate High Register
	LINBRRH_LDIV0 = 0x1
	LINBRRH_LDIV1 = 0x2
	LINBRRH_LDIV2 = 0x4
	LINBRRH_LDIV3 = 0x8

	// LINDLR: LIN Data Length Register
	LINDLR_LTXDL0 = 0x10 // LIN Transmit Data Length bits
	LINDLR_LTXDL1 = 0x20 // LIN Transmit Data Length bits
	LINDLR_LTXDL2 = 0x40 // LIN Transmit Data Length bits
	LINDLR_LTXDL3 = 0x80 // LIN Transmit Data Length bits
	LINDLR_LRXDL0 = 0x1  // LIN Receive Data Length bits
	LINDLR_LRXDL1 = 0x2  // LIN Receive Data Length bits
	LINDLR_LRXDL2 = 0x4  // LIN Receive Data Length bits
	LINDLR_LRXDL3 = 0x8  // LIN Receive Data Length bits

	// LINIDR: LIN Identifier Register
	LINIDR_LP0  = 0x40 // Parity bits
	LINIDR_LP1  = 0x80 // Parity bits
	LINIDR_LID0 = 0x1  // Identifier bit 5 or Data Length bits
	LINIDR_LID1 = 0x2  // Identifier bit 5 or Data Length bits
	LINIDR_LID2 = 0x4  // Identifier bit 5 or Data Length bits
	LINIDR_LID3 = 0x8  // Identifier bit 5 or Data Length bits
	LINIDR_LID4 = 0x10 // Identifier bit 5 or Data Length bits
	LINIDR_LID5 = 0x20 // Identifier bit 5 or Data Length bits

	// LINSEL: LIN Data Buffer Selection Register
	LINSEL_LAINC  = 0x8 // Auto Increment of Data Buffer Index (Active Low)
	LINSEL_LINDX0 = 0x1 // FIFO LIN Data Buffer Index bits
	LINSEL_LINDX1 = 0x2 // FIFO LIN Data Buffer Index bits
	LINSEL_LINDX2 = 0x4 // FIFO LIN Data Buffer Index bits

	// LINDAT: LIN Data Register
	LINDAT_LDATA0 = 0x1
	LINDAT_LDATA1 = 0x2
	LINDAT_LDATA2 = 0x4
	LINDAT_LDATA3 = 0x8
	LINDAT_LDATA4 = 0x10
	LINDAT_LDATA5 = 0x20
	LINDAT_LDATA6 = 0x40
	LINDAT_LDATA7 = 0x80
)

// Bitfields for CPU: CPU Registers
const (
	// SREG: Status Register
	SREG_I = 0x80 // Global Interrupt Enable
	SREG_T = 0x40 // Bit Copy Storage
	SREG_H = 0x20 // Half Carry Flag
	SREG_S = 0x10 // Sign Bit
	SREG_V = 0x8  // Two's Complement Overflow Flag
	SREG_N = 0x4  // Negative Flag
	SREG_Z = 0x2  // Zero Flag
	SREG_C = 0x1  // Carry Flag

	// MCUCR: MCU Control Register
	MCUCR_CKOE  = 0x20 // Clock Output Enable
	MCUCR_PUD   = 0x10 // Pull-up disable
	MCUCR_IVSEL = 0x2  // Interrupt Vector Select
	MCUCR_IVCE  = 0x1  // Interrupt Vector Change Enable

	// MCUSR: MCU Status Register
	MCUSR_OCDRF = 0x10 // OCD Reset Flag
	MCUSR_WDRF  = 0x8  // Watchdog Reset Flag
	MCUSR_BODRF = 0x4  // Brown-out Reset Flag
	MCUSR_EXTRF = 0x2  // External Reset Flag
	MCUSR_PORF  = 0x1  // Power-on reset flag

	// PLLCSR: PLL Control and Status Register
	PLLCSR_SWEN   = 0x20 // PLL Software Enable
	PLLCSR_LOCK   = 0x10 // PLL Lock
	PLLCSR_PLLCIF = 0x2  // PLL Lock Change Interrupt Flag
	PLLCSR_PLLCIE = 0x1  // PLL Lock Change Interrupt Enable

	// SMCR: Sleep Mode Control Register
	SMCR_SM0 = 0x2 // Sleep Mode Select bits
	SMCR_SM1 = 0x4 // Sleep Mode Select bits
	SMCR_SM2 = 0x8 // Sleep Mode Select bits
	SMCR_SE  = 0x1 // Sleep Enable

	// DIDR0: Digital Input Disable Register
	DIDR0_PA1DID = 0x2 // When this bit is written logic one, the digital input buffer of the corresponding V_ADC pin is disabled.
	DIDR0_PA0DID = 0x1 // When this bit is written logic one, the digital input buffer of the corresponding V_ADC pin is disabled.

	// PRR0: Power Reduction Register 0
	PRR0_PRLIN  = 0x8 // Power Reduction LIN UART Interface
	PRR0_PRSPI  = 0x4 // Power reduction SPI
	PRR0_PRTIM1 = 0x2 // Power Reduction Timer/Counter1
	PRR0_PRTIM0 = 0x1 // Power Reduction Timer/Counter0

	// CLKPR: Clock Prescale Register
	CLKPR_CLKPCE = 0x80 // Clock Prescaler Change Enable
	CLKPR_CLKPS0 = 0x1  // Clock Prescaler Select Bits
	CLKPR_CLKPS1 = 0x2  // Clock Prescaler Select Bits
)

// Bitfields for EXINT: External Interrupts
const (
	// EICRA: External Interrupt Control Register
	EICRA_ISC01 = 0x2 // External Interrupt Sense Control 0 Bit 1
	EICRA_ISC00 = 0x1 // External Interrupt Sense Control 0 Bit 0

	// EIMSK: External Interrupt Mask Register
	EIMSK_INT0 = 0x1 // External Interrupt Request 0 Enable

	// EIFR: External Interrupt Flag Register
	EIFR_INTF0 = 0x1 // External Interrupt Flag 0

	// PCICR: Pin Change Interrupt Control Register
	PCICR_PCIE0 = 0x1 // Pin Change Interrupt Enables
	PCICR_PCIE1 = 0x2 // Pin Change Interrupt Enables

	// PCIFR: Pin Change Interrupt Flag Register
	PCIFR_PCIF0 = 0x1 // Pin Change Interrupt Flags
	PCIFR_PCIF1 = 0x2 // Pin Change Interrupt Flags
)

// Bitfields for WDT: Watchdog Timer
const (
	// WDTCSR: Watchdog Timer Control Register
	WDTCSR_WDIF = 0x80 // Watchdog Timeout Interrupt Flag
	WDTCSR_WDIE = 0x40 // Watchdog Timeout Interrupt Enable
	WDTCSR_WDP0 = 0x1  // Watchdog Timer Prescaler Bits
	WDTCSR_WDP1 = 0x2  // Watchdog Timer Prescaler Bits
	WDTCSR_WDP2 = 0x4  // Watchdog Timer Prescaler Bits
	WDTCSR_WDP3 = 0x20 // Watchdog Timer Prescaler Bits
	WDTCSR_WDCE = 0x10 // Watchdog Change Enable
	WDTCSR_WDE  = 0x8  // Watch Dog Enable

	// WDTCLR: Watchdog Timer Configuration Lock Register
	WDTCLR_WDCL0 = 0x2 // Watchdog Timer Comfiguration Lock bits
	WDTCLR_WDCL1 = 0x4 // Watchdog Timer Comfiguration Lock bits
	WDTCLR_WDCLE = 0x1 // Watchdog Timer Comfiguration Lock Enable
)

// Bitfields for WAKEUP_TIMER: Wakeup Timer
const (
	// WUTCSR: Wake-up Timer Control and Status Register
	WUTCSR_WUTIF = 0x80 // Wake-up Timer Interrupt Flag
	WUTCSR_WUTIE = 0x40 // Wake-up Timer Interrupt Enable
	WUTCSR_WUTR  = 0x10 // Wake-up Timer Reset
	WUTCSR_WUTE  = 0x8  // Wake-up Timer Enable
	WUTCSR_WUTP0 = 0x1  // Wake-up Timer Prescaler Bits
	WUTCSR_WUTP1 = 0x2  // Wake-up Timer Prescaler Bits
	WUTCSR_WUTP2 = 0x4  // Wake-up Timer Prescaler Bits
)
