00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef INC_LPC_TMR_H
00015 #define INC_LPC_TMR_H
00016
00017
00018 #define TIR_MR0I (1 << 0) // Interrupt flag for match channel 0
00019 #define TIR_MR1I (1 << 1) // Interrupt flag for match channel 1
00020 #define TIR_MR2I (1 << 2) // Interrupt flag for match channel 2
00021 #define TIR_MR3I (1 << 3) // Interrupt flag for match channel 3
00022 #define TIR_CR0I (1 << 4) // Interrupt flag for capture channel 0 event
00023 #define TIR_CR1I (1 << 5) // Interrupt flag for capture channel 1 event
00024 #define TIR_CR2I (1 << 6) // Interrupt flag for capture channel 2 event
00025 #define TIR_CR3I (1 << 7) // Interrupt flag for capture channel 3 event
00026
00027
00028 #define PWMIR_MR0I (1 << 0) // Interrupt flag for match channel 0
00029 #define PWMIR_MR1I (1 << 1) // Interrupt flag for match channel 1
00030 #define PWMIR_MR2I (1 << 2) // Interrupt flag for match channel 2
00031 #define PWMIR_MR3I (1 << 3) // Interrupt flag for match channel 3
00032 #define PWMIR_MR4I (1 << 8) // Interrupt flag for match channel 4
00033 #define PWMIR_MR5I (1 << 9) // Interrupt flag for match channel 5
00034 #define PWMIR_MR6I (1 << 10) // Interrupt flag for match channel 6
00035 #define PWMIR_MASK (0x070F)
00036
00037
00038 #define TCR_ENABLE (1 << 0)
00039 #define TCR_RESET (1 << 1)
00040
00041
00042 #define PWMCR_ENABLE (1 << 0)
00043 #define PWMCR_RESET (1 << 1)
00044
00045
00046 #define TMCR_MR0_I (1 << 0) // Enable Interrupt when MR0 matches TC
00047 #define TMCR_MR0_R (1 << 1) // Enable Reset of TC upon MR0 match
00048 #define TMCR_MR0_S (1 << 2) // Enable Stop of TC upon MR0 match
00049 #define TMCR_MR1_I (1 << 3) // Enable Interrupt when MR1 matches TC
00050 #define TMCR_MR1_R (1 << 4) // Enable Reset of TC upon MR1 match
00051 #define TMCR_MR1_S (1 << 5) // Enable Stop of TC upon MR1 match
00052 #define TMCR_MR2_I (1 << 6) // Enable Interrupt when MR2 matches TC
00053 #define TMCR_MR2_R (1 << 7) // Enable Reset of TC upon MR2 match
00054 #define TMCR_MR2_S (1 << 8) // Enable Stop of TC upon MR2 match
00055 #define TMCR_MR3_I (1 << 9) // Enable Interrupt when MR3 matches TC
00056 #define TMCR_MR3_R (1 << 10) // Enable Reset of TC upon MR3 match
00057 #define TMCR_MR3_S (1 << 11) // Enable Stop of TC upon MR3 match
00058
00059
00060 #define TCCR_CR0_R (1 << 0) // Enable Rising edge on CAPn.0 will load TC to CR0
00061 #define TCCR_CR0_F (1 << 1) // Enable Falling edge on CAPn.0 will load TC to CR0
00062 #define TCCR_CR0_I (1 << 2) // Enable Interrupt on load of CR0
00063 #define TCCR_CR1_R (1 << 3) // Enable Rising edge on CAPn.1 will load TC to CR1
00064 #define TCCR_CR1_F (1 << 4) // Enable Falling edge on CAPn.1 will load TC to CR1
00065 #define TCCR_CR1_I (1 << 5) // Enable Interrupt on load of CR1
00066 #define TCCR_CR2_R (1 << 6) // Enable Rising edge on CAPn.2 will load TC to CR2
00067 #define TCCR_CR2_F (1 << 7) // Enable Falling edge on CAPn.2 will load TC to CR2
00068 #define TCCR_CR2_I (1 << 8) // Enable Interrupt on load of CR2
00069 #define TCCR_CR3_R (1 << 9) // Enable Rising edge on CAPn.3 will load TC to CR3
00070 #define TCCR_CR3_F (1 << 10) // Enable Falling edge on CAPn.3 will load TC to CR3
00071 #define TCCR_CR3_I (1 << 11) // Enable Interrupt on load of CR3
00072
00073 #endif