Netcruzer Library API  V2.03
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
brd_sbc32ul-r1.h
Go to the documentation of this file.
1 
34 #ifndef SBC32UL_R1_H
35 #define SBC32UL_R1_H
36 
37 #if defined(BRD_SBC32UL_R1)
38 
43 #if defined(THIS_IS_MAIN_FILE)
44  //#if defined(__PIC32MX450F256H__)
45 
46  #if !defined(CONFIGURATION_FUSES_SET)
47  #define CONFIGURATION_FUSES_SET
48 
49  // Config settings
50  // POSCMOD = XT, FNOSC = PRIPLL, FWDTEN = OFF
51  // PLLIDIV = DIV_2, PLLMUL = MUL_16
52  // PBDIV = 8 (default)
53  // Main clock = 8MHz /2 * 16 = 80MHz
54  // Peripheral clock = 80MHz /1 = 80MHz
55 
56  // Configuration Bit settings
57  // SYSCLK = 80 MHz (8MHz Crystal/ FPLLIDIV * FPLLMUL / FPLLODIV)
58  // PBCLK = 10 MHz
59  // Primary Osc w/PLL (XT+,HS+,EC+PLL)
60  // WDT OFF
61  //
62  #pragma config FPLLMUL = MUL_20, FPLLIDIV = DIV_2, FPLLODIV = DIV_1, FWDTEN = OFF
63  #pragma config POSCMOD = XT, FNOSC = PRIPLL, FPBDIV = DIV_1
64  #endif
65  //#else
66  // #error "Not configured for valid CPU"
67  //#endif
68 #endif // Prevent more than one set of config fuse definitions
69 
70 //System clock = Fosc. Instruction clock = Fcy = Fosc/2 (in datasheet)
71 #if !defined(CLOCK_FREQ)
72  #define CLOCK_FREQ (80000000ul)
73  #define GetSystemClock() (80000000ul) // Hz
74  #define GetInstructionClock() (GetSystemClock()/1) // Normally GetSystemClock()/4 for PIC18, GetSystemClock()/2 for PIC24/dsPIC, and GetSystemClock()/1 for PIC32. Might need changing if using Doze modes.
75  #define GetPeripheralClock() (GetSystemClock()/1) // Normally GetSystemClock()/4 for PIC18, GetSystemClock()/2 for PIC24/dsPIC, and GetSystemClock()/1 for PIC32. Divisor may be different if using a PIC32 since it's configurable.
76 #endif
77 
78 
79 
80 // *********************************************************************
81 // ----------- Daughter Board Connector Defines for SBC66EC ------------
82 // *********************************************************************
83 #define PORT_ID_MAX 41 //ID of highest used port ID
84 #define DUMMY_REG CNPUB
85 
86 #define UCPORT_00 B0
87 #define UCPORT_ID_00 UCPORT_ID_B0
88 #define PIN_00 _RB0
89 #define PIN_00_BITADR ((volatile WORD)(/*Bit0=0x0nnn*/0x02CA/*PORTB=0x02CA*/ ))
90 #define LAT_00 _LATB0
91 #define LAT_00_BITADR ((volatile WORD)(/*Bit0=0x0nnn*/0x02CC/*LATB=0x02CC*/ ))
92 #define DIR_00 _TRISB0
93 #define TRIS_00_BITADR ((volatile WORD)(/*Bit0=0x0nnn*/0x02C8/*TRISB=0x02C8*/ ))
94 #define PULLUP_00 DUMMY_REG //Complete code!
95 #define PULLDOWN_00 DUMMY_REG //Complete code!
96 #define PPS_OUT_00 DUMMY_REG //Complete code!
97 #define PPS_IN_00 0
98 
99 #define UCPORT_01 B1
100 #define UCPORT_ID_01 UCPORT_ID_B1
101 #define PIN_01 _RB1
102 #define PIN_01_BITADR ((volatile WORD)(/*Bit1=0x1nnn*/0x12CA/*PORTB=0x02CA*/ ))
103 #define LAT_01 _LATB1
104 #define LAT_01_BITADR ((volatile WORD)(/*Bit1=0x1nnn*/0x12CC/*LATB=0x02CC*/ ))
105 #define DIR_01 _TRISB1
106 #define TRIS_01_BITADR ((volatile WORD)(/*Bit1=0x1nnn*/0x12C8/*TRISB=0x02C8*/ ))
107 #define PULLUP_01 DUMMY_REG //Complete code!
108 #define PULLDOWN_01 DUMMY_REG //Complete code!
109 #define PPS_OUT_01 DUMMY_REG //Complete code!
110 #define PPS_IN_01 1
111 
112 #define UCPORT_02 B2
113 #define UCPORT_ID_02 UCPORT_ID_B2
114 #define PIN_02 _RB2
115 #define PIN_02_BITADR ((volatile WORD)(/*Bit2=0x2nnn*/0x22CA/*PORTB=0x02CA*/ ))
116 #define LAT_02 _LATB2
117 #define LAT_02_BITADR ((volatile WORD)(/*Bit2=0x2nnn*/0x22CC/*LATB=0x02CC*/ ))
118 #define DIR_02 _TRISB2
119 #define TRIS_02_BITADR ((volatile WORD)(/*Bit2=0x2nnn*/0x22C8/*TRISB=0x02C8*/ ))
120 #define PULLUP_02 DUMMY_REG //Complete code!
121 #define PULLDOWN_02 DUMMY_REG //Complete code!
122 #define PPS_OUT_02 DUMMY_REG //Complete code!
123 #define PPS_IN_02 13
124 
125 #define UCPORT_03 B3
126 #define UCPORT_ID_03 UCPORT_ID_B3
127 #define PIN_03 _RB3
128 #define PIN_03_BITADR ((volatile WORD)(/*Bit3=0x3nnn*/0x32CA/*PORTB=0x02CA*/ ))
129 #define LAT_03 _LATB3
130 #define LAT_03_BITADR ((volatile WORD)(/*Bit3=0x3nnn*/0x32CC/*LATB=0x02CC*/ ))
131 #define DIR_03 _TRISB3
132 #define TRIS_03_BITADR ((volatile WORD)(/*Bit3=0x3nnn*/0x32C8/*TRISB=0x02C8*/ ))
133 #define PULLUP_03 DUMMY_REG //Complete code!
134 #define PULLDOWN_03 DUMMY_REG //Complete code!
135 
136 #define UCPORT_04 B4
137 #define UCPORT_ID_04 UCPORT_ID_B4
138 #define PIN_04 _RB4
139 #define PIN_04_BITADR ((volatile WORD)(/*Bit4=0x4nnn*/0x42CA/*PORTB=0x02CA*/ ))
140 #define LAT_04 _LATB4
141 #define LAT_04_BITADR ((volatile WORD)(/*Bit4=0x4nnn*/0x42CC/*LATB=0x02CC*/ ))
142 #define DIR_04 _TRISB4
143 #define TRIS_04_BITADR ((volatile WORD)(/*Bit4=0x4nnn*/0x42C8/*TRISB=0x02C8*/ ))
144 #define PULLUP_04 DUMMY_REG //Complete code!
145 #define PULLDOWN_04 DUMMY_REG //Complete code!
146 #define PPS_OUT_04 DUMMY_REG //Complete code!
147 #define PPS_IN_04 28
148 
149 #define UCPORT_05 B5
150 #define UCPORT_ID_05 UCPORT_ID_B5
151 #define PIN_05 _RB5
152 #define PIN_05_BITADR ((volatile WORD)(/*Bit5=0x5nnn*/0x52CA/*PORTB=0x02CA*/ ))
153 #define LAT_05 _LATB5
154 #define LAT_05_BITADR ((volatile WORD)(/*Bit5=0x5nnn*/0x52CC/*LATB=0x02CC*/ ))
155 #define DIR_05 _TRISB5
156 #define TRIS_05_BITADR ((volatile WORD)(/*Bit5=0x5nnn*/0x52C8/*TRISB=0x02C8*/ ))
157 #define PULLUP_05 DUMMY_REG //Complete code!
158 #define PULLDOWN_05 DUMMY_REG //Complete code!
159 #define PPS_OUT_05 DUMMY_REG //Complete code!
160 #define PPS_IN_05 18
161 
162 #define UCPORT_06 G6
163 #define UCPORT_ID_06 UCPORT_ID_G6
164 #define PIN_06 _RG6
165 #define PIN_06_BITADR ((volatile WORD)(/*Bit6=0x6nnn*/0x62F2/*PORTG=0x02F2*/ ))
166 #define LAT_06 _LATG6
167 #define LAT_06_BITADR ((volatile WORD)(/*Bit6=0x6nnn*/0x62F4/*LATG=0x02F4*/ ))
168 #define DIR_06 _TRISG6
169 #define TRIS_06_BITADR ((volatile WORD)(/*Bit6=0x6nnn*/0x62F0/*TRISG=0x02F0*/ ))
170 #define PULLUP_06 DUMMY_REG //Complete code!
171 #define PULLDOWN_06 DUMMY_REG //Complete code!
172 #define PPS_OUT_06 DUMMY_REG //Complete code!
173 #define PPS_IN_06 21
174 
175 #define UCPORT_07 G7
176 #define UCPORT_ID_07 UCPORT_ID_G7
177 #define PIN_07 _RG7
178 #define PIN_07_BITADR ((volatile WORD)(/*Bit7=0x7nnn*/0x72F2/*PORTG=0x02F2*/ ))
179 #define LAT_07 _LATG7
180 #define LAT_07_BITADR ((volatile WORD)(/*Bit7=0x7nnn*/0x72F4/*LATG=0x02F4*/ ))
181 #define DIR_07 _TRISG7
182 #define TRIS_07_BITADR ((volatile WORD)(/*Bit7=0x7nnn*/0x72F0/*TRISG=0x02F0*/ ))
183 #define PULLUP_07 DUMMY_REG //Complete code!
184 #define PULLDOWN_07 DUMMY_REG //Complete code!
185 #define PPS_OUT_07 DUMMY_REG //Complete code!
186 #define PPS_IN_07 26
187 
188 #define UCPORT_08 G8
189 #define UCPORT_ID_08 UCPORT_ID_G8
190 #define PIN_08 _RG8
191 #define PIN_08_BITADR ((volatile WORD)(/*Bit8=0x8nnn*/0x82F2/*PORTG=0x02F2*/ ))
192 #define LAT_08 _LATG8
193 #define LAT_08_BITADR ((volatile WORD)(/*Bit8=0x8nnn*/0x82F4/*LATG=0x02F4*/ ))
194 #define DIR_08 _TRISG8
195 #define TRIS_08_BITADR ((volatile WORD)(/*Bit8=0x8nnn*/0x82F0/*TRISG=0x02F0*/ ))
196 #define PULLUP_08 DUMMY_REG //Complete code!
197 #define PULLDOWN_08 DUMMY_REG //Complete code!
198 #define PPS_OUT_08 DUMMY_REG //Complete code!
199 #define PPS_IN_08 19
200 
201 #define UCPORT_09 G9
202 #define UCPORT_ID_09 UCPORT_ID_G9
203 #define PIN_09 _RG9
204 #define PIN_09_BITADR ((volatile WORD)(/*Bit9=0x9nnn*/0x92F2/*PORTG=0x02F2*/ ))
205 #define LAT_09 _LATG9
206 #define LAT_09_BITADR ((volatile WORD)(/*Bit9=0x9nnn*/0x92F4/*LATG=0x02F4*/ ))
207 #define DIR_09 _TRISG9
208 #define TRIS_09_BITADR ((volatile WORD)(/*Bit9=0x9nnn*/0x92F0/*TRISG=0x02F0*/ ))
209 #define PULLUP_09 DUMMY_REG //Complete code!
210 #define PULLDOWN_09 DUMMY_REG //Complete code!
211 #define PPS_OUT_09 DUMMY_REG //Complete code!
212 #define PPS_IN_09 27
213 
214 #define UCPORT_10 G8
215 #define UCPORT_ID_10 UCPORT_ID_G8
216 #define PIN_10 _RG8
217 #define PIN_10_BITADR ((volatile WORD)(/*Bit8=0x8nnn*/0x82F2/*PORTG=0x02F2*/ ))
218 #define LAT_10 _LATG8
219 #define LAT_10_BITADR ((volatile WORD)(/*Bit8=0x8nnn*/0x82F4/*LATG=0x02F4*/ ))
220 #define DIR_10 _TRISG8
221 #define TRIS_10_BITADR ((volatile WORD)(/*Bit8=0x8nnn*/0x82F0/*TRISG=0x02F0*/ ))
222 #define PULLUP_10 DUMMY_REG //Complete code!
223 #define PULLDOWN_10 DUMMY_REG //Complete code!
224 #define PPS_OUT_10 DUMMY_REG //Complete code!
225 #define PPS_IN_10 19
226 
227 #define UCPORT_11 G9
228 #define UCPORT_ID_11 UCPORT_ID_G9
229 #define PIN_11 _RG9
230 #define PIN_11_BITADR ((volatile WORD)(/*Bit9=0x9nnn*/0x92F2/*PORTG=0x02F2*/ ))
231 #define LAT_11 _LATG9
232 #define LAT_11_BITADR ((volatile WORD)(/*Bit9=0x9nnn*/0x92F4/*LATG=0x02F4*/ ))
233 #define DIR_11 _TRISG9
234 #define TRIS_11_BITADR ((volatile WORD)(/*Bit9=0x9nnn*/0x92F0/*TRISG=0x02F0*/ ))
235 #define PULLUP_11 DUMMY_REG //Complete code!
236 #define PULLDOWN_11 DUMMY_REG //Complete code!
237 #define PPS_OUT_11 DUMMY_REG //Complete code!
238 #define PPS_IN_11 27
239 
240 #define UCPORT_12 D9
241 #define UCPORT_ID_12 UCPORT_ID_D9
242 #define PIN_12 _RD9
243 #define PIN_12_BITADR ((volatile WORD)(/*Bit9=0x9nnn*/0x92DA/*PORTD=0x02DA*/ ))
244 #define LAT_12 _LATD9
245 #define LAT_12_BITADR ((volatile WORD)(/*Bit9=0x9nnn*/0x92DC/*LATD=0x02DC*/ ))
246 #define DIR_12 _TRISD9
247 #define TRIS_12_BITADR ((volatile WORD)(/*Bit9=0x9nnn*/0x92D8/*TRISD=0x02D8*/ ))
248 #define PULLUP_12 DUMMY_REG //Complete code!
249 #define PULLDOWN_12 DUMMY_REG //Complete code!
250 #define PPS_OUT_12 DUMMY_REG //Complete code!
251 #define PPS_IN_12 4
252 
253 #define UCPORT_13 D10
254 #define UCPORT_ID_13 UCPORT_ID_D10
255 #define PIN_13 _RD10
256 #define PIN_13_BITADR ((volatile WORD)(/*Bit10=0xAnnn*/0xA2DA/*PORTD=0x02DA*/ ))
257 #define LAT_13 _LATD10
258 #define LAT_13_BITADR ((volatile WORD)(/*Bit10=0xAnnn*/0xA2DC/*LATD=0x02DC*/ ))
259 #define DIR_13 _TRISD10
260 #define TRIS_13_BITADR ((volatile WORD)(/*Bit10=0xAnnn*/0xA2D8/*TRISD=0x02D8*/ ))
261 #define PULLUP_13 DUMMY_REG //Complete code!
262 #define PULLDOWN_13 DUMMY_REG //Complete code!
263 #define PPS_OUT_13 DUMMY_REG //Complete code!
264 #define PPS_IN_13 3
265 
266 //#define UCPORT_14 0 //Dont define is not available!
267 #define UCPORT_ID_14 UCPORT_ID_NA
268 #define PIN_14_BITADR BITADR_NA
269 #define LAT_14_BITADR BITADR_NA
270 #define TRIS_14_BITADR BITADR_NA
271 
272 //#define UCPORT_15 0 //Dont define is not available!
273 #define UCPORT_ID_15 UCPORT_ID_NA
274 #define PIN_15_BITADR BITADR_NA
275 #define LAT_15_BITADR BITADR_NA
276 #define TRIS_15_BITADR BITADR_NA
277 
278 //#define UCPORT_16 0 //Dont define is not available!
279 #define UCPORT_ID_16 UCPORT_ID_NA
280 #define PIN_16_BITADR BITADR_NA
281 #define LAT_16_BITADR BITADR_NA
282 #define TRIS_16_BITADR BITADR_NA
283 
284 //#define UCPORT_17 0 //Dont define is not available!
285 #define UCPORT_ID_17 UCPORT_ID_NA
286 #define PIN_17_BITADR BITADR_NA
287 #define LAT_17_BITADR BITADR_NA
288 #define TRIS_17_BITADR BITADR_NA
289 
290 //#define UCPORT_18 0 //Dont define is not available!
291 #define UCPORT_ID_18 UCPORT_ID_NA
292 #define PIN_18_BITADR BITADR_NA
293 #define LAT_18_BITADR BITADR_NA
294 #define TRIS_18_BITADR BITADR_NA
295 
296 //#define UCPORT_19 0 //Dont define is not available!
297 #define UCPORT_ID_19 UCPORT_ID_NA
298 #define PIN_19_BITADR BITADR_NA
299 #define LAT_19_BITADR BITADR_NA
300 #define TRIS_19_BITADR BITADR_NA
301 
302 #define UCPORT_20 B6
303 #define UCPORT_ID_20 UCPORT_ID_B6
304 #define PIN_20 _RB6
305 #define PIN_20_BITADR ((volatile WORD)(/*Bit6=0x6nnn*/0x62CA/*PORTB=0x02CA*/ ))
306 #define LAT_20 _LATB6
307 #define LAT_20_BITADR ((volatile WORD)(/*Bit6=0x6nnn*/0x62CC/*LATB=0x02CC*/ ))
308 #define DIR_20 _TRISB6
309 #define TRIS_20_BITADR ((volatile WORD)(/*Bit6=0x6nnn*/0x62C8/*TRISB=0x02C8*/ ))
310 #define PULLUP_20 DUMMY_REG //Complete code!
311 #define PULLDOWN_20 DUMMY_REG //Complete code!
312 #define PPS_OUT_20 DUMMY_REG //Complete code!
313 #define PPS_IN_20 6
314 
315 #define UCPORT_21 B7
316 #define UCPORT_ID_21 UCPORT_ID_B7
317 #define PIN_21 _RB7
318 #define PIN_21_BITADR ((volatile WORD)(/*Bit7=0x7nnn*/0x72CA/*PORTB=0x02CA*/ ))
319 #define LAT_21 _LATB7
320 #define LAT_21_BITADR ((volatile WORD)(/*Bit7=0x7nnn*/0x72CC/*LATB=0x02CC*/ ))
321 #define DIR_21 _TRISB7
322 #define TRIS_21_BITADR ((volatile WORD)(/*Bit7=0x7nnn*/0x72C8/*TRISB=0x02C8*/ ))
323 #define PULLUP_21 DUMMY_REG //Complete code!
324 #define PULLDOWN_21 DUMMY_REG //Complete code!
325 #define PPS_OUT_21 DUMMY_REG //Complete code!
326 #define PPS_IN_21 7
327 
328 //#define UCPORT_22 0 //Dont define is not available!
329 #define UCPORT_ID_22 UCPORT_ID_NA
330 #define LAT_22_BITADR BITADR_NA
331 #define PIN_22_BITADR BITADR_NA
332 #define TRIS_22_BITADR BITADR_NA
333 
334 //#define UCPORT_23 0 //Dont define is not available!
335 #define UCPORT_ID_23 UCPORT_ID_NA
336 #define LAT_23_BITADR BITADR_NA
337 #define PIN_23_BITADR BITADR_NA
338 #define TRIS_23_BITADR BITADR_NA
339 
340 //#define UCPORT_24 0 //Dont define is not available!
341 #define UCPORT_ID_24 UCPORT_ID_NA
342 #define PIN_24_BITADR BITADR_NA
343 #define LAT_24_BITADR BITADR_NA
344 #define TRIS_24_BITADR BITADR_NA
345 
346 //#define UCPORT_25 0 //Dont define is not available!
347 #define UCPORT_ID_25 UCPORT_ID_NA
348 #define PIN_25_BITADR BITADR_NA
349 #define LAT_25_BITADR BITADR_NA
350 #define TRIS_25_BITADR BITADR_NA
351 
352 #define UCPORT_26 F1
353 #define UCPORT_ID_26 UCPORT_ID_F1
354 #define PIN_26 _RF1
355 #define PIN_26_BITADR ((volatile WORD)(/*Bit1=0x1nnn*/0x12EA/*PORTF=0x02EA*/ ))
356 #define LAT_26 _LATF1
357 #define LAT_26_BITADR ((volatile WORD)(/*Bit1=0x1nnn*/0x12EC/*LATF=0x02EC*/ ))
358 #define DIR_26 _TRISF1
359 #define TRIS_26_BITADR ((volatile WORD)(/*Bit1=0x1nnn*/0x12E8/*TRISF=0x02E8*/ ))
360 #define PULLUP_26 DUMMY_REG //Complete code!
361 #define PULLDOWN_26 DUMMY_REG //Complete code!
362 #define PPS_OUT_26 DUMMY_REG //Complete code!
363 
364 #define UCPORT_27 F3
365 #define UCPORT_ID_27 UCPORT_ID_F3
366 #define PIN_27 _RF3
367 #define PIN_27_BITADR ((volatile WORD)(/*Bit3=0x3nnn*/0x32EA/*PORTF=0x02EA*/ ))
368 #define LAT_27 _LATF3
369 #define LAT_27_BITADR ((volatile WORD)(/*Bit3=0x3nnn*/0x32EC/*LATF=0x02EC*/ ))
370 #define DIR_27 _TRISF3
371 #define TRIS_27_BITADR ((volatile WORD)(/*Bit3=0x3nnn*/0x32E8/*TRIS=0x02E8*/ ))
372 #define PULLUP_27 DUMMY_REG //Complete code!
373 #define PULLDOWN_27 DUMMY_REG //Complete code!
374 #define PPS_OUT_27 DUMMY_REG //Complete code!
375 #define PPS_IN_27 16
376 
377 #define UCPORT_28 F4
378 #define UCPORT_ID_28 UCPORT_ID_F4
379 #define PIN_28 _RF4
380 #define PIN_28_BITADR ((volatile WORD)(/*Bit4=0x4nnn*/0x42EA/*PORTF=0x02EA*/ ))
381 #define LAT_28 _LATF4
382 #define LAT_28_BITADR ((volatile WORD)(/*Bit4=0x4nnn*/0x42EC/*LATF=0x02EC*/ ))
383 #define DIR_28 _TRISF4
384 #define TRIS_28_BITADR ((volatile WORD)(/*Bit4=0x4nnn*/0x42E8/*TRISF=0x02E8*/ ))
385 #define PULLUP_28 DUMMY_REG //Complete code!
386 #define PULLDOWN_28 DUMMY_REG //Complete code!
387 #define PPS_OUT_28 DUMMY_REG //Complete code!
388 #define PPS_IN_28 10
389 
390 #define UCPORT_29 D8
391 #define UCPORT_ID_29 UCPORT_ID_D8
392 #define PIN_29 _RD8
393 #define PIN_29_BITADR ((volatile WORD)(/*Bit8=0x8nnn*/0x82DA/*PORTD=0x02DA*/ ))
394 #define LAT_29 _LATD8
395 #define LAT_29_BITADR ((volatile WORD)(/*Bit8=0x8nnn*/0x82DC/*LATD=0x02DC*/ ))
396 #define DIR_29 _TRISD8
397 #define TRIS_29_BITADR ((volatile WORD)(/*Bit8=0x8nnn*/0x82D8/*TRISD=0x02D8*/ ))
398 #define PULLUP_29 DUMMY_REG //Complete code!
399 #define PULLDOWN_29 DUMMY_REG //Complete code!
400 #define PPS_IN_29 2
401 
402 #define UCPORT_30 B8
403 #define UCPORT_ID_30 UCPORT_ID_B8
404 #define PIN_30 _RB8
405 #define PIN_30_BITADR ((volatile WORD)(/*Bit8=0x8nnn*/0x82CA/*PORTB=0x02CA*/ ))
406 #define LAT_30 _LATB8
407 #define LAT_30_BITADR ((volatile WORD)(/*Bit8=0x8nnn*/0x82CC/*LATB=0x02CC*/ ))
408 #define DIR_30 _TRISB8
409 #define TRIS_30_BITADR ((volatile WORD)(/*Bit8=0x8nnn*/0x82C8/*TRISB=0x02C8*/ ))
410 #define PULLUP_30 DUMMY_REG //Complete code!
411 #define PULLDOWN_30 DUMMY_REG //Complete code!
412 #define PPS_OUT_30 DUMMY_REG //Complete code!
413 #define PPS_IN_30 8
414 
415 #define UCPORT_31 B9
416 #define UCPORT_ID_31 UCPORT_ID_B9
417 #define PIN_31 _RB9
418 #define PIN_31_BITADR ((volatile WORD)(/*Bit9=0x9nnn*/0x92CA/*PORTB=0x02CA*/ ))
419 #define LAT_31 _LATB9
420 #define LAT_31_BITADR ((volatile WORD)(/*Bit9=0x9nnn*/0x92CC/*LATB=0x02CC*/ ))
421 #define DIR_31 _TRISB9
422 #define TRIS_31_BITADR ((volatile WORD)(/*Bit9=0x9nnn*/0x92C8/*TRISB=0x02C8*/ ))
423 #define PULLUP_31 DUMMY_REG //Complete code!
424 #define PULLDOWN_31 DUMMY_REG //Complete code!
425 #define PPS_OUT_31 DUMMY_REG //Complete code!
426 #define PPS_IN_31 9
427 
428 #define UCPORT_32 B10
429 #define UCPORT_ID_32 UCPORT_ID_B10
430 #define PIN_32 _RB10
431 #define PIN_32_BITADR ((volatile WORD)(/*Bit10=0xAnnn*/0xA2CA/*PORTB=0x02CA*/ ))
432 #define LAT_32 _LATB10
433 #define LAT_32_BITADR ((volatile WORD)(/*Bit10=0xAnnn*/0xA2CC/*LATB=0x02CC*/ ))
434 #define DIR_32 _TRISB10
435 #define TRIS_32_BITADR ((volatile WORD)(/*Bit10=0xAnnn*/0xA2C8/*TRISB=0x02C8*/ ))
436 #define PULLUP_32 DUMMY_REG //Complete code!
437 #define PULLDOWN_32 DUMMY_REG //Complete code!
438 
439 #define UCPORT_33 B11
440 #define UCPORT_ID_33 UCPORT_ID_B11
441 #define PIN_33 _RB11
442 #define PIN_33_BITADR ((volatile WORD)(/*Bit11=0xBnnn*/0xB2CA/*PORTB=0x02CA*/ ))
443 #define LAT_33 _LATB11
444 #define LAT_33_BITADR ((volatile WORD)(/*Bit11=0xBnnn*/0xB2CC/*LATB=0x02CC*/ ))
445 #define DIR_33 _TRISB11
446 #define TRIS_33_BITADR ((volatile WORD)(/*Bit11=0xBnnn*/0xB2C8/*TRISB=0x02C8*/ ))
447 #define PULLUP_33 DUMMY_REG //Complete code!
448 #define PULLDOWN_33 DUMMY_REG //Complete code!
449 
450 #define UCPORT_34 B12
451 #define UCPORT_ID_34 UCPORT_ID_B12
452 #define PIN_34 _RB12
453 #define PIN_34_BITADR ((volatile WORD)(/*Bit12=0xCnnn*/0xC2CA/*PORTB=0x02CA*/ ))
454 #define LAT_34 _LATB12
455 #define LAT_34_BITADR ((volatile WORD)(/*Bit12=0xCnnn*/0xC2CC/*LATB=0x02CC*/ ))
456 #define DIR_34 _TRISB12
457 #define TRIS_34_BITADR ((volatile WORD)(/*Bit12=0xCnnn*/0xC2C8/*TRISB=0x02C8*/ ))
458 #define PULLUP_34 DUMMY_REG //Complete code!
459 #define PULLDOWN_34 DUMMY_REG //Complete code!
460 
461 #define UCPORT_35 B13
462 #define UCPORT_ID_35 UCPORT_ID_B13
463 #define PIN_35 _RB13
464 #define PIN_35_BITADR ((volatile WORD)(/*Bit13=0xDnnn*/0xD2CA/*PORTB=0x02CA*/ ))
465 #define LAT_35 _LATB13
466 #define LAT_35_BITADR ((volatile WORD)(/*Bit13=0xDnnn*/0xD2CC/*LATB=0x02CC*/ ))
467 #define DIR_35 _TRISB13
468 #define TRIS_35_BITADR ((volatile WORD)(/*Bit13=0xDnnn*/0xD2C8/*TRISB=0x02C8*/ ))
469 #define PULLUP_35 DUMMY_REG //Complete code!
470 #define PULLDOWN_35 DUMMY_REG //Complete code!
471 
472 #define UCPORT_36 D0
473 #define UCPORT_ID_36 UCPORT_ID_D0
474 #define PIN_36 _RD0
475 #define PIN_36_BITADR ((volatile WORD)(/*Bit0=0x0nnn*/0x02DA/*PORTD=0x02DA*/ ))
476 #define LAT_36 _LATD0
477 #define LAT_36_BITADR ((volatile WORD)(/*Bit0=0x0nnn*/0x02DC/*LATD=0x02DC*/ ))
478 #define DIR_36 _TRISD0
479 #define TRIS_36_BITADR ((volatile WORD)(/*Bit0=0x0nnn*/0x02D8/*TRISD=0x02D8*/ ))
480 #define PULLUP_36 DUMMY_REG //Complete code!
481 #define PULLDOWN_36 DUMMY_REG //Complete code!
482 #define PPS_OUT_36 DUMMY_REG //Complete code!
483 #define PPS_IN_36 11
484 
485 #define UCPORT_37 D1
486 #define UCPORT_ID_37 UCPORT_ID_D1
487 #define PIN_37 _RD1
488 #define PIN_37_BITADR ((volatile WORD)(/*Bit1=0x1nnn*/0x12DA/*PORTD=0x02DA*/ ))
489 #define LAT_37 _LATD1
490 #define LAT_37_BITADR ((volatile WORD)(/*Bit1=0x1nnn*/0x12DC/*LATD=0x02DC*/ ))
491 #define DIR_37 _TRISD1
492 #define TRIS_37_BITADR ((volatile WORD)(/*Bit1=0x1nnn*/0x12D8/*TRISD=0x02D8*/ ))
493 #define PULLUP_37 DUMMY_REG //Complete code!
494 #define PULLDOWN_37 DUMMY_REG //Complete code!
495 #define PPS_OUT_37 DUMMY_REG //Complete code!
496 #define PPS_IN_37 24
497 
498 #define UCPORT_38 D2
499 #define UCPORT_ID_38 UCPORT_ID_D2
500 #define PIN_38 _RD2
501 #define PIN_38_BITADR ((volatile WORD)(/*Bit2=0x2nnn*/0x22DA/*PORTD=0x02DA*/ ))
502 #define LAT_38 _LATD2
503 #define LAT_38_BITADR ((volatile WORD)(/*Bit2=0x2nnn*/0x22DC/*LATD=0x02DC*/ ))
504 #define DIR_38 _TRISD2
505 #define TRIS_38_BITADR ((volatile WORD)(/*Bit2=0x2nnn*/0x22D8/*TRISD=0x02D8*/ ))
506 #define PULLUP_38 DUMMY_REG //Complete code!
507 #define PULLDOWN_38 DUMMY_REG //Complete code!
508 #define PPS_OUT_38 DUMMY_REG //Complete code!
509 #define PPS_IN_38 23
510 
511 #define UCPORT_39 D3
512 #define UCPORT_ID_39 UCPORT_ID_D3
513 #define PIN_39 _RD3
514 #define PIN_39_BITADR ((volatile WORD)(/*Bit3=0x3nnn*/0x32DA/*PORTD=0x02DA*/ ))
515 #define LAT_39 _LATD3
516 #define LAT_39_BITADR ((volatile WORD)(/*Bit3=0x3nnn*/0x32DC/*LATD=0x02DC*/ ))
517 #define DIR_39 _TRISD3
518 #define TRIS_39_BITADR ((volatile WORD)(/*Bit3=0x3nnn*/0x32D8/*TRISD=0x02D8*/ ))
519 #define PULLUP_39 DUMMY_REG //Complete code!
520 #define PULLDOWN_39 DUMMY_REG //Complete code!
521 #define PPS_OUT_39 DUMMY_REG //Complete code!
522 #define PPS_IN_39 22
523 
524 #define UCPORT_40 D6
525 #define UCPORT_ID_40 UCPORT_ID_D6
526 #define PIN_40 _RD6
527 #define PIN_40_BITADR ((volatile WORD)(/*Bit6=0x6nnn*/0x62DA/*PORTD=0x02DA*/ ))
528 #define LAT_40 _LATD6
529 #define LAT_40_BITADR ((volatile WORD)(/*Bit6=0x6nnn*/0x62DC/*LATD=0x02DC*/ ))
530 #define DIR_40 _TRISD6
531 #define TRIS_40_BITADR ((volatile WORD)(/*Bit6=0x6nnn*/0x62D8/*TRISD=0x02D8*/ ))
532 #define PULLUP_40 DUMMY_REG //Complete code!
533 #define PULLDOWN_40 DUMMY_REG //Complete code!
534 
535 #define UCPORT_41 D7
536 #define UCPORT_ID_41 UCPORT_ID_D7
537 #define PIN_41 _RD7
538 #define PIN_41_BITADR ((volatile WORD)(/*Bit7=0x7nnn*/0x72DA/*PORTD=0x02DA*/ ))
539 #define LAT_41 _LATD7
540 #define LAT_41_BITADR ((volatile WORD)(/*Bit7=0x7nnn*/0x72DC/*LATD=0x02DC*/ ))
541 #define DIR_41 _TRISD7
542 #define TRIS_41_BITADR ((volatile WORD)(/*Bit7=0x7nnn*/0x72D8/*TRISD=0x02D8*/ ))
543 #define PULLUP_41 DUMMY_REG //Complete code!
544 #define PULLDOWN_41 DUMMY_REG //Complete code!
545 
546 //#define UCPORT_42 0 //Dont define is not available!
547 #define UCPORT_ID_42 UCPORT_ID_NA
548 #define PIN_42_BITADR BITADR_NA
549 #define LAT_42_BITADR BITADR_NA
550 #define TRIS_42_BITADR BITADR_NA
551 
552 //#define UCPORT_43 0 //Dont define is not available!
553 #define UCPORT_ID_43 UCPORT_ID_NA
554 #define PIN_43_BITADR BITADR_NA
555 #define LAT_43_BITADR BITADR_NA
556 #define TRIS_43_BITADR BITADR_NA
557 
558 //#define UCPORT_44 0 //Dont define is not available!
559 #define UCPORT_ID_44 UCPORT_ID_NA
560 #define PIN_44_BITADR BITADR_NA
561 #define LAT_44_BITADR BITADR_NA
562 #define TRIS_44_BITADR BITADR_NA
563 
564 //#define UCPORT_45 0 //Dont define is not available!
565 #define UCPORT_ID_45 UCPORT_ID_NA
566 #define PIN_45_BITADR BITADR_NA
567 #define LAT_45_BITADR BITADR_NA
568 #define TRIS_45_BITADR BITADR_NA
569 
570 
571 //I2C ports
572 #define PORT_ID_SDA1 12
573 #define UCPORT_SDA1 UCPORT_12
574 #define UCPORT_ID_SDA1 UCPORT_ID_12
575 #define PIN_SDA1 PIN_12
576 #define PIN_SDA1_BITADR PIN_12_BITADR
577 #define LAT_SDA1 LAT_12
578 #define LAT_SDA1_BITADR LAT_12_BITADR
579 #define DIR_SDA1 DIR_12
580 #define TRIS_SDA1_BITADR TRIS_12_BITADR
581 #define PULLUP_SDA1 PULLUP_12
582 #define PULLDOWN_SDA1 PULLDOWN_12
583 
584 #define PORT_ID_SCL1 13
585 #define UCPORT_SCL1 UCPORT_13
586 #define UCPORT_ID_SCL1 UCPORT_ID_13
587 #define PIN_SCL1 PIN_13
588 #define PIN_SCL1_BITADR PIN_13_BITADR
589 #define LAT_SCL1 LAT_13
590 #define LAT_SCL1_BITADR LAT_13_BITADR
591 #define DIR_SCL1 DIR_13
592 #define TRIS_SCL1_BITADR TRIS_13_BITADR
593 #define PULLUP_SCL1 PULLUP_13
594 #define PULLDOWN_SCL1 PULLDOWN_13
595 
596 #define PORT_ID_SDA2 28
597 #define UCPORT_SDA2 UCPORT_28
598 #define UCPORT_ID_SDA2 UCPORT_ID_28
599 #define PIN_SDA2 PIN_28
600 #define PIN_SDA2_BITADR PIN_28_BITADR
601 #define LAT_SDA2 LAT_28
602 #define LAT_SDA2_BITADR LAT_28_BITADR
603 #define DIR_SDA2 DIR_28
604 #define TRIS_SDA2_BITADR TRIS_28_BITADR
605 #define PULLUP_SDA2 PULLUP_28
606 #define PULLDOWN_SDA2 PULLDOWN_28
607 
608 #define PORT_ID_SCL2 29
609 #define UCPORT_SCL2 UCPORT_29
610 #define UCPORT_ID_SCL UCPORT_ID_29
611 #define PIN_SCL2 PIN_29
612 #define PIN_SCL2_BITADR PIN_29_BITADR
613 #define LAT_SCL2 LAT_29
614 #define LAT_SCL2_BITADR LAT_29_BITADR
615 #define DIR_SCL2 DIR_29
616 #define TRIS_SCL2_BITADR TRIS_29_BITADR
617 #define PULLUP_SCL2 PULLUP_29
618 #define PULLDOWN_SCL2 PULLDOWN_29
619 
620 //#define UCPORT_SDA3 0 //Dont define is not available!
621 
622 //#define UCPORT_SCL3 0 //Dont define is not available!
623 
624 
625 
626 // *********************************************************************
627 // ---------------- Analog Netcruzer Port Names --------------------
628 // *********************************************************************
629 #define PIN_A0 PIN_00
630 #define PIN_A0_BITADR PIN_00_BITADR
631 #define LAT_A0 LAT_00
632 #define LAT_A0_BITADR LAT_00_BITADR
633 #define DIR_A0 DIR_00
634 #define TRIS_A0_BITADR TRIS_00_BITADR
635 #define PULLUP_A0 PULLUP_00
636 #define PULLDOWN_A0 PULLDOWN_00
637 
638 #define PIN_A1 PIN_01
639 #define PIN_A1_BITADR PIN_01_BITADR
640 #define LAT_A1 LAT_01
641 #define LAT_A1_BITADR LAT_01_BITADR
642 #define DIR_A1 DIR_01
643 #define TRIS_A1_BITADR TRIS_01_BITADR
644 #define PULLUP_A1 PULLUP_01
645 #define PULLDOWN_A1 PULLDOWN_01
646 
647 #define PIN_A2 PIN_02
648 #define PIN_A2_BITADR PIN_02_BITADR
649 #define LAT_A2 LAT_02
650 #define LAT_A2_BITADR LAT_02_BITADR
651 #define DIR_A2 DIR_02
652 #define TRIS_A2_BITADR TRIS_02_BITADR
653 #define PULLUP_A2 PULLUP_02
654 #define PULLDOWN_A2 PULLDOWN_02
655 
656 #define PIN_A3 PIN_03
657 #define PIN_A3_BITADR PIN_03_BITADR
658 #define LAT_A3 LAT_03
659 #define LAT_A3_BITADR LAT_03_BITADR
660 #define DIR_A3 DIR_03
661 #define TRIS_A3_BITADR TRIS_03_BITADR
662 #define PULLUP_A3 PULLUP_03
663 #define PULLDOWN_A3 PULLDOWN_03
664 
665 #define PIN_A4 PIN_04
666 #define PIN_A4_BITADR PIN_04_BITADR
667 #define LAT_A4 LAT_04
668 #define LAT_A4_BITADR LAT_04_BITADR
669 #define DIR_A4 DIR_04
670 #define TRIS_A4_BITADR TRIS_04_BITADR
671 #define PULLUP_A4 PULLUP_04
672 #define PULLDOWN_A4 PULLDOWN_04
673 
674 #define PIN_A5 PIN_05
675 #define PIN_A5_BITADR PIN_05_BITADR
676 #define LAT_A5 LAT_05
677 #define LAT_A5_BITADR LAT_05_BITADR
678 #define DIR_A5 DIR_05
679 #define TRIS_A5_BITADR TRIS_05_BITADR
680 #define PULLUP_A5 PULLUP_05
681 #define PULLDOWN_A5 PULLDOWN_05
682 
683 #define PIN_A6 PIN_30
684 #define PIN_A6_BITADR PIN_30_BITADR
685 #define LAT_A6 LAT_30
686 #define LAT_A6_BITADR LAT_30_BITADR
687 #define DIR_A6 DIR_30
688 #define TRIS_A6_BITADR TRIS_30_BITADR
689 #define PULLUP_A6 PULLUP_30
690 #define PULLDOWN_A6 PULLDOWN_30
691 
692 #define PIN_A7 PIN_31
693 #define PIN_A7_BITADR PIN_31_BITADR
694 #define LAT_A7 LAT_31
695 #define LAT_A7_BITADR LAT_31_BITADR
696 #define DIR_A7 DIR_31
697 #define TRIS_A7_BITADR TRIS_31_BITADR
698 #define PULLUP_A7 PULLUP_31
699 #define PULLDOWN_A7 PULLDOWN_31
700 
701 #define PIN_A8 PIN_32
702 #define PIN_A8_BITADR PIN_32_BITADR
703 #define LAT_A8 LAT_32
704 #define LAT_A8_BITADR LAT_32_BITADR
705 #define DIR_A8 DIR_32
706 #define TRIS_A8_BITADR TRIS_32_BITADR
707 #define PULLUP_A8 PULLUP_32
708 #define PULLDOWN_A8 PULLDOWN_32
709 
710 #define PIN_A9 PIN_33
711 #define PIN_A9_BITADR PIN_33_BITADR
712 #define LAT_A9 LAT_33
713 #define LAT_A9_BITADR LAT_33_BITADR
714 #define DIR_A9 DIR_33
715 #define TRIS_A9_BITADR TRIS_33_BITADR
716 #define PULLUP_A9 PULLUP_33
717 #define PULLDOWN_A9 PULLDOWN_33
718 
719 #define PIN_A10 PIN_34
720 #define PIN_A10_BITADR PIN_34_BITADR
721 #define LAT_A10 LAT_34
722 #define LAT_A10_BITADR LAT_34_BITADR
723 #define DIR_A10 DIR_34
724 #define TRIS_A10_BITADR TRIS_34_BITADR
725 #define PULLUP_A10 PULLUP_34
726 #define PULLDOWN_A10 PULLDOWN_34
727 
728 #define PIN_A11 PIN_35
729 #define PIN_A11_BITADR PIN_35_BITADR
730 #define LAT_A11 LAT_35
731 #define LAT_A11_BITADR LAT_35_BITADR
732 #define DIR_A11 DIR_35
733 #define TRIS_A11_BITADR TRIS_35_BITADR
734 #define PULLUP_A11 PULLUP_35
735 #define PULLDOWN_A11 PULLDOWN_35
736 
737 
738 
739 // *********************************************************************
740 // ---------------- Old to New Netcruzer Port Names --------------------
741 // *********************************************************************
742 #define UCPORT_SC UCPORT_13
743 #define UCPORT_ID_SC UCPORT_ID_13
744 #define PIN_SC PIN_13
745 #define PIN_SC_BITADR PIN_13_BITADR
746 #define LAT_SC LAT_13
747 #define LAT_SC_BITADR LAT_13_BITADR
748 #define DIR_SC DIR_13
749 #define TRIS_SC_BITADR TRIS_13_BITADR
750 #define PULLUP_SC PULLUP_13
751 #define PULLDOWN_SC PULLDOWN_13
752 #define PPS_OUT_SC PPS_OUT_13
753 #define PPS_IN_SC PPS_IN_13
754 
755 #define UCPORT_SD UCPORT_12
756 #define UCPORT_ID_SD UCPORT_ID_12
757 #define PIN_SD PIN_12
758 #define PIN_SD_BITADR PIN_12_BITADR
759 #define LAT_SD LAT_12
760 #define LAT_SD_BITADR LAT_12_BITADR
761 #define DIR_SD DIR_12
762 #define TRIS_SD_BITADR TRIS_12_BITADR
763 #define PULLUP_SD PULLUP_12
764 #define PULLDOWN_SD PULLDOWN_12
765 #define PPS_OUT_SD PPS_OUT_12
766 #define PPS_IN_SD PPS_IN_12
767 
768 #define UCPORT_S0 UCPORT_24
769 #define UCPORT_ID_S0 UCPORT_ID_24
770 #define PIN_S0 PIN_24
771 #define PIN_S0_BITADR PIN_24_BITADR
772 #define LAT_S0 LAT_24
773 #define LAT_S0_BITADR LAT_24_BITADR
774 #define DIR_S0 DIR_24
775 #define TRIS_S0_BITADR TRIS_24_BITADR
776 #define PULLUP_S0 PULLUP_24
777 #define PULLDOWN_S0 PULLDOWN_24
778 #define PPS_OUT_S0 PPS_OUT_24
779 #define PPS_IN_S0 PPS_IN_24
780 
781 #define UCPORT_S1 UCPORT_25
782 #define UCPORT_ID_S1 UCPORT_ID_25
783 #define PIN_S1 PIN_25
784 #define PIN_S1_BITADR PIN_25_BITADR
785 #define LAT_S1 LAT_25
786 #define LAT_S1_BITADR LAT_25_BITADR
787 #define DIR_S1 DIR_25
788 #define TRIS_S1_BITADR TRIS_25_BITADR
789 #define PULLUP_S1 PULLUP_25
790 #define PULLDOWN_S1 PULLDOWN_25
791 #define PPS_OUT_S1 PPS_OUT_25
792 #define PPS_IN_S1 PPS_IN_25
793 
794 #define UCPORT_T0 UCPORT_20
795 #define UCPORT_ID_T0 UCPORT_ID_20
796 #define PIN_T0 PIN_20
797 #define PIN_T0_BITADR PIN_20_BITADR
798 #define LAT_T0 LAT_20
799 #define LAT_T0_BITADR LAT_20_BITADR
800 #define DIR_T0 DIR_20
801 #define TRIS_T0_BITADR TRIS_20_BITADR
802 #define PULLUP_T0 PULLUP_20
803 #define PULLDOWN_T0 PULLDOWN_20
804 #define PPS_OUT_T0 PPS_OUT_20
805 #define PPS_IN_T0 PPS_IN_20
806 
807 #define UCPORT_T1 UCPORT_21
808 #define UCPORT_ID_T1 UCPORT_ID_21
809 #define PIN_T1 PIN_21
810 #define PIN_T1_BITADR PIN_21_BITADR
811 #define LAT_T1 LAT_21
812 #define LAT_T1_BITADR LAT_21_BITADR
813 #define DIR_T1 DIR_21
814 #define TRIS_T1_BITADR TRIS_21_BITADR
815 #define PULLUP_T1 PULLUP_21
816 #define PULLDOWN_T1 PULLDOWN_21
817 #define PPS_OUT_T1 PPS_OUT_21
818 #define PPS_IN_T1 PPS_IN_21
819 
820 #define UCPORT_T2 UCPORT_22
821 #define UCPORT_ID_T2 UCPORT_ID_22
822 #define PIN_T2 PIN_22
823 #define PIN_T2_BITADR PIN_22_BITADR
824 #define LAT_T2 LAT_22
825 #define LAT_T2_BITADR LAT_22_BITADR
826 #define DIR_T2 DIR_22
827 #define TRIS_T2_BITADR TRIS_22_BITADR
828 #define PULLUP_T2 PULLUP_22
829 #define PULLDOWN_T2 PULLDOWN_22
830 #define PPS_OUT_T2 PPS_OUT_22
831 #define PPS_IN_T2 PPS_IN_22
832 
833 #define UCPORT_T3 UCPORT_23
834 #define UCPORT_ID_T3 UCPORT_ID_23
835 #define PIN_T3 PIN_23
836 #define PIN_T3_BITADR PIN_23_BITADR
837 #define LAT_T3 LAT_23
838 #define LAT_T3_BITADR LAT_23_BITADR
839 #define DIR_T3 DIR_23
840 #define TRIS_T3_BITADR TRIS_23_BITADR
841 #define PULLUP_T3 PULLUP_23
842 #define PULLDOWN_T3 PULLDOWN_23
843 #define PPS_OUT_T3 PPS_OUT_23
844 #define PPS_IN_T3 PPS_IN_23
845 
846 #define UCPORT_T4 UCPORT_26
847 #define UCPORT_ID_T4 UCPORT_ID_26
848 #define PIN_T4 PIN_26
849 #define PIN_T4_BITADR PIN_26_BITADR
850 #define LAT_T4 LAT_26
851 #define LAT_T4_BITADR LAT_26_BITADR
852 #define DIR_T4 DIR_26
853 #define TRIS_T4_BITADR TRIS_26_BITADR
854 #define PULLUP_T4 PULLUP_26
855 #define PULLDOWN_T4 PULLDOWN_26
856 #define PPS_OUT_T4 PPS_OUT_26
857 #define PPS_IN_T4 PPS_IN_26
858 
859 #define UCPORT_T5 UCPORT_27
860 #define UCPORT_ID_T5 UCPORT_ID_27
861 #define PIN_T5 PIN_27
862 #define PIN_T5_BITADR PIN_27_BITADR
863 #define LAT_T5 LAT_27
864 #define LAT_T5_BITADR LAT_27_BITADR
865 #define DIR_T5 DIR_27
866 #define TRIS_T5_BITADR TRIS_27_BITADR
867 #define PULLUP_T5 PULLUP_27
868 #define PULLDOWN_T5 PULLDOWN_27
869 #define PPS_OUT_T5 PPS_OUT_27
870 #define PPS_IN_T5 PPS_IN_27
871 
872 #define UCPORT_T6 UCPORT_28
873 #define UCPORT_ID_T6 UCPORT_ID_28
874 #define PIN_T6 PIN_28
875 #define PIN_T6_BITADR PIN_28_BITADR
876 #define LAT_T6 LAT_28
877 #define LAT_T6_BITADR LAT_28_BITADR
878 #define DIR_T6 DIR_28
879 #define TRIS_T6_BITADR TRIS_28_BITADR
880 #define PULLUP_T6 PULLUP_28
881 #define PULLDOWN_T6 PULLDOWN_28
882 #define PPS_OUT_T6 PPS_OUT_28
883 #define PPS_IN_T6 PPS_IN_28
884 
885 #define UCPORT_T7 UCPORT_29
886 #define UCPORT_ID_T7 UCPORT_ID_29
887 #define PIN_T7 PIN_29
888 #define PIN_T7_BITADR PIN_29_BITADR
889 #define LAT_T7 LAT_29
890 #define LAT_T7_BITADR LAT_29_BITADR
891 #define DIR_T7 DIR_29
892 #define TRIS_T7_BITADR TRIS_29_BITADR
893 #define PULLUP_T7 PULLUP_29
894 #define PULLDOWN_T7 PULLDOWN_29
895 #define PPS_OUT_T7 PPS_OUT_29
896 #define PPS_IN_T7 PPS_IN_29
897 
898 #define UCPORT_X0 UCPORT_00
899 #define UCPORT_ID_X0 UCPORT_ID_00
900 #define PIN_X0 PIN_00
901 #define PIN_X0_BITADR PIN_00_BITADR
902 #define LAT_X0 LAT_00
903 #define LAT_X0_BITADR LAT_00_BITADR
904 #define DIR_X0 DIR_00
905 #define TRIS_X0_BITADR TRIS_00_BITADR
906 #define PULLUP_X0 PULLUP_00
907 #define PULLDOWN_X0 PULLDOWN_00
908 #define PPS_OUT_X0 PPS_OUT_00
909 #define PPS_IN_X0 PPS_IN_00
910 
911 #define UCPORT_X1 UCPORT_01
912 #define UCPORT_ID_X1 UCPORT_ID_01
913 #define PIN_X1 PIN_01
914 #define PIN_X1_BITADR PIN_01_BITADR
915 #define LAT_X1 LAT_01
916 #define LAT_X1_BITADR LAT_01_BITADR
917 #define DIR_X1 DIR_01
918 #define TRIS_X1_BITADR TRIS_01_BITADR
919 #define PULLUP_X1 PULLUP_01
920 #define PULLDOWN_X1 PULLDOWN_01
921 #define PPS_OUT_X1 PPS_OUT_01
922 #define PPS_IN_X1 PPS_IN_01
923 
924 #define UCPORT_X2 UCPORT_02
925 #define UCPORT_ID_X2 UCPORT_ID_02
926 #define PIN_X2 PIN_02
927 #define PIN_X2_BITADR PIN_02_BITADR
928 #define LAT_X2 LAT_02
929 #define LAT_X2_BITADR LAT_02_BITADR
930 #define DIR_X2 DIR_02
931 #define TRIS_X2_BITADR TRIS_02_BITADR
932 #define PULLUP_X2 PULLUP_02
933 #define PULLDOWN_X2 PULLDOWN_02
934 #define PPS_OUT_X2 PPS_OUT_02
935 #define PPS_IN_X2 PPS_IN_02
936 
937 #define UCPORT_X3 UCPORT_03
938 #define UCPORT_ID_X3 UCPORT_ID_03
939 #define PIN_X3 PIN_03
940 #define PIN_X3_BITADR PIN_03_BITADR
941 #define LAT_X3 LAT_03
942 #define LAT_X3_BITADR LAT_03_BITADR
943 #define DIR_X3 DIR_03
944 #define TRIS_X3_BITADR TRIS_03_BITADR
945 #define PULLUP_X3 PULLUP_03
946 #define PULLDOWN_X3 PULLDOWN_03
947 #define PPS_OUT_X3 PPS_OUT_03
948 #define PPS_IN_X3 PPS_IN_03
949 
950 #define UCPORT_X4 UCPORT_04
951 #define UCPORT_ID_X4 UCPORT_ID_04
952 #define PIN_X4 PIN_04
953 #define PIN_X4_BITADR PIN_04_BITADR
954 #define LAT_X4 LAT_04
955 #define LAT_X4_BITADR LAT_04_BITADR
956 #define DIR_X4 DIR_04
957 #define TRIS_X4_BITADR TRIS_04_BITADR
958 #define PULLUP_X4 PULLUP_04
959 #define PULLDOWN_X4 PULLDOWN_04
960 #define PPS_OUT_X4 PPS_OUT_04
961 #define PPS_IN_X4 PPS_IN_04
962 
963 #define UCPORT_X5 UCPORT_05
964 #define UCPORT_ID_X5 UCPORT_ID_05
965 #define PIN_X5 PIN_05
966 #define PIN_X5_BITADR PIN_05_BITADR
967 #define LAT_X5 LAT_05
968 #define LAT_X5_BITADR LAT_05_BITADR
969 #define DIR_X5 DIR_05
970 #define TRIS_X5_BITADR TRIS_05_BITADR
971 #define PULLUP_X5 PULLUP_05
972 #define PULLDOWN_X5 PULLDOWN_05
973 #define PPS_OUT_X5 PPS_OUT_05
974 #define PPS_IN_X5 PPS_IN_05
975 
976 #define UCPORT_X6 UCPORT_06
977 #define UCPORT_ID_X6 UCPORT_ID_06
978 #define PIN_X6 PIN_06
979 #define PIN_X6_BITADR PIN_06_BITADR
980 #define LAT_X6 LAT_06
981 #define LAT_X6_BITADR LAT_06_BITADR
982 #define DIR_X6 DIR_06
983 #define TRIS_X6_BITADR TRIS_06_BITADR
984 #define PULLUP_X6 PULLUP_06
985 #define PULLDOWN_X6 PULLDOWN_06
986 #define PPS_OUT_X6 PPS_OUT_06
987 #define PPS_IN_X6 PPS_IN_06
988 
989 #define UCPORT_X7 UCPORT_07
990 #define UCPORT_ID_X7 UCPORT_ID_07
991 #define PIN_X7 PIN_07
992 #define PIN_X7_BITADR PIN_07_BITADR
993 #define LAT_X7 LAT_07
994 #define LAT_X7_BITADR LAT_07_BITADR
995 #define DIR_X7 DIR_07
996 #define TRIS_X7_BITADR TRIS_07_BITADR
997 #define PULLUP_X7 PULLUP_07
998 #define PULLDOWN_X7 PULLDOWN_07
999 #define PPS_OUT_X7 PPS_OUT_07
1000 #define PPS_IN_X7 PPS_IN_07
1001 
1002 #define UCPORT_X8 UCPORT_08
1003 #define UCPORT_ID_X8 UCPORT_ID_08
1004 #define PIN_X8 PIN_08
1005 #define PIN_X8_BITADR PIN_08_BITADR
1006 #define LAT_X8 LAT_08
1007 #define LAT_X8_BITADR LAT_08_BITADR
1008 #define DIR_X8 DIR_08
1009 #define TRIS_X8_BITADR TRIS_08_BITADR
1010 #define PULLUP_X8 PULLUP_08
1011 #define PULLDOWN_X8 PULLDOWN_08
1012 #define PPS_OUT_X8 PPS_OUT_08
1013 #define PPS_IN_X8 PPS_IN_08
1014 
1015 #define UCPORT_X9 UCPORT_09
1016 #define UCPORT_ID_X9 UCPORT_ID_09
1017 #define PIN_X9 PIN_09
1018 #define PIN_X9_BITADR PIN_09_BITADR
1019 #define LAT_X9 LAT_09
1020 #define LAT_X9_BITADR LAT_09_BITADR
1021 #define DIR_X9 DIR_09
1022 #define TRIS_X9_BITADR TRIS_09_BITADR
1023 #define PULLUP_X9 PULLUP_09
1024 #define PULLDOWN_X9 PULLDOWN_09
1025 #define PPS_OUT_X9 PPS_OUT_09
1026 #define PPS_IN_X9 PPS_IN_09
1027 
1028 #define UCPORT_X10 UCPORT_10
1029 #define UCPORT_ID_X10 UCPORT_ID_10
1030 #define PIN_X10 PIN_10
1031 #define PIN_X10_BITADR PIN_10_BITADR
1032 #define LAT_X10 LAT_10
1033 #define LAT_X10_BITADR LAT_10_BITADR
1034 #define DIR_X10 DIR_10
1035 #define TRIS_X10_BITADR TRIS_10_BITADR
1036 #define PULLUP_X10 PULLUP_10
1037 #define PULLDOWN_X10 PULLDOWN_10
1038 #define PPS_OUT_X10 PPS_OUT_10
1039 #define PPS_IN_X10 PPS_IN_10
1040 
1041 #define UCPORT_X11 UCPORT_11
1042 #define UCPORT_ID_X11 UCPORT_ID_11
1043 #define PIN_X11 PIN_11
1044 #define PIN_X11_BITADR PIN_11_BITADR
1045 #define LAT_X11 LAT_11
1046 #define LAT_X11_BITADR LAT_11_BITADR
1047 #define DIR_X11 DIR_11
1048 #define TRIS_X11_BITADR TRIS_11_BITADR
1049 #define PULLUP_X11 PULLUP_11
1050 #define PULLDOWN_X11 PULLDOWN_11
1051 #define PPS_OUT_X11 PPS_OUT_11
1052 #define PPS_IN_X11 PPS_IN_11
1053 
1054 #define UCPORT_Y0 UCPORT_30
1055 #define UCPORT_ID_Y0 UCPORT_ID_30
1056 #define PIN_Y0 PIN_30
1057 #define PIN_Y0_BITADR PIN_30_BITADR
1058 #define LAT_Y0 LAT_30
1059 #define LAT_Y0_BITADR LAT_30_BITADR
1060 #define DIR_Y0 DIR_30
1061 #define TRIS_Y0_BITADR TRIS_30_BITADR
1062 #define PULLUP_Y0 PULLUP_30
1063 #define PULLDOWN_Y0 PULLDOWN_30
1064 #define PPS_OUT_Y0 PPS_OUT_30
1065 #define PPS_IN_Y0 PPS_IN_30
1066 
1067 #define UCPORT_Y1 UCPORT_31
1068 #define UCPORT_ID_Y1 UCPORT_ID_31
1069 #define PIN_Y1 PIN_31
1070 #define PIN_Y1_BITADR PIN_31_BITADR
1071 #define LAT_Y1 LAT_31
1072 #define LAT_Y1_BITADR LAT_31_BITADR
1073 #define DIR_Y1 DIR_31
1074 #define TRIS_Y1_BITADR TRIS_31_BITADR
1075 #define PULLUP_Y1 PULLUP_31
1076 #define PULLDOWN_Y1 PULLDOWN_31
1077 #define PPS_OUT_Y1 PPS_OUT_31
1078 #define PPS_IN_Y1 PPS_IN_31
1079 
1080 #define UCPORT_Y2 UCPORT_32
1081 #define UCPORT_ID_Y2 UCPORT_ID_32
1082 #define PIN_Y2 PIN_32
1083 #define PIN_Y2_BITADR PIN_32_BITADR
1084 #define LAT_Y2 LAT_32
1085 #define LAT_Y2_BITADR LAT_32_BITADR
1086 #define DIR_Y2 DIR_32
1087 #define TRIS_Y2_BITADR TRIS_32_BITADR
1088 #define PULLUP_Y2 PULLUP_32
1089 #define PULLDOWN_Y2 PULLDOWN_32
1090 #define PPS_OUT_Y2 PPS_OUT_32
1091 #define PPS_IN_Y2 PPS_IN_32
1092 
1093 #define UCPORT_Y3 UCPORT_33
1094 #define UCPORT_ID_Y3 UCPORT_ID_33
1095 #define PIN_Y3 PIN_33
1096 #define PIN_Y3_BITADR PIN_33_BITADR
1097 #define LAT_Y3 LAT_33
1098 #define LAT_Y3_BITADR LAT_33_BITADR
1099 #define DIR_Y3 DIR_33
1100 #define TRIS_Y3_BITADR TRIS_33_BITADR
1101 #define PULLUP_Y3 PULLUP_33
1102 #define PULLDOWN_Y3 PULLDOWN_33
1103 #define PPS_OUT_Y3 PPS_OUT_33
1104 #define PPS_IN_Y3 PPS_IN_33
1105 
1106 #define UCPORT_Y4 UCPORT_34
1107 #define UCPORT_ID_Y4 UCPORT_ID_34
1108 #define PIN_Y4 PIN_34
1109 #define PIN_Y4_BITADR PIN_34_BITADR
1110 #define LAT_Y4 LAT_34
1111 #define LAT_Y4_BITADR LAT_34_BITADR
1112 #define DIR_Y4 DIR_34
1113 #define TRIS_Y4_BITADR TRIS_34_BITADR
1114 #define PULLUP_Y4 PULLUP_34
1115 #define PULLDOWN_Y4 PULLDOWN_34
1116 #define PPS_OUT_Y4 PPS_OUT_34
1117 #define PPS_IN_Y4 PPS_IN_34
1118 
1119 #define UCPORT_Y5 UCPORT_35
1120 #define UCPORT_ID_Y5 UCPORT_ID_35
1121 #define PIN_Y5 PIN_35
1122 #define PIN_Y5_BITADR PIN_35_BITADR
1123 #define LAT_Y5 LAT_35
1124 #define LAT_Y5_BITADR LAT_35_BITADR
1125 #define DIR_Y5 DIR_35
1126 #define TRIS_Y5_BITADR TRIS_35_BITADR
1127 #define PULLUP_Y5 PULLUP_35
1128 #define PULLDOWN_Y5 PULLDOWN_35
1129 #define PPS_OUT_Y5 PPS_OUT_35
1130 #define PPS_IN_Y5 PPS_IN_35
1131 
1132 #define UCPORT_Y6 UCPORT_36
1133 #define UCPORT_ID_Y6 UCPORT_ID_36
1134 #define PIN_Y6 PIN_36
1135 #define PIN_Y6_BITADR PIN_36_BITADR
1136 #define LAT_Y6 LAT_36
1137 #define LAT_Y6_BITADR LAT_36_BITADR
1138 #define DIR_Y6 DIR_36
1139 #define TRIS_Y6_BITADR TRIS_36_BITADR
1140 #define PULLUP_Y6 PULLUP_36
1141 #define PULLDOWN_Y6 PULLDOWN_36
1142 #define PPS_OUT_Y6 PPS_OUT_36
1143 #define PPS_IN_Y6 PPS_IN_36
1144 
1145 #define UCPORT_Y7 UCPORT_37
1146 #define UCPORT_ID_Y7 UCPORT_ID_37
1147 #define PIN_Y7 PIN_37
1148 #define PIN_Y7_BITADR PIN_37_BITADR
1149 #define LAT_Y7 LAT_37
1150 #define LAT_Y7_BITADR LAT_37_BITADR
1151 #define DIR_Y7 DIR_37
1152 #define TRIS_Y7_BITADR TRIS_37_BITADR
1153 #define PULLUP_Y7 PULLUP_37
1154 #define PULLDOWN_Y7 PULLDOWN_37
1155 #define PPS_OUT_Y7 PPS_OUT_37
1156 #define PPS_IN_Y7 PPS_IN_37
1157 
1158 #define UCPORT_Y8 UCPORT_38
1159 #define UCPORT_ID_Y8 UCPORT_ID_38
1160 #define PIN_Y8 PIN_38
1161 #define PIN_Y8_BITADR PIN_38_BITADR
1162 #define LAT_Y8 LAT_38
1163 #define LAT_Y8_BITADR LAT_38_BITADR
1164 #define DIR_Y8 DIR_38
1165 #define TRIS_Y8_BITADR TRIS_38_BITADR
1166 #define PULLUP_Y8 PULLUP_38
1167 #define PULLDOWN_Y8 PULLDOWN_38
1168 #define PPS_OUT_Y8 PPS_OUT_38
1169 #define PPS_IN_Y8 PPS_IN_38
1170 
1171 #define UCPORT_Y9 UCPORT_39
1172 #define UCPORT_ID_Y9 UCPORT_ID_39
1173 #define PIN_Y9 PIN_39
1174 #define PIN_Y9_BITADR PIN_39_BITADR
1175 #define LAT_Y9 LAT_39
1176 #define LAT_Y9_BITADR LAT_39_BITADR
1177 #define DIR_Y9 DIR_39
1178 #define TRIS_Y9_BITADR TRIS_39_BITADR
1179 #define PULLUP_Y9 PULLUP_39
1180 #define PULLDOWN_Y9 PULLDOWN_39
1181 #define PPS_OUT_Y9 PPS_OUT_39
1182 #define PPS_IN_Y9 PPS_IN_39
1183 
1184 #define UCPORT_Y10 UCPORT_40
1185 #define UCPORT_ID_Y10 UCPORT_ID_40
1186 #define PIN_Y10 PIN_40
1187 #define PIN_Y10_BITADR PIN_40_BITADR
1188 #define LAT_Y10 LAT_40
1189 #define LAT_Y10_BITADR LAT_40_BITADR
1190 #define DIR_Y10 DIR_40
1191 #define TRIS_Y10_BITADR TRIS_40_BITADR
1192 #define PULLUP_Y10 PULLUP_40
1193 #define PULLDOWN_Y10 PULLDOWN_40
1194 #define PPS_OUT_Y10 PPS_OUT_40
1195 #define PPS_IN_Y10 PPS_IN_40
1196 
1197 #define UCPORT_Y11 UCPORT_41
1198 #define UCPORT_ID_Y11 UCPORT_ID_41
1199 #define PIN_Y11 PIN_41
1200 #define PIN_Y11_BITADR PIN_41_BITADR
1201 #define LAT_Y11 LAT_41
1202 #define LAT_Y11_BITADR LAT_41_BITADR
1203 #define DIR_Y11 DIR_41
1204 #define TRIS_Y11_BITADR TRIS_41_BITADR
1205 #define PULLUP_Y11 PULLUP_41
1206 #define PULLDOWN_Y11 PULLDOWN_41
1207 #define PPS_OUT_Y11 PPS_OUT_41
1208 #define PPS_IN_Y11 PPS_IN_41
1209 
1210 
1211 
1212 // *********************************************************************
1213 // -------------------- Some general CPU Defines -----------------------
1214 // *********************************************************************
1215 #define PWM_COUNT 9 //Hardware PWM channels
1216 
1217 
1218 
1219 // *********************************************************************
1220 // ---------------------------- Analog Defines -------------------------
1221 // *********************************************************************
1222 #define ADC_REF_MV 2500 //ADC External Reference in MV
1223 #define ADC_MAX_CHAN_BRD 12 //Maximum number of possible ADC channels, B0-B5, B8-B11, B14, B15 (rev2+)
1224 
1225 //The channel mask indicates what AN channels can be used for ADC inputs
1226 #define ADC_CHANNEL_MASK_LOW_BRD 0b0011111100111111 //AN0-AN5, AN8-AN13
1227 #define ADC_CHANNEL_MASK_HIGH_BRD 0 //Only has 16 ADC channels
1228 
1229 //Index for selected analog input in adcFilter[] and adcValue[] arrays. Some analog inputs do not have space assigned for them
1230 #define ADC_CH_A0 0 //AN0
1231 #define ADC_CH_A1 1 //AN1
1232 #define ADC_CH_A2 2 //AN2
1233 #define ADC_CH_A3 3 //AN3
1234 #define ADC_CH_A4 4 //AN4
1235 #define ADC_CH_A5 5 //AN5
1236 #define ADC_CH_A6 8 //AN8
1237 #define ADC_CH_A7 9 //AN9
1238 #define ADC_CH_A8 10 //AN10
1239 #define ADC_CH_A9 11 //AN11
1240 #define ADC_CH_A10 12 //AN12
1241 #define ADC_CH_A11 13 //AN13
1242 
1243 #define ADC_OPEN_A0 0x0001 //AN0
1244 #define ADC_OPEN_A1 0x0002 //AN1
1245 #define ADC_OPEN_A2 0x0004 //AN2
1246 #define ADC_OPEN_A3 0x0008 //AN3
1247 #define ADC_OPEN_A4 0x0010 //AN4
1248 #define ADC_OPEN_A5 0x0020 //AN5
1249 #define ADC_OPEN_A6 0x0100 //AN8
1250 #define ADC_OPEN_A7 0x0200 //AN9
1251 #define ADC_OPEN_A8 0x0400 //AN10
1252 #define ADC_OPEN_A9 0x0800 //AN11
1253 #define ADC_OPEN_A10 0x1000 //AN12
1254 #define ADC_OPEN_A11 0x2000 //AN13
1255 
1256 
1257 
1258 // *********************************************************************
1259 // --------------------------- Other IO Defines ------------------------
1260 // *********************************************************************
1261 #define PIN_SYSLED _RB6
1262 #define LAT_SYSLED _LATB6
1263 #define DIR_SYSLED _TRISB6
1264 #define PULLUP_SYSLED DUMMY_REG //Complete code!
1265 #define PULLDOWN_SYSLED DUMMY_REG //Complete code!
1266 
1267 
1268 
1269 // *********************************************************************
1270 // ------------------ Define ports for this board ----------------------
1271 // *********************************************************************
1272 #define UC_PORT_B0_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1273 #define UC_PORT_B1_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1274 #define UC_PORT_B2_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1275 #define UC_PORT_B3_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1276 #define UC_PORT_B4_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1277 #define UC_PORT_B5_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1278 #define UC_PORT_B6_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1279 #define UC_PORT_B7_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1280 #define UC_PORT_B8_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1281 #define UC_PORT_B9_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1282 #define UC_PORT_B10_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1283 #define UC_PORT_B11_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1284 #define UC_PORT_B12_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1285 #define UC_PORT_B13_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_ANALOG_IN | UCPORT_PROP_OPEN_COL | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1286 
1287 #define UC_PORT_D0_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN | UCPORT_PROP_5V | UCPORT_PROP_INT)
1288 #define UC_PORT_D1_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN | UCPORT_PROP_5V)
1289 #define UC_PORT_D2_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN | UCPORT_PROP_5V)
1290 #define UC_PORT_D3_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN | UCPORT_PROP_5V)
1291 #define UC_PORT_D6_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1292 #define UC_PORT_D7_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1293 #define UC_PORT_D8_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN | UCPORT_PROP_5V)
1294 #define UC_PORT_D9_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN | UCPORT_PROP_5V)
1295 #define UC_PORT_D10_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN | UCPORT_PROP_5V)
1296 
1297 #define UC_PORT_F0_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1298 #define UC_PORT_F1_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN | UCPORT_PROP_5V)
1299 #define UC_PORT_F3_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN | UCPORT_PROP_5V)
1300 #define UC_PORT_F4_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN | UCPORT_PROP_5V) /* Do NOT include SDA, seeing that matching SCL is not available */
1301  //G6, F7,G8,G9
1302 #define UC_PORT_G6_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1303 #define UC_PORT_G7_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1304 #define UC_PORT_G8_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1305 #define UC_PORT_G9_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_RP | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1306 
1307 
1308 // *********************************************************************
1309 // ---------------- Network ENC624J600 WiFi I/O pins -------------------
1310 // *********************************************************************
1311 // Auto-crossover pins on Fast 100Mbps Ethernet PICtail/PICtail Plus. If
1312 // your circuit doesn't have such a feature, delete these two defines.
1313 // TODO check if this is needed?
1314 //#define ENC100_MDIX_TRIS (TRISBbits.TRISB5)
1315 //#define ENC100_MDIX_IO (LATBbits.LATB5)
1316 
1317 // ENC624J600 I/O control and status pins
1318 // If a pin is not required for your selected ENC100_INTERFACE_MODE
1319 // interface selection (ex: WRH/B1SEL for PSP modes 1, 2, 5, and 6), then
1320 // you can ignore, delete, or put anything for the pin definition. Also,
1321 // the INT and POR pins are entirely optional. If not connected, comment
1322 // them out.
1323 //#define ENC100_INT_TRIS (TRISAbits.TRISA15) // INT signal is optional and currently unused in the Microchip TCP/IP Stack. Leave this pin disconnected and comment out this pin definition if you don't want it.
1324 //#define ENC100_INT_IO (PORTAbits.RA15)
1325 // PSP control signal pinout
1326 //#define ENC100_CS_TRIS (TRISGbits.TRISG8) // CS is optional in PSP mode. If you are not sharing the parallel bus with another device, tie CS to Vdd and comment out this pin definition.
1327 //#define ENC100_CS_IO (LATGbits.LATG8)
1328 //#define ENC100_POR_TRIS (TRISEbits.TRISE9) // POR signal is optional. If your application doesn't have a power disconnect feature, comment out this pin definition.
1329 //#define ENC100_POR_IO (LATEbits.LATE9)
1330 #define ENC100_SO_WR_B0SEL_EN_TRIS (TRISDbits.TRISD4)
1331 #define ENC100_SO_WR_B0SEL_EN_IO (LATDbits.LATD4)
1332 #define ENC100_SI_RD_RW_TRIS (TRISDbits.TRISD5)
1333 #define ENC100_SI_RD_RW_IO (LATDbits.LATD5)
1334 #define ENC100_SCK_AL_TRIS (TRISBbits.TRISB15)
1335 #define ENC100_SCK_AL_IO (LATBbits.LATB15)
1336 
1337 #if !defined(ENC100_INTERFACE_MODE)
1338  // ENC624J600 Interface Configuration, using PSP Mode 5
1339  // Comment out ENC100_INTERFACE_MODE if you don't have an ENC424J600.
1340  // - 5: 8-bit multiplexed PSP Mode 5 with RD and WR pins
1341  #define ENC100_INTERFACE_MODE 5
1342 
1343  // Indirect addressing is used = reduced number of pins can be used
1344  // for indirect addressing.
1345  #define ENC100_PSP_USE_INDIRECT_RAM_ADDRESSING
1346 
1347  // ENC424J600/624J600 parallel indirect address remapping macro function.
1348  // This section translates SFR and RAM addresses presented to the
1349  // ReadMemory() and WriteMemory() APIs in ENCX24J600.c to the actual
1350  // addresses that must be presented on the parallel interface. This macro
1351  // must be modified to match your hardware if you are using an indirect PSP
1352  // addressing mode (ENC100_PSP_USE_INDIRECT_RAM_ADDRESSING is defined) and
1353  // have some of your address lines tied off to Vdd. If you are using the
1354  // SPI interface, then this section can be ignored or deleted.
1355  #if (ENC100_INTERFACE_MODE == 1) || (ENC100_INTERFACE_MODE == 2) || (ENC100_INTERFACE_MODE == 5) || (ENC100_INTERFACE_MODE == 6) // 8-bit PSP
1356  //#define ENC100_TRANSLATE_TO_PIN_ADDR(a) ((((a)&0x0100)<<6) | ((a)&0x00FF))
1357  //For the SBC66EC, bit 8 uses AD8 pin
1358  #define ENC100_TRANSLATE_TO_PIN_ADDR(a) ((a)&0x01FF)
1359  #elif (ENC100_INTERFACE_MODE == 3) || (ENC100_INTERFACE_MODE == 4) // 16-bit PSP
1360  #define ENC100_TRANSLATE_TO_PIN_ADDR(a) (a)
1361  #endif
1362 
1363  // ENC624J600 Bit Bang PSP I/O macros and pin configuration for address and
1364  // data. If using the SPI interface (ENC100_INTERFACE_MODE is 0) then this
1365  // section is not used and can be ignored or deleted. The Enhanced PMP
1366  // module available on the PIC24FJ256DA210 family will not work with the
1367  // ENC424J600/624J600, so bit bang mode must be used if parallel access is
1368  // desired.
1369  #define ENC100_BIT_BANG_PMP
1370  #if defined(ENC100_BIT_BANG_PMP)
1371  #if ENC100_INTERFACE_MODE == 5 || ENC100_INTERFACE_MODE == 6 // Mutliplexed 8-bit address/data modes
1372  #if defined(ENC100_PSP_USE_INDIRECT_RAM_ADDRESSING) // Only ENCX24J600 address pins AD0-AD8 connected (AD9-AD14 tied to Vdd)
1373  #define ENC100_INIT_PSP_BIT_BANG() do{ANSB &= 0x7FFF;} while(0) // RE0-RE7, RF5, RD4, RD5 (AD0-AD7, AD8, WR, RD) pins are already digital only pins. RB15 (AL) needs to be made digital only.
1374 
1375  // TODO To optimize code size, check if F5 can be left as output!
1376  //#define ENC100_SET_AD_TRIS_IN() do{((volatile BYTE*)&TRISE)[0] = 0xFF;}while(0)
1377  #define ENC100_SET_AD_TRIS_IN() do{((volatile BYTE*)&TRISE)[0] = 0xFF; TRISFbits.TRISF5 = 1;}while(0)
1378 
1379  #define ENC100_SET_AD_TRIS_OUT() do{((volatile BYTE*)&TRISE)[0] = 0x00; TRISFbits.TRISF5 = 0;}while(0)
1380  #define ENC100_GET_AD_IO() (((volatile BYTE*)&PORTE)[0])
1381  #define ENC100_SET_AD_IO(data) do{WORD _wSetMacro = (data); ((volatile BYTE*)&LATE)[0] = (BYTE)_wSetMacro; LATFbits.LATF5 = 0; if(_wSetMacro & 0x0100) LATFbits.LATF5 = 1;}while(0)
1382  #define ENC100_SET_AD_IOL(data) (((volatile BYTE*)&LATE)[0] = (BYTE)(data))
1383  #else // All ENCX24J600 address pins AD0-AD14 connected
1384  #error "No defined"
1385  #endif
1386  #else
1387  #error "No defined"
1388  #endif
1389  #endif
1390 #endif
1391 
1392 
1393 
1394 // *********************************************************************
1395 // ---------------- Network MRF24WB0M WiFi I/O pins --------------------
1396 // *********************************************************************
1397 // #define WF_CS_TRIS (TRISGbits.TRISG8) // Comment this line out if you are using the ENC28J60, ENC424J600/624J600, or other network controller.
1398 // #define WF_CS_IO (LATGbits.LATG8)
1399 // #define WF_SDI_TRIS (TRISBbits.TRISB1)
1400 // #define WF_SCK_TRIS (TRISDbits.TRISD8)
1401 // #define WF_SDO_TRIS (TRISBbits.TRISB0)
1402 // #define WF_RESET_TRIS (TRISAbits.TRISA15)
1403 // #define WF_RESET_IO (LATAbits.LATA15)
1404 // #define WF_INT_TRIS (TRISEbits.TRISE9) // INT1
1405 // #define WF_INT_IO (PORTEbits.RE9)
1406 // #define WF_HIBERNATE_TRIS (TRISAbits.TRISA7)
1407 // #define WF_HIBERNATE_IO (LATAbits.LATA7)
1408 // #define WF_INT_EDGE (INTCON2bits.INT1EP)
1409 // #define WF_INT_IE (IEC1bits.INT1IE)
1410 // #define WF_INT_IF (IFS1bits.INT1IF)
1411 // #define WF_SSPBUF (SPI1BUF)
1412 // #define WF_SPISTAT (SPI1STAT)
1413 // #define WF_SPISTATbits (SPI1STATbits)
1414 // #define WF_SPICON1 (SPI1CON1)
1415 // #define WF_SPICON1bits (SPI1CON1bits)
1416 // #define WF_SPICON2 (SPI1CON2)
1417 // #define WF_SPI_IE (IEC0bits.SPI1IE)
1418 // //#define WF_SPI_IP (IPC2bits.SPI1IP)
1419 // #define WF_SPI_IF (IFS0bits.SPI1IF)
1420 
1421 
1422 
1423 // *********************************************************************
1424 // --------------------- spiFlash Configuration ------------------------
1425 // *********************************************************************
1426 #define SPI_FLASH_SECTOR_SIZE (4096ul)
1427 //#define SPI_FLASH_PAGE_SIZE (0ul) // SST has no page boundary requirements
1428 #define SPI_FLASH_PAGE_SIZE (256ul) // Winbond FLASH has 256 byte pages
1429 #define SPI_FLASH_SIZE (0x400000ul) // Flash is 4MByte
1430 
1431 
1432 // *********************************************************************
1433 // ----------------- SPI External FLASH and EEPROM ---------------------
1434 // *********************************************************************
1435 // To use SST (SST25VF016B) flash, SPI_FLASH_SECTOR_SIZE is 4096, and define SPI_FLASH_PAGE_SIZE as 0.
1436 // To use Winbond flash, SPI_FLASH_SECTOR_SIZE is 4096, and define SPI_FLASH_PAGE_SIZE as 256.
1437 #define SPIFLASH_CS_TRIS (TRISCbits.TRISC13)
1438 #define SPIFLASH_CS_IO (LATCbits.LATC13)
1439 
1440 // External EEPROM I/O pins
1441 #define EEPROM_CS_TRIS (TRISCbits.TRISC15)
1442 #define EEPROM_CS_IO (LATCbits.LATC15)
1443 
1444 // To use SST (SST25VF016B) flash, SPI_FLASH_SECTOR_SIZE is 4096, and define SPI_FLASH_PAGE_SIZE as 0.
1445 // To use Winbond flash, SPI_FLASH_SECTOR_SIZE is 4096, and define SPI_FLASH_PAGE_SIZE as 256.
1446 #define SPIFLASH_SPI_IF (IFS2bits.SPI2IF)
1447 #define SPIFLASH_SSPBUF (SPI2BUF)
1448 //#define SPIFLASH_SPICON1 (SPI2CON1)
1449 //#define SPIFLASH_SPICON1bits (SPI2CON1bits)
1450 //#define SPIFLASH_SPICON2 (SPI2CON2)
1451 #define SPIFLASH_SPISTAT (SPI2STAT)
1452 #define SPIFLASH_SPISTATbits (SPI2STATbits)
1453 
1454 // External EEPROM
1455 #define EEPROM_SPI_IF (IFS2bits.SPI2IF)
1456 #define EEPROM_SSPBUF (SPI2BUF)
1457 //#define EEPROM_SPICON1 (SPI2CON1)
1458 //#define EEPROM_SPICON1bits (SPI2CON1bits)
1459 //#define EEPROM_SPICON2 (SPI2CON2)
1460 #define EEPROM_SPISTAT (SPI2STAT)
1461 #define EEPROM_SPISTATbits (SPI2STATbits)
1462 
1463 
1464 
1465 // *********************************************************************
1466 // ----------- SPI External Mememory Bus Defines for SBC66EC -----------
1467 // *********************************************************************
1468 #define SPIMEM_SPI_IF (IFS2bits.SPI2IF)
1469 #define SPIMEM_SSPBUF (SPI2BUF)
1470 #define SPIMEM_SPICON1 (SPI2CON1)
1471 #define SPIMEM_SPICON1bits (SPI2CON1bits)
1472 #define SPIMEM_SPICON2 (SPI2CON2)
1473 #define SPIMEM_SPISTAT (SPI2STAT)
1474 #define SPIMEM_SPISTATbits (SPI2STATbits)
1475 
1476 // These defines are for the SPI bus used for the external FLASH and EEPROM
1477 #define PIN_SPIMEM_SDO _RB14
1478 #define LAT_SPIMEM_SDO _LATB14
1479 #define DIR_SPIMEM_SDO _TRISB14
1480 //#define PULLUP_SPIMEM_SDO DUMMY_REG //Complete code!
1481 //#define PULLDOWN_SPIMEM_SDO DUMMY_REG //Complete code!
1482 #define PPS_OUT_SPIMEM_SDO DUMMY_REG //Complete code!
1483 
1484 #define PIN_SPIMEM_SCK _RD11
1485 #define LAT_SPIMEM_SCK _LATD11
1486 #define DIR_SPIMEM_SCK _TRISD11
1487 //#define PULLUP_SPIMEM_SCK DUMMY_REG //Complete code!
1488 //#define PULLDOWN_SPIMEM_SCK DUMMY_REG //Complete code!
1489 #define PPS_OUT_SPIMEM_SCK DUMMY_REG //Complete code!
1490 
1491 #define PIN_SPIMEM_SDI _RC14
1492 #define LAT_SPIMEM_SDI _LATC14
1493 #define DIR_SPIMEM_SDI _TRISC14
1494 //#define PULLUP_SPIMEM_SDI DUMMY_REG //Complete code!
1495 //#define PULLDOWN_SPIMEM_SDI DUMMY_REG //Complete code!
1496 #define PPS_IN_SPIMEM_SDI DUMMY_REG //Complete code!
1497 
1498 
1499 
1500 // *********************************************************************
1501 // -------------- USB stack hardware selection options -----------------
1502 // *********************************************************************
1503 //This section is the set of definitions required by the MCHPFSUSB framework. These definitions
1504 //tell the firmware what mode it is running in, and are required by every application developed
1505 //with this revision of the MCHPFSUSB framework.
1506 
1507 //#define USE_SELF_POWER_SENSE_IO
1508 //#define tris_self_power TRISAbits.TRISA2 // Input
1509 #define self_power 1
1510 
1511 //#define USE_USB_BUS_SENSE_IO
1512 //#define tris_usb_bus_sense TRISBbits.TRISB5 // Input
1513 #define USB_BUS_SENSE U1OTGSTATbits.SESVD
1514 
1515 
1516 
1517 // *******************************************************
1518 // ----------------- xEeprom Configuration -----------------
1519 // ********************************************************
1520 #define XEEPROM_SIZE (8192) //Default EEPROM is 25LC640 = 64kBits = 8kBytes)
1521 #define XEEPROM_PAGE_SIZE (32)
1522 
1523 
1534 #define GET_UCPORT_PROP_OFFSET(ucPort) (offsetof(CFG_STRUCT, ucPortProp) + ((offsetof(TABLE_BLOCK_UC66_PORT, ucPort)/sizeof(UCPORT_PROP)) * sizeof(UCPORT_PROP)) )
1535 
1546 #define GET_UCPORT_CONFIG_OFFSET(ucPortVal) (offsetof(CFG_STRUCT, ucPort) + ((offsetof(CFG_BLOCK_UC66_PORT, ucPortVal)/sizeof(UCPORT_CONFIG)) * sizeof(UCPORT_CONFIG)) )
1547 
1548 #endif //#if defined(BRD_SBC32UL_R1)
1549 #endif