27 #ifndef LPC17XX_MCPWM_H_
28 #define LPC17XX_MCPWM_H_
47 #define MCPWM_CHANNEL_EDGE_MODE ((uint32_t)(0))
49 #define MCPWM_CHANNEL_CENTER_MODE ((uint32_t)(1))
52 #define MCPWM_CHANNEL_PASSIVE_LO ((uint32_t)(0))
54 #define MCPWM_CHANNEL_PASSIVE_HI ((uint32_t)(1))
58 #define MCPWM_PATENT_A0 ((uint32_t)(1<<0))
59 #define MCPWM_PATENT_B0 ((uint32_t)(1<<1))
60 #define MCPWM_PATENT_A1 ((uint32_t)(1<<2))
61 #define MCPWM_PATENT_B1 ((uint32_t)(1<<3))
62 #define MCPWM_PATENT_A2 ((uint32_t)(1<<4))
63 #define MCPWM_PATENT_B2 ((uint32_t)(1<<5))
67 #define MCPWM_INTFLAG_LIM0 MCPWM_INT_ILIM(0)
69 #define MCPWM_INTFLAG_MAT0 MCPWM_INT_IMAT(0)
71 #define MCPWM_INTFLAG_CAP0 MCPWM_INT_ICAP(0)
74 #define MCPWM_INTFLAG_LIM1 MCPWM_INT_ILIM(1)
76 #define MCPWM_INTFLAG_MAT1 MCPWM_INT_IMAT(1)
78 #define MCPWM_INTFLAG_CAP1 MCPWM_INT_ICAP(1)
81 #define MCPWM_INTFLAG_LIM2 MCPWM_INT_ILIM(2)
83 #define MCPWM_INTFLAG_MAT2 MCPWM_INT_IMAT(2)
85 #define MCPWM_INTFLAG_CAP2 MCPWM_INT_ICAP(2)
88 #define MCPWM_INTFLAG_ABORT MCPWM_INT_ABORT
108 #define MCPWM_CON_RUN(n) (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*8)+0))) : (0))
109 #define MCPWM_CON_CENTER(n) (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*8)+1))) : (0))
110 #define MCPWM_CON_POLAR(n) (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*8)+2))) : (0))
111 #define MCPWM_CON_DTE(n) (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*8)+3))) : (0))
112 #define MCPWM_CON_DISUP(n) (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*8)+4))) : (0))
113 #define MCPWM_CON_INVBDC ((uint32_t)(1<<29))
114 #define MCPWM_CON_ACMODE ((uint32_t)(1<<30))
115 #define MCPWM_CON_DCMODE ((uint32_t)(1<<31))
127 #define MCPWM_CAPCON_CAPMCI_RE(cap,mci) (((cap>=0)&&(cap<=2)&&(mci>=0)&&(mci<=2)) ? ((uint32_t)(1<<((cap*6)+(mci*2)+0))) : (0))
129 #define MCPWM_CAPCON_CAPMCI_FE(cap,mci) (((cap>=0)&&(cap<=2)&&(mci>=0)&&(mci<=2)) ? ((uint32_t)(1<<((cap*6)+(mci*2)+1))) : (0))
131 #define MCPWM_CAPCON_RT(n) (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<(18+(n)))) : (0))
133 #define MCPWM_CAPCON_HNFCAP(n) (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<(21+(n)))) : (0))
148 #define MCPWM_INT_ILIM(n) (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*4)+0))) : (0))
150 #define MCPWM_INT_IMAT(n) (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*4)+1))) : (0))
152 #define MCPWM_INT_ICAP(n) (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*4)+2))) : (0))
154 #define MCPWM_INT_ABORT ((uint32_t)(1<<15))
166 #define MCPWM_CNTCON_TCMCI_RE(tc,mci) (((tc>=0)&&(tc<=2)&&(mci>=0)&&(mci<=2)) ? ((uint32_t)(1<<((6*tc)+(2*mci)+0))) : (0))
168 #define MCPWM_CNTCON_TCMCI_FE(tc,mci) (((tc>=0)&&(tc<=2)&&(mci>=0)&&(mci<=2)) ? ((uint32_t)(1<<((6*tc)+(2*mci)+1))) : (0))
170 #define MCPWM_CNTCON_CNTR(n) (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<(29+n))) : (0))
176 #define MCPWM_DT(n,x) (((n>=0)&&(n<=2)) ? ((uint32_t)((x&0x3FF)<<(n*10))) : (0))
181 #define MCPWM_CP_A0 ((uint32_t)(1<<0))
182 #define MCPWM_CP_B0 ((uint32_t)(1<<1))
183 #define MCPWM_CP_A1 ((uint32_t)(1<<2))
184 #define MCPWM_CP_B1 ((uint32_t)(1<<3))
185 #define MCPWM_CP_A2 ((uint32_t)(1<<4))
186 #define MCPWM_CP_B2 ((uint32_t)(1<<5))
192 #define MCPWM_CAPCLR_CAP(n) (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<n)) : (0))
297 uint32_t outputInvered, uint32_t outputPattern);