]> rtime.felk.cvut.cz Git - arc.git/blob - boards/hcs12_elmicro_card12/config/Port_Cfg.h
Cleanup of some drivers. Re-generated examples for mpc551xsim
[arc.git] / boards / hcs12_elmicro_card12 / config / Port_Cfg.h
1 /* -------------------------------- Arctic Core ------------------------------\r
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
3  *\r
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
5  *\r
6  * This source code is free software; you can redistribute it and/or modify it\r
7  * under the terms of the GNU General Public License version 2 as published by the\r
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
9  *\r
10  * This program is distributed in the hope that it will be useful, but\r
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
13  * for more details.\r
14  * -------------------------------- Arctic Core ------------------------------*/\r
15 \r
16 #ifndef PORT_CFG_H_\r
17 #define PORT_CFG_H_\r
18 \r
19 #warning "This default file may only be used as an example!"\r
20 \r
21 #include "Std_Types.h"\r
22 \r
23 /** Build version info API */\r
24 #define PORT_VERSION_INFO_API                           STD_ON  /** @req PORT100 PORT101 */\r
25 /** Enable Development Error Trace */\r
26 #define PORT_DEV_ERROR_DETECT                           STD_ON\r
27 /** Build change pin direction API */\r
28 #define PORT_SET_PIN_DIRECTION_API              STD_ON\r
29 /** Allow Pin mode changes during runtime (not avail on this CPU) */\r
30 #define PORT_SET_PIN_MODE_API               STD_ON\r
31 \r
32 /** Parameter to enable/disable configuration on a port */\r
33 #define PORTA_CONFIGURABLE  STD_OFF\r
34 #define PORTB_CONFIGURABLE  STD_OFF\r
35 #define PORTE_CONFIGURABLE  STD_OFF\r
36 #define PORTK_CONFIGURABLE  STD_OFF\r
37 #define PORTH_CONFIGURABLE  STD_ON\r
38 #define PORTJ_CONFIGURABLE  STD_OFF\r
39 #define PORTM_CONFIGURABLE  STD_OFF\r
40 #define PORTP_CONFIGURABLE  STD_OFF\r
41 #define PORTS_CONFIGURABLE  STD_OFF\r
42 #define PORTT_CONFIGURABLE  STD_OFF\r
43 \r
44 #define PORT_A_BASE 0x0100\r
45 #define PORT_B_BASE 0x0200\r
46 #define PORT_E_BASE 0x0300\r
47 #define PORT_K_BASE 0x0400\r
48 #define PORT_H_BASE 0x0500\r
49 #define PORT_J_BASE 0x0600\r
50 #define PORT_M_BASE 0x0700\r
51 #define PORT_P_BASE 0x0800\r
52 #define PORT_S_BASE 0x0900\r
53 #define PORT_T_BASE 0x0A00\r
54 #define PORT_BITMASK  0x00FF\r
55 #define PORT_BASEMASK 0xFF00;\r
56 \r
57 /** HW specific symbolic names of pins */\r
58 /** @req PORT013 */\r
59 typedef enum\r
60 {\r
61   PORT_PA0 = PORT_A_BASE,\r
62   PORT_PA1,\r
63   PORT_PA2,\r
64   PORT_PA3,\r
65   PORT_PA4,\r
66   PORT_PA5,\r
67   PORT_PA6,\r
68   PORT_PA7,\r
69   PORT_PB0 = PORT_B_BASE,\r
70   PORT_PB1,\r
71   PORT_PB2,\r
72   PORT_PB3,\r
73   PORT_PB4,\r
74   PORT_PB5,\r
75   PORT_PB6,\r
76   PORT_PB7,\r
77   PORT_PE0 = PORT_E_BASE,\r
78   PORT_PE1,\r
79   PORT_PE2,\r
80   PORT_PE3,\r
81   PORT_PE4,\r
82   PORT_PE5,\r
83   PORT_PE6,\r
84   PORT_PE7,\r
85   PORT_PH0 = PORT_H_BASE,\r
86   PORT_PH1,\r
87   PORT_PH2,\r
88   PORT_PH3,\r
89   PORT_PH4,\r
90   PORT_PH5,\r
91   PORT_PH6,\r
92   PORT_PH7,\r
93   PORT_PJ0 = PORT_J_BASE,\r
94   PORT_PJ1,\r
95   PORT_PJ2,\r
96   PORT_PJ3,\r
97   PORT_PJ4,\r
98   PORT_PJ5,\r
99   PORT_PJ6,\r
100   PORT_PJ7,\r
101   PORT_PK0 = PORT_K_BASE,\r
102   PORT_PK1,\r
103   PORT_PK2,\r
104   PORT_PK3,\r
105   PORT_PK4,\r
106   PORT_PK5,\r
107   PORT_PK6,\r
108   PORT_PK7,\r
109   PORT_PM0 = PORT_M_BASE,\r
110   PORT_PM1,\r
111   PORT_PM2,\r
112   PORT_PM3,\r
113   PORT_PM4,\r
114   PORT_PM5,\r
115   PORT_PM6,\r
116   PORT_PM7,\r
117   PORT_PP0 = PORT_P_BASE,\r
118   PORT_PP1,\r
119   PORT_PP2,\r
120   PORT_PP3,\r
121   PORT_PP4,\r
122   PORT_PP5,\r
123   PORT_PP6,\r
124   PORT_PP7,\r
125   PORT_PS0 = PORT_S_BASE,\r
126   PORT_PS1,\r
127   PORT_PS2,\r
128   PORT_PS3,\r
129   PORT_PS4,\r
130   PORT_PS5,\r
131   PORT_PS6,\r
132   PORT_PS7,\r
133   PORT_PT0 = PORT_T_BASE,\r
134   PORT_PT1,\r
135   PORT_PT2,\r
136   PORT_PT3,\r
137   PORT_PT4,\r
138   PORT_PT5,\r
139   PORT_PT6,\r
140   PORT_PT7,\r
141 } Port_PinType;\r
142 \r
143 /** @req PORT124 */\r
144 //typedef uint8 Port_PinModeType;\r
145 \r
146 /** Top level configuration container */\r
147 /** @req PORT073 */\r
148 typedef struct\r
149 {\r
150   const uint8_t corePullUpRegister; // PUCR\r
151   const uint8_t coreReducedDriveRegister; // RDRIV\r
152   const uint8_t modeRoutingRegister; // MODRR\r
153 \r
154   /**\r
155    * Every port has:\r
156    *  a direction (input or output)\r
157    *  a default out value\r
158    *  a mask that is 0 if the direction is allowed to change during runtime\r
159    *\r
160    * Some ports have:\r
161    *  a reduced drive conf (power saving)\r
162    *  a pull enable conf (enable pull-up/pull-down\r
163    *  a pull direction conf (pull-up or pull-down)\r
164    *  a wired mode (enable open drain outputs)\r
165    */\r
166 #if ( PORTA_CONFIGURABLE == STD_ON )\r
167   const uint8_t portADirection;\r
168   const uint8_t portAOutValue;\r
169   const uint8_t portAMask;\r
170 #endif\r
171 \r
172 #if ( PORTB_CONFIGURABLE == STD_ON )\r
173   const uint8_t portBDirection;\r
174   const uint8_t portBOutValue;\r
175   const uint8_t portBMask;\r
176 #endif\r
177 \r
178 #if ( PORTE_CONFIGURABLE == STD_ON )\r
179   const uint8_t portEDirection;\r
180   const uint8_t portEOutValue;\r
181   const uint8_t portEMask;\r
182 #endif\r
183 \r
184 #if ( PORTK_CONFIGURABLE == STD_ON )\r
185   const uint8_t portKDirection;\r
186   const uint8_t portKOutValue;\r
187   const uint8_t portKMask;\r
188 #endif\r
189 \r
190 #if ( PORTH_CONFIGURABLE == STD_ON )\r
191   const uint8_t portHDirection;\r
192   const uint8_t portHOutValue;\r
193   const uint8_t portHMask;\r
194   const uint8_t portHPullEnableRegister;\r
195   const uint8_t portHPullPolarityRegsiter;\r
196   const uint8_t portHReducedDriveRegister;\r
197 #endif\r
198 \r
199 #if ( PORTJ_CONFIGURABLE == STD_ON )\r
200   const uint8_t portJDirection;\r
201   const uint8_t portJOutValue;\r
202   const uint8_t portJMask;\r
203   const uint8_t portJPullEnableRegister;\r
204   const uint8_t portJPullPolarityRegsiter;\r
205   const uint8_t portJReducedDriveRegister;\r
206 #endif\r
207 \r
208 #if ( PORTM_CONFIGURABLE == STD_ON )\r
209   const uint8_t portMDirection;\r
210   const uint8_t portMOutValue;\r
211   const uint8_t portMMask;\r
212   const uint8_t portMPullEnableRegister;\r
213   const uint8_t portMPullPolarityRegsiter;\r
214   const uint8_t portMWiredModeRegsiter;\r
215   const uint8_t portMReducedDriveRegister;\r
216 #endif\r
217 \r
218 #if ( PORTP_CONFIGURABLE == STD_ON )\r
219   const uint8_t portPDirection;\r
220   const uint8_t portPOutValue;\r
221   const uint8_t portPMask;\r
222   const uint8_t portPPullEnableRegister;\r
223   const uint8_t portPPullPolarityRegsiter;\r
224   const uint8_t portPReducedDriveRegister;\r
225 #endif\r
226 \r
227 #if ( PORTS_CONFIGURABLE == STD_ON )\r
228   const uint8_t portSDirection;\r
229   const uint8_t portSOutValue;\r
230   const uint8_t portSMask;\r
231   const uint8_t portSPullEnableRegister;\r
232   const uint8_t portSPullPolarityRegsiter;\r
233   const uint8_t portSWiredModeRegsiter;\r
234   const uint8_t portSReducedDriveRegister;\r
235 #endif\r
236 \r
237 #if ( PORTT_CONFIGURABLE == STD_ON )\r
238   const uint8_t portTDirection;\r
239   const uint8_t portTOutValue;\r
240   const uint8_t portTMask;\r
241   const uint8_t portTPullEnableRegister;\r
242   const uint8_t portTPullPolarityRegsiter;\r
243   const uint8_t portTReducedDriveRegister;\r
244 #endif\r
245 } Port_ConfigType;\r
246 \r
247 /** Instance of the top level configuration container */\r
248 extern const Port_ConfigType PortConfigData;\r
249 \r
250 #endif /*PORT_CFG_H_*/\r