1 /* Coldfire C Header File
\r
2 * Copyright Freescale Semiconductor Inc
\r
3 * All rights reserved.
\r
5 * 2008/04/17 Revision: 0.2
\r
7 * (c) Copyright UNIS, spol. s r.o. 1997-2008
\r
12 * http : www.processorexpert.com
\r
13 * mail : info@processorexpert.com
\r
16 #ifndef __MCF52259_CANMB_H__
\r
17 #define __MCF52259_CANMB_H__
\r
20 /*********************************************************************
\r
22 * Flex Controller Area Network Module (FlexCAN) message buffers
\r
24 *********************************************************************/
\r
26 /* Register read/write macros */
\r
27 #define MCF_CANMB_CODE0 (*(vuint8 *)(&__IPSBAR[0x170080]))
\r
28 #define MCF_CANMB_CTRL0 (*(vuint8 *)(&__IPSBAR[0x170081]))
\r
29 #define MCF_CANMB_TIME0 (*(vuint16*)(&__IPSBAR[0x170082]))
\r
30 #define MCF_CANMB_ID0 (*(vuint32*)(&__IPSBAR[0x170084]))
\r
31 #define MCF_CANMB_DATA_WORD_1_0 (*(vuint16*)(&__IPSBAR[0x170088]))
\r
32 #define MCF_CANMB_DATA_WORD_2_0 (*(vuint16*)(&__IPSBAR[0x17008A]))
\r
33 #define MCF_CANMB_DATA_WORD_3_0 (*(vuint16*)(&__IPSBAR[0x17008C]))
\r
34 #define MCF_CANMB_DATA_WORD_4_0 (*(vuint16*)(&__IPSBAR[0x17008E]))
\r
35 #define MCF_CANMB_CODE1 (*(vuint8 *)(&__IPSBAR[0x170090]))
\r
36 #define MCF_CANMB_CTRL1 (*(vuint8 *)(&__IPSBAR[0x170091]))
\r
37 #define MCF_CANMB_TIME1 (*(vuint16*)(&__IPSBAR[0x170092]))
\r
38 #define MCF_CANMB_ID1 (*(vuint32*)(&__IPSBAR[0x170094]))
\r
39 #define MCF_CANMB_DATA_WORD_1_1 (*(vuint16*)(&__IPSBAR[0x170098]))
\r
40 #define MCF_CANMB_DATA_WORD_2_1 (*(vuint16*)(&__IPSBAR[0x17009A]))
\r
41 #define MCF_CANMB_DATA_WORD_3_1 (*(vuint16*)(&__IPSBAR[0x17009C]))
\r
42 #define MCF_CANMB_DATA_WORD_4_1 (*(vuint16*)(&__IPSBAR[0x17009E]))
\r
43 #define MCF_CANMB_CODE2 (*(vuint8 *)(&__IPSBAR[0x1700A0]))
\r
44 #define MCF_CANMB_CTRL2 (*(vuint8 *)(&__IPSBAR[0x1700A1]))
\r
45 #define MCF_CANMB_TIME2 (*(vuint16*)(&__IPSBAR[0x1700A2]))
\r
46 #define MCF_CANMB_ID2 (*(vuint32*)(&__IPSBAR[0x1700A4]))
\r
47 #define MCF_CANMB_DATA_WORD_1_2 (*(vuint16*)(&__IPSBAR[0x1700A8]))
\r
48 #define MCF_CANMB_DATA_WORD_2_2 (*(vuint16*)(&__IPSBAR[0x1700AA]))
\r
49 #define MCF_CANMB_DATA_WORD_3_2 (*(vuint16*)(&__IPSBAR[0x1700AC]))
\r
50 #define MCF_CANMB_DATA_WORD_4_2 (*(vuint16*)(&__IPSBAR[0x1700AE]))
\r
51 #define MCF_CANMB_CODE3 (*(vuint8 *)(&__IPSBAR[0x1700B0]))
\r
52 #define MCF_CANMB_CTRL3 (*(vuint8 *)(&__IPSBAR[0x1700B1]))
\r
53 #define MCF_CANMB_TIME3 (*(vuint16*)(&__IPSBAR[0x1700B2]))
\r
54 #define MCF_CANMB_ID3 (*(vuint32*)(&__IPSBAR[0x1700B4]))
\r
55 #define MCF_CANMB_DATA_WORD_1_3 (*(vuint16*)(&__IPSBAR[0x1700B8]))
\r
56 #define MCF_CANMB_DATA_WORD_2_3 (*(vuint16*)(&__IPSBAR[0x1700BA]))
\r
57 #define MCF_CANMB_DATA_WORD_3_3 (*(vuint16*)(&__IPSBAR[0x1700BC]))
\r
58 #define MCF_CANMB_DATA_WORD_4_3 (*(vuint16*)(&__IPSBAR[0x1700BE]))
\r
59 #define MCF_CANMB_CODE4 (*(vuint8 *)(&__IPSBAR[0x1700C0]))
\r
60 #define MCF_CANMB_CTRL4 (*(vuint8 *)(&__IPSBAR[0x1700C1]))
\r
61 #define MCF_CANMB_TIME4 (*(vuint16*)(&__IPSBAR[0x1700C2]))
\r
62 #define MCF_CANMB_ID4 (*(vuint32*)(&__IPSBAR[0x1700C4]))
\r
63 #define MCF_CANMB_DATA_WORD_1_4 (*(vuint16*)(&__IPSBAR[0x1700C8]))
\r
64 #define MCF_CANMB_DATA_WORD_2_4 (*(vuint16*)(&__IPSBAR[0x1700CA]))
\r
65 #define MCF_CANMB_DATA_WORD_3_4 (*(vuint16*)(&__IPSBAR[0x1700CC]))
\r
66 #define MCF_CANMB_DATA_WORD_4_4 (*(vuint16*)(&__IPSBAR[0x1700CE]))
\r
67 #define MCF_CANMB_CODE5 (*(vuint8 *)(&__IPSBAR[0x1700D0]))
\r
68 #define MCF_CANMB_CTRL5 (*(vuint8 *)(&__IPSBAR[0x1700D1]))
\r
69 #define MCF_CANMB_TIME5 (*(vuint16*)(&__IPSBAR[0x1700D2]))
\r
70 #define MCF_CANMB_ID5 (*(vuint32*)(&__IPSBAR[0x1700D4]))
\r
71 #define MCF_CANMB_DATA_WORD_1_5 (*(vuint16*)(&__IPSBAR[0x1700D8]))
\r
72 #define MCF_CANMB_DATA_WORD_2_5 (*(vuint16*)(&__IPSBAR[0x1700DA]))
\r
73 #define MCF_CANMB_DATA_WORD_3_5 (*(vuint16*)(&__IPSBAR[0x1700DC]))
\r
74 #define MCF_CANMB_DATA_WORD_4_5 (*(vuint16*)(&__IPSBAR[0x1700DE]))
\r
75 #define MCF_CANMB_CODE6 (*(vuint8 *)(&__IPSBAR[0x1700E0]))
\r
76 #define MCF_CANMB_CTRL6 (*(vuint8 *)(&__IPSBAR[0x1700E1]))
\r
77 #define MCF_CANMB_TIME6 (*(vuint16*)(&__IPSBAR[0x1700E2]))
\r
78 #define MCF_CANMB_ID6 (*(vuint32*)(&__IPSBAR[0x1700E4]))
\r
79 #define MCF_CANMB_DATA_WORD_1_6 (*(vuint16*)(&__IPSBAR[0x1700E8]))
\r
80 #define MCF_CANMB_DATA_WORD_2_6 (*(vuint16*)(&__IPSBAR[0x1700EA]))
\r
81 #define MCF_CANMB_DATA_WORD_3_6 (*(vuint16*)(&__IPSBAR[0x1700EC]))
\r
82 #define MCF_CANMB_DATA_WORD_4_6 (*(vuint16*)(&__IPSBAR[0x1700EE]))
\r
83 #define MCF_CANMB_CODE7 (*(vuint8 *)(&__IPSBAR[0x1700F0]))
\r
84 #define MCF_CANMB_CTRL7 (*(vuint8 *)(&__IPSBAR[0x1700F1]))
\r
85 #define MCF_CANMB_TIME7 (*(vuint16*)(&__IPSBAR[0x1700F2]))
\r
86 #define MCF_CANMB_ID7 (*(vuint32*)(&__IPSBAR[0x1700F4]))
\r
87 #define MCF_CANMB_DATA_WORD_1_7 (*(vuint16*)(&__IPSBAR[0x1700F8]))
\r
88 #define MCF_CANMB_DATA_WORD_2_7 (*(vuint16*)(&__IPSBAR[0x1700FA]))
\r
89 #define MCF_CANMB_DATA_WORD_3_7 (*(vuint16*)(&__IPSBAR[0x1700FC]))
\r
90 #define MCF_CANMB_DATA_WORD_4_7 (*(vuint16*)(&__IPSBAR[0x1700FE]))
\r
91 #define MCF_CANMB_CODE8 (*(vuint8 *)(&__IPSBAR[0x170100]))
\r
92 #define MCF_CANMB_CTRL8 (*(vuint8 *)(&__IPSBAR[0x170101]))
\r
93 #define MCF_CANMB_TIME8 (*(vuint16*)(&__IPSBAR[0x170102]))
\r
94 #define MCF_CANMB_ID8 (*(vuint32*)(&__IPSBAR[0x170104]))
\r
95 #define MCF_CANMB_DATA_WORD_1_8 (*(vuint16*)(&__IPSBAR[0x170108]))
\r
96 #define MCF_CANMB_DATA_WORD_2_8 (*(vuint16*)(&__IPSBAR[0x17010A]))
\r
97 #define MCF_CANMB_DATA_WORD_3_8 (*(vuint16*)(&__IPSBAR[0x17010C]))
\r
98 #define MCF_CANMB_DATA_WORD_4_8 (*(vuint16*)(&__IPSBAR[0x17010E]))
\r
99 #define MCF_CANMB_CODE9 (*(vuint8 *)(&__IPSBAR[0x170110]))
\r
100 #define MCF_CANMB_CTRL9 (*(vuint8 *)(&__IPSBAR[0x170111]))
\r
101 #define MCF_CANMB_TIME9 (*(vuint16*)(&__IPSBAR[0x170112]))
\r
102 #define MCF_CANMB_ID9 (*(vuint32*)(&__IPSBAR[0x170114]))
\r
103 #define MCF_CANMB_DATA_WORD_1_9 (*(vuint16*)(&__IPSBAR[0x170118]))
\r
104 #define MCF_CANMB_DATA_WORD_2_9 (*(vuint16*)(&__IPSBAR[0x17011A]))
\r
105 #define MCF_CANMB_DATA_WORD_3_9 (*(vuint16*)(&__IPSBAR[0x17011C]))
\r
106 #define MCF_CANMB_DATA_WORD_4_9 (*(vuint16*)(&__IPSBAR[0x17011E]))
\r
107 #define MCF_CANMB_CODE10 (*(vuint8 *)(&__IPSBAR[0x170120]))
\r
108 #define MCF_CANMB_CTRL10 (*(vuint8 *)(&__IPSBAR[0x170121]))
\r
109 #define MCF_CANMB_TIME10 (*(vuint16*)(&__IPSBAR[0x170122]))
\r
110 #define MCF_CANMB_ID10 (*(vuint32*)(&__IPSBAR[0x170124]))
\r
111 #define MCF_CANMB_DATA_WORD_1_10 (*(vuint16*)(&__IPSBAR[0x170128]))
\r
112 #define MCF_CANMB_DATA_WORD_2_10 (*(vuint16*)(&__IPSBAR[0x17012A]))
\r
113 #define MCF_CANMB_DATA_WORD_3_10 (*(vuint16*)(&__IPSBAR[0x17012C]))
\r
114 #define MCF_CANMB_DATA_WORD_4_10 (*(vuint16*)(&__IPSBAR[0x17012E]))
\r
115 #define MCF_CANMB_CODE11 (*(vuint8 *)(&__IPSBAR[0x170130]))
\r
116 #define MCF_CANMB_CTRL11 (*(vuint8 *)(&__IPSBAR[0x170131]))
\r
117 #define MCF_CANMB_TIME11 (*(vuint16*)(&__IPSBAR[0x170132]))
\r
118 #define MCF_CANMB_ID11 (*(vuint32*)(&__IPSBAR[0x170134]))
\r
119 #define MCF_CANMB_DATA_WORD_1_11 (*(vuint16*)(&__IPSBAR[0x170138]))
\r
120 #define MCF_CANMB_DATA_WORD_2_11 (*(vuint16*)(&__IPSBAR[0x17013A]))
\r
121 #define MCF_CANMB_DATA_WORD_3_11 (*(vuint16*)(&__IPSBAR[0x17013C]))
\r
122 #define MCF_CANMB_DATA_WORD_4_11 (*(vuint16*)(&__IPSBAR[0x17013E]))
\r
123 #define MCF_CANMB_CODE12 (*(vuint8 *)(&__IPSBAR[0x170140]))
\r
124 #define MCF_CANMB_CTRL12 (*(vuint8 *)(&__IPSBAR[0x170141]))
\r
125 #define MCF_CANMB_TIME12 (*(vuint16*)(&__IPSBAR[0x170142]))
\r
126 #define MCF_CANMB_ID12 (*(vuint32*)(&__IPSBAR[0x170144]))
\r
127 #define MCF_CANMB_DATA_WORD_1_ (*(vuint16*)(&__IPSBAR[0x170148]))
\r
128 #define MCF_CANMB_DATA_WORD_2_12 (*(vuint16*)(&__IPSBAR[0x17014A]))
\r
129 #define MCF_CANMB_DATA_WORD_3_12 (*(vuint16*)(&__IPSBAR[0x17014C]))
\r
130 #define MCF_CANMB_DATA_WORD_4_12 (*(vuint16*)(&__IPSBAR[0x17014E]))
\r
131 #define MCF_CANMB_CODE13 (*(vuint8 *)(&__IPSBAR[0x170150]))
\r
132 #define MCF_CANMB_CTRL13 (*(vuint8 *)(&__IPSBAR[0x170151]))
\r
133 #define MCF_CANMB_TIME13 (*(vuint16*)(&__IPSBAR[0x170152]))
\r
134 #define MCF_CANMB_ID13 (*(vuint32*)(&__IPSBAR[0x170154]))
\r
135 #define MCF_CANMB_DATA_WORD_1_13 (*(vuint16*)(&__IPSBAR[0x170158]))
\r
136 #define MCF_CANMB_DATA_WORD_2_13 (*(vuint16*)(&__IPSBAR[0x17015A]))
\r
137 #define MCF_CANMB_DATA_WORD_3_13 (*(vuint16*)(&__IPSBAR[0x17015C]))
\r
138 #define MCF_CANMB_DATA_WORD_4_13 (*(vuint16*)(&__IPSBAR[0x17015E]))
\r
139 #define MCF_CANMB_CODE14 (*(vuint8 *)(&__IPSBAR[0x170160]))
\r
140 #define MCF_CANMB_CTRL14 (*(vuint8 *)(&__IPSBAR[0x170161]))
\r
141 #define MCF_CANMB_TIME14 (*(vuint16*)(&__IPSBAR[0x170162]))
\r
142 #define MCF_CANMB_ID14 (*(vuint32*)(&__IPSBAR[0x170164]))
\r
143 #define MCF_CANMB_DATA_WORD_1_14 (*(vuint16*)(&__IPSBAR[0x170168]))
\r
144 #define MCF_CANMB_DATA_WORD_2_14 (*(vuint16*)(&__IPSBAR[0x17016A]))
\r
145 #define MCF_CANMB_DATA_WORD_3_14 (*(vuint16*)(&__IPSBAR[0x17016C]))
\r
146 #define MCF_CANMB_DATA_WORD_4_14 (*(vuint16*)(&__IPSBAR[0x17016E]))
\r
147 #define MCF_CANMB_CODE15 (*(vuint8 *)(&__IPSBAR[0x170170]))
\r
148 #define MCF_CANMB_CTRL15 (*(vuint8 *)(&__IPSBAR[0x170171]))
\r
149 #define MCF_CANMB_TIME15 (*(vuint16*)(&__IPSBAR[0x170172]))
\r
150 #define MCF_CANMB_ID15 (*(vuint32*)(&__IPSBAR[0x170174]))
\r
151 #define MCF_CANMB_DATA_WORD_1_15 (*(vuint16*)(&__IPSBAR[0x170178]))
\r
152 #define MCF_CANMB_DATA_WORD_2_15 (*(vuint16*)(&__IPSBAR[0x17017A]))
\r
153 #define MCF_CANMB_DATA_WORD_3_15 (*(vuint16*)(&__IPSBAR[0x17017C]))
\r
154 #define MCF_CANMB_DATA_WORD_4_15 (*(vuint16*)(&__IPSBAR[0x17017E]))
\r
155 #define MCF_CANMB_CODE(x) (*(vuint8 *)(&__IPSBAR[0x170080 + ((x)*0x10)]))
\r
156 #define MCF_CANMB_CTRL(x) (*(vuint8 *)(&__IPSBAR[0x170081 + ((x)*0x10)]))
\r
157 #define MCF_CANMB_TIME(x) (*(vuint16*)(&__IPSBAR[0x170082 + ((x)*0x10)]))
\r
158 #define MCF_CANMB_ID(x) (*(vuint32*)(&__IPSBAR[0x170084 + ((x)*0x10)]))
\r
159 #define MCF_CANMB_DATA_WORD_1(x) (*(vuint16*)(&__IPSBAR[0x170088 + ((x)*0x10)]))
\r
160 #define MCF_CANMB_DATA_WORD_2(x) (*(vuint16*)(&__IPSBAR[0x17008A + ((x)*0x10)]))
\r
161 #define MCF_CANMB_DATA_WORD_3(x) (*(vuint16*)(&__IPSBAR[0x17008C + ((x)*0x10)]))
\r
162 #define MCF_CANMB_DATA_WORD_4(x) (*(vuint16*)(&__IPSBAR[0x17008E + ((x)*0x10)]))
\r
166 #define MCF_CANMB_BYTE(x,y) (*(vuint8 *)(&__IPSBAR[((0x170088 + ((x)*0x10)+y))]))
\r
169 /* Bit definitions and macros for MCF_CANMB_CODE */
\r
170 #define MCF_CANMB_CODE_CODE(x) (((x)&0xF)<<0)
\r
172 /* Bit definitions and macros for MCF_CANMB_CTRL */
\r
173 #define MCF_CANMB_CTRL_LENGTH(x) (((x)&0xF)<<0)
\r
174 #define MCF_CANMB_CTRL_RTR (0x10)
\r
175 #define MCF_CANMB_CTRL_IDE (0x20)
\r
176 #define MCF_CANMB_CTRL_SRR (0x40)
\r
178 /* Bit definitions and macros for MCF_CANMB_TIME */
\r
179 #define MCF_CANMB_TIME_TIME_STAMP(x) (((x)&0xFFFF)<<0)
\r
181 /* Bit definitions and macros for MCF_CANMB_ID */
\r
182 #define MCF_CANMB_ID_EXT(x) (((x)&0x3FFFF)<<0)
\r
183 #define MCF_CANMB_ID_STD(x) (((x)&0x7FF)<<0x12)
\r
185 /* Bit definitions and macros for MCF_CANMB_DATA_WORD_1 */
\r
186 #define MCF_CANMB_DATA_WORD_1_DATA_BYTE_1(x) (((x)&0xFF)<<0)
\r
187 #define MCF_CANMB_DATA_WORD_1_DATA_BYTE_0(x) (((x)&0xFF)<<0x8)
\r
189 /* Bit definitions and macros for MCF_CANMB_DATA_WORD_2 */
\r
190 #define MCF_CANMB_DATA_WORD_2_DATA_BYTE_3(x) (((x)&0xFF)<<0)
\r
191 #define MCF_CANMB_DATA_WORD_2_DATA_BYTE_2(x) (((x)&0xFF)<<0x8)
\r
193 /* Bit definitions and macros for MCF_CANMB_DATA_WORD_3 */
\r
194 #define MCF_CANMB_DATA_WORD_3_DATA_BYTE_5(x) (((x)&0xFF)<<0)
\r
195 #define MCF_CANMB_DATA_WORD_3_DATA_BYTE_4(x) (((x)&0xFF)<<0x8)
\r
197 /* Bit definitions and macros for MCF_CANMB_DATA_WORD_4 */
\r
198 #define MCF_CANMB_DATA_WORD_4_DATA_BYTE_7(x) (((x)&0xFF)<<0)
\r
199 #define MCF_CANMB_DATA_WORD_4_DATA_BYTE_6(x) (((x)&0xFF)<<0x8)
\r
202 #endif /* __MCF52259_CANMB_H__ */
\r