]> git.sur5r.net Git - freertos/blob - Demo/ColdFire_MCF52259_CodeWarrior/Freescale_Headers/MCF52259_UART.h
Start to re-arrange files to include FreeRTOS+ in main download.
[freertos] / Demo / ColdFire_MCF52259_CodeWarrior / Freescale_Headers / MCF52259_UART.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_UART_H__\r
17 #define __MCF52259_UART_H__\r
18 \r
19 \r
20 /*********************************************************************\r
21 *\r
22 * Universal Asynchronous Receiver Transmitter (UART)\r
23 *\r
24 *********************************************************************/\r
25 \r
26 /* Register read/write macros */\r
27 #define MCF_UART0_UMR1                       (*(vuint8 *)(0x40000200))\r
28 #define MCF_UART0_UMR2                       (*(vuint8 *)(0x40000200))\r
29 #define MCF_UART0_USR                        (*(vuint8 *)(0x40000204))\r
30 #define MCF_UART0_UCSR                       (*(vuint8 *)(0x40000204))\r
31 #define MCF_UART0_UCR                        (*(vuint8 *)(0x40000208))\r
32 #define MCF_UART0_URB                        (*(vuint8 *)(0x4000020C))\r
33 #define MCF_UART0_UTB                        (*(vuint8 *)(0x4000020C))\r
34 #define MCF_UART0_UIPCR                      (*(vuint8 *)(0x40000210))\r
35 #define MCF_UART0_UACR                       (*(vuint8 *)(0x40000210))\r
36 #define MCF_UART0_UIMR                       (*(vuint8 *)(0x40000214))\r
37 #define MCF_UART0_UISR                       (*(vuint8 *)(0x40000214))\r
38 #define MCF_UART0_UBG1                       (*(vuint8 *)(0x40000218))\r
39 #define MCF_UART0_UBG2                       (*(vuint8 *)(0x4000021C))\r
40 #define MCF_UART0_UIP                        (*(vuint8 *)(0x40000234))\r
41 #define MCF_UART0_UOP1                       (*(vuint8 *)(0x40000238))\r
42 #define MCF_UART0_UOP0                       (*(vuint8 *)(0x4000023C))\r
43 \r
44 #define MCF_UART1_UMR1                       (*(vuint8 *)(0x40000240))\r
45 #define MCF_UART1_UMR2                       (*(vuint8 *)(0x40000240))\r
46 #define MCF_UART1_USR                        (*(vuint8 *)(0x40000244))\r
47 #define MCF_UART1_UCSR                       (*(vuint8 *)(0x40000244))\r
48 #define MCF_UART1_UCR                        (*(vuint8 *)(0x40000248))\r
49 #define MCF_UART1_URB                        (*(vuint8 *)(0x4000024C))\r
50 #define MCF_UART1_UTB                        (*(vuint8 *)(0x4000024C))\r
51 #define MCF_UART1_UIPCR                      (*(vuint8 *)(0x40000250))\r
52 #define MCF_UART1_UACR                       (*(vuint8 *)(0x40000250))\r
53 #define MCF_UART1_UIMR                       (*(vuint8 *)(0x40000254))\r
54 #define MCF_UART1_UISR                       (*(vuint8 *)(0x40000254))\r
55 #define MCF_UART1_UBG1                       (*(vuint8 *)(0x40000258))\r
56 #define MCF_UART1_UBG2                       (*(vuint8 *)(0x4000025C))\r
57 #define MCF_UART1_UIP                        (*(vuint8 *)(0x40000274))\r
58 #define MCF_UART1_UOP1                       (*(vuint8 *)(0x40000278))\r
59 #define MCF_UART1_UOP0                       (*(vuint8 *)(0x4000027C))\r
60 \r
61 #define MCF_UART2_UMR1                       (*(vuint8 *)(0x40000280))\r
62 #define MCF_UART2_UMR2                       (*(vuint8 *)(0x40000280))\r
63 #define MCF_UART2_USR                        (*(vuint8 *)(0x40000284))\r
64 #define MCF_UART2_UCSR                       (*(vuint8 *)(0x40000284))\r
65 #define MCF_UART2_UCR                        (*(vuint8 *)(0x40000288))\r
66 #define MCF_UART2_URB                        (*(vuint8 *)(0x4000028C))\r
67 #define MCF_UART2_UTB                        (*(vuint8 *)(0x4000028C))\r
68 #define MCF_UART2_UIPCR                      (*(vuint8 *)(0x40000290))\r
69 #define MCF_UART2_UACR                       (*(vuint8 *)(0x40000290))\r
70 #define MCF_UART2_UIMR                       (*(vuint8 *)(0x40000294))\r
71 #define MCF_UART2_UISR                       (*(vuint8 *)(0x40000294))\r
72 #define MCF_UART2_UBG1                       (*(vuint8 *)(0x40000298))\r
73 #define MCF_UART2_UBG2                       (*(vuint8 *)(0x4000029C))\r
74 #define MCF_UART2_UIP                        (*(vuint8 *)(0x400002B4))\r
75 #define MCF_UART2_UOP1                       (*(vuint8 *)(0x400002B8))\r
76 #define MCF_UART2_UOP0                       (*(vuint8 *)(0x400002BC))\r
77 \r
78 #define MCF_UART_UMR(x)                      (*(vuint8 *)(0x40000200 + ((x)*0x40)))\r
79 #define MCF_UART_USR(x)                      (*(vuint8 *)(0x40000204 + ((x)*0x40)))\r
80 #define MCF_UART_UCSR(x)                     (*(vuint8 *)(0x40000204 + ((x)*0x40)))\r
81 #define MCF_UART_UCR(x)                      (*(vuint8 *)(0x40000208 + ((x)*0x40)))\r
82 #define MCF_UART_URB(x)                      (*(vuint8 *)(0x4000020C + ((x)*0x40)))\r
83 #define MCF_UART_UTB(x)                      (*(vuint8 *)(0x4000020C + ((x)*0x40)))\r
84 #define MCF_UART_UIPCR(x)                    (*(vuint8 *)(0x40000210 + ((x)*0x40)))\r
85 #define MCF_UART_UACR(x)                     (*(vuint8 *)(0x40000210 + ((x)*0x40)))\r
86 #define MCF_UART_UIMR(x)                     (*(vuint8 *)(0x40000214 + ((x)*0x40)))\r
87 #define MCF_UART_UISR(x)                     (*(vuint8 *)(0x40000214 + ((x)*0x40)))\r
88 #define MCF_UART_UBG1(x)                     (*(vuint8 *)(0x40000218 + ((x)*0x40)))\r
89 #define MCF_UART_UBG2(x)                     (*(vuint8 *)(0x4000021C + ((x)*0x40)))\r
90 #define MCF_UART_UIP(x)                      (*(vuint8 *)(0x40000234 + ((x)*0x40)))\r
91 #define MCF_UART_UOP1(x)                     (*(vuint8 *)(0x40000238 + ((x)*0x40)))\r
92 #define MCF_UART_UOP0(x)                     (*(vuint8 *)(0x4000023C + ((x)*0x40)))\r
93 \r
94 /* Bit definitions and macros for MCF_UART_UMR */\r
95 #define MCF_UART_UMR_BC(x)                   (((x)&0x3)<<0)\r
96 #define MCF_UART_UMR_BC_5                    (0)\r
97 #define MCF_UART_UMR_BC_6                    (0x1)\r
98 #define MCF_UART_UMR_BC_7                    (0x2)\r
99 #define MCF_UART_UMR_BC_8                    (0x3)\r
100 #define MCF_UART_UMR_PT                      (0x4)\r
101 #define MCF_UART_UMR_PM(x)                   (((x)&0x3)<<0x3)\r
102 #define MCF_UART_UMR_ERR                     (0x20)\r
103 #define MCF_UART_UMR_RXIRQ                   (0x40)\r
104 #define MCF_UART_UMR_RXRTS                   (0x80)\r
105 #define MCF_UART_UMR_PM_MULTI_ADDR           (0x1C)\r
106 #define MCF_UART_UMR_PM_MULTI_DATA           (0x18)\r
107 #define MCF_UART_UMR_PM_NONE                 (0x10)\r
108 #define MCF_UART_UMR_PM_FORCE_HI             (0xC)\r
109 #define MCF_UART_UMR_PM_FORCE_LO             (0x8)\r
110 #define MCF_UART_UMR_PM_ODD                  (0x4)\r
111 #define MCF_UART_UMR_PM_EVEN                 (0)\r
112 #define MCF_UART_UMR_SB(x)                   (((x)&0xF)<<0)\r
113 #define MCF_UART_UMR_SB_STOP_BITS_1          (0x7)\r
114 #define MCF_UART_UMR_SB_STOP_BITS_15         (0x8)\r
115 #define MCF_UART_UMR_SB_STOP_BITS_2          (0xF)\r
116 #define MCF_UART_UMR_TXCTS                   (0x10)\r
117 #define MCF_UART_UMR_TXRTS                   (0x20)\r
118 #define MCF_UART_UMR_CM(x)                   (((x)&0x3)<<0x6)\r
119 #define MCF_UART_UMR_CM_NORMAL               (0)\r
120 #define MCF_UART_UMR_CM_ECHO                 (0x40)\r
121 #define MCF_UART_UMR_CM_LOCAL_LOOP           (0x80)\r
122 #define MCF_UART_UMR_CM_REMOTE_LOOP          (0xC0)\r
123 \r
124 /* Bit definitions and macros for MCF_UART_USR */\r
125 #define MCF_UART_USR_RXRDY                   (0x1)\r
126 #define MCF_UART_USR_FFULL                   (0x2)\r
127 #define MCF_UART_USR_TXRDY                   (0x4)\r
128 #define MCF_UART_USR_TXEMP                   (0x8)\r
129 #define MCF_UART_USR_OE                      (0x10)\r
130 #define MCF_UART_USR_PE                      (0x20)\r
131 #define MCF_UART_USR_FE                      (0x40)\r
132 #define MCF_UART_USR_RB                      (0x80)\r
133 \r
134 /* Bit definitions and macros for MCF_UART_UCSR */\r
135 #define MCF_UART_UCSR_TCS(x)                 (((x)&0xF)<<0)\r
136 #define MCF_UART_UCSR_TCS_SYS_CLK            (0xD)\r
137 #define MCF_UART_UCSR_TCS_CTM16              (0xE)\r
138 #define MCF_UART_UCSR_TCS_CTM                (0xF)\r
139 #define MCF_UART_UCSR_RCS(x)                 (((x)&0xF)<<0x4)\r
140 #define MCF_UART_UCSR_RCS_SYS_CLK            (0xD0)\r
141 #define MCF_UART_UCSR_RCS_CTM16              (0xE0)\r
142 #define MCF_UART_UCSR_RCS_CTM                (0xF0)\r
143 \r
144 /* Bit definitions and macros for MCF_UART_UCR */\r
145 #define MCF_UART_UCR_RC(x)                   (((x)&0x3)<<0)\r
146 #define MCF_UART_UCR_RX_ENABLED              (0x1)\r
147 #define MCF_UART_UCR_RX_DISABLED             (0x2)\r
148 #define MCF_UART_UCR_TC(x)                   (((x)&0x3)<<0x2)\r
149 #define MCF_UART_UCR_TX_ENABLED              (0x4)\r
150 #define MCF_UART_UCR_TX_DISABLED             (0x8)\r
151 #define MCF_UART_UCR_MISC(x)                 (((x)&0x7)<<0x4)\r
152 #define MCF_UART_UCR_NONE                    (0)\r
153 #define MCF_UART_UCR_RESET_MR                (0x10)\r
154 #define MCF_UART_UCR_RESET_RX                (0x20)\r
155 #define MCF_UART_UCR_RESET_TX                (0x30)\r
156 #define MCF_UART_UCR_RESET_ERROR             (0x40)\r
157 #define MCF_UART_UCR_RESET_BKCHGINT          (0x50)\r
158 #define MCF_UART_UCR_START_BREAK             (0x60)\r
159 #define MCF_UART_UCR_STOP_BREAK              (0x70)\r
160 \r
161 /* Bit definitions and macros for MCF_UART_URB */\r
162 #define MCF_UART_URB_RB(x)                   (((x)&0xFF)<<0)\r
163 \r
164 /* Bit definitions and macros for MCF_UART_UTB */\r
165 #define MCF_UART_UTB_TB(x)                   (((x)&0xFF)<<0)\r
166 \r
167 /* Bit definitions and macros for MCF_UART_UIPCR */\r
168 #define MCF_UART_UIPCR_CTS                   (0x1)\r
169 #define MCF_UART_UIPCR_COS                   (0x10)\r
170 \r
171 /* Bit definitions and macros for MCF_UART_UACR */\r
172 #define MCF_UART_UACR_IEC                    (0x1)\r
173 \r
174 /* Bit definitions and macros for MCF_UART_UIMR */\r
175 #define MCF_UART_UIMR_TXRDY                  (0x1)\r
176 #define MCF_UART_UIMR_FFULL_RXRDY            (0x2)\r
177 #define MCF_UART_UIMR_DB                     (0x4)\r
178 #define MCF_UART_UIMR_COS                    (0x80)\r
179 \r
180 /* Bit definitions and macros for MCF_UART_UISR */\r
181 #define MCF_UART_UISR_TXRDY                  (0x1)\r
182 #define MCF_UART_UISR_FFULL_RXRDY            (0x2)\r
183 #define MCF_UART_UISR_DB                     (0x4)\r
184 #define MCF_UART_UISR_COS                    (0x80)\r
185 \r
186 /* Bit definitions and macros for MCF_UART_UBG1 */\r
187 #define MCF_UART_UBG1_Divider_MSB(x)         (((x)&0xFF)<<0)\r
188 \r
189 /* Bit definitions and macros for MCF_UART_UBG2 */\r
190 #define MCF_UART_UBG2_Divider_LSB(x)         (((x)&0xFF)<<0)\r
191 \r
192 /* Bit definitions and macros for MCF_UART_UIP */\r
193 #define MCF_UART_UIP_CTS                     (0x1)\r
194 \r
195 /* Bit definitions and macros for MCF_UART_UOP1 */\r
196 #define MCF_UART_UOP1_RTS                    (0x1)\r
197 \r
198 /* Bit definitions and macros for MCF_UART_UOP0 */\r
199 #define MCF_UART_UOP0_RTS                    (0x1)\r
200 \r
201 \r
202 #endif /* __MCF52259_UART_H__ */\r