]> git.sur5r.net Git - freertos/blob - Demo/ColdFire_MCF52259_CodeWarrior/Freescale_Headers/MCF52259_GPT.h
Change to the file headers only.
[freertos] / Demo / ColdFire_MCF52259_CodeWarrior / Freescale_Headers / MCF52259_GPT.h
1 /* Coldfire C Header File\r
2  * Copyright Freescale Semiconductor Inc\r
3  * All rights reserved.\r
4  *\r
5  * 2008/04/17 Revision: 0.2\r
6  *\r
7  * (c) Copyright UNIS, spol. s r.o. 1997-2008\r
8  * UNIS, spol. s r.o.\r
9  * Jundrovska 33\r
10  * 624 00 Brno\r
11  * Czech Republic\r
12  * http      : www.processorexpert.com\r
13  * mail      : info@processorexpert.com\r
14  */\r
15 \r
16 #ifndef __MCF52259_GPT_H__\r
17 #define __MCF52259_GPT_H__\r
18 \r
19 \r
20 /*********************************************************************\r
21 *\r
22 * General Purpose Timer Module (GPT)\r
23 *\r
24 *********************************************************************/\r
25 \r
26 /* Register read/write macros */\r
27 #define MCF_GPT_GPTIOS                       (*(vuint8 *)(0x401A0000))\r
28 #define MCF_GPT_GPTCFORC                     (*(vuint8 *)(0x401A0001))\r
29 #define MCF_GPT_GPTOC3M                      (*(vuint8 *)(0x401A0002))\r
30 #define MCF_GPT_GPTOC3D                      (*(vuint8 *)(0x401A0003))\r
31 #define MCF_GPT_GPTCNT                       (*(vuint16*)(0x401A0004))\r
32 #define MCF_GPT_GPTSCR1                      (*(vuint8 *)(0x401A0006))\r
33 #define MCF_GPT_GPTTOV                       (*(vuint8 *)(0x401A0008))\r
34 #define MCF_GPT_GPTCTL1                      (*(vuint8 *)(0x401A0009))\r
35 #define MCF_GPT_GPTCTL2                      (*(vuint8 *)(0x401A000B))\r
36 #define MCF_GPT_GPTIE                        (*(vuint8 *)(0x401A000C))\r
37 #define MCF_GPT_GPTSCR2                      (*(vuint8 *)(0x401A000D))\r
38 #define MCF_GPT_GPTFLG1                      (*(vuint8 *)(0x401A000E))\r
39 #define MCF_GPT_GPTFLG2                      (*(vuint8 *)(0x401A000F))\r
40 #define MCF_GPT_GPTC0                        (*(vuint16*)(0x401A0010))\r
41 #define MCF_GPT_GPTC1                        (*(vuint16*)(0x401A0012))\r
42 #define MCF_GPT_GPTC2                        (*(vuint16*)(0x401A0014))\r
43 #define MCF_GPT_GPTC3                        (*(vuint16*)(0x401A0016))\r
44 #define MCF_GPT_GPTPACTL                     (*(vuint8 *)(0x401A0018))\r
45 #define MCF_GPT_GPTPAFLG                     (*(vuint8 *)(0x401A0019))\r
46 #define MCF_GPT_GPTPACNT                     (*(vuint16*)(0x401A001A))\r
47 #define MCF_GPT_GPTPORT                      (*(vuint8 *)(0x401A001D))\r
48 #define MCF_GPT_GPTDDR                       (*(vuint8 *)(0x401A001E))\r
49 #define MCF_GPT_GPTC(x)                      (*(vuint16*)(0x401A0010 + ((x)*0x2)))\r
50 \r
51 \r
52 /* Bit definitions and macros for MCF_GPT_GPTIOS */\r
53 #define MCF_GPT_GPTIOS_IOS0                  (0x1)\r
54 #define MCF_GPT_GPTIOS_IOS1                  (0x2)\r
55 #define MCF_GPT_GPTIOS_IOS2                  (0x4)\r
56 #define MCF_GPT_GPTIOS_IOS3                  (0x8)\r
57 \r
58 /* Bit definitions and macros for MCF_GPT_GPTCFORC */\r
59 #define MCF_GPT_GPTCFORC_FOC0                (0x1)\r
60 #define MCF_GPT_GPTCFORC_FOC1                (0x2)\r
61 #define MCF_GPT_GPTCFORC_FOC2                (0x4)\r
62 #define MCF_GPT_GPTCFORC_FOC3                (0x8)\r
63 \r
64 /* Bit definitions and macros for MCF_GPT_GPTOC3M */\r
65 #define MCF_GPT_GPTOC3M_OC3M0                (0x1)\r
66 #define MCF_GPT_GPTOC3M_OC3M1                (0x2)\r
67 #define MCF_GPT_GPTOC3M_OC3M2                (0x4)\r
68 #define MCF_GPT_GPTOC3M_OC3M3                (0x8)\r
69 \r
70 /* Bit definitions and macros for MCF_GPT_GPTOC3D */\r
71 #define MCF_GPT_GPTOC3D_OC3D0                (0x1)\r
72 #define MCF_GPT_GPTOC3D_OC3D1                (0x2)\r
73 #define MCF_GPT_GPTOC3D_OC3D2                (0x4)\r
74 #define MCF_GPT_GPTOC3D_OC3D3                (0x8)\r
75 \r
76 /* Bit definitions and macros for MCF_GPT_GPTCNT */\r
77 #define MCF_GPT_GPTCNT_CNTR(x)               (((x)&0xFFFF)<<0)\r
78 \r
79 /* Bit definitions and macros for MCF_GPT_GPTSCR1 */\r
80 #define MCF_GPT_GPTSCR1_TFFCA                (0x10)\r
81 #define MCF_GPT_GPTSCR1_GPTEN                (0x80)\r
82 \r
83 /* Bit definitions and macros for MCF_GPT_GPTTOV */\r
84 #define MCF_GPT_GPTTOV_TOV0                  (0x1)\r
85 #define MCF_GPT_GPTTOV_TOV1                  (0x2)\r
86 #define MCF_GPT_GPTTOV_TOV2                  (0x4)\r
87 #define MCF_GPT_GPTTOV_TOV3                  (0x8)\r
88 \r
89 /* Bit definitions and macros for MCF_GPT_GPTCTL1 */\r
90 #define MCF_GPT_GPTCTL1_OL0                  (0x1)\r
91 #define MCF_GPT_GPTCTL1_OM0                  (0x2)\r
92 #define MCF_GPT_GPTCTL1_OL1                  (0x4)\r
93 #define MCF_GPT_GPTCTL1_OM1                  (0x8)\r
94 #define MCF_GPT_GPTCTL1_OL2                  (0x10)\r
95 #define MCF_GPT_GPTCTL1_OM2                  (0x20)\r
96 #define MCF_GPT_GPTCTL1_OL3                  (0x40)\r
97 #define MCF_GPT_GPTCTL1_OM3                  (0x80)\r
98 #define MCF_GPT_GPTCTL1_OUTPUT0_NOTHING      (0)\r
99 #define MCF_GPT_GPTCTL1_OUTPUT0_TOGGLE       (0x1)\r
100 #define MCF_GPT_GPTCTL1_OUTPUT0_CLEAR        (0x2)\r
101 #define MCF_GPT_GPTCTL1_OUTPUT0_SET          (0x3)\r
102 #define MCF_GPT_GPTCTL1_OUTPUT1_NOTHING      (0)\r
103 #define MCF_GPT_GPTCTL1_OUTPUT1_TOGGLE       (0x4)\r
104 #define MCF_GPT_GPTCTL1_OUTPUT1_CLEAR        (0x8)\r
105 #define MCF_GPT_GPTCTL1_OUTPUT1_SET          (0xC)\r
106 #define MCF_GPT_GPTCTL1_OUTPUT2_NOTHING      (0)\r
107 #define MCF_GPT_GPTCTL1_OUTPUT2_TOGGLE       (0x10)\r
108 #define MCF_GPT_GPTCTL1_OUTPUT2_CLEAR        (0x20)\r
109 #define MCF_GPT_GPTCTL1_OUTPUT2_SET          (0x30)\r
110 #define MCF_GPT_GPTCTL1_OUTPUT3_NOTHING      (0)\r
111 #define MCF_GPT_GPTCTL1_OUTPUT3_TOGGLE       (0x40)\r
112 #define MCF_GPT_GPTCTL1_OUTPUT3_CLEAR        (0x80)\r
113 #define MCF_GPT_GPTCTL1_OUTPUT3_SET          (0xC0)\r
114 \r
115 /* Bit definitions and macros for MCF_GPT_GPTCTL2 */\r
116 #define MCF_GPT_GPTCTL2_EDG0A                (0x1)\r
117 #define MCF_GPT_GPTCTL2_EDG0B                (0x2)\r
118 #define MCF_GPT_GPTCTL2_EDG1A                (0x4)\r
119 #define MCF_GPT_GPTCTL2_EDG1B                (0x8)\r
120 #define MCF_GPT_GPTCTL2_EDG2A                (0x10)\r
121 #define MCF_GPT_GPTCTL2_EDG2B                (0x20)\r
122 #define MCF_GPT_GPTCTL2_EDG3A                (0x40)\r
123 #define MCF_GPT_GPTCTL2_EDG3B                (0x80)\r
124 #define MCF_GPT_GPTCTL2_INPUT0_DISABLED      (0)\r
125 #define MCF_GPT_GPTCTL2_INPUT0_RISING        (0x1)\r
126 #define MCF_GPT_GPTCTL2_INPUT0_FALLING       (0x2)\r
127 #define MCF_GPT_GPTCTL2_INPUT0_ANY           (0x3)\r
128 #define MCF_GPT_GPTCTL2_INPUT1_DISABLED      (0)\r
129 #define MCF_GPT_GPTCTL2_INPUT1_RISING        (0x4)\r
130 #define MCF_GPT_GPTCTL2_INPUT1_FALLING       (0x8)\r
131 #define MCF_GPT_GPTCTL2_INPUT1_ANY           (0xC)\r
132 #define MCF_GPT_GPTCTL2_INPUT2_DISABLED      (0)\r
133 #define MCF_GPT_GPTCTL2_INPUT2_RISING        (0x10)\r
134 #define MCF_GPT_GPTCTL2_INPUT2_FALLING       (0x20)\r
135 #define MCF_GPT_GPTCTL2_INPUT2_ANY           (0x30)\r
136 #define MCF_GPT_GPTCTL2_INPUT3_DISABLED      (0)\r
137 #define MCF_GPT_GPTCTL2_INPUT3_RISING        (0x40)\r
138 #define MCF_GPT_GPTCTL2_INPUT3_FALLING       (0x80)\r
139 #define MCF_GPT_GPTCTL2_INPUT3_ANY           (0xC0)\r
140 \r
141 /* Bit definitions and macros for MCF_GPT_GPTIE */\r
142 #define MCF_GPT_GPTIE_CI0                    (0x1)\r
143 #define MCF_GPT_GPTIE_CI1                    (0x2)\r
144 #define MCF_GPT_GPTIE_CI2                    (0x4)\r
145 #define MCF_GPT_GPTIE_CI3                    (0x8)\r
146 \r
147 /* Bit definitions and macros for MCF_GPT_GPTSCR2 */\r
148 #define MCF_GPT_GPTSCR2_PR(x)                (((x)&0x7)<<0)\r
149 #define MCF_GPT_GPTSCR2_PR_1                 (0)\r
150 #define MCF_GPT_GPTSCR2_PR_2                 (0x1)\r
151 #define MCF_GPT_GPTSCR2_PR_4                 (0x2)\r
152 #define MCF_GPT_GPTSCR2_PR_8                 (0x3)\r
153 #define MCF_GPT_GPTSCR2_PR_16                (0x4)\r
154 #define MCF_GPT_GPTSCR2_PR_32                (0x5)\r
155 #define MCF_GPT_GPTSCR2_PR_64                (0x6)\r
156 #define MCF_GPT_GPTSCR2_PR_128               (0x7)\r
157 #define MCF_GPT_GPTSCR2_TCRE                 (0x8)\r
158 #define MCF_GPT_GPTSCR2_RDPT                 (0x10)\r
159 #define MCF_GPT_GPTSCR2_PUPT                 (0x20)\r
160 #define MCF_GPT_GPTSCR2_TOI                  (0x80)\r
161 \r
162 /* Bit definitions and macros for MCF_GPT_GPTFLG1 */\r
163 #define MCF_GPT_GPTFLG1_CF0                  (0x1)\r
164 #define MCF_GPT_GPTFLG1_CF1                  (0x2)\r
165 #define MCF_GPT_GPTFLG1_CF2                  (0x4)\r
166 #define MCF_GPT_GPTFLG1_CF3                  (0x8)\r
167 \r
168 /* Bit definitions and macros for MCF_GPT_GPTFLG2 */\r
169 #define MCF_GPT_GPTFLG2_TOF                  (0x80)\r
170 \r
171 /* Bit definitions and macros for MCF_GPT_GPTC */\r
172 #define MCF_GPT_GPTC_CCNT(x)                 (((x)&0xFFFF)<<0)\r
173 \r
174 /* Bit definitions and macros for MCF_GPT_GPTPACTL */\r
175 #define MCF_GPT_GPTPACTL_PAI                 (0x1)\r
176 #define MCF_GPT_GPTPACTL_PAOVI               (0x2)\r
177 #define MCF_GPT_GPTPACTL_CLK(x)              (((x)&0x3)<<0x2)\r
178 #define MCF_GPT_GPTPACTL_CLK_GPTPR           (0)\r
179 #define MCF_GPT_GPTPACTL_CLK_PACLK           (0x1)\r
180 #define MCF_GPT_GPTPACTL_CLK_PACLK_256       (0x2)\r
181 #define MCF_GPT_GPTPACTL_CLK_PACLK_65536     (0x3)\r
182 #define MCF_GPT_GPTPACTL_PEDGE               (0x10)\r
183 #define MCF_GPT_GPTPACTL_PAMOD               (0x20)\r
184 #define MCF_GPT_GPTPACTL_PAE                 (0x40)\r
185 \r
186 /* Bit definitions and macros for MCF_GPT_GPTPAFLG */\r
187 #define MCF_GPT_GPTPAFLG_PAIF                (0x1)\r
188 #define MCF_GPT_GPTPAFLG_PAOVF               (0x2)\r
189 \r
190 /* Bit definitions and macros for MCF_GPT_GPTPACNT */\r
191 #define MCF_GPT_GPTPACNT_PACNT(x)            (((x)&0xFFFF)<<0)\r
192 \r
193 /* Bit definitions and macros for MCF_GPT_GPTPORT */\r
194 #define MCF_GPT_GPTPORT_PORTT0               (0x1)\r
195 #define MCF_GPT_GPTPORT_PORTT1               (0x2)\r
196 #define MCF_GPT_GPTPORT_PORTT2               (0x4)\r
197 #define MCF_GPT_GPTPORT_PORTT3               (0x8)\r
198 \r
199 /* Bit definitions and macros for MCF_GPT_GPTDDR */\r
200 #define MCF_GPT_GPTDDR_DDRT0                 (0x1)\r
201 #define MCF_GPT_GPTDDR_DDRT1                 (0x2)\r
202 #define MCF_GPT_GPTDDR_DDRT2                 (0x4)\r
203 #define MCF_GPT_GPTDDR_DDRT3                 (0x8)\r
204 \r
205 \r
206 #endif /* __MCF52259_GPT_H__ */\r