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