39 #if defined(BRD_SBC66ECL_R2)
45 #if defined(THIS_IS_MAIN_FILE)
46 #if defined(__PIC24FJ128GB106__)
48 #if !defined(CONFIGURATION_FUSES_SET)
49 #define CONFIGURATION_FUSES_SET
53 #define DEBUG_ON 0x77FF
56 #define DEBUG_OFF 0x7FFF
67 _CONFIG1(JTAGEN_OFF & GCP_OFF & GWRP_OFF & ICS_PGx2 & FWDTEN_OFF & FWPSA_PR32 & WDTPS_PS8192)
78 _CONFIG2(IESO_OFF & PLLDIV_NODIV & FNOSC_PRIPLL & FCKSM_CSDCMD & OSCIOFNC_ON & IOL1WAY_OFF & DISUVREG_OFF & POSCMOD_EC)
82 _CONFIG3(WPCFG_WPCFGDIS & WPDIS_WPDIS)
85 #error "Not configured for valid CPU"
87 #endif // Prevent more than one set of config fuse definitions
90 #if !defined(CLOCK_FREQ)
91 #define CLOCK_FREQ (32000000ul)
92 #define GetSystemClock() (32000000ul) // Hz
93 #define GetInstructionClock() (GetSystemClock()/2)
94 #define GetPeripheralClock() (GetSystemClock()/2)
102 #define PORT_ID_MAX 41 //ID of highest used port ID
105 #define UCPORT_ID_00 UCPORT_ID_B0
107 #define PIN_00_BITADR ((volatile WORD)(0x02CA ))
108 #define LAT_00 _LATB0
109 #define LAT_00_BITADR ((volatile WORD)(0x02CC ))
110 #define DIR_00 _TRISB0
111 #define TRIS_00_BITADR ((volatile WORD)(0x02C8 ))
112 #define PULLUP_00 _CN2PUE
113 #define PULLDOWN_00 _CN2PDE
114 #define PPS_OUT_00 _RP0R
118 #define UCPORT_ID_01 UCPORT_ID_B1
120 #define PIN_01_BITADR ((volatile WORD)(0x12CA ))
121 #define LAT_01 _LATB1
122 #define LAT_01_BITADR ((volatile WORD)(0x12CC ))
123 #define DIR_01 _TRISB1
124 #define TRIS_01_BITADR ((volatile WORD)(0x12C8 ))
125 #define PULLUP_01 _CN3PUE
126 #define PULLDOWN_01 _CN3PDE
127 #define PPS_OUT_01 _RP1R
131 #define UCPORT_ID_02 UCPORT_ID_B2
133 #define PIN_02_BITADR ((volatile WORD)(0x22CA ))
134 #define LAT_02 _LATB2
135 #define LAT_02_BITADR ((volatile WORD)(0x22CC ))
136 #define DIR_02 _TRISB2
137 #define TRIS_02_BITADR ((volatile WORD)(0x22C8 ))
138 #define PULLUP_02 _CN4PUE
139 #define PULLDOWN_02 _CN4PDE
140 #define PPS_OUT_02 _RP13R
144 #define UCPORT_ID_03 UCPORT_ID_B3
146 #define PIN_03_BITADR ((volatile WORD)(0x32CA ))
147 #define LAT_03 _LATB3
148 #define LAT_03_BITADR ((volatile WORD)(0x32CC ))
149 #define DIR_03 _TRISB3
150 #define TRIS_03_BITADR ((volatile WORD)(0x32C8 ))
151 #define PULLUP_03 _CN5PUE
152 #define PULLDOWN_03 _CN5PDE
155 #define UCPORT_ID_04 UCPORT_ID_B4
157 #define PIN_04_BITADR ((volatile WORD)(0x42CA ))
158 #define LAT_04 _LATB4
159 #define LAT_04_BITADR ((volatile WORD)(0x42CC ))
160 #define DIR_04 _TRISB4
161 #define TRIS_04_BITADR ((volatile WORD)(0x42C8 ))
162 #define PULLUP_04 _CN6PUE
163 #define PULLDOWN_04 _CN6PDE
164 #define PPS_OUT_04 _RP28R
168 #define UCPORT_ID_05 UCPORT_ID_B5
170 #define PIN_05_BITADR ((volatile WORD)(0x52CA ))
171 #define LAT_05 _LATB5
172 #define LAT_05_BITADR ((volatile WORD)(0x52CC ))
173 #define DIR_05 _TRISB5
174 #define TRIS_05_BITADR ((volatile WORD)(0x52C8 ))
175 #define PULLUP_05 _CN7PUE
176 #define PULLDOWN_05 _CN7PDE
177 #define PPS_OUT_05 _RP18R
181 #define UCPORT_ID_06 UCPORT_ID_G6
183 #define PIN_06_BITADR ((volatile WORD)(0x62F2 ))
184 #define LAT_06 _LATG6
185 #define LAT_06_BITADR ((volatile WORD)(0x62F4 ))
186 #define DIR_06 _TRISG6
187 #define TRIS_06_BITADR ((volatile WORD)(0x62F0 ))
188 #define PULLUP_06 _CN8PUE
189 #define PULLDOWN_06 _CN8PDE
190 #define PPS_OUT_06 _RP21R
194 #define UCPORT_ID_07 UCPORT_ID_G7
196 #define PIN_07_BITADR ((volatile WORD)(0x72F2 ))
197 #define LAT_07 _LATG7
198 #define LAT_07_BITADR ((volatile WORD)(0x72F4 ))
199 #define DIR_07 _TRISG7
200 #define TRIS_07_BITADR ((volatile WORD)(0x72F0 ))
201 #define PULLUP_07 _CN9PUE
202 #define PULLDOWN_07 _CN9PDE
203 #define PPS_OUT_07 _RP26R
207 #define UCPORT_ID_08 UCPORT_ID_G8
209 #define PIN_08_BITADR ((volatile WORD)(0x82F2 ))
210 #define LAT_08 _LATG8
211 #define LAT_08_BITADR ((volatile WORD)(0x82F4 ))
212 #define DIR_08 _TRISG8
213 #define TRIS_08_BITADR ((volatile WORD)(0x82F0 ))
214 #define PULLUP_08 _CN10PUE
215 #define PULLDOWN_08 _CN10PDE
216 #define PPS_OUT_08 _RP19R
220 #define UCPORT_ID_09 UCPORT_ID_G9
222 #define PIN_09_BITADR ((volatile WORD)(0x92F2 ))
223 #define LAT_09 _LATG9
224 #define LAT_09_BITADR ((volatile WORD)(0x92F4 ))
225 #define DIR_09 _TRISG9
226 #define TRIS_09_BITADR ((volatile WORD)(0x92F0 ))
227 #define PULLUP_09 _CN11PUE
228 #define PULLDOWN_09 _CN11PDE
229 #define PPS_OUT_09 _RP27R
233 #define UCPORT_ID_10 UCPORT_ID_G8
235 #define PIN_10_BITADR ((volatile WORD)(0x82F2 ))
236 #define LAT_10 _LATG8
237 #define LAT_10_BITADR ((volatile WORD)(0x82F4 ))
238 #define DIR_10 _TRISG8
239 #define TRIS_10_BITADR ((volatile WORD)(0x82F0 ))
240 #define PULLUP_10 _CN10PUE
241 #define PULLDOWN_10 _CN10PDE
242 #define PPS_OUT_10 _RP19R
246 #define UCPORT_ID_11 UCPORT_ID_G9
248 #define PIN_11_BITADR ((volatile WORD)(0x92F2 ))
249 #define LAT_11 _LATG9
250 #define LAT_11_BITADR ((volatile WORD)(0x92F4 ))
251 #define DIR_11 _TRISG9
252 #define TRIS_11_BITADR ((volatile WORD)(0x92F0 ))
253 #define PULLUP_11 _CN11PUE
254 #define PULLDOWN_11 _CN11PDE
255 #define PPS_OUT_11 _RP27R
259 #define UCPORT_ID_12 UCPORT_ID_D9
261 #define PIN_12_BITADR ((volatile WORD)(0x92DA ))
262 #define LAT_12 _LATD9
263 #define LAT_12_BITADR ((volatile WORD)(0x92DC ))
264 #define DIR_12 _TRISD9
265 #define TRIS_12_BITADR ((volatile WORD)(0x92D8 ))
266 #define PULLUP_12 _CN54PUE
267 #define PULLDOWN_12 _CN54PDE
268 #define PPS_OUT_12 _RP4R
271 #define UCPORT_13 D10
272 #define UCPORT_ID_13 UCPORT_ID_D10
274 #define PIN_13_BITADR ((volatile WORD)(0xA2DA ))
275 #define LAT_13 _LATD10
276 #define LAT_13_BITADR ((volatile WORD)(0xA2DC ))
277 #define DIR_13 _TRISD10
278 #define TRIS_13_BITADR ((volatile WORD)(0xA2D8 ))
279 #define PULLUP_13 _CN55PUE
280 #define PULLDOWN_13 _CN55PDE
281 #define PPS_OUT_13 _RP3R
285 #define UCPORT_ID_14 UCPORT_ID_NA
286 #define PIN_14_BITADR BITADR_NA
287 #define LAT_14_BITADR BITADR_NA
288 #define TRIS_14_BITADR BITADR_NA
291 #define UCPORT_ID_15 UCPORT_ID_NA
292 #define PIN_15_BITADR BITADR_NA
293 #define LAT_15_BITADR BITADR_NA
294 #define TRIS_15_BITADR BITADR_NA
297 #define UCPORT_ID_16 UCPORT_ID_NA
298 #define PIN_16_BITADR BITADR_NA
299 #define LAT_16_BITADR BITADR_NA
300 #define TRIS_16_BITADR BITADR_NA
303 #define UCPORT_ID_17 UCPORT_ID_NA
304 #define PIN_17_BITADR BITADR_NA
305 #define LAT_17_BITADR BITADR_NA
306 #define TRIS_17_BITADR BITADR_NA
309 #define UCPORT_ID_18 UCPORT_ID_NA
310 #define PIN_18_BITADR BITADR_NA
311 #define LAT_18_BITADR BITADR_NA
312 #define TRIS_18_BITADR BITADR_NA
315 #define UCPORT_ID_19 UCPORT_ID_NA
316 #define PIN_19_BITADR BITADR_NA
317 #define LAT_19_BITADR BITADR_NA
318 #define TRIS_19_BITADR BITADR_NA
321 #define UCPORT_ID_20 UCPORT_ID_B6
323 #define PIN_20_BITADR ((volatile WORD)(0x62CA ))
324 #define LAT_20 _LATB6
325 #define LAT_20_BITADR ((volatile WORD)(0x62CC ))
326 #define DIR_20 _TRISB6
327 #define TRIS_20_BITADR ((volatile WORD)(0x62C8 ))
328 #define PULLUP_20 _CN24PUE
329 #define PULLDOWN_20 _CN24PDE
330 #define PPS_OUT_20 _RP6R
334 #define UCPORT_ID_21 UCPORT_ID_B7
336 #define PIN_21_BITADR ((volatile WORD)(0x72CA ))
337 #define LAT_21 _LATB7
338 #define LAT_21_BITADR ((volatile WORD)(0x72CC ))
339 #define DIR_21 _TRISB7
340 #define TRIS_21_BITADR ((volatile WORD)(0x72C8 ))
341 #define PULLUP_21 _CN25PUE
342 #define PULLDOWN_21 _CN25PDE
343 #define PPS_OUT_21 _RP7R
347 #define UCPORT_ID_22 UCPORT_ID_NA
348 #define LAT_22_BITADR BITADR_NA
349 #define PIN_22_BITADR BITADR_NA
350 #define TRIS_22_BITADR BITADR_NA
353 #define UCPORT_ID_23 UCPORT_ID_NA
354 #define LAT_23_BITADR BITADR_NA
355 #define PIN_23_BITADR BITADR_NA
356 #define TRIS_23_BITADR BITADR_NA
359 #define UCPORT_ID_24 UCPORT_ID_NA
360 #define PIN_24_BITADR BITADR_NA
361 #define LAT_24_BITADR BITADR_NA
362 #define TRIS_24_BITADR BITADR_NA
365 #define UCPORT_ID_25 UCPORT_ID_NA
366 #define PIN_25_BITADR BITADR_NA
367 #define LAT_25_BITADR BITADR_NA
368 #define TRIS_25_BITADR BITADR_NA
371 #define UCPORT_ID_26 UCPORT_ID_F1
373 #define PIN_26_BITADR ((volatile WORD)(0x12EA ))
374 #define LAT_26 _LATF1
375 #define LAT_26_BITADR ((volatile WORD)(0x12EC ))
376 #define DIR_26 _TRISF1
377 #define TRIS_26_BITADR ((volatile WORD)(0x12E8 ))
378 #define PULLUP_26 _CN69PUE
379 #define PULLDOWN_26 _CN69PDE
382 #define UCPORT_ID_27 UCPORT_ID_F3
384 #define PIN_27_BITADR ((volatile WORD)(0x32EA ))
385 #define LAT_27 _LATF3
386 #define LAT_27_BITADR ((volatile WORD)(0x32EC ))
387 #define DIR_27 _TRISF3
388 #define TRIS_27_BITADR ((volatile WORD)(0x32E8 ))
389 #define PULLUP_27 _CN71PUE
390 #define PULLDOWN_27 _CN71PDE
391 #define PPS_OUT_27 _RP16R
395 #define UCPORT_ID_28 UCPORT_ID_F4
397 #define PIN_28_BITADR ((volatile WORD)(0x42EA ))
398 #define LAT_28 _LATF4
399 #define LAT_28_BITADR ((volatile WORD)(0x42EC ))
400 #define DIR_28 _TRISF4
401 #define TRIS_28_BITADR ((volatile WORD)(0x42E8 ))
402 #define PULLUP_28 _CN17PUE
403 #define PULLDOWN_28 _CN17PDE
404 #define PPS_OUT_28 _RP10R
408 #define UCPORT_ID_29 UCPORT_ID_D8
410 #define PIN_29_BITADR ((volatile WORD)(0x82DA ))
411 #define LAT_29 _LATD8
412 #define LAT_29_BITADR ((volatile WORD)(0x82DC ))
413 #define DIR_29 _TRISD8
414 #define TRIS_29_BITADR ((volatile WORD)(0x82D8 ))
415 #define PULLUP_29 _CN53PUE
416 #define PULLDOWN_29 _CN53PDE
417 #define PPS_OUT_26 _RP2R
421 #define UCPORT_ID_30 UCPORT_ID_B8
423 #define PIN_30_BITADR ((volatile WORD)(0x82CA ))
424 #define LAT_30 _LATB8
425 #define LAT_30_BITADR ((volatile WORD)(0x82CC ))
426 #define DIR_30 _TRISB8
427 #define TRIS_30_BITADR ((volatile WORD)(0x82C8 ))
428 #define PULLUP_30 _CN26PUE
429 #define PULLDOWN_30 _CN26PDE
430 #define PPS_OUT_30 _RP8R
434 #define UCPORT_ID_31 UCPORT_ID_B9
436 #define PIN_31_BITADR ((volatile WORD)(0x92CA ))
437 #define LAT_31 _LATB9
438 #define LAT_31_BITADR ((volatile WORD)(0x92CC ))
439 #define DIR_31 _TRISB9
440 #define TRIS_31_BITADR ((volatile WORD)(0x92C8 ))
441 #define PULLUP_31 _CN27PUE
442 #define PULLDOWN_31 _CN27PDE
443 #define PPS_OUT_31 _RP9R
446 #define UCPORT_32 B10
447 #define UCPORT_ID_32 UCPORT_ID_B10
449 #define PIN_32_BITADR ((volatile WORD)(0xA2CA ))
450 #define LAT_32 _LATB10
451 #define LAT_32_BITADR ((volatile WORD)(0xA2CC ))
452 #define DIR_32 _TRISB10
453 #define TRIS_32_BITADR ((volatile WORD)(0xA2C8 ))
454 #define PULLUP_32 _CN28PUE
455 #define PULLDOWN_32 _CN28PDE
457 #define UCPORT_33 B11
458 #define UCPORT_ID_33 UCPORT_ID_B11
460 #define PIN_33_BITADR ((volatile WORD)(0xB2CA ))
461 #define LAT_33 _LATB11
462 #define LAT_33_BITADR ((volatile WORD)(0xB2CC ))
463 #define DIR_33 _TRISB11
464 #define TRIS_33_BITADR ((volatile WORD)(0xB2C8 ))
465 #define PULLUP_33 _CN29PUE
466 #define PULLDOWN_33 _CN29PDE
468 #define UCPORT_34 B12
469 #define UCPORT_ID_34 UCPORT_ID_B12
471 #define PIN_34_BITADR ((volatile WORD)(0xC2CA ))
472 #define LAT_34 _LATB12
473 #define LAT_34_BITADR ((volatile WORD)(0xC2CC ))
474 #define DIR_34 _TRISB12
475 #define TRIS_34_BITADR ((volatile WORD)(0xC2C8 ))
476 #define PULLUP_34 _CN30PUE
477 #define PULLDOWN_34 _CN30PDE
479 #define UCPORT_35 B13
480 #define UCPORT_ID_35 UCPORT_ID_B13
482 #define PIN_35_BITADR ((volatile WORD)(0xD2CA ))
483 #define LAT_35 _LATB13
484 #define LAT_35_BITADR ((volatile WORD)(0xD2CC ))
485 #define DIR_35 _TRISB13
486 #define TRIS_35_BITADR ((volatile WORD)(0xD2C8 ))
487 #define PULLUP_35 _CN31PUE
488 #define PULLDOWN_35 _CN31PDE
491 #define UCPORT_ID_36 UCPORT_ID_D0
493 #define PIN_36_BITADR ((volatile WORD)(0x02DA ))
494 #define LAT_36 _LATD0
495 #define LAT_36_BITADR ((volatile WORD)(0x02DC ))
496 #define DIR_36 _TRISD0
497 #define TRIS_36_BITADR ((volatile WORD)(0x02D8 ))
498 #define PULLUP_36 _CN49PUE
499 #define PULLDOWN_36 _CN49PDE
500 #define PPS_OUT_36 _RP11R
504 #define UCPORT_ID_37 UCPORT_ID_D1
506 #define PIN_37_BITADR ((volatile WORD)(0x12DA ))
507 #define LAT_37 _LATD1
508 #define LAT_37_BITADR ((volatile WORD)(0x12DC ))
509 #define DIR_37 _TRISD1
510 #define TRIS_37_BITADR ((volatile WORD)(0x12D8 ))
511 #define PULLUP_37 _CN50PUE
512 #define PULLDOWN_37 _CN50PDE
513 #define PPS_OUT_37 _RP24R
517 #define UCPORT_ID_38 UCPORT_ID_D2
519 #define PIN_38_BITADR ((volatile WORD)(0x22DA ))
520 #define LAT_38 _LATD2
521 #define LAT_38_BITADR ((volatile WORD)(0x22DC ))
522 #define DIR_38 _TRISD2
523 #define TRIS_38_BITADR ((volatile WORD)(0x22D8 ))
524 #define PULLUP_38 _CN51PUE
525 #define PULLDOWN_38 _CN51PDE
526 #define PPS_OUT_38 _RP23R
530 #define UCPORT_ID_39 UCPORT_ID_D3
532 #define PIN_39_BITADR ((volatile WORD)(0x32DA ))
533 #define LAT_39 _LATD3
534 #define LAT_39_BITADR ((volatile WORD)(0x32DC ))
535 #define DIR_39 _TRISD3
536 #define TRIS_39_BITADR ((volatile WORD)(0x32D8 ))
537 #define PULLUP_39 _CN52PUE
538 #define PULLDOWN_39 _CN52PDE
539 #define PPS_OUT_39 _RP22R
543 #define UCPORT_ID_40 UCPORT_ID_D6
545 #define PIN_40_BITADR ((volatile WORD)(0x62DA ))
546 #define LAT_40 _LATD6
547 #define LAT_40_BITADR ((volatile WORD)(0x62DC ))
548 #define DIR_40 _TRISD6
549 #define TRIS_40_BITADR ((volatile WORD)(0x62D8 ))
550 #define PULLUP_40 _CN15PUE
551 #define PULLDOWN_40 _CN15PDE
554 #define UCPORT_ID_41 UCPORT_ID_D7
556 #define PIN_41_BITADR ((volatile WORD)(0x72DA ))
557 #define LAT_41 _LATD7
558 #define LAT_41_BITADR ((volatile WORD)(0x72DC ))
559 #define DIR_41 _TRISD7
560 #define TRIS_41_BITADR ((volatile WORD)(0x72D8 ))
561 #define PULLUP_41 _CN16PUE
562 #define PULLDOWN_41 _CN16PDE
565 #define UCPORT_ID_42 UCPORT_ID_NA
566 #define PIN_42_BITADR BITADR_NA
567 #define LAT_42_BITADR BITADR_NA
568 #define TRIS_42_BITADR BITADR_NA
571 #define UCPORT_ID_43 UCPORT_ID_NA
572 #define PIN_43_BITADR BITADR_NA
573 #define LAT_43_BITADR BITADR_NA
574 #define TRIS_43_BITADR BITADR_NA
577 #define UCPORT_ID_44 UCPORT_ID_NA
578 #define PIN_44_BITADR BITADR_NA
579 #define LAT_44_BITADR BITADR_NA
580 #define TRIS_44_BITADR BITADR_NA
583 #define UCPORT_ID_45 UCPORT_ID_NA
584 #define PIN_45_BITADR BITADR_NA
585 #define LAT_45_BITADR BITADR_NA
586 #define TRIS_45_BITADR BITADR_NA
590 #define PORT_ID_SDA1 12
591 #define UCPORT_SDA1 UCPORT_12
592 #define UCPORT_ID_SDA1 UCPORT_ID_12
593 #define PIN_SDA1 PIN_12
594 #define PIN_SDA1_BITADR PIN_12_BITADR
595 #define LAT_SDA1 LAT_12
596 #define LAT_SDA1_BITADR LAT_12_BITADR
597 #define DIR_SDA1 DIR_12
598 #define TRIS_SDA1_BITADR TRIS_12_BITADR
599 #define PULLUP_SDA1 PULLUP_12
600 #define PULLDOWN_SDA1 PULLDOWN_12
602 #define PORT_ID_SCL1 13
603 #define UCPORT_SCL1 UCPORT_13
604 #define UCPORT_ID_SCL1 UCPORT_ID_13
605 #define PIN_SCL1 PIN_13
606 #define PIN_SCL1_BITADR PIN_13_BITADR
607 #define LAT_SCL1 LAT_13
608 #define LAT_SCL1_BITADR LAT_13_BITADR
609 #define DIR_SCL1 DIR_13
610 #define TRIS_SCL1_BITADR TRIS_13_BITADR
611 #define PULLUP_SCL1 PULLUP_13
612 #define PULLDOWN_SCL1 PULLDOWN_13
614 #define PORT_ID_SDA2 28
615 #define UCPORT_SDA2 UCPORT_28
616 #define UCPORT_ID_SDA2 UCPORT_ID_28
617 #define PIN_SDA2 PIN_28
618 #define PIN_SDA2_BITADR PIN_28_BITADR
619 #define LAT_SDA2 LAT_28
620 #define LAT_SDA2_BITADR LAT_28_BITADR
621 #define DIR_SDA2 DIR_28
622 #define TRIS_SDA2_BITADR TRIS_28_BITADR
623 #define PULLUP_SDA2 PULLUP_28
624 #define PULLDOWN_SDA2 PULLDOWN_28
626 #define PORT_ID_SCL2 29
627 #define UCPORT_SCL2 UCPORT_29
628 #define UCPORT_ID_SCL2 UCPORT_ID_29
629 #define PIN_SCL2 PIN_29
630 #define PIN_SCL2_BITADR PIN_29_BITADR
631 #define LAT_SCL2 LAT_29
632 #define LAT_SCL2_BITADR LAT_29_BITADR
633 #define DIR_SCL2 DIR_29
634 #define TRIS_SCL2_BITADR TRIS_29_BITADR
635 #define PULLUP_SCL2 PULLUP_29
636 #define PULLDOWN_SCL2 PULLDOWN_29
647 #define PIN_A0 PIN_00
648 #define PIN_A0_BITADR PIN_00_BITADR
649 #define LAT_A0 LAT_00
650 #define LAT_A0_BITADR LAT_00_BITADR
651 #define DIR_A0 DIR_00
652 #define TRIS_A0_BITADR TRIS_00_BITADR
653 #define PULLUP_A0 PULLUP_00
654 #define PULLDOWN_A0 PULLDOWN_00
656 #define PIN_A1 PIN_01
657 #define PIN_A1_BITADR PIN_01_BITADR
658 #define LAT_A1 LAT_01
659 #define LAT_A1_BITADR LAT_01_BITADR
660 #define DIR_A1 DIR_01
661 #define TRIS_A1_BITADR TRIS_01_BITADR
662 #define PULLUP_A1 PULLUP_01
663 #define PULLDOWN_A1 PULLDOWN_01
665 #define PIN_A2 PIN_02
666 #define PIN_A2_BITADR PIN_02_BITADR
667 #define LAT_A2 LAT_02
668 #define LAT_A2_BITADR LAT_02_BITADR
669 #define DIR_A2 DIR_02
670 #define TRIS_A2_BITADR TRIS_02_BITADR
671 #define PULLUP_A2 PULLUP_02
672 #define PULLDOWN_A2 PULLDOWN_02
674 #define PIN_A3 PIN_03
675 #define PIN_A3_BITADR PIN_03_BITADR
676 #define LAT_A3 LAT_03
677 #define LAT_A3_BITADR LAT_03_BITADR
678 #define DIR_A3 DIR_03
679 #define TRIS_A3_BITADR TRIS_03_BITADR
680 #define PULLUP_A3 PULLUP_03
681 #define PULLDOWN_A3 PULLDOWN_03
683 #define PIN_A4 PIN_04
684 #define PIN_A4_BITADR PIN_04_BITADR
685 #define LAT_A4 LAT_04
686 #define LAT_A4_BITADR LAT_04_BITADR
687 #define DIR_A4 DIR_04
688 #define TRIS_A4_BITADR TRIS_04_BITADR
689 #define PULLUP_A4 PULLUP_04
690 #define PULLDOWN_A4 PULLDOWN_04
692 #define PIN_A5 PIN_05
693 #define PIN_A5_BITADR PIN_05_BITADR
694 #define LAT_A5 LAT_05
695 #define LAT_A5_BITADR LAT_05_BITADR
696 #define DIR_A5 DIR_05
697 #define TRIS_A5_BITADR TRIS_05_BITADR
698 #define PULLUP_A5 PULLUP_05
699 #define PULLDOWN_A5 PULLDOWN_05
701 #define PIN_A6 PIN_30
702 #define PIN_A6_BITADR PIN_30_BITADR
703 #define LAT_A6 LAT_30
704 #define LAT_A6_BITADR LAT_30_BITADR
705 #define DIR_A6 DIR_30
706 #define TRIS_A6_BITADR TRIS_30_BITADR
707 #define PULLUP_A6 PULLUP_30
708 #define PULLDOWN_A6 PULLDOWN_30
710 #define PIN_A7 PIN_31
711 #define PIN_A7_BITADR PIN_31_BITADR
712 #define LAT_A7 LAT_31
713 #define LAT_A7_BITADR LAT_31_BITADR
714 #define DIR_A7 DIR_31
715 #define TRIS_A7_BITADR TRIS_31_BITADR
716 #define PULLUP_A7 PULLUP_31
717 #define PULLDOWN_A7 PULLDOWN_31
719 #define PIN_A8 PIN_32
720 #define PIN_A8_BITADR PIN_32_BITADR
721 #define LAT_A8 LAT_32
722 #define LAT_A8_BITADR LAT_32_BITADR
723 #define DIR_A8 DIR_32
724 #define TRIS_A8_BITADR TRIS_32_BITADR
725 #define PULLUP_A8 PULLUP_32
726 #define PULLDOWN_A8 PULLDOWN_32
728 #define PIN_A9 PIN_33
729 #define PIN_A9_BITADR PIN_33_BITADR
730 #define LAT_A9 LAT_33
731 #define LAT_A9_BITADR LAT_33_BITADR
732 #define DIR_A9 DIR_33
733 #define TRIS_A9_BITADR TRIS_33_BITADR
734 #define PULLUP_A9 PULLUP_33
735 #define PULLDOWN_A9 PULLDOWN_33
737 #define PIN_A10 PIN_34
738 #define PIN_A10_BITADR PIN_34_BITADR
739 #define LAT_A10 LAT_34
740 #define LAT_A10_BITADR LAT_34_BITADR
741 #define DIR_A10 DIR_34
742 #define TRIS_A10_BITADR TRIS_34_BITADR
743 #define PULLUP_A10 PULLUP_34
744 #define PULLDOWN_A10 PULLDOWN_34
746 #define PIN_A11 PIN_35
747 #define PIN_A11_BITADR PIN_35_BITADR
748 #define LAT_A11 LAT_35
749 #define LAT_A11_BITADR LAT_35_BITADR
750 #define DIR_A11 DIR_35
751 #define TRIS_A11_BITADR TRIS_35_BITADR
752 #define PULLUP_A11 PULLUP_35
753 #define PULLDOWN_A11 PULLDOWN_35
760 #define UCPORT_SC UCPORT_13
761 #define UCPORT_ID_SC UCPORT_ID_13
762 #define PIN_SC PIN_13
763 #define PIN_SC_BITADR PIN_13_BITADR
764 #define LAT_SC LAT_13
765 #define LAT_SC_BITADR LAT_13_BITADR
766 #define DIR_SC DIR_13
767 #define TRIS_SC_BITADR TRIS_13_BITADR
768 #define PULLUP_SC PULLUP_13
769 #define PULLDOWN_SC PULLDOWN_13
770 #define PPS_OUT_SC PPS_OUT_13
771 #define PPS_IN_SC PPS_IN_13
773 #define UCPORT_SD UCPORT_12
774 #define UCPORT_ID_SD UCPORT_ID_12
775 #define PIN_SD PIN_12
776 #define PIN_SD_BITADR PIN_12_BITADR
777 #define LAT_SD LAT_12
778 #define LAT_SD_BITADR LAT_12_BITADR
779 #define DIR_SD DIR_12
780 #define TRIS_SD_BITADR TRIS_12_BITADR
781 #define PULLUP_SD PULLUP_12
782 #define PULLDOWN_SD PULLDOWN_12
783 #define PPS_OUT_SD PPS_OUT_12
784 #define PPS_IN_SD PPS_IN_12
786 #define UCPORT_S0 UCPORT_24
787 #define UCPORT_ID_S0 UCPORT_ID_24
788 #define PIN_S0 PIN_24
789 #define PIN_S0_BITADR PIN_24_BITADR
790 #define LAT_S0 LAT_24
791 #define LAT_S0_BITADR LAT_24_BITADR
792 #define DIR_S0 DIR_24
793 #define TRIS_S0_BITADR TRIS_24_BITADR
794 #define PULLUP_S0 PULLUP_24
795 #define PULLDOWN_S0 PULLDOWN_24
796 #define PPS_OUT_S0 PPS_OUT_24
797 #define PPS_IN_S0 PPS_IN_24
799 #define UCPORT_S1 UCPORT_25
800 #define UCPORT_ID_S1 UCPORT_ID_25
801 #define PIN_S1 PIN_25
802 #define PIN_S1_BITADR PIN_25_BITADR
803 #define LAT_S1 LAT_25
804 #define LAT_S1_BITADR LAT_25_BITADR
805 #define DIR_S1 DIR_25
806 #define TRIS_S1_BITADR TRIS_25_BITADR
807 #define PULLUP_S1 PULLUP_25
808 #define PULLDOWN_S1 PULLDOWN_25
809 #define PPS_OUT_S1 PPS_OUT_25
810 #define PPS_IN_S1 PPS_IN_25
812 #define UCPORT_T0 UCPORT_20
813 #define UCPORT_ID_T0 UCPORT_ID_20
814 #define PIN_T0 PIN_20
815 #define PIN_T0_BITADR PIN_20_BITADR
816 #define LAT_T0 LAT_20
817 #define LAT_T0_BITADR LAT_20_BITADR
818 #define DIR_T0 DIR_20
819 #define TRIS_T0_BITADR TRIS_20_BITADR
820 #define PULLUP_T0 PULLUP_20
821 #define PULLDOWN_T0 PULLDOWN_20
822 #define PPS_OUT_T0 PPS_OUT_20
823 #define PPS_IN_T0 PPS_IN_20
825 #define UCPORT_T1 UCPORT_21
826 #define UCPORT_ID_T1 UCPORT_ID_21
827 #define PIN_T1 PIN_21
828 #define PIN_T1_BITADR PIN_21_BITADR
829 #define LAT_T1 LAT_21
830 #define LAT_T1_BITADR LAT_21_BITADR
831 #define DIR_T1 DIR_21
832 #define TRIS_T1_BITADR TRIS_21_BITADR
833 #define PULLUP_T1 PULLUP_21
834 #define PULLDOWN_T1 PULLDOWN_21
835 #define PPS_OUT_T1 PPS_OUT_21
836 #define PPS_IN_T1 PPS_IN_21
838 #define UCPORT_T2 UCPORT_22
839 #define UCPORT_ID_T2 UCPORT_ID_22
840 #define PIN_T2 PIN_22
841 #define PIN_T2_BITADR PIN_22_BITADR
842 #define LAT_T2 LAT_22
843 #define LAT_T2_BITADR LAT_22_BITADR
844 #define DIR_T2 DIR_22
845 #define TRIS_T2_BITADR TRIS_22_BITADR
846 #define PULLUP_T2 PULLUP_22
847 #define PULLDOWN_T2 PULLDOWN_22
848 #define PPS_OUT_T2 PPS_OUT_22
849 #define PPS_IN_T2 PPS_IN_22
851 #define UCPORT_T3 UCPORT_23
852 #define UCPORT_ID_T3 UCPORT_ID_23
853 #define PIN_T3 PIN_23
854 #define PIN_T3_BITADR PIN_23_BITADR
855 #define LAT_T3 LAT_23
856 #define LAT_T3_BITADR LAT_23_BITADR
857 #define DIR_T3 DIR_23
858 #define TRIS_T3_BITADR TRIS_23_BITADR
859 #define PULLUP_T3 PULLUP_23
860 #define PULLDOWN_T3 PULLDOWN_23
861 #define PPS_OUT_T3 PPS_OUT_23
862 #define PPS_IN_T3 PPS_IN_23
864 #define UCPORT_T4 UCPORT_26
865 #define UCPORT_ID_T4 UCPORT_ID_26
866 #define PIN_T4 PIN_26
867 #define PIN_T4_BITADR PIN_26_BITADR
868 #define LAT_T4 LAT_26
869 #define LAT_T4_BITADR LAT_26_BITADR
870 #define DIR_T4 DIR_26
871 #define TRIS_T4_BITADR TRIS_26_BITADR
872 #define PULLUP_T4 PULLUP_26
873 #define PULLDOWN_T4 PULLDOWN_26
874 #define PPS_OUT_T4 PPS_OUT_26
875 #define PPS_IN_T4 PPS_IN_26
877 #define UCPORT_T5 UCPORT_27
878 #define UCPORT_ID_T5 UCPORT_ID_27
879 #define PIN_T5 PIN_27
880 #define PIN_T5_BITADR PIN_27_BITADR
881 #define LAT_T5 LAT_27
882 #define LAT_T5_BITADR LAT_27_BITADR
883 #define DIR_T5 DIR_27
884 #define TRIS_T5_BITADR TRIS_27_BITADR
885 #define PULLUP_T5 PULLUP_27
886 #define PULLDOWN_T5 PULLDOWN_27
887 #define PPS_OUT_T5 PPS_OUT_27
888 #define PPS_IN_T5 PPS_IN_27
890 #define UCPORT_T6 UCPORT_28
891 #define UCPORT_ID_T6 UCPORT_ID_28
892 #define PIN_T6 PIN_28
893 #define PIN_T6_BITADR PIN_28_BITADR
894 #define LAT_T6 LAT_28
895 #define LAT_T6_BITADR LAT_28_BITADR
896 #define DIR_T6 DIR_28
897 #define TRIS_T6_BITADR TRIS_28_BITADR
898 #define PULLUP_T6 PULLUP_28
899 #define PULLDOWN_T6 PULLDOWN_28
900 #define PPS_OUT_T6 PPS_OUT_28
901 #define PPS_IN_T6 PPS_IN_28
903 #define UCPORT_T7 UCPORT_29
904 #define UCPORT_ID_T7 UCPORT_ID_29
905 #define PIN_T7 PIN_29
906 #define PIN_T7_BITADR PIN_29_BITADR
907 #define LAT_T7 LAT_29
908 #define LAT_T7_BITADR LAT_29_BITADR
909 #define DIR_T7 DIR_29
910 #define TRIS_T7_BITADR TRIS_29_BITADR
911 #define PULLUP_T7 PULLUP_29
912 #define PULLDOWN_T7 PULLDOWN_29
913 #define PPS_OUT_T7 PPS_OUT_29
914 #define PPS_IN_T7 PPS_IN_29
916 #define UCPORT_X0 UCPORT_00
917 #define UCPORT_ID_X0 UCPORT_ID_00
918 #define PIN_X0 PIN_00
919 #define PIN_X0_BITADR PIN_00_BITADR
920 #define LAT_X0 LAT_00
921 #define LAT_X0_BITADR LAT_00_BITADR
922 #define DIR_X0 DIR_00
923 #define TRIS_X0_BITADR TRIS_00_BITADR
924 #define PULLUP_X0 PULLUP_00
925 #define PULLDOWN_X0 PULLDOWN_00
926 #define PPS_OUT_X0 PPS_OUT_00
927 #define PPS_IN_X0 PPS_IN_00
929 #define UCPORT_X1 UCPORT_01
930 #define UCPORT_ID_X1 UCPORT_ID_01
931 #define PIN_X1 PIN_01
932 #define PIN_X1_BITADR PIN_01_BITADR
933 #define LAT_X1 LAT_01
934 #define LAT_X1_BITADR LAT_01_BITADR
935 #define DIR_X1 DIR_01
936 #define TRIS_X1_BITADR TRIS_01_BITADR
937 #define PULLUP_X1 PULLUP_01
938 #define PULLDOWN_X1 PULLDOWN_01
939 #define PPS_OUT_X1 PPS_OUT_01
940 #define PPS_IN_X1 PPS_IN_01
942 #define UCPORT_X2 UCPORT_02
943 #define UCPORT_ID_X2 UCPORT_ID_02
944 #define PIN_X2 PIN_02
945 #define PIN_X2_BITADR PIN_02_BITADR
946 #define LAT_X2 LAT_02
947 #define LAT_X2_BITADR LAT_02_BITADR
948 #define DIR_X2 DIR_02
949 #define TRIS_X2_BITADR TRIS_02_BITADR
950 #define PULLUP_X2 PULLUP_02
951 #define PULLDOWN_X2 PULLDOWN_02
952 #define PPS_OUT_X2 PPS_OUT_02
953 #define PPS_IN_X2 PPS_IN_02
955 #define UCPORT_X3 UCPORT_03
956 #define UCPORT_ID_X3 UCPORT_ID_03
957 #define PIN_X3 PIN_03
958 #define PIN_X3_BITADR PIN_03_BITADR
959 #define LAT_X3 LAT_03
960 #define LAT_X3_BITADR LAT_03_BITADR
961 #define DIR_X3 DIR_03
962 #define TRIS_X3_BITADR TRIS_03_BITADR
963 #define PULLUP_X3 PULLUP_03
964 #define PULLDOWN_X3 PULLDOWN_03
965 #define PPS_OUT_X3 PPS_OUT_03
966 #define PPS_IN_X3 PPS_IN_03
968 #define UCPORT_X4 UCPORT_04
969 #define UCPORT_ID_X4 UCPORT_ID_04
970 #define PIN_X4 PIN_04
971 #define PIN_X4_BITADR PIN_04_BITADR
972 #define LAT_X4 LAT_04
973 #define LAT_X4_BITADR LAT_04_BITADR
974 #define DIR_X4 DIR_04
975 #define TRIS_X4_BITADR TRIS_04_BITADR
976 #define PULLUP_X4 PULLUP_04
977 #define PULLDOWN_X4 PULLDOWN_04
978 #define PPS_OUT_X4 PPS_OUT_04
979 #define PPS_IN_X4 PPS_IN_04
981 #define UCPORT_X5 UCPORT_05
982 #define UCPORT_ID_X5 UCPORT_ID_05
983 #define PIN_X5 PIN_05
984 #define PIN_X5_BITADR PIN_05_BITADR
985 #define LAT_X5 LAT_05
986 #define LAT_X5_BITADR LAT_05_BITADR
987 #define DIR_X5 DIR_05
988 #define TRIS_X5_BITADR TRIS_05_BITADR
989 #define PULLUP_X5 PULLUP_05
990 #define PULLDOWN_X5 PULLDOWN_05
991 #define PPS_OUT_X5 PPS_OUT_05
992 #define PPS_IN_X5 PPS_IN_05
994 #define UCPORT_X6 UCPORT_06
995 #define UCPORT_ID_X6 UCPORT_ID_06
996 #define PIN_X6 PIN_06
997 #define PIN_X6_BITADR PIN_06_BITADR
998 #define LAT_X6 LAT_06
999 #define LAT_X6_BITADR LAT_06_BITADR
1000 #define DIR_X6 DIR_06
1001 #define TRIS_X6_BITADR TRIS_06_BITADR
1002 #define PULLUP_X6 PULLUP_06
1003 #define PULLDOWN_X6 PULLDOWN_06
1004 #define PPS_OUT_X6 PPS_OUT_06
1005 #define PPS_IN_X6 PPS_IN_06
1007 #define UCPORT_X7 UCPORT_07
1008 #define UCPORT_ID_X7 UCPORT_ID_07
1009 #define PIN_X7 PIN_07
1010 #define PIN_X7_BITADR PIN_07_BITADR
1011 #define LAT_X7 LAT_07
1012 #define LAT_X7_BITADR LAT_07_BITADR
1013 #define DIR_X7 DIR_07
1014 #define TRIS_X7_BITADR TRIS_07_BITADR
1015 #define PULLUP_X7 PULLUP_07
1016 #define PULLDOWN_X7 PULLDOWN_07
1017 #define PPS_OUT_X7 PPS_OUT_07
1018 #define PPS_IN_X7 PPS_IN_07
1020 #define UCPORT_X8 UCPORT_08
1021 #define UCPORT_ID_X8 UCPORT_ID_08
1022 #define PIN_X8 PIN_08
1023 #define PIN_X8_BITADR PIN_08_BITADR
1024 #define LAT_X8 LAT_08
1025 #define LAT_X8_BITADR LAT_08_BITADR
1026 #define DIR_X8 DIR_08
1027 #define TRIS_X8_BITADR TRIS_08_BITADR
1028 #define PULLUP_X8 PULLUP_08
1029 #define PULLDOWN_X8 PULLDOWN_08
1030 #define PPS_OUT_X8 PPS_OUT_08
1031 #define PPS_IN_X8 PPS_IN_08
1033 #define UCPORT_X9 UCPORT_09
1034 #define UCPORT_ID_X9 UCPORT_ID_09
1035 #define PIN_X9 PIN_09
1036 #define PIN_X9_BITADR PIN_09_BITADR
1037 #define LAT_X9 LAT_09
1038 #define LAT_X9_BITADR LAT_09_BITADR
1039 #define DIR_X9 DIR_09
1040 #define TRIS_X9_BITADR TRIS_09_BITADR
1041 #define PULLUP_X9 PULLUP_09
1042 #define PULLDOWN_X9 PULLDOWN_09
1043 #define PPS_OUT_X9 PPS_OUT_09
1044 #define PPS_IN_X9 PPS_IN_09
1046 #define UCPORT_X10 UCPORT_10
1047 #define UCPORT_ID_X10 UCPORT_ID_10
1048 #define PIN_X10 PIN_10
1049 #define PIN_X10_BITADR PIN_10_BITADR
1050 #define LAT_X10 LAT_10
1051 #define LAT_X10_BITADR LAT_10_BITADR
1052 #define DIR_X10 DIR_10
1053 #define TRIS_X10_BITADR TRIS_10_BITADR
1054 #define PULLUP_X10 PULLUP_10
1055 #define PULLDOWN_X10 PULLDOWN_10
1056 #define PPS_OUT_X10 PPS_OUT_10
1057 #define PPS_IN_X10 PPS_IN_10
1059 #define UCPORT_X11 UCPORT_11
1060 #define UCPORT_ID_X11 UCPORT_ID_11
1061 #define PIN_X11 PIN_11
1062 #define PIN_X11_BITADR PIN_11_BITADR
1063 #define LAT_X11 LAT_11
1064 #define LAT_X11_BITADR LAT_11_BITADR
1065 #define DIR_X11 DIR_11
1066 #define TRIS_X11_BITADR TRIS_11_BITADR
1067 #define PULLUP_X11 PULLUP_11
1068 #define PULLDOWN_X11 PULLDOWN_11
1069 #define PPS_OUT_X11 PPS_OUT_11
1070 #define PPS_IN_X11 PPS_IN_11
1072 #define UCPORT_Y0 UCPORT_30
1073 #define UCPORT_ID_Y0 UCPORT_ID_30
1074 #define PIN_Y0 PIN_30
1075 #define PIN_Y0_BITADR PIN_30_BITADR
1076 #define LAT_Y0 LAT_30
1077 #define LAT_Y0_BITADR LAT_30_BITADR
1078 #define DIR_Y0 DIR_30
1079 #define TRIS_Y0_BITADR TRIS_30_BITADR
1080 #define PULLUP_Y0 PULLUP_30
1081 #define PULLDOWN_Y0 PULLDOWN_30
1082 #define PPS_OUT_Y0 PPS_OUT_30
1083 #define PPS_IN_Y0 PPS_IN_30
1085 #define UCPORT_Y1 UCPORT_31
1086 #define UCPORT_ID_Y1 UCPORT_ID_31
1087 #define PIN_Y1 PIN_31
1088 #define PIN_Y1_BITADR PIN_31_BITADR
1089 #define LAT_Y1 LAT_31
1090 #define LAT_Y1_BITADR LAT_31_BITADR
1091 #define DIR_Y1 DIR_31
1092 #define TRIS_Y1_BITADR TRIS_31_BITADR
1093 #define PULLUP_Y1 PULLUP_31
1094 #define PULLDOWN_Y1 PULLDOWN_31
1095 #define PPS_OUT_Y1 PPS_OUT_31
1096 #define PPS_IN_Y1 PPS_IN_31
1098 #define UCPORT_Y2 UCPORT_32
1099 #define UCPORT_ID_Y2 UCPORT_ID_32
1100 #define PIN_Y2 PIN_32
1101 #define PIN_Y2_BITADR PIN_32_BITADR
1102 #define LAT_Y2 LAT_32
1103 #define LAT_Y2_BITADR LAT_32_BITADR
1104 #define DIR_Y2 DIR_32
1105 #define TRIS_Y2_BITADR TRIS_32_BITADR
1106 #define PULLUP_Y2 PULLUP_32
1107 #define PULLDOWN_Y2 PULLDOWN_32
1108 #define PPS_OUT_Y2 PPS_OUT_32
1109 #define PPS_IN_Y2 PPS_IN_32
1111 #define UCPORT_Y3 UCPORT_33
1112 #define UCPORT_ID_Y3 UCPORT_ID_33
1113 #define PIN_Y3 PIN_33
1114 #define PIN_Y3_BITADR PIN_33_BITADR
1115 #define LAT_Y3 LAT_33
1116 #define LAT_Y3_BITADR LAT_33_BITADR
1117 #define DIR_Y3 DIR_33
1118 #define TRIS_Y3_BITADR TRIS_33_BITADR
1119 #define PULLUP_Y3 PULLUP_33
1120 #define PULLDOWN_Y3 PULLDOWN_33
1121 #define PPS_OUT_Y3 PPS_OUT_33
1122 #define PPS_IN_Y3 PPS_IN_33
1124 #define UCPORT_Y4 UCPORT_34
1125 #define UCPORT_ID_Y4 UCPORT_ID_34
1126 #define PIN_Y4 PIN_34
1127 #define PIN_Y4_BITADR PIN_34_BITADR
1128 #define LAT_Y4 LAT_34
1129 #define LAT_Y4_BITADR LAT_34_BITADR
1130 #define DIR_Y4 DIR_34
1131 #define TRIS_Y4_BITADR TRIS_34_BITADR
1132 #define PULLUP_Y4 PULLUP_34
1133 #define PULLDOWN_Y4 PULLDOWN_34
1134 #define PPS_OUT_Y4 PPS_OUT_34
1135 #define PPS_IN_Y4 PPS_IN_34
1137 #define UCPORT_Y5 UCPORT_35
1138 #define UCPORT_ID_Y5 UCPORT_ID_35
1139 #define PIN_Y5 PIN_35
1140 #define PIN_Y5_BITADR PIN_35_BITADR
1141 #define LAT_Y5 LAT_35
1142 #define LAT_Y5_BITADR LAT_35_BITADR
1143 #define DIR_Y5 DIR_35
1144 #define TRIS_Y5_BITADR TRIS_35_BITADR
1145 #define PULLUP_Y5 PULLUP_35
1146 #define PULLDOWN_Y5 PULLDOWN_35
1147 #define PPS_OUT_Y5 PPS_OUT_35
1148 #define PPS_IN_Y5 PPS_IN_35
1150 #define UCPORT_Y6 UCPORT_36
1151 #define UCPORT_ID_Y6 UCPORT_ID_36
1152 #define PIN_Y6 PIN_36
1153 #define PIN_Y6_BITADR PIN_36_BITADR
1154 #define LAT_Y6 LAT_36
1155 #define LAT_Y6_BITADR LAT_36_BITADR
1156 #define DIR_Y6 DIR_36
1157 #define TRIS_Y6_BITADR TRIS_36_BITADR
1158 #define PULLUP_Y6 PULLUP_36
1159 #define PULLDOWN_Y6 PULLDOWN_36
1160 #define PPS_OUT_Y6 PPS_OUT_36
1161 #define PPS_IN_Y6 PPS_IN_36
1163 #define UCPORT_Y7 UCPORT_37
1164 #define UCPORT_ID_Y7 UCPORT_ID_37
1165 #define PIN_Y7 PIN_37
1166 #define PIN_Y7_BITADR PIN_37_BITADR
1167 #define LAT_Y7 LAT_37
1168 #define LAT_Y7_BITADR LAT_37_BITADR
1169 #define DIR_Y7 DIR_37
1170 #define TRIS_Y7_BITADR TRIS_37_BITADR
1171 #define PULLUP_Y7 PULLUP_37
1172 #define PULLDOWN_Y7 PULLDOWN_37
1173 #define PPS_OUT_Y7 PPS_OUT_37
1174 #define PPS_IN_Y7 PPS_IN_37
1176 #define UCPORT_Y8 UCPORT_38
1177 #define UCPORT_ID_Y8 UCPORT_ID_38
1178 #define PIN_Y8 PIN_38
1179 #define PIN_Y8_BITADR PIN_38_BITADR
1180 #define LAT_Y8 LAT_38
1181 #define LAT_Y8_BITADR LAT_38_BITADR
1182 #define DIR_Y8 DIR_38
1183 #define TRIS_Y8_BITADR TRIS_38_BITADR
1184 #define PULLUP_Y8 PULLUP_38
1185 #define PULLDOWN_Y8 PULLDOWN_38
1186 #define PPS_OUT_Y8 PPS_OUT_38
1187 #define PPS_IN_Y8 PPS_IN_38
1189 #define UCPORT_Y9 UCPORT_39
1190 #define UCPORT_ID_Y9 UCPORT_ID_39
1191 #define PIN_Y9 PIN_39
1192 #define PIN_Y9_BITADR PIN_39_BITADR
1193 #define LAT_Y9 LAT_39
1194 #define LAT_Y9_BITADR LAT_39_BITADR
1195 #define DIR_Y9 DIR_39
1196 #define TRIS_Y9_BITADR TRIS_39_BITADR
1197 #define PULLUP_Y9 PULLUP_39
1198 #define PULLDOWN_Y9 PULLDOWN_39
1199 #define PPS_OUT_Y9 PPS_OUT_39
1200 #define PPS_IN_Y9 PPS_IN_39
1202 #define UCPORT_Y10 UCPORT_40
1203 #define UCPORT_ID_Y10 UCPORT_ID_40
1204 #define PIN_Y10 PIN_40
1205 #define PIN_Y10_BITADR PIN_40_BITADR
1206 #define LAT_Y10 LAT_40
1207 #define LAT_Y10_BITADR LAT_40_BITADR
1208 #define DIR_Y10 DIR_40
1209 #define TRIS_Y10_BITADR TRIS_40_BITADR
1210 #define PULLUP_Y10 PULLUP_40
1211 #define PULLDOWN_Y10 PULLDOWN_40
1212 #define PPS_OUT_Y10 PPS_OUT_40
1213 #define PPS_IN_Y10 PPS_IN_40
1215 #define UCPORT_Y11 UCPORT_41
1216 #define UCPORT_ID_Y11 UCPORT_ID_41
1217 #define PIN_Y11 PIN_41
1218 #define PIN_Y11_BITADR PIN_41_BITADR
1219 #define LAT_Y11 LAT_41
1220 #define LAT_Y11_BITADR LAT_41_BITADR
1221 #define DIR_Y11 DIR_41
1222 #define TRIS_Y11_BITADR TRIS_41_BITADR
1223 #define PULLUP_Y11 PULLUP_41
1224 #define PULLDOWN_Y11 PULLDOWN_41
1225 #define PPS_OUT_Y11 PPS_OUT_41
1226 #define PPS_IN_Y11 PPS_IN_41
1233 #define PIN_SYSLED _RB6
1234 #define LAT_SYSLED _LATB6
1235 #define DIR_SYSLED _TRISB6
1236 #define PULLUP_SYSLED _CN24PUE
1237 #define PULLDOWN_SYSLED _CN24PDE
1244 #define PWM_COUNT 9 //Hardware PWM channels
1251 #define ADC_REF_MV 2500 //ADC External Reference in MV
1252 #define ADC_MAX_CHAN_BRD 12 //Maximum number of possible ADC channels, B0-B5, B8-B13
1255 #define ADC_CHANNEL_MASK_LOW_BRD 0b0011111100111111 //AN0-AN5, AN8-AN13
1256 #define ADC_CHANNEL_MASK_HIGH_BRD 0 //Only has 16 ADC channels
1259 #define ADC_CH_A0 0 //AN0
1260 #define ADC_CH_A1 1 //AN1
1261 #define ADC_CH_A2 2 //AN2
1262 #define ADC_CH_A3 3 //AN3
1263 #define ADC_CH_A4 4 //AN4
1264 #define ADC_CH_A5 5 //AN5
1265 #define ADC_CH_A6 8 //AN8
1266 #define ADC_CH_A7 9 //AN9
1267 #define ADC_CH_A8 10 //AN10
1268 #define ADC_CH_A9 11 //AN11
1269 #define ADC_CH_A10 12 //AN12
1270 #define ADC_CH_A11 13 //AN13
1272 #define ADC_OPEN_A0 0x0001 //AN0
1273 #define ADC_OPEN_A1 0x0002 //AN1
1274 #define ADC_OPEN_A2 0x0004 //AN2
1275 #define ADC_OPEN_A3 0x0008 //AN3
1276 #define ADC_OPEN_A4 0x0010 //AN4
1277 #define ADC_OPEN_A5 0x0020 //AN5
1278 #define ADC_OPEN_A6 0x0100 //AN8
1279 #define ADC_OPEN_A7 0x0200 //AN9
1280 #define ADC_OPEN_A8 0x0400 //AN10
1281 #define ADC_OPEN_A9 0x0800 //AN11
1282 #define ADC_OPEN_A10 0x1000 //AN12
1283 #define ADC_OPEN_A11 0x2000 //AN13
1290 #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)
1291 #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)
1292 #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)
1293 #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)
1294 #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)
1295 #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)
1296 #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)
1297 #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)
1298 #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)
1299 #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)
1300 #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)
1301 #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)
1302 #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)
1303 #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)
1305 #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)
1306 #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)
1307 #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)
1308 #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)
1309 #define UC_PORT_D6_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1310 #define UC_PORT_D7_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1311 #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)
1312 #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)
1313 #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)
1315 #define UC_PORT_F0_PROP (UCPORT_PROP_DIG_IN | UCPORT_PROP_DIG_OUT | UCPORT_PROP_OPEN_COL | UCPORT_PROP_PULLUP | UCPORT_PROP_PULLDOWN)
1316 #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)
1317 #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)
1318 #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)
1320 #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)
1321 #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)
1322 #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)
1323 #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)
1348 #define ENC100_SO_WR_B0SEL_EN_TRIS (TRISDbits.TRISD4)
1349 #define ENC100_SO_WR_B0SEL_EN_IO (LATDbits.LATD4)
1350 #define ENC100_SI_RD_RW_TRIS (TRISDbits.TRISD5)
1351 #define ENC100_SI_RD_RW_IO (LATDbits.LATD5)
1352 #define ENC100_SCK_AL_TRIS (TRISBbits.TRISB15)
1353 #define ENC100_SCK_AL_IO (LATBbits.LATB15)
1355 #if !defined(ENC100_INTERFACE_MODE)
1359 #define ENC100_INTERFACE_MODE 5
1363 #define ENC100_PSP_USE_INDIRECT_RAM_ADDRESSING
1373 #if (ENC100_INTERFACE_MODE == 1) || (ENC100_INTERFACE_MODE == 2) || (ENC100_INTERFACE_MODE == 5) || (ENC100_INTERFACE_MODE == 6) // 8-bit PSP
1376 #define ENC100_TRANSLATE_TO_PIN_ADDR(a) ((a)&0x01FF)
1377 #elif (ENC100_INTERFACE_MODE == 3) || (ENC100_INTERFACE_MODE == 4) // 16-bit PSP
1378 #define ENC100_TRANSLATE_TO_PIN_ADDR(a) (a)
1387 #define ENC100_BIT_BANG_PMP
1388 #if defined(ENC100_BIT_BANG_PMP)
1389 #if ENC100_INTERFACE_MODE == 5 || ENC100_INTERFACE_MODE == 6 // Mutliplexed 8-bit address/data modes
1390 #if defined(ENC100_PSP_USE_INDIRECT_RAM_ADDRESSING) // Only ENCX24J600 address pins AD0-AD8 connected (AD9-AD14 tied to Vdd)
1391 #define ENC100_INIT_PSP_BIT_BANG() do{AD1PCFGL |= 0x8000;} 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.
1395 #define ENC100_SET_AD_TRIS_IN() do{((volatile BYTE*)&TRISE)[0] = 0xFF; TRISFbits.TRISF5 = 1;}while(0)
1397 #define ENC100_SET_AD_TRIS_OUT() do{((volatile BYTE*)&TRISE)[0] = 0x00; TRISFbits.TRISF5 = 0;}while(0)
1398 #define ENC100_GET_AD_IO() (((volatile BYTE*)&PORTE)[0])
1399 #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)
1400 #define ENC100_SET_AD_IOL(data) (((volatile BYTE*)&LATE)[0] = (BYTE)(data))
1401 #else // All ENCX24J600 address pins AD0-AD14 connected
1444 #define SPI_FLASH_SECTOR_SIZE (4096ul)
1446 #define SPI_FLASH_PAGE_SIZE (256ul) // Winbond FLASH has 256 byte pages
1447 #define SPI_FLASH_SIZE (0x400000ul) // Flash is 4MByte
1456 #define SPIFLASH_CS_TRIS (TRISCbits.TRISC13)
1457 #define SPIFLASH_CS_IO (LATCbits.LATC13)
1460 #define EEPROM_CS_TRIS (TRISCbits.TRISC15)
1461 #define EEPROM_CS_IO (LATCbits.LATC15)
1464 #define SPIFLASH_SPI_IF (IFS2bits.SPI2IF)
1465 #define SPIFLASH_SSPBUF (SPI2BUF)
1469 #define SPIFLASH_SPISTAT (SPI2STAT)
1470 #define SPIFLASH_SPISTATbits (SPI2STATbits)
1473 #define EEPROM_SPI_IF (IFS2bits.SPI2IF)
1474 #define EEPROM_SSPBUF (SPI2BUF)
1478 #define EEPROM_SPISTAT (SPI2STAT)
1479 #define EEPROM_SPISTATbits (SPI2STATbits)
1486 #define SPIMEM_SPI_IF (IFS2bits.SPI2IF)
1487 #define SPIMEM_SSPBUF (SPI2BUF)
1488 #define SPIMEM_SPICON1 (SPI2CON1)
1489 #define SPIMEM_SPICON1bits (SPI2CON1bits)
1490 #define SPIMEM_SPICON2 (SPI2CON2)
1491 #define SPIMEM_SPISTAT (SPI2STAT)
1492 #define SPIMEM_SPISTATbits (SPI2STATbits)
1495 #define PIN_SPIMEM_SDO _RB14
1496 #define LAT_SPIMEM_SDO _LATB14
1497 #define DIR_SPIMEM_SDO _TRISB14
1500 #define PPS_OUT_SPIMEM_SDO OUT_PIN_PPS_RP14
1502 #define PIN_SPIMEM_SCK _RD11
1503 #define LAT_SPIMEM_SCK _LATD11
1504 #define DIR_SPIMEM_SCK _TRISD11
1507 #define PPS_OUT_SPIMEM_SCK OUT_PIN_PPS_RP12
1509 #define PIN_SPIMEM_SDI _RC14
1510 #define LAT_SPIMEM_SDI _LATC14
1511 #define DIR_SPIMEM_SDI _TRISC14
1514 #define PPS_IN_SPIMEM_SDI IN_PIN_PPS_RPI37
1527 #define self_power 1
1531 #define USB_BUS_SENSE U1OTGSTATbits.SESVD
1538 #define XEEPROM_SIZE (8192) //Default EEPROM is 25LC640 = 64kBits = 8kBytes)
1539 #define XEEPROM_PAGE_SIZE (32)
1552 #define GET_UCPORT_PROP_OFFSET(ucPort) (offsetof(CFG_STRUCT, ucPortProp) + ((offsetof(TABLE_BLOCK_UC66_PORT, ucPort)/sizeof(UCPORT_PROP)) * sizeof(UCPORT_PROP)) )
1564 #define GET_UCPORT_CONFIG_OFFSET(ucPortVal) (offsetof(CFG_STRUCT, ucPort) + ((offsetof(CFG_BLOCK_UC66_PORT, ucPortVal)/sizeof(UCPORT_CONFIG)) * sizeof(UCPORT_CONFIG)) )
1566 #endif //#if defined(BRD_SBC66ECL_R2)