1 /* Coldfire C Header File
\r
2 * Copyright Freescale Semiconductor Inc
\r
3 * All rights reserved.
\r
5 * 2007/03/19 Revision: 0.9
\r
8 #ifndef __MCF5282_GPTB_H__
\r
9 #define __MCF5282_GPTB_H__
\r
12 /*********************************************************************
\r
14 * General Purpose Timer Module (GPT)
\r
16 *********************************************************************/
\r
18 /* Register read/write macros */
\r
19 #define MCF_GPTB_GPTIOS (*(vuint8 *)(&__IPSBAR[0x1B0000]))
\r
20 #define MCF_GPTB_GPTCFORC (*(vuint8 *)(&__IPSBAR[0x1B0001]))
\r
21 #define MCF_GPTB_GPTOC3M (*(vuint8 *)(&__IPSBAR[0x1B0002]))
\r
22 #define MCF_GPTB_GPTOC3D (*(vuint8 *)(&__IPSBAR[0x1B0003]))
\r
23 #define MCF_GPTB_GPTCNT (*(vuint16*)(&__IPSBAR[0x1B0004]))
\r
24 #define MCF_GPTB_GPTSCR1 (*(vuint8 *)(&__IPSBAR[0x1B0006]))
\r
25 #define MCF_GPTB_GPTTOV (*(vuint8 *)(&__IPSBAR[0x1B0008]))
\r
26 #define MCF_GPTB_GPTCTL1 (*(vuint8 *)(&__IPSBAR[0x1B0009]))
\r
27 #define MCF_GPTB_GPTCTL2 (*(vuint8 *)(&__IPSBAR[0x1B000B]))
\r
28 #define MCF_GPTB_GPTIE (*(vuint8 *)(&__IPSBAR[0x1B000C]))
\r
29 #define MCF_GPTB_GPTSCR2 (*(vuint8 *)(&__IPSBAR[0x1B000D]))
\r
30 #define MCF_GPTB_GPTFLG1 (*(vuint8 *)(&__IPSBAR[0x1B000E]))
\r
31 #define MCF_GPTB_GPTFLG2 (*(vuint8 *)(&__IPSBAR[0x1B000F]))
\r
32 #define MCF_GPTB_GPTC0 (*(vuint16*)(&__IPSBAR[0x1B0010]))
\r
33 #define MCF_GPTB_GPTC1 (*(vuint16*)(&__IPSBAR[0x1B0012]))
\r
34 #define MCF_GPTB_GPTC2 (*(vuint16*)(&__IPSBAR[0x1B0014]))
\r
35 #define MCF_GPTB_GPTC3 (*(vuint16*)(&__IPSBAR[0x1B0016]))
\r
36 #define MCF_GPTB_GPTPACTL (*(vuint8 *)(&__IPSBAR[0x1B0018]))
\r
37 #define MCF_GPTB_GPTPAFLG (*(vuint8 *)(&__IPSBAR[0x1B0019]))
\r
38 #define MCF_GPTB_GPTPACNT (*(vuint16*)(&__IPSBAR[0x1B001A]))
\r
39 #define MCF_GPTB_GPTPORT (*(vuint8 *)(&__IPSBAR[0x1B001D]))
\r
40 #define MCF_GPTB_GPTDDR (*(vuint8 *)(&__IPSBAR[0x1B001E]))
\r
41 #define MCF_GPTB_GPTC(x) (*(vuint16*)(&__IPSBAR[0x1B0010 + ((x)*0x2)]))
\r
44 /* Bit definitions and macros for MCF_GPTB_GPTIOS */
\r
45 #define MCF_GPTB_GPTIOS_IOS0 (0x1)
\r
46 #define MCF_GPTB_GPTIOS_IOS1 (0x2)
\r
47 #define MCF_GPTB_GPTIOS_IOS2 (0x4)
\r
48 #define MCF_GPTB_GPTIOS_IOS3 (0x8)
\r
50 /* Bit definitions and macros for MCF_GPTB_GPTCFORC */
\r
51 #define MCF_GPTB_GPTCFORC_FOC0 (0x1)
\r
52 #define MCF_GPTB_GPTCFORC_FOC1 (0x2)
\r
53 #define MCF_GPTB_GPTCFORC_FOC2 (0x4)
\r
54 #define MCF_GPTB_GPTCFORC_FOC3 (0x8)
\r
56 /* Bit definitions and macros for MCF_GPTB_GPTOC3M */
\r
57 #define MCF_GPTB_GPTOC3M_OC3M0 (0x1)
\r
58 #define MCF_GPTB_GPTOC3M_OC3M1 (0x2)
\r
59 #define MCF_GPTB_GPTOC3M_OC3M2 (0x4)
\r
60 #define MCF_GPTB_GPTOC3M_OC3M3 (0x8)
\r
62 /* Bit definitions and macros for MCF_GPTB_GPTOC3D */
\r
63 #define MCF_GPTB_GPTOC3D_OC3D0 (0x1)
\r
64 #define MCF_GPTB_GPTOC3D_OC3D1 (0x2)
\r
65 #define MCF_GPTB_GPTOC3D_OC3D2 (0x4)
\r
66 #define MCF_GPTB_GPTOC3D_OC3D3 (0x8)
\r
68 /* Bit definitions and macros for MCF_GPTB_GPTCNT */
\r
69 #define MCF_GPTB_GPTCNT_CNTR(x) (((x)&0xFFFF)<<0)
\r
71 /* Bit definitions and macros for MCF_GPTB_GPTSCR1 */
\r
72 #define MCF_GPTB_GPTSCR1_TFFCA (0x10)
\r
73 #define MCF_GPTB_GPTSCR1_GPTEN (0x80)
\r
75 /* Bit definitions and macros for MCF_GPTB_GPTTOV */
\r
76 #define MCF_GPTB_GPTTOV_TOV0 (0x1)
\r
77 #define MCF_GPTB_GPTTOV_TOV1 (0x2)
\r
78 #define MCF_GPTB_GPTTOV_TOV2 (0x4)
\r
79 #define MCF_GPTB_GPTTOV_TOV3 (0x8)
\r
81 /* Bit definitions and macros for MCF_GPTB_GPTCTL1 */
\r
82 #define MCF_GPTB_GPTCTL1_OL0 (0x1)
\r
83 #define MCF_GPTB_GPTCTL1_OM0 (0x2)
\r
84 #define MCF_GPTB_GPTCTL1_OL1 (0x4)
\r
85 #define MCF_GPTB_GPTCTL1_OM1 (0x8)
\r
86 #define MCF_GPTB_GPTCTL1_OL2 (0x10)
\r
87 #define MCF_GPTB_GPTCTL1_OM2 (0x20)
\r
88 #define MCF_GPTB_GPTCTL1_OL3 (0x40)
\r
89 #define MCF_GPTB_GPTCTL1_OM3 (0x80)
\r
90 #define MCF_GPTB_GPTCTL1_OUTPUT0_NOTHING (0)
\r
91 #define MCF_GPTB_GPTCTL1_OUTPUT0_TOGGLE (0x1)
\r
92 #define MCF_GPTB_GPTCTL1_OUTPUT0_CLEAR (0x2)
\r
93 #define MCF_GPTB_GPTCTL1_OUTPUT0_SET (0x3)
\r
94 #define MCF_GPTB_GPTCTL1_OUTPUT1_NOTHING (0)
\r
95 #define MCF_GPTB_GPTCTL1_OUTPUT1_TOGGLE (0x4)
\r
96 #define MCF_GPTB_GPTCTL1_OUTPUT1_CLEAR (0x8)
\r
97 #define MCF_GPTB_GPTCTL1_OUTPUT1_SET (0xC)
\r
98 #define MCF_GPTB_GPTCTL1_OUTPUT2_NOTHING (0)
\r
99 #define MCF_GPTB_GPTCTL1_OUTPUT2_TOGGLE (0x10)
\r
100 #define MCF_GPTB_GPTCTL1_OUTPUT2_CLEAR (0x20)
\r
101 #define MCF_GPTB_GPTCTL1_OUTPUT2_SET (0x30)
\r
102 #define MCF_GPTB_GPTCTL1_OUTPUT3_NOTHING (0)
\r
103 #define MCF_GPTB_GPTCTL1_OUTPUT3_TOGGLE (0x40)
\r
104 #define MCF_GPTB_GPTCTL1_OUTPUT3_CLEAR (0x80)
\r
105 #define MCF_GPTB_GPTCTL1_OUTPUT3_SET (0xC0)
\r
107 /* Bit definitions and macros for MCF_GPTB_GPTCTL2 */
\r
108 #define MCF_GPTB_GPTCTL2_EDG0A (0x1)
\r
109 #define MCF_GPTB_GPTCTL2_EDG0B (0x2)
\r
110 #define MCF_GPTB_GPTCTL2_EDG1A (0x4)
\r
111 #define MCF_GPTB_GPTCTL2_EDG1B (0x8)
\r
112 #define MCF_GPTB_GPTCTL2_EDG2A (0x10)
\r
113 #define MCF_GPTB_GPTCTL2_EDG2B (0x20)
\r
114 #define MCF_GPTB_GPTCTL2_EDG3A (0x40)
\r
115 #define MCF_GPTB_GPTCTL2_EDG3B (0x80)
\r
116 #define MCF_GPTB_GPTCTL2_INPUT0_DISABLED (0)
\r
117 #define MCF_GPTB_GPTCTL2_INPUT0_RISING (0x1)
\r
118 #define MCF_GPTB_GPTCTL2_INPUT0_FALLING (0x2)
\r
119 #define MCF_GPTB_GPTCTL2_INPUT0_ANY (0x3)
\r
120 #define MCF_GPTB_GPTCTL2_INPUT1_DISABLED (0)
\r
121 #define MCF_GPTB_GPTCTL2_INPUT1_RISING (0x4)
\r
122 #define MCF_GPTB_GPTCTL2_INPUT1_FALLING (0x8)
\r
123 #define MCF_GPTB_GPTCTL2_INPUT1_ANY (0xC)
\r
124 #define MCF_GPTB_GPTCTL2_INPUT2_DISABLED (0)
\r
125 #define MCF_GPTB_GPTCTL2_INPUT2_RISING (0x10)
\r
126 #define MCF_GPTB_GPTCTL2_INPUT2_FALLING (0x20)
\r
127 #define MCF_GPTB_GPTCTL2_INPUT2_ANY (0x30)
\r
128 #define MCF_GPTB_GPTCTL2_INPUT3_DISABLED (0)
\r
129 #define MCF_GPTB_GPTCTL2_INPUT3_RISING (0x40)
\r
130 #define MCF_GPTB_GPTCTL2_INPUT3_FALLING (0x80)
\r
131 #define MCF_GPTB_GPTCTL2_INPUT3_ANY (0xC0)
\r
133 /* Bit definitions and macros for MCF_GPTB_GPTIE */
\r
134 #define MCF_GPTB_GPTIE_CI0 (0x1)
\r
135 #define MCF_GPTB_GPTIE_CI1 (0x2)
\r
136 #define MCF_GPTB_GPTIE_CI2 (0x4)
\r
137 #define MCF_GPTB_GPTIE_CI3 (0x8)
\r
139 /* Bit definitions and macros for MCF_GPTB_GPTSCR2 */
\r
140 #define MCF_GPTB_GPTSCR2_PR(x) (((x)&0x7)<<0)
\r
141 #define MCF_GPTB_GPTSCR2_PR_1 (0)
\r
142 #define MCF_GPTB_GPTSCR2_PR_2 (0x1)
\r
143 #define MCF_GPTB_GPTSCR2_PR_4 (0x2)
\r
144 #define MCF_GPTB_GPTSCR2_PR_8 (0x3)
\r
145 #define MCF_GPTB_GPTSCR2_PR_16 (0x4)
\r
146 #define MCF_GPTB_GPTSCR2_PR_32 (0x5)
\r
147 #define MCF_GPTB_GPTSCR2_PR_64 (0x6)
\r
148 #define MCF_GPTB_GPTSCR2_PR_128 (0x7)
\r
149 #define MCF_GPTB_GPTSCR2_TCRE (0x8)
\r
150 #define MCF_GPTB_GPTSCR2_RDPT (0x10)
\r
151 #define MCF_GPTB_GPTSCR2_PUPT (0x20)
\r
152 #define MCF_GPTB_GPTSCR2_TOI (0x80)
\r
154 /* Bit definitions and macros for MCF_GPTB_GPTFLG1 */
\r
155 #define MCF_GPTB_GPTFLG1_CF0 (0x1)
\r
156 #define MCF_GPTB_GPTFLG1_CF1 (0x2)
\r
157 #define MCF_GPTB_GPTFLG1_CF2 (0x4)
\r
158 #define MCF_GPTB_GPTFLG1_CF3 (0x8)
\r
160 /* Bit definitions and macros for MCF_GPTB_GPTFLG2 */
\r
161 #define MCF_GPTB_GPTFLG2_TOF (0x80)
\r
163 /* Bit definitions and macros for MCF_GPTB_GPTC */
\r
164 #define MCF_GPTB_GPTC_CCNT(x) (((x)&0xFFFF)<<0)
\r
166 /* Bit definitions and macros for MCF_GPTB_GPTPACTL */
\r
167 #define MCF_GPTB_GPTPACTL_PAI (0x1)
\r
168 #define MCF_GPTB_GPTPACTL_PAOVI (0x2)
\r
169 #define MCF_GPTB_GPTPACTL_CLK(x) (((x)&0x3)<<0x2)
\r
170 #define MCF_GPTB_GPTPACTL_CLK_GPTPR (0)
\r
171 #define MCF_GPTB_GPTPACTL_CLK_PACLK (0x1)
\r
172 #define MCF_GPTB_GPTPACTL_CLK_PACLK_256 (0x2)
\r
173 #define MCF_GPTB_GPTPACTL_CLK_PACLK_65536 (0x3)
\r
174 #define MCF_GPTB_GPTPACTL_PEDGE (0x10)
\r
175 #define MCF_GPTB_GPTPACTL_PAMOD (0x20)
\r
176 #define MCF_GPTB_GPTPACTL_PAE (0x40)
\r
178 /* Bit definitions and macros for MCF_GPTB_GPTPAFLG */
\r
179 #define MCF_GPTB_GPTPAFLG_PAIF (0x1)
\r
180 #define MCF_GPTB_GPTPAFLG_PAOVF (0x2)
\r
182 /* Bit definitions and macros for MCF_GPTB_GPTPACNT */
\r
183 #define MCF_GPTB_GPTPACNT_PACNT(x) (((x)&0xFFFF)<<0)
\r
185 /* Bit definitions and macros for MCF_GPTB_GPTPORT */
\r
186 #define MCF_GPTB_GPTPORT_PORTT0 (0x1)
\r
187 #define MCF_GPTB_GPTPORT_PORTT1 (0x2)
\r
188 #define MCF_GPTB_GPTPORT_PORTT2 (0x4)
\r
189 #define MCF_GPTB_GPTPORT_PORTT3 (0x8)
\r
191 /* Bit definitions and macros for MCF_GPTB_GPTDDR */
\r
192 #define MCF_GPTB_GPTDDR_DDRT0 (0x1)
\r
193 #define MCF_GPTB_GPTDDR_DDRT1 (0x2)
\r
194 #define MCF_GPTB_GPTDDR_DDRT2 (0x4)
\r
195 #define MCF_GPTB_GPTDDR_DDRT3 (0x8)
\r
198 #endif /* __MCF5282_GPTB_H__ */
\r