]> rtime.felk.cvut.cz Git - arc.git/blob - examples/pwm_node/config/mpc5516it/Port_Cfg.h
Initial commit.
[arc.git] / examples / pwm_node / config / mpc5516it / Port_Cfg.h
1 /* -------------------------------- Arctic Core ------------------------------
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com
3  *
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
5  *
6  * This source code is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 as published by the
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13  * for more details.
14  * -------------------------------- Arctic Core ------------------------------*/
15
16
17
18
19
20
21
22
23 #ifndef PORT_CFG_H_\r
24 #define PORT_CFG_H_\r
25 \r
26 #include "Std_Types.h"\r
27 \r
28 #define PORT_VERSION_INFO_API                           STD_ON\r
29 #define PORT_DEV_ERROR_DETECT                           STD_ON\r
30 #define PORT_PIN_DIRECTION_CHANGES_ALLOWED      STD_ON\r
31 \r
32 typedef enum\r
33 {\r
34   PA0,\r
35   PA1,\r
36   PA2,\r
37   PA3,\r
38   PA4,\r
39   PA5,\r
40   PA6,\r
41   PA7,\r
42   PA8,\r
43   PA9,\r
44   PA10,\r
45   PA11,\r
46   PA12,\r
47   PA13,\r
48   PA14,\r
49   PA15,\r
50   PB0,\r
51   PB1,\r
52   PB2,\r
53   PB3,\r
54   PB4,\r
55   PB5,\r
56   PB6,\r
57   PB7,\r
58   PB8,\r
59   PB9,\r
60   PB10,\r
61   PB11,\r
62   PB12,\r
63   PB13,\r
64   PB14,\r
65   PB15,\r
66   PC0,\r
67   PC1,\r
68   PC2,\r
69   PC3,\r
70   PC4,\r
71   PC5,\r
72   PC6,\r
73   PC7,\r
74   PC8,\r
75   PC9,\r
76   PC10,\r
77   PC11,\r
78   PC12,\r
79   PC13,\r
80   PC14,\r
81   PC15,\r
82   PD0,\r
83   PD1,\r
84   PD2,\r
85   PD3,\r
86   PD4,\r
87   PD5,\r
88   PD6,\r
89   PD7,\r
90   PD8,\r
91   PD9,\r
92   PD10,\r
93   PD11,\r
94   PD12,\r
95   PD13,\r
96   PD14,\r
97   PD15,\r
98   PE0,\r
99   PE1,\r
100   PE2,\r
101   PE3,\r
102   PE4,\r
103   PE5,\r
104   PE6,\r
105   PE7,\r
106   PE8,\r
107   PE9,\r
108   PE10,\r
109   PE11,\r
110   PE12,\r
111   PE13,\r
112   PE14,\r
113   PE15,\r
114   PF0,\r
115   PF1,\r
116   PF2,\r
117   PF3,\r
118   PF4,\r
119   PF5,\r
120   PF6,\r
121   PF7,\r
122   PF8,\r
123   PF9,\r
124   PF10,\r
125   PF11,\r
126   PF12,\r
127   PF13,\r
128   PF14,\r
129   PF15,\r
130   PG0,\r
131   PG1,\r
132   PG2,\r
133   PG3,\r
134   PG4,\r
135   PG5,\r
136   PG6,\r
137   PG7,\r
138   PG8,\r
139   PG9,\r
140   PG10,\r
141   PG11,\r
142   PG12,\r
143   PG13,\r
144   PG14,\r
145   PG15,\r
146   PH0,\r
147   PH1,\r
148   PH2,\r
149   PH3,\r
150   PH4,\r
151   PH5,\r
152   PH6,\r
153   PH7,\r
154   PH8,\r
155   PH9,\r
156   PH10,\r
157   PH11,\r
158   PH12,\r
159   PH13,\r
160   PH14,\r
161   PH15,\r
162   PJ0,\r
163   PJ1,\r
164   PJ2,\r
165   PJ3,\r
166   PJ4,\r
167   PJ5,\r
168   PJ6,\r
169   PJ7,\r
170   PJ8,\r
171   PJ9,\r
172   PJ10,\r
173   PJ11,\r
174   PJ12,\r
175   PJ13,\r
176   PJ14,\r
177   PJ15,\r
178   PK0,\r
179   PK1\r
180 } Port_PinType;\r
181 \r
182 #define   BIT0    (1<<15)\r
183 #define   BIT1    (1<<14)\r
184 #define   BIT2    (1<<13)\r
185 #define   BIT3    (1<<12)\r
186 #define   BIT4    (1<<11)\r
187 #define   BIT5    (1<<10)\r
188 #define   BIT6    (1<<9)\r
189 #define   BIT7    (1<<8)\r
190 #define   BIT8    (1<<7)\r
191 #define   BIT9    (1<<6)\r
192 #define   BIT10   (1<<5)\r
193 #define   BIT11   (1<<4)\r
194 #define   BIT12   (1<<3)\r
195 #define   BIT13   (1<<2)\r
196 #define   BIT14   (1<<1)\r
197 #define   BIT15   (1<<0)\r
198 \r
199 #define   WPE_BIT     BIT14\r
200 #define   WPS_BIT     BIT15\r
201 #define   SRC0    BIT12\r
202 #define   SRC1    BIT13\r
203 \r
204 #define   PULL_UP     (WPE_BIT|WPS_BIT)\r
205 #define   PULL_DOWN   (WPE_BIT)\r
206 #define   PULL_NONE   0\r
207 #define   SLEW_RATE_MIN 0\r
208 #define   SLEW_RATE_MED BIT13\r
209 #define   SLEW_RATE_MAX (BIT12|BIT13)\r
210 #define   HYS_ENABLE    BIT11\r
211 #define   ODE_ENABLE    BIT10\r
212 #define   IBE_ENABLE    BIT7\r
213 #define   OBE_ENABLE    BIT6\r
214 #define   PA_IO     0\r
215 #define   PA_FUNC1    (BIT5)\r
216 #define   PA_FUNC2    (BIT4)\r
217 #define   PA_FUNC3    (BIT4|BIT5)\r
218 \r
219 #define   NORMAL_INPUT  (BIT15)\r
220 \r
221 // Should be this out of reset\r
222 #define    PCR_RESET    (0)\r
223 #define PCR_BOOTCFG   (IBE_ENABLE|PULL_DOWN)\r
224 \r
225 #define EVB_TEST_CONFIG  (&PortConfigData)\r
226 \r
227 typedef struct\r
228 {\r
229   uint16_t padCnt;\r
230   const uint16_t *padConfig;\r
231   uint16_t outCnt;\r
232   const uint8_t *outConfig;\r
233 //  uint16_t inCnt;\r
234 //  const uint8_t *inConfig;\r
235 } Port_ConfigType;\r
236 \r
237 extern const Port_ConfigType PortConfigData;\r
238 \r
239 #endif /*PORT_CFG_H_*/\r