* * $Log: at91_tc.h,v $ * Revision 1.1 2006/07/05 07:45:28 haraldkipp * Split on-chip interface definitions. * * *
Timer Counter Control Register | |
#define | TC0_CCR (TC_BASE + 0x00) |
Channel 0 control register address. | |
#define | TC1_CCR (TC_BASE + 0x40) |
Channel 1 control register address. | |
#define | TC2_CCR (TC_BASE + 0x80) |
Channel 2 control register address. | |
#define | TC_CLKEN 0x00000001 |
Clock enable command. | |
#define | TC_CLKDIS 0x00000002 |
Clock disable command. | |
#define | TC_SWTRG 0x00000004 |
Software trigger command. | |
Timer Counter Channel Mode Register | |
#define | TC0_CMR (TC_BASE + 0x04) |
Channel 0 mode register address. | |
#define | TC1_CMR (TC_BASE + 0x44) |
Channel 1 mode register address. | |
#define | TC2_CMR (TC_BASE + 0x84) |
Channel 2 mode register address. | |
#define | TC_CLKS 0x00000007 |
Clock selection mask. | |
#define | TC_CLKS_MCK2 0x00000000 |
Selects MCK / 2. | |
#define | TC_CLKS_MCK8 0x00000001 |
Selects MCK / 8. | |
#define | TC_CLKS_MCK32 0x00000002 |
Selects MCK / 32. | |
#define | TC_CLKS_MCK128 0x00000003 |
Selects MCK / 128. | |
#define | TC_CLKS_MCK1024 0x00000004 |
Selects MCK / 1024. | |
#define | TC_CLKS_XC0 0x00000005 |
Selects external clock 0. | |
#define | TC_CLKS_XC1 0x00000006 |
Selects external clock 1. | |
#define | TC_CLKS_XC2 0x00000007 |
Selects external clock 2. | |
#define | TC_CLKI 0x00000008 |
Increments on falling edge. | |
#define | TC_BURST 0x00000030 |
Burst signal selection mask. | |
#define | TC_BURST_NONE 0x00000000 |
Clock is not gated by an external signal. | |
#define | TC_BUSRT_XC0 0x00000010 |
ANDed with external clock 0. | |
#define | TC_BURST_XC1 0x00000020 |
ANDed with external clock 1. | |
#define | TC_BURST_XC2 0x00000030 |
ANDed with external clock 2. | |
#define | TC_CPCTRG 0x00004000 |
RC Compare Enable Trigger Enable. | |
#define | TC_WAVE 0x00008000 |
Selects waveform mode. | |
#define | TC_CAPT 0x00000000 |
Selects capture mode. | |
Capture Mode | |
#define | TC_LDBSTOP 0x00000040 |
Counter clock stopped on RB loading. | |
#define | TC_LDBDIS 0x00000080 |
Counter clock disabled on RB loading. | |
#define | TC_ETRGEDG 0x00000300 |
External trigger edge selection mask. | |
#define | TC_ETRGEDG_RISING_EDGE 0x00000100 |
Trigger on external rising edge. | |
#define | TC_ETRGEDG_FALLING_EDGE 0x00000200 |
Trigger on external falling edge. | |
#define | TC_ETRGEDG_BOTH_EDGE 0x00000300 |
Trigger on both external edges. | |
#define | TC_ABETRG 0x00000400 |
TIOA or TIOB external trigger selection mask. | |
#define | TC_ABETRG_TIOB 0x00000000 |
TIOB used as an external trigger. | |
#define | TC_ABETRG_TIOA 0x00000400 |
TIOA used as an external trigger. | |
#define | TC_LDRA 0x00030000 |
RA loading selection mask. | |
#define | TC_LDRA_RISING_EDGE 0x00010000 |
Load RA on rising edge of TIOA. | |
#define | TC_LDRA_FALLING_EDGE 0x00020000 |
Load RA on falling edge of TIOA. | |
#define | TC_LDRA_BOTH_EDGE 0x00030000 |
Load RA on any edge of TIOA. | |
#define | TC_LDRB 0x000C0000 |
RB loading selection mask. | |
#define | TC_LDRB_RISING_EDGE 0x00040000 |
Load RB on rising edge of TIOA. | |
#define | TC_LDRB_FALLING_EDGE 0x00080000 |
Load RB on falling edge of TIOA. | |
#define | TC_LDRB_BOTH_EDGE 0x000C0000 |
Load RB on any edge of TIOA. | |
Waveform Mode | |
#define | TC_CPCSTOP 0x00000040 |
Counter clock stopped on RC compare. | |
#define | TC_CPCDIS 0x00000080 |
Counter clock disabled on RC compare. | |
#define | TC_EEVTEDG 0x00000300 |
External event edge selection mask. | |
#define | TC_EEVTEDG_RISING_EDGE 0x00000100 |
External event on rising edge. | |
#define | TC_EEVTEDG_FALLING_EDGE 0x00000200 |
External event on falling edge. | |
#define | TC_EEVTEDG_BOTH_EDGE 0x00000300 |
External event on any edge. | |
#define | TC_EEVT 0x00000C00 |
External event selection mask. | |
#define | TC_EEVT_TIOB 0x00000000 |
TIOB selected as external event. | |
#define | TC_EEVT_XC0 0x00000400 |
XC0 selected as external event. | |
#define | TC_EEVT_XC1 0x00000800 |
XC1 selected as external event. | |
#define | TC_EEVT_XC2 0x00000C00 |
XC2 selected as external event. | |
#define | TC_ENETRG 0x00001000 |
External event trigger enable. | |
#define | TC_ACPA 0x00030000 |
Masks RA compare effect on TIOA. | |
#define | TC_ACPA_SET_OUTPUT 0x00010000 |
RA compare sets TIOA. | |
#define | TC_ACPA_CLEAR_OUTPUT 0x00020000 |
RA compare clears TIOA. | |
#define | TC_ACPA_TOGGLE_OUTPUT 0x00030000 |
RA compare toggles TIOA. | |
#define | TC_ACPC 0x000C0000 |
Masks RC compare effect on TIOA. | |
#define | TC_ACPC_SET_OUTPUT 0x00040000 |
RC compare sets TIOA. | |
#define | TC_ACPC_CLEAR_OUTPUT 0x00080000 |
RC compare clears TIOA. | |
#define | TC_ACPC_TOGGLE_OUTPUT 0x000C0000 |
RC compare toggles TIOA. | |
#define | TC_AEEVT 0x00300000 |
Masks external event effect on TIOA. | |
#define | TC_AEEVT_SET_OUTPUT 0x00100000 |
External event sets TIOA. | |
#define | TC_AEEVT_CLEAR_OUTPUT 0x00200000 |
External event clears TIOA. | |
#define | TC_AEEVT_TOGGLE_OUTPUT 0x00300000 |
External event toggles TIOA. | |
#define | TC_ASWTRG 0x00C00000 |
Masks software trigger effect on TIOA. | |
#define | TC_ASWTRG_SET_OUTPUT 0x00400000 |
Software trigger sets TIOA. | |
#define | TC_ASWTRG_CLEAR_OUTPUT 0x00800000 |
Software trigger clears TIOA. | |
#define | TC_ASWTRG_TOGGLE_OUTPUT 0x00C00000 |
Software trigger toggles TIOA. | |
#define | TC_BCPB 0x03000000 |
Masks RB compare effect on TIOB. | |
#define | TC_BCPB_SET_OUTPUT 0x01000000 |
RB compare sets TIOB. | |
#define | TC_BCPB_CLEAR_OUTPUT 0x02000000 |
RB compare clears TIOB. | |
#define | TC_BCPB_TOGGLE_OUTPUT 0x03000000 |
RB compare toggles TIOB. | |
#define | TC_BCPC 0x0C000000 |
Masks RC compare effect on TIOB. | |
#define | TC_BCPC_SET_OUTPUT 0x04000000 |
RC compare sets TIOB. | |
#define | TC_BCPC_CLEAR_OUTPUT 0x08000000 |
RC compare clears TIOB. | |
#define | TC_BCPC_TOGGLE_OUTPUT 0x0C000000 |
RC compare toggles TIOB. | |
#define | TC_BEEVT 0x30000000 |
Masks external event effect on TIOB. | |
#define | TC_BEEVT_SET_OUTPUT 0x10000000 |
External event sets TIOB. | |
#define | TC_BEEVT_CLEAR_OUTPUT 0x20000000 |
External event clears TIOB. | |
#define | TC_BEEVT_TOGGLE_OUTPUT 0x30000000 |
External event toggles TIOB. | |
#define | TC_BSWTRG 0xC0000000 |
Masks software trigger effect on TIOB. | |
#define | TC_BSWTRG_SET_OUTPUT 0x40000000 |
Software trigger sets TIOB. | |
#define | TC_BSWTRG_CLEAR_OUTPUT 0x80000000 |
Software trigger clears TIOB. | |
#define | TC_BSWTRG_TOGGLE_OUTPUT 0xC0000000 |
Software trigger toggles TIOB. | |
Counter Value Register | |
#define | TC0_CV (TC_BASE + 0x10) |
Counter 0 value. | |
#define | TC1_CV (TC_BASE + 0x50) |
Counter 1 value. | |
#define | TC2_CV (TC_BASE + 0x90) |
Counter 2 value. | |
Timer Counter Register A | |
#define | TC0_RA (TC_BASE + 0x14) |
Channel 0 register A. | |
#define | TC1_RA (TC_BASE + 0x54) |
Channel 1 register A. | |
#define | TC2_RA (TC_BASE + 0x94) |
Channel 2 register A. | |
Timer Counter Register B | |
#define | TC0_RB (TC_BASE + 0x18) |
Channel 0 register B. | |
#define | TC1_RB (TC_BASE + 0x58) |
Channel 1 register B. | |
#define | TC2_RB (TC_BASE + 0x98) |
Channel 2 register B. | |
Timer Counter Register C | |
#define | TC0_RC (TC_BASE + 0x1C) |
Channel 0 register C. | |
#define | TC1_RC (TC_BASE + 0x5C) |
Channel 1 register C. | |
#define | TC2_RC (TC_BASE + 0x9C) |
Channel 2 register C. | |
Timer Counter Status and Interrupt Registers | |
#define | TC0_SR (TC_BASE + 0x20) |
Status register address. | |
#define | TC1_SR (TC_BASE + 0x60) |
Status register address. | |
#define | TC2_SR (TC_BASE + 0xA0) |
Status register address. | |
#define | TC0_IER (TC_BASE + 0x24) |
Channel 0 interrupt enable register address. | |
#define | TC1_IER (TC_BASE + 0x64) |
Channel 1 interrupt enable register address. | |
#define | TC2_IER (TC_BASE + 0xA4) |
Channel 2 interrupt enable register address. | |
#define | TC0_IDR (TC_BASE + 0x28) |
Channel 0 interrupt disable register address. | |
#define | TC1_IDR (TC_BASE + 0x68) |
Channel 1 interrupt disable register address. | |
#define | TC2_IDR (TC_BASE + 0xA8) |
Channel 2 interrupt disable register address. | |
#define | TC0_IMR (TC_BASE + 0x2C) |
Channel 0 interrupt mask register address. | |
#define | TC1_IMR (TC_BASE + 0x6C) |
Channel 1 interrupt mask register address. | |
#define | TC2_IMR (TC_BASE + 0xAC) |
Channel 2 interrupt mask register address. | |
#define | TC_COVFS 0x00000001 |
Counter overflow flag. | |
#define | TC_LOVRS 0x00000002 |
Load overrun flag. | |
#define | TC_CPAS 0x00000004 |
RA compare flag. | |
#define | TC_CPBS 0x00000008 |
RB compare flag. | |
#define | TC_CPCS 0x00000010 |
RC compare flag. | |
#define | TC_LDRAS 0x00000020 |
RA loading flag. | |
#define | TC_LDRBS 0x00000040 |
RB loading flag. | |
#define | TC_ETRGS 0x00000080 |
External trigger flag. | |
#define | TC_CLKSTA 0x00010000 |
Clock enable flag. | |
#define | TC_MTIOA 0x00020000 |
TIOA flag. | |
#define | TC_MTIOB 0x00040000 |
TIOB flag. | |
Timer Counter Block Control Register | |
#define | TC_BCR (TC_BASE + 0xC0) |
Block control register address. | |
#define | TC_SYNC 0x00000001 |
Synchronisation trigger. | |
Timer Counter Block Mode Register | |
#define | TC_BMR (TC_BASE + 0xC4) |
Block mode register address. | |
#define | TC_TC0XC0S 0x00000003 |
External clock signal 0 selection mask. | |
#define | TC_TCLK0XC0 0x00000000 |
Selects TCLK0. | |
#define | TC_NONEXC0 0x00000001 |
None selected. | |
#define | TC_TIOA1XC0 0x00000002 |
Selects TIOA1. | |
#define | TC_TIOA2XC0 0x00000003 |
Selects TIOA2. | |
#define | TC_TC1XC1S 0x0000000C |
External clock signal 1 selection mask. | |
#define | TC_TCLK1XC1 0x00000000 |
Selects TCLK1. | |
#define | TC_NONEXC1 0x00000004 |
None selected. | |
#define | TC_TIOA0XC1 0x00000008 |
Selects TIOA0. | |
#define | TC_TIOA2XC1 0x0000000C |
Selects TIOA2. | |
#define | TC_TC2XC2S 0x00000030 |
External clock signal 2 selection mask. | |
#define | TC_TCLK2XC2 0x00000000 |
Selects TCLK2. | |
#define | TC_NONEXC2 0x00000010 |
None selected. | |
#define | TC_TIOA0XC2 0x00000020 |
Selects TIOA0. | |
#define | TC_TIOA1XC2 0x00000030 |
Selects TIOA1. |