]> rtime.felk.cvut.cz Git - arc.git/blob - examples/pwm_node2/config/hcs12x_elmicro_tboard/Port_Cfg.h
Starting 'pdur2' branch with copied content from remote repository.
[arc.git] / examples / pwm_node2 / config / hcs12x_elmicro_tboard / Port_Cfg.h
1 /*\r
2 * Configuration of module: Port (Port_Cfg.h)\r
3 *\r
4 * Created by:              Arccore AB\r
5 * Copyright:               \r
6 *\r
7 * Configured for (MCU):    HCS12\r
8 *\r
9 * Module vendor:           ArcCore\r
10 * Generator version:       2.0.2\r
11 *\r
12 * Generated by Arctic Studio (http://arccore.com) \r
13 *           on Thu Mar 10 14:35:00 CET 2011\r
14 */\r
15 \r
16
17 #if !(((PORT_SW_MAJOR_VERSION == 1) && (PORT_SW_MINOR_VERSION == 0)) )\r
18 #error Port: Configuration file expected BSW module version to be 1.0.*\r
19 #endif
20
21 \r
22 #ifndef PORT_CFG_H_\r
23 #define PORT_CFG_H_\r
24 \r
25 #include "Std_Types.h"\r
26 \r
27 \r
28 /** Build version info API */\r
29 #define PORT_VERSION_INFO_API                           STD_ON\r
30 /** Enable Development Error Trace */\r
31 #define PORT_DEV_ERROR_DETECT                           STD_ON\r
32 /** Build change pin direction API */\r
33 #define PORT_SET_PIN_DIRECTION_API              STD_OFF\r
34 /** Allow Pin mode changes during runtime (not avail on this CPU) */\r
35 #define PORT_SET_PIN_MODE_API               STD_OFF\r
36 \r
37 /** Parameter to enable/disable configuration on a port */\r
38 #define PORTA_CONFIGURABLE  STD_OFF\r
39 #define PORTB_CONFIGURABLE  STD_ON\r
40 #define PORTE_CONFIGURABLE  STD_OFF\r
41 #define PORTK_CONFIGURABLE  STD_OFF\r
42 #define PORTH_CONFIGURABLE  STD_ON\r
43 #define PORTJ_CONFIGURABLE  STD_ON\r
44 #define PORTM_CONFIGURABLE  STD_ON\r
45 #define PORTP_CONFIGURABLE  STD_ON\r
46 #define PORTS_CONFIGURABLE  STD_ON\r
47 #define PORTT_CONFIGURABLE  STD_ON\r
48 \r
49 #define PORT_A_BASE 0x0100\r
50 #define PORT_B_BASE 0x0200\r
51 #define PORT_E_BASE 0x0300\r
52 #define PORT_K_BASE 0x0400\r
53 #define PORT_H_BASE 0x0500\r
54 #define PORT_J_BASE 0x0600\r
55 #define PORT_M_BASE 0x0700\r
56 #define PORT_P_BASE 0x0800\r
57 #define PORT_S_BASE 0x0900\r
58 #define PORT_T_BASE 0x0A00\r
59 #define PORT_BITMASK  0x00FF\r
60 #define PORT_BASEMASK 0xFF00;\r
61 \r
62 /** HW specific symbolic names of pins */\r
63 /** @req PORT013 */\r
64 typedef enum\r
65 {\r
66   PORT_PA0 = PORT_A_BASE,\r
67   PORT_PA1,\r
68   PORT_PA2,\r
69   PORT_PA3,\r
70   PORT_PA4,\r
71   PORT_PA5,\r
72   PORT_PA6,\r
73   PORT_PA7,\r
74   PORT_PB0 = PORT_B_BASE,\r
75   PORT_PB1,\r
76   PORT_PB2,\r
77   PORT_PB3,\r
78   PORT_PB4,\r
79   PORT_PB5,\r
80   PORT_PB6,\r
81   PORT_PB7,\r
82   PORT_PE0 = PORT_E_BASE,\r
83   PORT_PE1,\r
84   PORT_PE2,\r
85   PORT_PE3,\r
86   PORT_PE4,\r
87   PORT_PE5,\r
88   PORT_PE6,\r
89   PORT_PE7,\r
90   PORT_PH0 = PORT_H_BASE,\r
91   PORT_PH1,\r
92   PORT_PH2,\r
93   PORT_PH3,\r
94   PORT_PH4,\r
95   PORT_PH5,\r
96   PORT_PH6,\r
97   PORT_PH7,\r
98   PORT_PJ0 = PORT_J_BASE,\r
99   PORT_PJ1,\r
100   PORT_PJ2,\r
101   PORT_PJ3,\r
102   PORT_PJ4,\r
103   PORT_PJ5,\r
104   PORT_PJ6,\r
105   PORT_PJ7,\r
106   PORT_PK0 = PORT_K_BASE,\r
107   PORT_PK1,\r
108   PORT_PK2,\r
109   PORT_PK3,\r
110   PORT_PK4,\r
111   PORT_PK5,\r
112   PORT_PK6,\r
113   PORT_PK7,\r
114   PORT_PM0 = PORT_M_BASE,\r
115   PORT_PM1,\r
116   PORT_PM2,\r
117   PORT_PM3,\r
118   PORT_PM4,\r
119   PORT_PM5,\r
120   PORT_PM6,\r
121   PORT_PM7,\r
122   PORT_PP0 = PORT_P_BASE,\r
123   PORT_PP1,\r
124   PORT_PP2,\r
125   PORT_PP3,\r
126   PORT_PP4,\r
127   PORT_PP5,\r
128   PORT_PP6,\r
129   PORT_PP7,\r
130   PORT_PS0 = PORT_S_BASE,\r
131   PORT_PS1,\r
132   PORT_PS2,\r
133   PORT_PS3,\r
134   PORT_PS4,\r
135   PORT_PS5,\r
136   PORT_PS6,\r
137   PORT_PS7,\r
138   PORT_PT0 = PORT_T_BASE,\r
139   PORT_PT1,\r
140   PORT_PT2,\r
141   PORT_PT3,\r
142   PORT_PT4,\r
143   PORT_PT5,\r
144   PORT_PT6,\r
145   PORT_PT7,\r
146 } Port_PinType;\r
147 \r
148 /** Top level configuration container */\r
149 /** @req PORT073 */\r
150 typedef struct\r
151 {\r
152   const uint8_t corePullUpRegister; // PUCR\r
153   const uint8_t coreReducedDriveRegister; // RDRIV\r
154   const uint8_t modeRoutingRegister; // MODRR\r
155 \r
156   /**\r
157    * Every port has:\r
158    *  a direction (input or output)\r
159    *  a default out value\r
160    *  a mask that is 0 if the direction is allowed to change during runtime\r
161    *\r
162    * Some ports have:\r
163    *  a reduced drive conf (power saving)\r
164    *  a pull enable conf (enable pull-up/pull-down\r
165    *  a pull direction conf (pull-up or pull-down)\r
166    *  a wired mode (enable open drain outputs)\r
167    */\r
168 #if ( PORTA_CONFIGURABLE == STD_ON )\r
169   const uint8_t portADirection;\r
170   const uint8_t portAOutValue;\r
171   const uint8_t portAMask;\r
172 #endif\r
173 \r
174 #if ( PORTB_CONFIGURABLE == STD_ON )\r
175   const uint8_t portBDirection;\r
176   const uint8_t portBOutValue;\r
177   const uint8_t portBMask;\r
178 #endif\r
179 \r
180 #if ( PORTE_CONFIGURABLE == STD_ON )\r
181   const uint8_t portEDirection;\r
182   const uint8_t portEOutValue;\r
183   const uint8_t portEMask;\r
184 #endif\r
185 \r
186 #if ( PORTK_CONFIGURABLE == STD_ON )\r
187   const uint8_t portKDirection;\r
188   const uint8_t portKOutValue;\r
189   const uint8_t portKMask;\r
190 #endif\r
191 \r
192 #if ( PORTH_CONFIGURABLE == STD_ON )\r
193   const uint8_t portHDirection;\r
194   const uint8_t portHOutValue;\r
195   const uint8_t portHMask;\r
196   const uint8_t portHPullEnableRegister;\r
197   const uint8_t portHPullPolarityRegsiter;\r
198   const uint8_t portHReducedDriveRegister;\r
199 #endif\r
200 \r
201 #if ( PORTJ_CONFIGURABLE == STD_ON )\r
202   const uint8_t portJDirection;\r
203   const uint8_t portJOutValue;\r
204   const uint8_t portJMask;\r
205   const uint8_t portJPullEnableRegister;\r
206   const uint8_t portJPullPolarityRegsiter;\r
207   const uint8_t portJReducedDriveRegister;\r
208 #endif\r
209 \r
210 #if ( PORTM_CONFIGURABLE == STD_ON )\r
211   const uint8_t portMDirection;\r
212   const uint8_t portMOutValue;\r
213   const uint8_t portMMask;\r
214   const uint8_t portMPullEnableRegister;\r
215   const uint8_t portMPullPolarityRegsiter;\r
216   const uint8_t portMWiredModeRegsiter;\r
217   const uint8_t portMReducedDriveRegister;\r
218 #endif\r
219 \r
220 #if ( PORTP_CONFIGURABLE == STD_ON )\r
221   const uint8_t portPDirection;\r
222   const uint8_t portPOutValue;\r
223   const uint8_t portPMask;\r
224   const uint8_t portPPullEnableRegister;\r
225   const uint8_t portPPullPolarityRegsiter;\r
226   const uint8_t portPReducedDriveRegister;\r
227 #endif\r
228 \r
229 #if ( PORTS_CONFIGURABLE == STD_ON )\r
230   const uint8_t portSDirection;\r
231   const uint8_t portSOutValue;\r
232   const uint8_t portSMask;\r
233   const uint8_t portSPullEnableRegister;\r
234   const uint8_t portSPullPolarityRegsiter;\r
235   const uint8_t portSWiredModeRegsiter;\r
236   const uint8_t portSReducedDriveRegister;\r
237 #endif\r
238 \r
239 #if ( PORTT_CONFIGURABLE == STD_ON )\r
240   const uint8_t portTDirection;\r
241   const uint8_t portTOutValue;\r
242   const uint8_t portTMask;\r
243   const uint8_t portTPullEnableRegister;\r
244   const uint8_t portTPullPolarityRegsiter;\r
245   const uint8_t portTReducedDriveRegister;\r
246 #endif\r
247 } Port_ConfigType;\r
248 \r
249 /** Instance of the top level configuration container */\r
250 extern const Port_ConfigType PortConfigData;\r
251 \r
252 #define PORT_PIN_NAME_SDA               PORT_PJ6        \r
253 #define PORT_PIN_NAME_SCL               PORT_PJ7        \r
254 #define PORT_PIN_NAME_TXD               PORT_PM1        \r
255 #define PORT_PIN_NAME_RXD               PORT_PM0        \r
256 #define PORT_PIN_NAME_PB0               PORT_PB0        \r
257 #define PORT_PIN_NAME_PB1               PORT_PB1        \r
258 #define PORT_PIN_NAME_PB2               PORT_PB2        \r
259 #define PORT_PIN_NAME_PB3               PORT_PB3        \r
260 #define PORT_PIN_NAME_PB4               PORT_PB4        \r
261 #define PORT_PIN_NAME_PB5               PORT_PB5        \r
262 #define PORT_PIN_NAME_PB6               PORT_PB6        \r
263 #define PORT_PIN_NAME_PB7               PORT_PB7        \r
264 #define PORT_PIN_NAME_PH0               PORT_PH0        \r
265 #define PORT_PIN_NAME_PH1               PORT_PH1        \r
266 #define PORT_PIN_NAME_PH2               PORT_PH2        \r
267 #define PORT_PIN_NAME_PH3               PORT_PH3        \r
268 #define PORT_PIN_NAME_PH4               PORT_PH4        \r
269 #define PORT_PIN_NAME_PH5               PORT_PH5        \r
270 #define PORT_PIN_NAME_PH6               PORT_PH6        \r
271 #define PORT_PIN_NAME_PH7               PORT_PH7        \r
272 #define PORT_PIN_NAME_PT0               PORT_PT0        \r
273 #define PORT_PIN_NAME_PT1               PORT_PT1        \r
274 #define PORT_PIN_NAME_BEEPER            PORT_PT2        \r
275 #define PORT_PIN_NAME_PP0               PORT_PP0        \r
276 #define PORT_PIN_NAME_PP1               PORT_PP1        \r
277 #define PORT_PIN_NAME_RXD0              PORT_PS0        \r
278 #define PORT_PIN_NAME_TXD0              PORT_PS1        \r
279 #define PORT_PIN_NAME_RXD1              PORT_PS2        \r
280 #define PORT_PIN_NAME_TXD1              PORT_PS3        \r
281 #define PORT_PIN_NAME_PM6               PORT_PM6        \r
282 #define PORT_PIN_NAME_PM7               PORT_PM7        \r
283 #endif /*PORT_CFG_H_*/\r