[info] name = "TIMER1" desc = "16-Bit Timer/Counter1" [[int]] name = "TIMER1_CAPT" desc = "Timer/Counter1 Capture Event" vect = 16 [[int]] name = "TIMER1_COMPA" desc = "Timer/Counter1 Compare Match A" vect = 17 [[int]] name = "TIMER1_COMPB" desc = "Timer/Counter1 Compare Match B" vect = 18 [[int]] name = "TIMER1_COMPC" desc = "Timer/Counter1 Compare Match C" vect = 19 [[int]] name = "TIMER1_OVF" desc = "Timer/Counter1 Overflow" vect = 20 [val.com] values = [ {valu=0, name="DISCONNECTED", desc="Normal port operation, OC1x disconnected"}, {valu=1, name="MATCH_TOGGLE", desc="Toggle OC1x on Compare Match (Might depend on WGM)"}, {valu=2, name="MATCH_CLEAR", desc="Clear OC1x on Compare Match (If PWM is enabled, OC1x is set at TOP)"}, {valu=3, name="MATCH_SET", desc="Set OC1x on Compare Match (If PWM is enabled, OC1x is cleared at TOP)"}, ] [val.cs] values = [ {valu=0, name="STOPPED", desc="No clock source (Timer/Counter stopped)"}, {valu=1, name="IO", desc="clkIO/1 (No prescaling)"}, {valu=2, name="IO_8", desc="clkIO/8 (From prescaler)"}, {valu=3, name="IO_64", desc="clkIO/64 (From prescaler)"}, {valu=4, name="IO_256", desc="clkIO/256 (From prescaler)"}, {valu=5, name="IO_1024", desc="clkIO/1024 (From prescaler)"}, {valu=6, name="EXT_FALLING", desc="External clock source on T0 pin. Clock on falling edge."}, {valu=7, name="EXT_RISING", desc="External clock source on T0 pin. Clock on rising edge."}, ] #---------------------------------------------------------------------# [[reg]] name = "TIFR" desc = "Timer Interrupt Flag Register" addr = "0x36" fields = [ {name="ICF", desc="Input Capture Flag", rnge="5:5"}, {name="OCF_C", desc="Output Compare C Match Flag", rnge="3:3"}, {name="OCF_B", desc="Output Compare B Match Flag", rnge="2:2"}, {name="OCF_A", desc="Output Compare A Match Flag", rnge="1:1"}, {name="TOV", desc="Timer Overflow Flag", rnge="0:0"}, ] #---------------------------------------------------------------------# [[reg]] name = "TCCR_A" desc = "Timer/Counter Control Register A" addr = "0x80" fields = [ {name="COM_A", desc="Compare Output Mode for Channel A", rnge="7:6", valu="com"}, {name="COM_B", desc="Compare Output Mode for Channel B", rnge="5:4", valu="com"}, {name="COM_C", desc="Compare Output Mode for Channel C", rnge="3:2", valu="com"}, {name="WGM0", desc="Waveform Generation Mode 1:0", rnge="1:0"}, ] #---------------------------------------------------------------------# [[reg]] name = "TCCR_B" desc = "Timer/Counter Control Register B" addr = "0x81" fields = [ {name="ICNC", desc="Input Capture Noise Canceler", rnge="7:7"}, {name="ICES", desc="Input Capture Edge Set", rnge="6:6"}, {name="WGM2", desc="Waveform Generation Mode 3:2", rnge="4:3"}, {name="CS", desc="Clock Select", rnge="2:0", valu="cs"}, ] #---------------------------------------------------------------------# [[reg]] name = "TCCR_C" desc = "Timer/Counter Control Register C" addr = "0x82" fields = [ {name="FOC_A", desc="Force Output Compare for Channel A", rnge="7:7"}, {name="FOC_B", desc="Force Output Compare for Channel B", rnge="6:6"}, {name="FOC_C", desc="Force Output Compare for Channel C", rnge="5:5"}, ] #---------------------------------------------------------------------# [[reg]] name = "TCNT_H" desc = "Timer/Counter Register High Byte" addr = "0x85" safe = true #---------------------------------------------------------------------# [[reg]] name = "TCNT_L" desc = "Timer/Counter Register Low Byte" addr = "0x84" safe = true #---------------------------------------------------------------------# [[reg]] name = "OCR_A_H" desc = "Output Compare Register A High Byte" addr = "0x89" safe = true #---------------------------------------------------------------------# [[reg]] name = "OCR_A_L" desc = "Output Compare Register A Low Byte" addr = "0x88" safe = true #---------------------------------------------------------------------# [[reg]] name = "OCR_B_H" desc = "Output Compare Register B High Byte" addr = "0x8B" safe = true #---------------------------------------------------------------------# [[reg]] name = "OCR_B_L" desc = "Output Compare Register B Low Byte" addr = "0x8A" safe = true #---------------------------------------------------------------------# [[reg]] name = "OCR_C_H" desc = "Output Compare Register C High Byte" addr = "0x8D" safe = true #---------------------------------------------------------------------# [[reg]] name = "OCR_C_L" desc = "Output Compare Register C Low Byte" addr = "0x8C" safe = true #---------------------------------------------------------------------# [[reg]] name = "ICR_H" desc = "Input Capture Register High Byte" addr = "0x87" safe = true #---------------------------------------------------------------------# [[reg]] name = "ICR_L" desc = "Input Capture Register Low Byte" addr = "0x86" safe = true #---------------------------------------------------------------------# [[reg]] name = "TIMSK" desc = "Timer Interrupt Mask Register" addr = "0x6f" fields = [ {name="ICIE", desc="Input Capture Interrupt Enable", rnge="5:5"}, {name="OCIE_C", desc="Output Compare Match C Interrupt Enable", rnge="3:3"}, {name="OCIE_B", desc="Output Compare Match B Interrupt Enable", rnge="2:2"}, {name="OCIE_A", desc="Output Compare Match A Interrupt Enable", rnge="1:1"}, {name="TOIE", desc="Timer Overflow Interrupt Enable", rnge="0:0"}, ]