Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f96j65.h
blob965a240d4898f618d80545da92063f59395d118f
1 /*
2 * This declarations of the PIC18F96J65 MCU.
4 * This file is part of the GNU PIC library for SDCC, originally
5 * created by Molnar Karoly <molnarkaroly@users.sf.net> 2016.
7 * This file is generated automatically by the cinc2h.pl, 2016-04-13 17:23:40 UTC.
9 * SDCC is licensed under the GNU Public license (GPL) v2. Note that
10 * this license covers the code to the compiler and other executables,
11 * but explicitly does not cover any code or objects generated by sdcc.
13 * For pic device libraries and header files which are derived from
14 * Microchip header (.inc) and linker script (.lkr) files Microchip
15 * requires that "The header files should state that they are only to be
16 * used with authentic Microchip devices" which makes them incompatible
17 * with the GPL. Pic device libraries and header files are located at
18 * non-free/lib and non-free/include directories respectively.
19 * Sdcc should be run with the --use-non-free command line option in
20 * order to include non-free header files and libraries.
22 * See http://sdcc.sourceforge.net/ for the latest information on sdcc.
25 #ifndef __PIC18F96J65_H__
26 #define __PIC18F96J65_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
36 extern __at(0x0E80) __sfr MAADR5;
37 extern __at(0x0E81) __sfr MAADR6;
38 extern __at(0x0E82) __sfr MAADR3;
39 extern __at(0x0E83) __sfr MAADR4;
40 extern __at(0x0E84) __sfr MAADR1;
41 extern __at(0x0E85) __sfr MAADR2;
43 //==============================================================================
44 // MISTAT Bits
46 extern __at(0x0E8A) __sfr MISTAT;
48 typedef struct
50 unsigned BUSY : 1;
51 unsigned SCAN : 1;
52 unsigned NVALID : 1;
53 unsigned : 1;
54 unsigned : 1;
55 unsigned : 1;
56 unsigned : 1;
57 unsigned : 1;
58 } __MISTATbits_t;
60 extern __at(0x0E8A) volatile __MISTATbits_t MISTATbits;
62 #define _BUSY 0x01
63 #define _SCAN 0x02
64 #define _NVALID 0x04
66 //==============================================================================
69 //==============================================================================
70 // EFLOCON Bits
72 extern __at(0x0E97) __sfr EFLOCON;
74 typedef union
76 struct
78 unsigned FCEN0 : 1;
79 unsigned FCEN1 : 1;
80 unsigned FULDPXS : 1;
81 unsigned : 1;
82 unsigned : 1;
83 unsigned : 1;
84 unsigned : 1;
85 unsigned : 1;
88 struct
90 unsigned FCEN : 2;
91 unsigned : 6;
93 } __EFLOCONbits_t;
95 extern __at(0x0E97) volatile __EFLOCONbits_t EFLOCONbits;
97 #define _FCEN0 0x01
98 #define _FCEN1 0x02
99 #define _FULDPXS 0x04
101 //==============================================================================
103 extern __at(0x0E98) __sfr EPAUS;
104 extern __at(0x0E98) __sfr EPAUSL;
105 extern __at(0x0E99) __sfr EPAUSH;
107 //==============================================================================
108 // MACON1 Bits
110 extern __at(0x0EA0) __sfr MACON1;
112 typedef struct
114 unsigned MARXEN : 1;
115 unsigned PASSALL : 1;
116 unsigned RXPAUS : 1;
117 unsigned TXPAUS : 1;
118 unsigned : 1;
119 unsigned : 1;
120 unsigned : 1;
121 unsigned : 1;
122 } __MACON1bits_t;
124 extern __at(0x0EA0) volatile __MACON1bits_t MACON1bits;
126 #define _MARXEN 0x01
127 #define _PASSALL 0x02
128 #define _RXPAUS 0x04
129 #define _TXPAUS 0x08
131 //==============================================================================
134 //==============================================================================
135 // MACON3 Bits
137 extern __at(0x0EA2) __sfr MACON3;
139 typedef union
141 struct
143 unsigned FULDPX : 1;
144 unsigned FRMLNEN : 1;
145 unsigned HFRMEN : 1;
146 unsigned PHDREN : 1;
147 unsigned TXCRCEN : 1;
148 unsigned PADCFG0 : 1;
149 unsigned PADCFG1 : 1;
150 unsigned PADCFG2 : 1;
153 struct
155 unsigned : 5;
156 unsigned PADCFG : 3;
158 } __MACON3bits_t;
160 extern __at(0x0EA2) volatile __MACON3bits_t MACON3bits;
162 #define _FULDPX 0x01
163 #define _FRMLNEN 0x02
164 #define _HFRMEN 0x04
165 #define _PHDREN 0x08
166 #define _TXCRCEN 0x10
167 #define _PADCFG0 0x20
168 #define _PADCFG1 0x40
169 #define _PADCFG2 0x80
171 //==============================================================================
174 //==============================================================================
175 // MACON4 Bits
177 extern __at(0x0EA3) __sfr MACON4;
179 typedef struct
181 unsigned : 1;
182 unsigned : 1;
183 unsigned : 1;
184 unsigned : 1;
185 unsigned : 1;
186 unsigned : 1;
187 unsigned DEFER : 1;
188 unsigned : 1;
189 } __MACON4bits_t;
191 extern __at(0x0EA3) volatile __MACON4bits_t MACON4bits;
193 #define _DEFER 0x40
195 //==============================================================================
198 //==============================================================================
199 // MABBIPG Bits
201 extern __at(0x0EA4) __sfr MABBIPG;
203 typedef union
205 struct
207 unsigned BBIPG0 : 1;
208 unsigned BBIPG1 : 1;
209 unsigned BBIPG2 : 1;
210 unsigned BBIPG3 : 1;
211 unsigned BBIPG4 : 1;
212 unsigned BBIPG5 : 1;
213 unsigned BBIPG6 : 1;
214 unsigned : 1;
217 struct
219 unsigned BBIPG : 7;
220 unsigned : 1;
222 } __MABBIPGbits_t;
224 extern __at(0x0EA4) volatile __MABBIPGbits_t MABBIPGbits;
226 #define _BBIPG0 0x01
227 #define _BBIPG1 0x02
228 #define _BBIPG2 0x04
229 #define _BBIPG3 0x08
230 #define _BBIPG4 0x10
231 #define _BBIPG5 0x20
232 #define _BBIPG6 0x40
234 //==============================================================================
236 extern __at(0x0EA6) __sfr MAIPG;
237 extern __at(0x0EA6) __sfr MAIPGL;
238 extern __at(0x0EA7) __sfr MAIPGH;
239 extern __at(0x0EAA) __sfr MAMXFL;
240 extern __at(0x0EAA) __sfr MAMXFLL;
241 extern __at(0x0EAB) __sfr MAMXFLH;
243 //==============================================================================
244 // MICMD Bits
246 extern __at(0x0EB2) __sfr MICMD;
248 typedef struct
250 unsigned MIIRD : 1;
251 unsigned MIISCAN : 1;
252 unsigned : 1;
253 unsigned : 1;
254 unsigned : 1;
255 unsigned : 1;
256 unsigned : 1;
257 unsigned : 1;
258 } __MICMDbits_t;
260 extern __at(0x0EB2) volatile __MICMDbits_t MICMDbits;
262 #define _MIIRD 0x01
263 #define _MIISCAN 0x02
265 //==============================================================================
267 extern __at(0x0EB4) __sfr MIREGADR;
268 extern __at(0x0EB6) __sfr MIWR;
269 extern __at(0x0EB6) __sfr MIWRL;
270 extern __at(0x0EB7) __sfr MIWRH;
271 extern __at(0x0EB8) __sfr MIRD;
272 extern __at(0x0EB8) __sfr MIRDL;
273 extern __at(0x0EB9) __sfr MIRDH;
274 extern __at(0x0EC0) __sfr EHT0;
275 extern __at(0x0EC1) __sfr EHT1;
276 extern __at(0x0EC2) __sfr EHT2;
277 extern __at(0x0EC3) __sfr EHT3;
278 extern __at(0x0EC4) __sfr EHT4;
279 extern __at(0x0EC5) __sfr EHT5;
280 extern __at(0x0EC6) __sfr EHT6;
281 extern __at(0x0EC7) __sfr EHT7;
282 extern __at(0x0EC8) __sfr EPMM0;
283 extern __at(0x0EC9) __sfr EPMM1;
284 extern __at(0x0ECA) __sfr EPMM2;
285 extern __at(0x0ECB) __sfr EPMM3;
286 extern __at(0x0ECC) __sfr EPMM4;
287 extern __at(0x0ECD) __sfr EPMM5;
288 extern __at(0x0ECE) __sfr EPMM6;
289 extern __at(0x0ECF) __sfr EPMM7;
290 extern __at(0x0ED0) __sfr EPMCS;
291 extern __at(0x0ED0) __sfr EPMCSL;
292 extern __at(0x0ED1) __sfr EPMCSH;
293 extern __at(0x0ED4) __sfr EPMO;
294 extern __at(0x0ED4) __sfr EPMOL;
295 extern __at(0x0ED5) __sfr EPMOH;
297 //==============================================================================
298 // ERXFCON Bits
300 extern __at(0x0ED8) __sfr ERXFCON;
302 typedef struct
304 unsigned BCEN : 1;
305 unsigned MCEN : 1;
306 unsigned HTEN : 1;
307 unsigned MPEN : 1;
308 unsigned PMEN : 1;
309 unsigned CRCEN : 1;
310 unsigned ANDOR : 1;
311 unsigned UCEN : 1;
312 } __ERXFCONbits_t;
314 extern __at(0x0ED8) volatile __ERXFCONbits_t ERXFCONbits;
316 #define _BCEN 0x01
317 #define _MCEN 0x02
318 #define _HTEN 0x04
319 #define _MPEN 0x08
320 #define _PMEN 0x10
321 #define _CRCEN 0x20
322 #define _ANDOR 0x40
323 #define _UCEN 0x80
325 //==============================================================================
327 extern __at(0x0ED9) __sfr EPKTCNT;
328 extern __at(0x0EE2) __sfr EWRPT;
329 extern __at(0x0EE2) __sfr EWRPTL;
330 extern __at(0x0EE3) __sfr EWRPTH;
331 extern __at(0x0EE4) __sfr ETXST;
332 extern __at(0x0EE4) __sfr ETXSTL;
333 extern __at(0x0EE5) __sfr ETXSTH;
334 extern __at(0x0EE6) __sfr ETXND;
335 extern __at(0x0EE6) __sfr ETXNDL;
336 extern __at(0x0EE7) __sfr ETXNDH;
337 extern __at(0x0EE8) __sfr ERXST;
338 extern __at(0x0EE8) __sfr ERXSTL;
339 extern __at(0x0EE9) __sfr ERXSTH;
340 extern __at(0x0EEA) __sfr ERXND;
341 extern __at(0x0EEA) __sfr ERXNDL;
342 extern __at(0x0EEB) __sfr ERXNDH;
343 extern __at(0x0EEC) __sfr ERXRDPT;
344 extern __at(0x0EEC) __sfr ERXRDPTL;
345 extern __at(0x0EED) __sfr ERXRDPTH;
346 extern __at(0x0EEE) __sfr ERXWRPT;
347 extern __at(0x0EEE) __sfr ERXWRPTL;
348 extern __at(0x0EEF) __sfr ERXWRPTH;
349 extern __at(0x0EF0) __sfr EDMAST;
350 extern __at(0x0EF0) __sfr EDMASTL;
351 extern __at(0x0EF1) __sfr EDMASTH;
352 extern __at(0x0EF2) __sfr EDMAND;
353 extern __at(0x0EF2) __sfr EDMANDL;
354 extern __at(0x0EF3) __sfr EDMANDH;
355 extern __at(0x0EF4) __sfr EDMADST;
356 extern __at(0x0EF4) __sfr EDMADSTL;
357 extern __at(0x0EF5) __sfr EDMADSTH;
358 extern __at(0x0EF6) __sfr EDMACS;
359 extern __at(0x0EF6) __sfr EDMACSL;
360 extern __at(0x0EF7) __sfr EDMACSH;
362 //==============================================================================
363 // EIE Bits
365 extern __at(0x0EFB) __sfr EIE;
367 typedef union
369 struct
371 unsigned RXERIE : 1;
372 unsigned TXERIE : 1;
373 unsigned : 1;
374 unsigned TXIE : 1;
375 unsigned LINKIE : 1;
376 unsigned DMAIE : 1;
377 unsigned PKTIE : 1;
378 unsigned : 1;
381 struct
383 unsigned : 1;
384 unsigned : 1;
385 unsigned : 1;
386 unsigned ETXIE : 1;
387 unsigned : 1;
388 unsigned : 1;
389 unsigned : 1;
390 unsigned : 1;
392 } __EIEbits_t;
394 extern __at(0x0EFB) volatile __EIEbits_t EIEbits;
396 #define _RXERIE 0x01
397 #define _TXERIE 0x02
398 #define _TXIE 0x08
399 #define _ETXIE 0x08
400 #define _LINKIE 0x10
401 #define _DMAIE 0x20
402 #define _PKTIE 0x40
404 //==============================================================================
407 //==============================================================================
408 // ESTAT Bits
410 extern __at(0x0EFD) __sfr ESTAT;
412 typedef struct
414 unsigned PHYRDY : 1;
415 unsigned TXABRT : 1;
416 unsigned RXBUSY : 1;
417 unsigned : 1;
418 unsigned : 1;
419 unsigned : 1;
420 unsigned BUFER : 1;
421 unsigned : 1;
422 } __ESTATbits_t;
424 extern __at(0x0EFD) volatile __ESTATbits_t ESTATbits;
426 #define _PHYRDY 0x01
427 #define _TXABRT 0x02
428 #define _RXBUSY 0x04
429 #define _BUFER 0x40
431 //==============================================================================
434 //==============================================================================
435 // ECON2 Bits
437 extern __at(0x0EFE) __sfr ECON2;
439 typedef struct
441 unsigned : 1;
442 unsigned : 1;
443 unsigned : 1;
444 unsigned : 1;
445 unsigned : 1;
446 unsigned ETHEN : 1;
447 unsigned PKTDEC : 1;
448 unsigned AUTOINC : 1;
449 } __ECON2bits_t;
451 extern __at(0x0EFE) volatile __ECON2bits_t ECON2bits;
453 #define _ETHEN 0x20
454 #define _PKTDEC 0x40
455 #define _AUTOINC 0x80
457 //==============================================================================
460 //==============================================================================
461 // EIR Bits
463 extern __at(0x0F60) __sfr EIR;
465 typedef struct
467 unsigned RXERIF : 1;
468 unsigned TXERIF : 1;
469 unsigned : 1;
470 unsigned TXIF : 1;
471 unsigned LINKIF : 1;
472 unsigned DMAIF : 1;
473 unsigned PKTIF : 1;
474 unsigned : 1;
475 } __EIRbits_t;
477 extern __at(0x0F60) volatile __EIRbits_t EIRbits;
479 #define _RXERIF 0x01
480 #define _TXERIF 0x02
481 #define _TXIF 0x08
482 #define _LINKIF 0x10
483 #define _DMAIF 0x20
484 #define _PKTIF 0x40
486 //==============================================================================
489 //==============================================================================
490 // EDATA Bits
492 extern __at(0x0F61) __sfr EDATA;
494 typedef struct
496 unsigned EDATA0 : 1;
497 unsigned EDATA1 : 1;
498 unsigned EDATA2 : 1;
499 unsigned EDATA3 : 1;
500 unsigned EDATA4 : 1;
501 unsigned EDATA5 : 1;
502 unsigned EDATA6 : 1;
503 unsigned EDATA7 : 1;
504 } __EDATAbits_t;
506 extern __at(0x0F61) volatile __EDATAbits_t EDATAbits;
508 #define _EDATA0 0x01
509 #define _EDATA1 0x02
510 #define _EDATA2 0x04
511 #define _EDATA3 0x08
512 #define _EDATA4 0x10
513 #define _EDATA5 0x20
514 #define _EDATA6 0x40
515 #define _EDATA7 0x80
517 //==============================================================================
520 //==============================================================================
521 // SSP2CON2 Bits
523 extern __at(0x0F62) __sfr SSP2CON2;
525 typedef union
527 struct
529 unsigned SEN : 1;
530 unsigned RSEN : 1;
531 unsigned PEN : 1;
532 unsigned RCEN : 1;
533 unsigned ACKEN : 1;
534 unsigned ACKDT : 1;
535 unsigned ACKSTAT : 1;
536 unsigned GCEN : 1;
539 struct
541 unsigned SEN2 : 1;
542 unsigned ADMSK1 : 1;
543 unsigned ADMSK2 : 1;
544 unsigned ADMSK3 : 1;
545 unsigned ADMSK4 : 1;
546 unsigned ADMSK5 : 1;
547 unsigned ACKSTAT2 : 1;
548 unsigned GCEN2 : 1;
551 struct
553 unsigned : 1;
554 unsigned RSEN2 : 1;
555 unsigned PEN2 : 1;
556 unsigned RCEN2 : 1;
557 unsigned ACKEN2 : 1;
558 unsigned ACKDT2 : 1;
559 unsigned : 1;
560 unsigned : 1;
563 struct
565 unsigned : 1;
566 unsigned ADMSK12 : 1;
567 unsigned ADMSK22 : 1;
568 unsigned ADMSK32 : 1;
569 unsigned ADMSK42 : 1;
570 unsigned ADMSK52 : 1;
571 unsigned : 1;
572 unsigned : 1;
574 } __SSP2CON2bits_t;
576 extern __at(0x0F62) volatile __SSP2CON2bits_t SSP2CON2bits;
578 #define _SSP2CON2_SEN 0x01
579 #define _SSP2CON2_SEN2 0x01
580 #define _SSP2CON2_RSEN 0x02
581 #define _SSP2CON2_ADMSK1 0x02
582 #define _SSP2CON2_RSEN2 0x02
583 #define _SSP2CON2_ADMSK12 0x02
584 #define _SSP2CON2_PEN 0x04
585 #define _SSP2CON2_ADMSK2 0x04
586 #define _SSP2CON2_PEN2 0x04
587 #define _SSP2CON2_ADMSK22 0x04
588 #define _SSP2CON2_RCEN 0x08
589 #define _SSP2CON2_ADMSK3 0x08
590 #define _SSP2CON2_RCEN2 0x08
591 #define _SSP2CON2_ADMSK32 0x08
592 #define _SSP2CON2_ACKEN 0x10
593 #define _SSP2CON2_ADMSK4 0x10
594 #define _SSP2CON2_ACKEN2 0x10
595 #define _SSP2CON2_ADMSK42 0x10
596 #define _SSP2CON2_ACKDT 0x20
597 #define _SSP2CON2_ADMSK5 0x20
598 #define _SSP2CON2_ACKDT2 0x20
599 #define _SSP2CON2_ADMSK52 0x20
600 #define _SSP2CON2_ACKSTAT 0x40
601 #define _SSP2CON2_ACKSTAT2 0x40
602 #define _SSP2CON2_GCEN 0x80
603 #define _SSP2CON2_GCEN2 0x80
605 //==============================================================================
608 //==============================================================================
609 // SSP2CON1 Bits
611 extern __at(0x0F63) __sfr SSP2CON1;
613 typedef union
615 struct
617 unsigned SSPM0 : 1;
618 unsigned SSPM1 : 1;
619 unsigned SSPM2 : 1;
620 unsigned SSPM3 : 1;
621 unsigned CKP : 1;
622 unsigned SSPEN : 1;
623 unsigned SSPOV : 1;
624 unsigned WCOL : 1;
627 struct
629 unsigned SSPM02 : 1;
630 unsigned SSPM12 : 1;
631 unsigned SSPM22 : 1;
632 unsigned SSPM32 : 1;
633 unsigned CKP2 : 1;
634 unsigned SSPEN2 : 1;
635 unsigned SSPOV2 : 1;
636 unsigned WCOL2 : 1;
638 } __SSP2CON1bits_t;
640 extern __at(0x0F63) volatile __SSP2CON1bits_t SSP2CON1bits;
642 #define _SSP2CON1_SSPM0 0x01
643 #define _SSP2CON1_SSPM02 0x01
644 #define _SSP2CON1_SSPM1 0x02
645 #define _SSP2CON1_SSPM12 0x02
646 #define _SSP2CON1_SSPM2 0x04
647 #define _SSP2CON1_SSPM22 0x04
648 #define _SSP2CON1_SSPM3 0x08
649 #define _SSP2CON1_SSPM32 0x08
650 #define _SSP2CON1_CKP 0x10
651 #define _SSP2CON1_CKP2 0x10
652 #define _SSP2CON1_SSPEN 0x20
653 #define _SSP2CON1_SSPEN2 0x20
654 #define _SSP2CON1_SSPOV 0x40
655 #define _SSP2CON1_SSPOV2 0x40
656 #define _SSP2CON1_WCOL 0x80
657 #define _SSP2CON1_WCOL2 0x80
659 //==============================================================================
662 //==============================================================================
663 // SSP2STAT Bits
665 extern __at(0x0F64) __sfr SSP2STAT;
667 typedef union
669 struct
671 unsigned BF : 1;
672 unsigned UA : 1;
673 unsigned R_NOT_W : 1;
674 unsigned S : 1;
675 unsigned P : 1;
676 unsigned D_NOT_A : 1;
677 unsigned CKE : 1;
678 unsigned SMP : 1;
681 struct
683 unsigned BF2 : 1;
684 unsigned UA2 : 1;
685 unsigned R_W : 1;
686 unsigned I2C_START : 1;
687 unsigned I2C_STOP : 1;
688 unsigned D_A : 1;
689 unsigned CKE2 : 1;
690 unsigned SMP2 : 1;
693 struct
695 unsigned : 1;
696 unsigned : 1;
697 unsigned I2C_READ : 1;
698 unsigned START2 : 1;
699 unsigned STOP2 : 1;
700 unsigned I2C_DAT : 1;
701 unsigned : 1;
702 unsigned : 1;
705 struct
707 unsigned : 1;
708 unsigned : 1;
709 unsigned NOT_W : 1;
710 unsigned : 1;
711 unsigned : 1;
712 unsigned NOT_A : 1;
713 unsigned : 1;
714 unsigned : 1;
717 struct
719 unsigned : 1;
720 unsigned : 1;
721 unsigned NOT_WRITE : 1;
722 unsigned : 1;
723 unsigned : 1;
724 unsigned NOT_ADDRESS : 1;
725 unsigned : 1;
726 unsigned : 1;
729 struct
731 unsigned : 1;
732 unsigned : 1;
733 unsigned READ_WRITE : 1;
734 unsigned : 1;
735 unsigned : 1;
736 unsigned DATA_ADDRESS : 1;
737 unsigned : 1;
738 unsigned : 1;
741 struct
743 unsigned : 1;
744 unsigned : 1;
745 unsigned R : 1;
746 unsigned : 1;
747 unsigned : 1;
748 unsigned D : 1;
749 unsigned : 1;
750 unsigned : 1;
753 struct
755 unsigned : 1;
756 unsigned : 1;
757 unsigned RW2 : 1;
758 unsigned : 1;
759 unsigned : 1;
760 unsigned DA2 : 1;
761 unsigned : 1;
762 unsigned : 1;
764 } __SSP2STATbits_t;
766 extern __at(0x0F64) volatile __SSP2STATbits_t SSP2STATbits;
768 #define _SSP2STAT_BF 0x01
769 #define _SSP2STAT_BF2 0x01
770 #define _SSP2STAT_UA 0x02
771 #define _SSP2STAT_UA2 0x02
772 #define _SSP2STAT_R_NOT_W 0x04
773 #define _SSP2STAT_R_W 0x04
774 #define _SSP2STAT_I2C_READ 0x04
775 #define _SSP2STAT_NOT_W 0x04
776 #define _SSP2STAT_NOT_WRITE 0x04
777 #define _SSP2STAT_READ_WRITE 0x04
778 #define _SSP2STAT_R 0x04
779 #define _SSP2STAT_RW2 0x04
780 #define _SSP2STAT_S 0x08
781 #define _SSP2STAT_I2C_START 0x08
782 #define _SSP2STAT_START2 0x08
783 #define _SSP2STAT_P 0x10
784 #define _SSP2STAT_I2C_STOP 0x10
785 #define _SSP2STAT_STOP2 0x10
786 #define _SSP2STAT_D_NOT_A 0x20
787 #define _SSP2STAT_D_A 0x20
788 #define _SSP2STAT_I2C_DAT 0x20
789 #define _SSP2STAT_NOT_A 0x20
790 #define _SSP2STAT_NOT_ADDRESS 0x20
791 #define _SSP2STAT_DATA_ADDRESS 0x20
792 #define _SSP2STAT_D 0x20
793 #define _SSP2STAT_DA2 0x20
794 #define _SSP2STAT_CKE 0x40
795 #define _SSP2STAT_CKE2 0x40
796 #define _SSP2STAT_SMP 0x80
797 #define _SSP2STAT_SMP2 0x80
799 //==============================================================================
801 extern __at(0x0F65) __sfr SSP2ADD;
802 extern __at(0x0F66) __sfr SSP2BUF;
804 //==============================================================================
805 // ECCP2DEL Bits
807 extern __at(0x0F67) __sfr ECCP2DEL;
809 typedef union
811 struct
813 unsigned PDC0 : 1;
814 unsigned PDC1 : 1;
815 unsigned PDC2 : 1;
816 unsigned PDC3 : 1;
817 unsigned PDC4 : 1;
818 unsigned PDC5 : 1;
819 unsigned PDC6 : 1;
820 unsigned PRSEN : 1;
823 struct
825 unsigned P2DC0 : 1;
826 unsigned P2DC1 : 1;
827 unsigned P2DC2 : 1;
828 unsigned P2DC3 : 1;
829 unsigned P2DC4 : 1;
830 unsigned P2DC5 : 1;
831 unsigned P2DC6 : 1;
832 unsigned P2RSEN : 1;
835 struct
837 unsigned P2DC : 7;
838 unsigned : 1;
841 struct
843 unsigned PDC : 7;
844 unsigned : 1;
846 } __ECCP2DELbits_t;
848 extern __at(0x0F67) volatile __ECCP2DELbits_t ECCP2DELbits;
850 #define _ECCP2DEL_PDC0 0x01
851 #define _ECCP2DEL_P2DC0 0x01
852 #define _ECCP2DEL_PDC1 0x02
853 #define _ECCP2DEL_P2DC1 0x02
854 #define _ECCP2DEL_PDC2 0x04
855 #define _ECCP2DEL_P2DC2 0x04
856 #define _ECCP2DEL_PDC3 0x08
857 #define _ECCP2DEL_P2DC3 0x08
858 #define _ECCP2DEL_PDC4 0x10
859 #define _ECCP2DEL_P2DC4 0x10
860 #define _ECCP2DEL_PDC5 0x20
861 #define _ECCP2DEL_P2DC5 0x20
862 #define _ECCP2DEL_PDC6 0x40
863 #define _ECCP2DEL_P2DC6 0x40
864 #define _ECCP2DEL_PRSEN 0x80
865 #define _ECCP2DEL_P2RSEN 0x80
867 //==============================================================================
870 //==============================================================================
871 // ECCP2AS Bits
873 extern __at(0x0F68) __sfr ECCP2AS;
875 typedef union
877 struct
879 unsigned PSSBD0 : 1;
880 unsigned PSSBD1 : 1;
881 unsigned PSSAC0 : 1;
882 unsigned PSSAC1 : 1;
883 unsigned ECCPAS0 : 1;
884 unsigned ECCPAS1 : 1;
885 unsigned ECCPAS2 : 1;
886 unsigned ECCPASE : 1;
889 struct
891 unsigned PSS2BD0 : 1;
892 unsigned PSS2BD1 : 1;
893 unsigned PSS2AC0 : 1;
894 unsigned PSS2AC1 : 1;
895 unsigned ECCP2AS0 : 1;
896 unsigned ECCP2AS1 : 1;
897 unsigned ECCP2AS2 : 1;
898 unsigned ECCP2ASE : 1;
901 struct
903 unsigned PSSBD : 2;
904 unsigned : 6;
907 struct
909 unsigned PSS2BD : 2;
910 unsigned : 6;
913 struct
915 unsigned : 2;
916 unsigned PSSAC : 2;
917 unsigned : 4;
920 struct
922 unsigned : 2;
923 unsigned PSS2AC : 2;
924 unsigned : 4;
927 struct
929 unsigned : 4;
930 unsigned ECCP2AS : 3;
931 unsigned : 1;
934 struct
936 unsigned : 4;
937 unsigned ECCPAS : 3;
938 unsigned : 1;
940 } __ECCP2ASbits_t;
942 extern __at(0x0F68) volatile __ECCP2ASbits_t ECCP2ASbits;
944 #define _ECCP2AS_PSSBD0 0x01
945 #define _ECCP2AS_PSS2BD0 0x01
946 #define _ECCP2AS_PSSBD1 0x02
947 #define _ECCP2AS_PSS2BD1 0x02
948 #define _ECCP2AS_PSSAC0 0x04
949 #define _ECCP2AS_PSS2AC0 0x04
950 #define _ECCP2AS_PSSAC1 0x08
951 #define _ECCP2AS_PSS2AC1 0x08
952 #define _ECCP2AS_ECCPAS0 0x10
953 #define _ECCP2AS_ECCP2AS0 0x10
954 #define _ECCP2AS_ECCPAS1 0x20
955 #define _ECCP2AS_ECCP2AS1 0x20
956 #define _ECCP2AS_ECCPAS2 0x40
957 #define _ECCP2AS_ECCP2AS2 0x40
958 #define _ECCP2AS_ECCPASE 0x80
959 #define _ECCP2AS_ECCP2ASE 0x80
961 //==============================================================================
964 //==============================================================================
965 // ECCP3DEL Bits
967 extern __at(0x0F69) __sfr ECCP3DEL;
969 typedef union
971 struct
973 unsigned PDC0 : 1;
974 unsigned PDC1 : 1;
975 unsigned PDC2 : 1;
976 unsigned PDC3 : 1;
977 unsigned PDC4 : 1;
978 unsigned PDC5 : 1;
979 unsigned PDC6 : 1;
980 unsigned PRSEN : 1;
983 struct
985 unsigned P3DC0 : 1;
986 unsigned P3DC1 : 1;
987 unsigned P3DC2 : 1;
988 unsigned P3DC3 : 1;
989 unsigned P3DC4 : 1;
990 unsigned P3DC5 : 1;
991 unsigned P3DC6 : 1;
992 unsigned P3RSEN : 1;
995 struct
997 unsigned P3DC : 7;
998 unsigned : 1;
1001 struct
1003 unsigned PDC : 7;
1004 unsigned : 1;
1006 } __ECCP3DELbits_t;
1008 extern __at(0x0F69) volatile __ECCP3DELbits_t ECCP3DELbits;
1010 #define _ECCP3DEL_PDC0 0x01
1011 #define _ECCP3DEL_P3DC0 0x01
1012 #define _ECCP3DEL_PDC1 0x02
1013 #define _ECCP3DEL_P3DC1 0x02
1014 #define _ECCP3DEL_PDC2 0x04
1015 #define _ECCP3DEL_P3DC2 0x04
1016 #define _ECCP3DEL_PDC3 0x08
1017 #define _ECCP3DEL_P3DC3 0x08
1018 #define _ECCP3DEL_PDC4 0x10
1019 #define _ECCP3DEL_P3DC4 0x10
1020 #define _ECCP3DEL_PDC5 0x20
1021 #define _ECCP3DEL_P3DC5 0x20
1022 #define _ECCP3DEL_PDC6 0x40
1023 #define _ECCP3DEL_P3DC6 0x40
1024 #define _ECCP3DEL_PRSEN 0x80
1025 #define _ECCP3DEL_P3RSEN 0x80
1027 //==============================================================================
1030 //==============================================================================
1031 // ECCP3AS Bits
1033 extern __at(0x0F6A) __sfr ECCP3AS;
1035 typedef union
1037 struct
1039 unsigned PSSBD0 : 1;
1040 unsigned PSSBD1 : 1;
1041 unsigned PSSAC0 : 1;
1042 unsigned PSSAC1 : 1;
1043 unsigned ECCPAS0 : 1;
1044 unsigned ECCPAS1 : 1;
1045 unsigned ECCPAS2 : 1;
1046 unsigned ECCPASE : 1;
1049 struct
1051 unsigned PSS3BD0 : 1;
1052 unsigned PSS3BD1 : 1;
1053 unsigned PSS3AC0 : 1;
1054 unsigned PSS3AC1 : 1;
1055 unsigned ECCP3AS0 : 1;
1056 unsigned ECCP3AS1 : 1;
1057 unsigned ECCP3AS2 : 1;
1058 unsigned ECCP3ASE : 1;
1061 struct
1063 unsigned PSSBD : 2;
1064 unsigned : 6;
1067 struct
1069 unsigned PSS3BD : 2;
1070 unsigned : 6;
1073 struct
1075 unsigned : 2;
1076 unsigned PSS3AC : 2;
1077 unsigned : 4;
1080 struct
1082 unsigned : 2;
1083 unsigned PSSAC : 2;
1084 unsigned : 4;
1087 struct
1089 unsigned : 4;
1090 unsigned ECCPAS : 3;
1091 unsigned : 1;
1094 struct
1096 unsigned : 4;
1097 unsigned ECCP3AS : 3;
1098 unsigned : 1;
1100 } __ECCP3ASbits_t;
1102 extern __at(0x0F6A) volatile __ECCP3ASbits_t ECCP3ASbits;
1104 #define _ECCP3AS_PSSBD0 0x01
1105 #define _ECCP3AS_PSS3BD0 0x01
1106 #define _ECCP3AS_PSSBD1 0x02
1107 #define _ECCP3AS_PSS3BD1 0x02
1108 #define _ECCP3AS_PSSAC0 0x04
1109 #define _ECCP3AS_PSS3AC0 0x04
1110 #define _ECCP3AS_PSSAC1 0x08
1111 #define _ECCP3AS_PSS3AC1 0x08
1112 #define _ECCP3AS_ECCPAS0 0x10
1113 #define _ECCP3AS_ECCP3AS0 0x10
1114 #define _ECCP3AS_ECCPAS1 0x20
1115 #define _ECCP3AS_ECCP3AS1 0x20
1116 #define _ECCP3AS_ECCPAS2 0x40
1117 #define _ECCP3AS_ECCP3AS2 0x40
1118 #define _ECCP3AS_ECCPASE 0x80
1119 #define _ECCP3AS_ECCP3ASE 0x80
1121 //==============================================================================
1124 //==============================================================================
1125 // RCSTA2 Bits
1127 extern __at(0x0F6B) __sfr RCSTA2;
1129 typedef union
1131 struct
1133 unsigned RX9D : 1;
1134 unsigned OERR : 1;
1135 unsigned FERR : 1;
1136 unsigned ADDEN : 1;
1137 unsigned CREN : 1;
1138 unsigned SREN : 1;
1139 unsigned RX9 : 1;
1140 unsigned SPEN : 1;
1143 struct
1145 unsigned RCD8 : 1;
1146 unsigned OERR2 : 1;
1147 unsigned FERR2 : 1;
1148 unsigned ADDEN2 : 1;
1149 unsigned CREN2 : 1;
1150 unsigned SREN2 : 1;
1151 unsigned RC9 : 1;
1152 unsigned SPEN2 : 1;
1155 struct
1157 unsigned RX9D2 : 1;
1158 unsigned : 1;
1159 unsigned : 1;
1160 unsigned : 1;
1161 unsigned : 1;
1162 unsigned : 1;
1163 unsigned NOT_RC8 : 1;
1164 unsigned : 1;
1167 struct
1169 unsigned : 1;
1170 unsigned : 1;
1171 unsigned : 1;
1172 unsigned : 1;
1173 unsigned : 1;
1174 unsigned : 1;
1175 unsigned RC8_9 : 1;
1176 unsigned : 1;
1179 struct
1181 unsigned : 1;
1182 unsigned : 1;
1183 unsigned : 1;
1184 unsigned : 1;
1185 unsigned : 1;
1186 unsigned : 1;
1187 unsigned RX92 : 1;
1188 unsigned : 1;
1190 } __RCSTA2bits_t;
1192 extern __at(0x0F6B) volatile __RCSTA2bits_t RCSTA2bits;
1194 #define _RCSTA2_RX9D 0x01
1195 #define _RCSTA2_RCD8 0x01
1196 #define _RCSTA2_RX9D2 0x01
1197 #define _RCSTA2_OERR 0x02
1198 #define _RCSTA2_OERR2 0x02
1199 #define _RCSTA2_FERR 0x04
1200 #define _RCSTA2_FERR2 0x04
1201 #define _RCSTA2_ADDEN 0x08
1202 #define _RCSTA2_ADDEN2 0x08
1203 #define _RCSTA2_CREN 0x10
1204 #define _RCSTA2_CREN2 0x10
1205 #define _RCSTA2_SREN 0x20
1206 #define _RCSTA2_SREN2 0x20
1207 #define _RCSTA2_RX9 0x40
1208 #define _RCSTA2_RC9 0x40
1209 #define _RCSTA2_NOT_RC8 0x40
1210 #define _RCSTA2_RC8_9 0x40
1211 #define _RCSTA2_RX92 0x40
1212 #define _RCSTA2_SPEN 0x80
1213 #define _RCSTA2_SPEN2 0x80
1215 //==============================================================================
1218 //==============================================================================
1219 // TXSTA2 Bits
1221 extern __at(0x0F6C) __sfr TXSTA2;
1223 typedef union
1225 struct
1227 unsigned TX9D : 1;
1228 unsigned TRMT : 1;
1229 unsigned BRGH : 1;
1230 unsigned SENDB : 1;
1231 unsigned SYNC : 1;
1232 unsigned TXEN : 1;
1233 unsigned TX9 : 1;
1234 unsigned CSRC : 1;
1237 struct
1239 unsigned TXD8 : 1;
1240 unsigned TRMT2 : 1;
1241 unsigned BRGH2 : 1;
1242 unsigned SENDB2 : 1;
1243 unsigned SYNC2 : 1;
1244 unsigned TXEN2 : 1;
1245 unsigned TX8_9 : 1;
1246 unsigned CSRC2 : 1;
1249 struct
1251 unsigned TX9D2 : 1;
1252 unsigned : 1;
1253 unsigned : 1;
1254 unsigned : 1;
1255 unsigned : 1;
1256 unsigned : 1;
1257 unsigned NOT_TX8 : 1;
1258 unsigned : 1;
1261 struct
1263 unsigned : 1;
1264 unsigned : 1;
1265 unsigned : 1;
1266 unsigned : 1;
1267 unsigned : 1;
1268 unsigned : 1;
1269 unsigned TX92 : 1;
1270 unsigned : 1;
1272 } __TXSTA2bits_t;
1274 extern __at(0x0F6C) volatile __TXSTA2bits_t TXSTA2bits;
1276 #define _TXSTA2_TX9D 0x01
1277 #define _TXSTA2_TXD8 0x01
1278 #define _TXSTA2_TX9D2 0x01
1279 #define _TXSTA2_TRMT 0x02
1280 #define _TXSTA2_TRMT2 0x02
1281 #define _TXSTA2_BRGH 0x04
1282 #define _TXSTA2_BRGH2 0x04
1283 #define _TXSTA2_SENDB 0x08
1284 #define _TXSTA2_SENDB2 0x08
1285 #define _TXSTA2_SYNC 0x10
1286 #define _TXSTA2_SYNC2 0x10
1287 #define _TXSTA2_TXEN 0x20
1288 #define _TXSTA2_TXEN2 0x20
1289 #define _TXSTA2_TX9 0x40
1290 #define _TXSTA2_TX8_9 0x40
1291 #define _TXSTA2_NOT_TX8 0x40
1292 #define _TXSTA2_TX92 0x40
1293 #define _TXSTA2_CSRC 0x80
1294 #define _TXSTA2_CSRC2 0x80
1296 //==============================================================================
1298 extern __at(0x0F6D) __sfr TXREG2;
1299 extern __at(0x0F6E) __sfr RCREG2;
1300 extern __at(0x0F6F) __sfr SPBRG2;
1302 //==============================================================================
1303 // CCP5CON Bits
1305 extern __at(0x0F70) __sfr CCP5CON;
1307 typedef union
1309 struct
1311 unsigned CCP5M0 : 1;
1312 unsigned CCP5M1 : 1;
1313 unsigned CCP5M2 : 1;
1314 unsigned CCP5M3 : 1;
1315 unsigned CCP5Y : 1;
1316 unsigned CCP5X : 1;
1317 unsigned : 1;
1318 unsigned : 1;
1321 struct
1323 unsigned : 1;
1324 unsigned : 1;
1325 unsigned : 1;
1326 unsigned : 1;
1327 unsigned DC5B0 : 1;
1328 unsigned DC5B1 : 1;
1329 unsigned : 1;
1330 unsigned : 1;
1333 struct
1335 unsigned CCP5M : 4;
1336 unsigned : 4;
1339 struct
1341 unsigned : 4;
1342 unsigned DC5B : 2;
1343 unsigned : 2;
1345 } __CCP5CONbits_t;
1347 extern __at(0x0F70) volatile __CCP5CONbits_t CCP5CONbits;
1349 #define _CCP5M0 0x01
1350 #define _CCP5M1 0x02
1351 #define _CCP5M2 0x04
1352 #define _CCP5M3 0x08
1353 #define _CCP5Y 0x10
1354 #define _DC5B0 0x10
1355 #define _CCP5X 0x20
1356 #define _DC5B1 0x20
1358 //==============================================================================
1360 extern __at(0x0F71) __sfr CCPR5;
1361 extern __at(0x0F71) __sfr CCPR5L;
1362 extern __at(0x0F72) __sfr CCPR5H;
1364 //==============================================================================
1365 // CCP4CON Bits
1367 extern __at(0x0F73) __sfr CCP4CON;
1369 typedef union
1371 struct
1373 unsigned CCP4M0 : 1;
1374 unsigned CCP4M1 : 1;
1375 unsigned CCP4M2 : 1;
1376 unsigned CCP4M3 : 1;
1377 unsigned DC4B0 : 1;
1378 unsigned DC4B1 : 1;
1379 unsigned : 1;
1380 unsigned : 1;
1383 struct
1385 unsigned : 1;
1386 unsigned : 1;
1387 unsigned : 1;
1388 unsigned : 1;
1389 unsigned CCP4Y : 1;
1390 unsigned CCP4X : 1;
1391 unsigned : 1;
1392 unsigned : 1;
1395 struct
1397 unsigned CCP4M : 4;
1398 unsigned : 4;
1401 struct
1403 unsigned : 4;
1404 unsigned DC4B : 2;
1405 unsigned : 2;
1407 } __CCP4CONbits_t;
1409 extern __at(0x0F73) volatile __CCP4CONbits_t CCP4CONbits;
1411 #define _CCP4M0 0x01
1412 #define _CCP4M1 0x02
1413 #define _CCP4M2 0x04
1414 #define _CCP4M3 0x08
1415 #define _DC4B0 0x10
1416 #define _CCP4Y 0x10
1417 #define _DC4B1 0x20
1418 #define _CCP4X 0x20
1420 //==============================================================================
1422 extern __at(0x0F74) __sfr CCPR4;
1423 extern __at(0x0F74) __sfr CCPR4L;
1424 extern __at(0x0F75) __sfr CCPR4H;
1426 //==============================================================================
1427 // T4CON Bits
1429 extern __at(0x0F76) __sfr T4CON;
1431 typedef union
1433 struct
1435 unsigned T4CKPS0 : 1;
1436 unsigned T4CKPS1 : 1;
1437 unsigned TMR4ON : 1;
1438 unsigned T4OUTPS0 : 1;
1439 unsigned T4OUTPS1 : 1;
1440 unsigned T4OUTPS2 : 1;
1441 unsigned T4OUTPS3 : 1;
1442 unsigned : 1;
1445 struct
1447 unsigned T4CKPS : 2;
1448 unsigned : 6;
1451 struct
1453 unsigned : 3;
1454 unsigned T4OUTPS : 4;
1455 unsigned : 1;
1457 } __T4CONbits_t;
1459 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
1461 #define _T4CKPS0 0x01
1462 #define _T4CKPS1 0x02
1463 #define _TMR4ON 0x04
1464 #define _T4OUTPS0 0x08
1465 #define _T4OUTPS1 0x10
1466 #define _T4OUTPS2 0x20
1467 #define _T4OUTPS3 0x40
1469 //==============================================================================
1471 extern __at(0x0F77) __sfr PR4;
1472 extern __at(0x0F78) __sfr TMR4;
1474 //==============================================================================
1475 // ECCP1DEL Bits
1477 extern __at(0x0F79) __sfr ECCP1DEL;
1479 typedef union
1481 struct
1483 unsigned PDC0 : 1;
1484 unsigned PDC1 : 1;
1485 unsigned PDC2 : 1;
1486 unsigned PDC3 : 1;
1487 unsigned PDC4 : 1;
1488 unsigned PDC5 : 1;
1489 unsigned PDC6 : 1;
1490 unsigned PRSEN : 1;
1493 struct
1495 unsigned P1DC0 : 1;
1496 unsigned P1DC1 : 1;
1497 unsigned P1DC2 : 1;
1498 unsigned P1DC3 : 1;
1499 unsigned P1DC4 : 1;
1500 unsigned P1DC5 : 1;
1501 unsigned P1DC6 : 1;
1502 unsigned P1RSEN : 1;
1505 struct
1507 unsigned PDC : 7;
1508 unsigned : 1;
1511 struct
1513 unsigned P1DC : 7;
1514 unsigned : 1;
1516 } __ECCP1DELbits_t;
1518 extern __at(0x0F79) volatile __ECCP1DELbits_t ECCP1DELbits;
1520 #define _PDC0 0x01
1521 #define _P1DC0 0x01
1522 #define _PDC1 0x02
1523 #define _P1DC1 0x02
1524 #define _PDC2 0x04
1525 #define _P1DC2 0x04
1526 #define _PDC3 0x08
1527 #define _P1DC3 0x08
1528 #define _PDC4 0x10
1529 #define _P1DC4 0x10
1530 #define _PDC5 0x20
1531 #define _P1DC5 0x20
1532 #define _PDC6 0x40
1533 #define _P1DC6 0x40
1534 #define _PRSEN 0x80
1535 #define _P1RSEN 0x80
1537 //==============================================================================
1539 extern __at(0x0F7A) __sfr ERDPT;
1540 extern __at(0x0F7A) __sfr ERDPTL;
1541 extern __at(0x0F7B) __sfr ERDPTH;
1543 //==============================================================================
1544 // BAUDCON2 Bits
1546 extern __at(0x0F7C) __sfr BAUDCON2;
1548 typedef union
1550 struct
1552 unsigned ABDEN : 1;
1553 unsigned WUE : 1;
1554 unsigned : 1;
1555 unsigned BRG16 : 1;
1556 unsigned TXCKP : 1;
1557 unsigned RXDTP : 1;
1558 unsigned RCIDL : 1;
1559 unsigned ABDOVF : 1;
1562 struct
1564 unsigned ABDEN2 : 1;
1565 unsigned WUE2 : 1;
1566 unsigned : 1;
1567 unsigned BRG162 : 1;
1568 unsigned SCKP : 1;
1569 unsigned RXDTP2 : 1;
1570 unsigned RCMT : 1;
1571 unsigned ABDOVF2 : 1;
1574 struct
1576 unsigned : 1;
1577 unsigned : 1;
1578 unsigned : 1;
1579 unsigned : 1;
1580 unsigned TXCKP2 : 1;
1581 unsigned : 1;
1582 unsigned RCIDL2 : 1;
1583 unsigned : 1;
1585 } __BAUDCON2bits_t;
1587 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
1589 #define _BAUDCON2_ABDEN 0x01
1590 #define _BAUDCON2_ABDEN2 0x01
1591 #define _BAUDCON2_WUE 0x02
1592 #define _BAUDCON2_WUE2 0x02
1593 #define _BAUDCON2_BRG16 0x08
1594 #define _BAUDCON2_BRG162 0x08
1595 #define _BAUDCON2_TXCKP 0x10
1596 #define _BAUDCON2_SCKP 0x10
1597 #define _BAUDCON2_TXCKP2 0x10
1598 #define _BAUDCON2_RXDTP 0x20
1599 #define _BAUDCON2_RXDTP2 0x20
1600 #define _BAUDCON2_RCIDL 0x40
1601 #define _BAUDCON2_RCMT 0x40
1602 #define _BAUDCON2_RCIDL2 0x40
1603 #define _BAUDCON2_ABDOVF 0x80
1604 #define _BAUDCON2_ABDOVF2 0x80
1606 //==============================================================================
1609 //==============================================================================
1610 // BAUDCTL2 Bits
1612 extern __at(0x0F7C) __sfr BAUDCTL2;
1614 typedef union
1616 struct
1618 unsigned ABDEN : 1;
1619 unsigned WUE : 1;
1620 unsigned : 1;
1621 unsigned BRG16 : 1;
1622 unsigned TXCKP : 1;
1623 unsigned RXDTP : 1;
1624 unsigned RCIDL : 1;
1625 unsigned ABDOVF : 1;
1628 struct
1630 unsigned ABDEN2 : 1;
1631 unsigned WUE2 : 1;
1632 unsigned : 1;
1633 unsigned BRG162 : 1;
1634 unsigned SCKP : 1;
1635 unsigned RXDTP2 : 1;
1636 unsigned RCMT : 1;
1637 unsigned ABDOVF2 : 1;
1640 struct
1642 unsigned : 1;
1643 unsigned : 1;
1644 unsigned : 1;
1645 unsigned : 1;
1646 unsigned TXCKP2 : 1;
1647 unsigned : 1;
1648 unsigned RCIDL2 : 1;
1649 unsigned : 1;
1651 } __BAUDCTL2bits_t;
1653 extern __at(0x0F7C) volatile __BAUDCTL2bits_t BAUDCTL2bits;
1655 #define _BAUDCTL2_ABDEN 0x01
1656 #define _BAUDCTL2_ABDEN2 0x01
1657 #define _BAUDCTL2_WUE 0x02
1658 #define _BAUDCTL2_WUE2 0x02
1659 #define _BAUDCTL2_BRG16 0x08
1660 #define _BAUDCTL2_BRG162 0x08
1661 #define _BAUDCTL2_TXCKP 0x10
1662 #define _BAUDCTL2_SCKP 0x10
1663 #define _BAUDCTL2_TXCKP2 0x10
1664 #define _BAUDCTL2_RXDTP 0x20
1665 #define _BAUDCTL2_RXDTP2 0x20
1666 #define _BAUDCTL2_RCIDL 0x40
1667 #define _BAUDCTL2_RCMT 0x40
1668 #define _BAUDCTL2_RCIDL2 0x40
1669 #define _BAUDCTL2_ABDOVF 0x80
1670 #define _BAUDCTL2_ABDOVF2 0x80
1672 //==============================================================================
1674 extern __at(0x0F7D) __sfr SPBRGH2;
1676 //==============================================================================
1677 // BAUDCON Bits
1679 extern __at(0x0F7E) __sfr BAUDCON;
1681 typedef union
1683 struct
1685 unsigned ABDEN : 1;
1686 unsigned WUE : 1;
1687 unsigned : 1;
1688 unsigned BRG16 : 1;
1689 unsigned TXCKP : 1;
1690 unsigned RXDTP : 1;
1691 unsigned RCIDL : 1;
1692 unsigned ABDOVF : 1;
1695 struct
1697 unsigned : 1;
1698 unsigned : 1;
1699 unsigned : 1;
1700 unsigned : 1;
1701 unsigned SCKP : 1;
1702 unsigned : 1;
1703 unsigned RCMT : 1;
1704 unsigned : 1;
1706 } __BAUDCONbits_t;
1708 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
1710 #define _ABDEN 0x01
1711 #define _WUE 0x02
1712 #define _BRG16 0x08
1713 #define _TXCKP 0x10
1714 #define _SCKP 0x10
1715 #define _RXDTP 0x20
1716 #define _RCIDL 0x40
1717 #define _RCMT 0x40
1718 #define _ABDOVF 0x80
1720 //==============================================================================
1723 //==============================================================================
1724 // BAUDCON1 Bits
1726 extern __at(0x0F7E) __sfr BAUDCON1;
1728 typedef union
1730 struct
1732 unsigned ABDEN : 1;
1733 unsigned WUE : 1;
1734 unsigned : 1;
1735 unsigned BRG16 : 1;
1736 unsigned TXCKP : 1;
1737 unsigned RXDTP : 1;
1738 unsigned RCIDL : 1;
1739 unsigned ABDOVF : 1;
1742 struct
1744 unsigned : 1;
1745 unsigned : 1;
1746 unsigned : 1;
1747 unsigned : 1;
1748 unsigned SCKP : 1;
1749 unsigned : 1;
1750 unsigned RCMT : 1;
1751 unsigned : 1;
1753 } __BAUDCON1bits_t;
1755 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1757 #define _BAUDCON1_ABDEN 0x01
1758 #define _BAUDCON1_WUE 0x02
1759 #define _BAUDCON1_BRG16 0x08
1760 #define _BAUDCON1_TXCKP 0x10
1761 #define _BAUDCON1_SCKP 0x10
1762 #define _BAUDCON1_RXDTP 0x20
1763 #define _BAUDCON1_RCIDL 0x40
1764 #define _BAUDCON1_RCMT 0x40
1765 #define _BAUDCON1_ABDOVF 0x80
1767 //==============================================================================
1770 //==============================================================================
1771 // BAUDCTL Bits
1773 extern __at(0x0F7E) __sfr BAUDCTL;
1775 typedef union
1777 struct
1779 unsigned ABDEN : 1;
1780 unsigned WUE : 1;
1781 unsigned : 1;
1782 unsigned BRG16 : 1;
1783 unsigned TXCKP : 1;
1784 unsigned RXDTP : 1;
1785 unsigned RCIDL : 1;
1786 unsigned ABDOVF : 1;
1789 struct
1791 unsigned : 1;
1792 unsigned : 1;
1793 unsigned : 1;
1794 unsigned : 1;
1795 unsigned SCKP : 1;
1796 unsigned : 1;
1797 unsigned RCMT : 1;
1798 unsigned : 1;
1800 } __BAUDCTLbits_t;
1802 extern __at(0x0F7E) volatile __BAUDCTLbits_t BAUDCTLbits;
1804 #define _BAUDCTL_ABDEN 0x01
1805 #define _BAUDCTL_WUE 0x02
1806 #define _BAUDCTL_BRG16 0x08
1807 #define _BAUDCTL_TXCKP 0x10
1808 #define _BAUDCTL_SCKP 0x10
1809 #define _BAUDCTL_RXDTP 0x20
1810 #define _BAUDCTL_RCIDL 0x40
1811 #define _BAUDCTL_RCMT 0x40
1812 #define _BAUDCTL_ABDOVF 0x80
1814 //==============================================================================
1817 //==============================================================================
1818 // BAUDCTL1 Bits
1820 extern __at(0x0F7E) __sfr BAUDCTL1;
1822 typedef union
1824 struct
1826 unsigned ABDEN : 1;
1827 unsigned WUE : 1;
1828 unsigned : 1;
1829 unsigned BRG16 : 1;
1830 unsigned TXCKP : 1;
1831 unsigned RXDTP : 1;
1832 unsigned RCIDL : 1;
1833 unsigned ABDOVF : 1;
1836 struct
1838 unsigned : 1;
1839 unsigned : 1;
1840 unsigned : 1;
1841 unsigned : 1;
1842 unsigned SCKP : 1;
1843 unsigned : 1;
1844 unsigned RCMT : 1;
1845 unsigned : 1;
1847 } __BAUDCTL1bits_t;
1849 extern __at(0x0F7E) volatile __BAUDCTL1bits_t BAUDCTL1bits;
1851 #define _BAUDCTL1_ABDEN 0x01
1852 #define _BAUDCTL1_WUE 0x02
1853 #define _BAUDCTL1_BRG16 0x08
1854 #define _BAUDCTL1_TXCKP 0x10
1855 #define _BAUDCTL1_SCKP 0x10
1856 #define _BAUDCTL1_RXDTP 0x20
1857 #define _BAUDCTL1_RCIDL 0x40
1858 #define _BAUDCTL1_RCMT 0x40
1859 #define _BAUDCTL1_ABDOVF 0x80
1861 //==============================================================================
1863 extern __at(0x0F7F) __sfr SPBRGH;
1864 extern __at(0x0F7F) __sfr SPBRGH1;
1866 //==============================================================================
1867 // PORTA Bits
1869 extern __at(0x0F80) __sfr PORTA;
1871 typedef union
1873 struct
1875 unsigned RA0 : 1;
1876 unsigned RA1 : 1;
1877 unsigned RA2 : 1;
1878 unsigned RA3 : 1;
1879 unsigned RA4 : 1;
1880 unsigned RA5 : 1;
1881 unsigned : 1;
1882 unsigned RJPU : 1;
1885 struct
1887 unsigned AN0 : 1;
1888 unsigned AN1 : 1;
1889 unsigned AN2 : 1;
1890 unsigned AN3 : 1;
1891 unsigned T0CKI : 1;
1892 unsigned AN4 : 1;
1893 unsigned : 1;
1894 unsigned : 1;
1897 struct
1899 unsigned LEDA : 1;
1900 unsigned LEDB : 1;
1901 unsigned VREFM : 1;
1902 unsigned VREFP : 1;
1903 unsigned : 1;
1904 unsigned : 1;
1905 unsigned : 1;
1906 unsigned : 1;
1909 struct
1911 unsigned RA : 6;
1912 unsigned : 2;
1914 } __PORTAbits_t;
1916 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1918 #define _PORTA_RA0 0x01
1919 #define _PORTA_AN0 0x01
1920 #define _PORTA_LEDA 0x01
1921 #define _PORTA_RA1 0x02
1922 #define _PORTA_AN1 0x02
1923 #define _PORTA_LEDB 0x02
1924 #define _PORTA_RA2 0x04
1925 #define _PORTA_AN2 0x04
1926 #define _PORTA_VREFM 0x04
1927 #define _PORTA_RA3 0x08
1928 #define _PORTA_AN3 0x08
1929 #define _PORTA_VREFP 0x08
1930 #define _PORTA_RA4 0x10
1931 #define _PORTA_T0CKI 0x10
1932 #define _PORTA_RA5 0x20
1933 #define _PORTA_AN4 0x20
1934 #define _PORTA_RJPU 0x80
1936 //==============================================================================
1939 //==============================================================================
1940 // PORTB Bits
1942 extern __at(0x0F81) __sfr PORTB;
1944 typedef union
1946 struct
1948 unsigned RB0 : 1;
1949 unsigned RB1 : 1;
1950 unsigned RB2 : 1;
1951 unsigned RB3 : 1;
1952 unsigned RB4 : 1;
1953 unsigned RB5 : 1;
1954 unsigned RB6 : 1;
1955 unsigned RB7 : 1;
1958 struct
1960 unsigned INT0 : 1;
1961 unsigned INT1 : 1;
1962 unsigned INT2 : 1;
1963 unsigned INT3 : 1;
1964 unsigned KBI0 : 1;
1965 unsigned KBI1 : 1;
1966 unsigned KBI2 : 1;
1967 unsigned KBI3 : 1;
1970 struct
1972 unsigned FLT0 : 1;
1973 unsigned : 1;
1974 unsigned : 1;
1975 unsigned CCP2 : 1;
1976 unsigned : 1;
1977 unsigned : 1;
1978 unsigned PGC : 1;
1979 unsigned PGD : 1;
1982 struct
1984 unsigned : 1;
1985 unsigned : 1;
1986 unsigned : 1;
1987 unsigned ECCP2 : 1;
1988 unsigned : 1;
1989 unsigned : 1;
1990 unsigned : 1;
1991 unsigned : 1;
1994 struct
1996 unsigned INT : 4;
1997 unsigned : 4;
2000 struct
2002 unsigned : 4;
2003 unsigned KBI : 4;
2005 } __PORTBbits_t;
2007 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
2009 #define _PORTB_RB0 0x01
2010 #define _PORTB_INT0 0x01
2011 #define _PORTB_FLT0 0x01
2012 #define _PORTB_RB1 0x02
2013 #define _PORTB_INT1 0x02
2014 #define _PORTB_RB2 0x04
2015 #define _PORTB_INT2 0x04
2016 #define _PORTB_RB3 0x08
2017 #define _PORTB_INT3 0x08
2018 #define _PORTB_CCP2 0x08
2019 #define _PORTB_ECCP2 0x08
2020 #define _PORTB_RB4 0x10
2021 #define _PORTB_KBI0 0x10
2022 #define _PORTB_RB5 0x20
2023 #define _PORTB_KBI1 0x20
2024 #define _PORTB_RB6 0x40
2025 #define _PORTB_KBI2 0x40
2026 #define _PORTB_PGC 0x40
2027 #define _PORTB_RB7 0x80
2028 #define _PORTB_KBI3 0x80
2029 #define _PORTB_PGD 0x80
2031 //==============================================================================
2034 //==============================================================================
2035 // PORTC Bits
2037 extern __at(0x0F82) __sfr PORTC;
2039 typedef union
2041 struct
2043 unsigned RC0 : 1;
2044 unsigned RC1 : 1;
2045 unsigned RC2 : 1;
2046 unsigned RC3 : 1;
2047 unsigned RC4 : 1;
2048 unsigned RC5 : 1;
2049 unsigned RC6 : 1;
2050 unsigned RC7 : 1;
2053 struct
2055 unsigned T1OSO : 1;
2056 unsigned T1OSI : 1;
2057 unsigned CCP1 : 1;
2058 unsigned SCK : 1;
2059 unsigned SDI : 1;
2060 unsigned SDO : 1;
2061 unsigned TX : 1;
2062 unsigned RX : 1;
2065 struct
2067 unsigned T13CKI : 1;
2068 unsigned CCP2 : 1;
2069 unsigned ECCP1 : 1;
2070 unsigned SCL : 1;
2071 unsigned SDA : 1;
2072 unsigned SDO1 : 1;
2073 unsigned CK : 1;
2074 unsigned RX1 : 1;
2077 struct
2079 unsigned : 1;
2080 unsigned ECCP2 : 1;
2081 unsigned : 1;
2082 unsigned SCK1 : 1;
2083 unsigned SDI1 : 1;
2084 unsigned : 1;
2085 unsigned TX1 : 1;
2086 unsigned DT1 : 1;
2089 struct
2091 unsigned : 1;
2092 unsigned : 1;
2093 unsigned : 1;
2094 unsigned SCL1 : 1;
2095 unsigned SDA1 : 1;
2096 unsigned : 1;
2097 unsigned CK1 : 1;
2098 unsigned : 1;
2100 } __PORTCbits_t;
2102 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
2104 #define _PORTC_RC0 0x01
2105 #define _PORTC_T1OSO 0x01
2106 #define _PORTC_T13CKI 0x01
2107 #define _PORTC_RC1 0x02
2108 #define _PORTC_T1OSI 0x02
2109 #define _PORTC_CCP2 0x02
2110 #define _PORTC_ECCP2 0x02
2111 #define _PORTC_RC2 0x04
2112 #define _PORTC_CCP1 0x04
2113 #define _PORTC_ECCP1 0x04
2114 #define _PORTC_RC3 0x08
2115 #define _PORTC_SCK 0x08
2116 #define _PORTC_SCL 0x08
2117 #define _PORTC_SCK1 0x08
2118 #define _PORTC_SCL1 0x08
2119 #define _PORTC_RC4 0x10
2120 #define _PORTC_SDI 0x10
2121 #define _PORTC_SDA 0x10
2122 #define _PORTC_SDI1 0x10
2123 #define _PORTC_SDA1 0x10
2124 #define _PORTC_RC5 0x20
2125 #define _PORTC_SDO 0x20
2126 #define _PORTC_SDO1 0x20
2127 #define _PORTC_RC6 0x40
2128 #define _PORTC_TX 0x40
2129 #define _PORTC_CK 0x40
2130 #define _PORTC_TX1 0x40
2131 #define _PORTC_CK1 0x40
2132 #define _PORTC_RC7 0x80
2133 #define _PORTC_RX 0x80
2134 #define _PORTC_RX1 0x80
2135 #define _PORTC_DT1 0x80
2137 //==============================================================================
2140 //==============================================================================
2141 // PORTD Bits
2143 extern __at(0x0F83) __sfr PORTD;
2145 typedef union
2147 struct
2149 unsigned RD0 : 1;
2150 unsigned RD1 : 1;
2151 unsigned RD2 : 1;
2152 unsigned RD3 : 1;
2153 unsigned RD4 : 1;
2154 unsigned RD5 : 1;
2155 unsigned RD6 : 1;
2156 unsigned RD7 : 1;
2159 struct
2161 unsigned PSP0 : 1;
2162 unsigned PSP1 : 1;
2163 unsigned PSP2 : 1;
2164 unsigned PSP3 : 1;
2165 unsigned PSP4 : 1;
2166 unsigned PSP5 : 1;
2167 unsigned PSP6 : 1;
2168 unsigned PSP7 : 1;
2171 struct
2173 unsigned AD0 : 1;
2174 unsigned AD1 : 1;
2175 unsigned AD2 : 1;
2176 unsigned AD3 : 1;
2177 unsigned AD4 : 1;
2178 unsigned AD5 : 1;
2179 unsigned AD6 : 1;
2180 unsigned AD7 : 1;
2183 struct
2185 unsigned : 1;
2186 unsigned : 1;
2187 unsigned : 1;
2188 unsigned : 1;
2189 unsigned SDO2 : 1;
2190 unsigned SDA2 : 1;
2191 unsigned SCL2 : 1;
2192 unsigned SS2 : 1;
2195 struct
2197 unsigned : 1;
2198 unsigned : 1;
2199 unsigned : 1;
2200 unsigned : 1;
2201 unsigned : 1;
2202 unsigned SDI2 : 1;
2203 unsigned SCK2 : 1;
2204 unsigned NOT_SS2 : 1;
2206 } __PORTDbits_t;
2208 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
2210 #define _PORTD_RD0 0x01
2211 #define _PORTD_PSP0 0x01
2212 #define _PORTD_AD0 0x01
2213 #define _PORTD_RD1 0x02
2214 #define _PORTD_PSP1 0x02
2215 #define _PORTD_AD1 0x02
2216 #define _PORTD_RD2 0x04
2217 #define _PORTD_PSP2 0x04
2218 #define _PORTD_AD2 0x04
2219 #define _PORTD_RD3 0x08
2220 #define _PORTD_PSP3 0x08
2221 #define _PORTD_AD3 0x08
2222 #define _PORTD_RD4 0x10
2223 #define _PORTD_PSP4 0x10
2224 #define _PORTD_AD4 0x10
2225 #define _PORTD_SDO2 0x10
2226 #define _PORTD_RD5 0x20
2227 #define _PORTD_PSP5 0x20
2228 #define _PORTD_AD5 0x20
2229 #define _PORTD_SDA2 0x20
2230 #define _PORTD_SDI2 0x20
2231 #define _PORTD_RD6 0x40
2232 #define _PORTD_PSP6 0x40
2233 #define _PORTD_AD6 0x40
2234 #define _PORTD_SCL2 0x40
2235 #define _PORTD_SCK2 0x40
2236 #define _PORTD_RD7 0x80
2237 #define _PORTD_PSP7 0x80
2238 #define _PORTD_AD7 0x80
2239 #define _PORTD_SS2 0x80
2240 #define _PORTD_NOT_SS2 0x80
2242 //==============================================================================
2245 //==============================================================================
2246 // PORTE Bits
2248 extern __at(0x0F84) __sfr PORTE;
2250 typedef union
2252 struct
2254 unsigned RE0 : 1;
2255 unsigned RE1 : 1;
2256 unsigned RE2 : 1;
2257 unsigned RE3 : 1;
2258 unsigned RE4 : 1;
2259 unsigned RE5 : 1;
2260 unsigned RE6 : 1;
2261 unsigned RE7 : 1;
2264 struct
2266 unsigned RD : 1;
2267 unsigned WR : 1;
2268 unsigned CS : 1;
2269 unsigned AD11 : 1;
2270 unsigned AD12 : 1;
2271 unsigned AD13 : 1;
2272 unsigned AD14 : 1;
2273 unsigned CCP2 : 1;
2276 struct
2278 unsigned AD8 : 1;
2279 unsigned AD9 : 1;
2280 unsigned AD10 : 1;
2281 unsigned : 1;
2282 unsigned : 1;
2283 unsigned : 1;
2284 unsigned : 1;
2285 unsigned AD15 : 1;
2288 struct
2290 unsigned NOT_RD : 1;
2291 unsigned NOT_WR : 1;
2292 unsigned NOT_CS : 1;
2293 unsigned : 1;
2294 unsigned : 1;
2295 unsigned : 1;
2296 unsigned : 1;
2297 unsigned ECCP2 : 1;
2299 } __PORTEbits_t;
2301 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
2303 #define _PORTE_RE0 0x01
2304 #define _PORTE_RD 0x01
2305 #define _PORTE_AD8 0x01
2306 #define _PORTE_NOT_RD 0x01
2307 #define _PORTE_RE1 0x02
2308 #define _PORTE_WR 0x02
2309 #define _PORTE_AD9 0x02
2310 #define _PORTE_NOT_WR 0x02
2311 #define _PORTE_RE2 0x04
2312 #define _PORTE_CS 0x04
2313 #define _PORTE_AD10 0x04
2314 #define _PORTE_NOT_CS 0x04
2315 #define _PORTE_RE3 0x08
2316 #define _PORTE_AD11 0x08
2317 #define _PORTE_RE4 0x10
2318 #define _PORTE_AD12 0x10
2319 #define _PORTE_RE5 0x20
2320 #define _PORTE_AD13 0x20
2321 #define _PORTE_RE6 0x40
2322 #define _PORTE_AD14 0x40
2323 #define _PORTE_RE7 0x80
2324 #define _PORTE_CCP2 0x80
2325 #define _PORTE_AD15 0x80
2326 #define _PORTE_ECCP2 0x80
2328 //==============================================================================
2331 //==============================================================================
2332 // PORTF Bits
2334 extern __at(0x0F85) __sfr PORTF;
2336 typedef union
2338 struct
2340 unsigned RF0 : 1;
2341 unsigned RF1 : 1;
2342 unsigned RF2 : 1;
2343 unsigned RF3 : 1;
2344 unsigned RF4 : 1;
2345 unsigned RF5 : 1;
2346 unsigned RF6 : 1;
2347 unsigned RF7 : 1;
2350 struct
2352 unsigned AN5 : 1;
2353 unsigned AN6 : 1;
2354 unsigned AN7 : 1;
2355 unsigned AN8 : 1;
2356 unsigned AN9 : 1;
2357 unsigned AN10 : 1;
2358 unsigned AN11 : 1;
2359 unsigned SS : 1;
2362 struct
2364 unsigned : 1;
2365 unsigned : 1;
2366 unsigned : 1;
2367 unsigned : 1;
2368 unsigned : 1;
2369 unsigned CVREF : 1;
2370 unsigned : 1;
2371 unsigned NOT_SS : 1;
2374 struct
2376 unsigned : 1;
2377 unsigned : 1;
2378 unsigned : 1;
2379 unsigned : 1;
2380 unsigned : 1;
2381 unsigned : 1;
2382 unsigned : 1;
2383 unsigned SS1 : 1;
2386 struct
2388 unsigned : 1;
2389 unsigned : 1;
2390 unsigned : 1;
2391 unsigned : 1;
2392 unsigned : 1;
2393 unsigned : 1;
2394 unsigned : 1;
2395 unsigned NOT_SS1 : 1;
2397 } __PORTFbits_t;
2399 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
2401 #define _PORTF_RF0 0x01
2402 #define _PORTF_AN5 0x01
2403 #define _PORTF_RF1 0x02
2404 #define _PORTF_AN6 0x02
2405 #define _PORTF_RF2 0x04
2406 #define _PORTF_AN7 0x04
2407 #define _PORTF_RF3 0x08
2408 #define _PORTF_AN8 0x08
2409 #define _PORTF_RF4 0x10
2410 #define _PORTF_AN9 0x10
2411 #define _PORTF_RF5 0x20
2412 #define _PORTF_AN10 0x20
2413 #define _PORTF_CVREF 0x20
2414 #define _PORTF_RF6 0x40
2415 #define _PORTF_AN11 0x40
2416 #define _PORTF_RF7 0x80
2417 #define _PORTF_SS 0x80
2418 #define _PORTF_NOT_SS 0x80
2419 #define _PORTF_SS1 0x80
2420 #define _PORTF_NOT_SS1 0x80
2422 //==============================================================================
2425 //==============================================================================
2426 // PORTG Bits
2428 extern __at(0x0F86) __sfr PORTG;
2430 typedef union
2432 struct
2434 unsigned RG0 : 1;
2435 unsigned RG1 : 1;
2436 unsigned RG2 : 1;
2437 unsigned RG3 : 1;
2438 unsigned RG4 : 1;
2439 unsigned RG5 : 1;
2440 unsigned RG6 : 1;
2441 unsigned RG7 : 1;
2444 struct
2446 unsigned CCP3 : 1;
2447 unsigned TX2 : 1;
2448 unsigned RX2 : 1;
2449 unsigned CCP4 : 1;
2450 unsigned CCP5 : 1;
2451 unsigned : 1;
2452 unsigned : 1;
2453 unsigned : 1;
2456 struct
2458 unsigned ECCP3 : 1;
2459 unsigned CK2 : 1;
2460 unsigned DT2 : 1;
2461 unsigned : 1;
2462 unsigned : 1;
2463 unsigned : 1;
2464 unsigned : 1;
2465 unsigned : 1;
2467 } __PORTGbits_t;
2469 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
2471 #define _PORTG_RG0 0x01
2472 #define _PORTG_CCP3 0x01
2473 #define _PORTG_ECCP3 0x01
2474 #define _PORTG_RG1 0x02
2475 #define _PORTG_TX2 0x02
2476 #define _PORTG_CK2 0x02
2477 #define _PORTG_RG2 0x04
2478 #define _PORTG_RX2 0x04
2479 #define _PORTG_DT2 0x04
2480 #define _PORTG_RG3 0x08
2481 #define _PORTG_CCP4 0x08
2482 #define _PORTG_RG4 0x10
2483 #define _PORTG_CCP5 0x10
2484 #define _PORTG_RG5 0x20
2485 #define _PORTG_RG6 0x40
2486 #define _PORTG_RG7 0x80
2488 //==============================================================================
2491 //==============================================================================
2492 // PORTH Bits
2494 extern __at(0x0F87) __sfr PORTH;
2496 typedef union
2498 struct
2500 unsigned RH0 : 1;
2501 unsigned RH1 : 1;
2502 unsigned RH2 : 1;
2503 unsigned RH3 : 1;
2504 unsigned RH4 : 1;
2505 unsigned RH5 : 1;
2506 unsigned RH6 : 1;
2507 unsigned RH7 : 1;
2510 struct
2512 unsigned AD16 : 1;
2513 unsigned AD17 : 1;
2514 unsigned AD18 : 1;
2515 unsigned AD19 : 1;
2516 unsigned AN12 : 1;
2517 unsigned AN13 : 1;
2518 unsigned AN14 : 1;
2519 unsigned AN15 : 1;
2521 } __PORTHbits_t;
2523 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
2525 #define _PORTH_RH0 0x01
2526 #define _PORTH_AD16 0x01
2527 #define _PORTH_RH1 0x02
2528 #define _PORTH_AD17 0x02
2529 #define _PORTH_RH2 0x04
2530 #define _PORTH_AD18 0x04
2531 #define _PORTH_RH3 0x08
2532 #define _PORTH_AD19 0x08
2533 #define _PORTH_RH4 0x10
2534 #define _PORTH_AN12 0x10
2535 #define _PORTH_RH5 0x20
2536 #define _PORTH_AN13 0x20
2537 #define _PORTH_RH6 0x40
2538 #define _PORTH_AN14 0x40
2539 #define _PORTH_RH7 0x80
2540 #define _PORTH_AN15 0x80
2542 //==============================================================================
2545 //==============================================================================
2546 // PORTJ Bits
2548 extern __at(0x0F88) __sfr PORTJ;
2550 typedef union
2552 struct
2554 unsigned RJ0 : 1;
2555 unsigned RJ1 : 1;
2556 unsigned RJ2 : 1;
2557 unsigned RJ3 : 1;
2558 unsigned RJ4 : 1;
2559 unsigned RJ5 : 1;
2560 unsigned RJ6 : 1;
2561 unsigned RJ7 : 1;
2564 struct
2566 unsigned ALE : 1;
2567 unsigned OE : 1;
2568 unsigned WRL : 1;
2569 unsigned WRH : 1;
2570 unsigned BA0 : 1;
2571 unsigned CE : 1;
2572 unsigned LB : 1;
2573 unsigned UB : 1;
2576 struct
2578 unsigned : 1;
2579 unsigned NOT_OE : 1;
2580 unsigned NOT_WRL : 1;
2581 unsigned NOT_WRH : 1;
2582 unsigned : 1;
2583 unsigned NOT_CE : 1;
2584 unsigned NOT_LB : 1;
2585 unsigned NOT_UB : 1;
2587 } __PORTJbits_t;
2589 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
2591 #define _PORTJ_RJ0 0x01
2592 #define _PORTJ_ALE 0x01
2593 #define _PORTJ_RJ1 0x02
2594 #define _PORTJ_OE 0x02
2595 #define _PORTJ_NOT_OE 0x02
2596 #define _PORTJ_RJ2 0x04
2597 #define _PORTJ_WRL 0x04
2598 #define _PORTJ_NOT_WRL 0x04
2599 #define _PORTJ_RJ3 0x08
2600 #define _PORTJ_WRH 0x08
2601 #define _PORTJ_NOT_WRH 0x08
2602 #define _PORTJ_RJ4 0x10
2603 #define _PORTJ_BA0 0x10
2604 #define _PORTJ_RJ5 0x20
2605 #define _PORTJ_CE 0x20
2606 #define _PORTJ_NOT_CE 0x20
2607 #define _PORTJ_RJ6 0x40
2608 #define _PORTJ_LB 0x40
2609 #define _PORTJ_NOT_LB 0x40
2610 #define _PORTJ_RJ7 0x80
2611 #define _PORTJ_UB 0x80
2612 #define _PORTJ_NOT_UB 0x80
2614 //==============================================================================
2617 //==============================================================================
2618 // LATA Bits
2620 extern __at(0x0F89) __sfr LATA;
2622 typedef union
2624 struct
2626 unsigned LATA0 : 1;
2627 unsigned LATA1 : 1;
2628 unsigned LATA2 : 1;
2629 unsigned LATA3 : 1;
2630 unsigned LATA4 : 1;
2631 unsigned LATA5 : 1;
2632 unsigned REPU : 1;
2633 unsigned RDPU : 1;
2636 struct
2638 unsigned LATA : 6;
2639 unsigned : 2;
2641 } __LATAbits_t;
2643 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2645 #define _LATA0 0x01
2646 #define _LATA1 0x02
2647 #define _LATA2 0x04
2648 #define _LATA3 0x08
2649 #define _LATA4 0x10
2650 #define _LATA5 0x20
2651 #define _REPU 0x40
2652 #define _RDPU 0x80
2654 //==============================================================================
2657 //==============================================================================
2658 // LATB Bits
2660 extern __at(0x0F8A) __sfr LATB;
2662 typedef struct
2664 unsigned LATB0 : 1;
2665 unsigned LATB1 : 1;
2666 unsigned LATB2 : 1;
2667 unsigned LATB3 : 1;
2668 unsigned LATB4 : 1;
2669 unsigned LATB5 : 1;
2670 unsigned LATB6 : 1;
2671 unsigned LATB7 : 1;
2672 } __LATBbits_t;
2674 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2676 #define _LATB0 0x01
2677 #define _LATB1 0x02
2678 #define _LATB2 0x04
2679 #define _LATB3 0x08
2680 #define _LATB4 0x10
2681 #define _LATB5 0x20
2682 #define _LATB6 0x40
2683 #define _LATB7 0x80
2685 //==============================================================================
2688 //==============================================================================
2689 // LATC Bits
2691 extern __at(0x0F8B) __sfr LATC;
2693 typedef struct
2695 unsigned LATC0 : 1;
2696 unsigned LATC1 : 1;
2697 unsigned LATC2 : 1;
2698 unsigned LATC3 : 1;
2699 unsigned LATC4 : 1;
2700 unsigned LATC5 : 1;
2701 unsigned LATC6 : 1;
2702 unsigned LATC7 : 1;
2703 } __LATCbits_t;
2705 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2707 #define _LATC0 0x01
2708 #define _LATC1 0x02
2709 #define _LATC2 0x04
2710 #define _LATC3 0x08
2711 #define _LATC4 0x10
2712 #define _LATC5 0x20
2713 #define _LATC6 0x40
2714 #define _LATC7 0x80
2716 //==============================================================================
2719 //==============================================================================
2720 // LATD Bits
2722 extern __at(0x0F8C) __sfr LATD;
2724 typedef struct
2726 unsigned LATD0 : 1;
2727 unsigned LATD1 : 1;
2728 unsigned LATD2 : 1;
2729 unsigned LATD3 : 1;
2730 unsigned LATD4 : 1;
2731 unsigned LATD5 : 1;
2732 unsigned LATD6 : 1;
2733 unsigned LATD7 : 1;
2734 } __LATDbits_t;
2736 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
2738 #define _LATD0 0x01
2739 #define _LATD1 0x02
2740 #define _LATD2 0x04
2741 #define _LATD3 0x08
2742 #define _LATD4 0x10
2743 #define _LATD5 0x20
2744 #define _LATD6 0x40
2745 #define _LATD7 0x80
2747 //==============================================================================
2750 //==============================================================================
2751 // LATE Bits
2753 extern __at(0x0F8D) __sfr LATE;
2755 typedef struct
2757 unsigned LATE0 : 1;
2758 unsigned LATE1 : 1;
2759 unsigned LATE2 : 1;
2760 unsigned LATE3 : 1;
2761 unsigned LATE4 : 1;
2762 unsigned LATE5 : 1;
2763 unsigned LATE6 : 1;
2764 unsigned LATE7 : 1;
2765 } __LATEbits_t;
2767 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
2769 #define _LATE0 0x01
2770 #define _LATE1 0x02
2771 #define _LATE2 0x04
2772 #define _LATE3 0x08
2773 #define _LATE4 0x10
2774 #define _LATE5 0x20
2775 #define _LATE6 0x40
2776 #define _LATE7 0x80
2778 //==============================================================================
2781 //==============================================================================
2782 // LATF Bits
2784 extern __at(0x0F8E) __sfr LATF;
2786 typedef struct
2788 unsigned LATF0 : 1;
2789 unsigned LATF1 : 1;
2790 unsigned LATF2 : 1;
2791 unsigned LATF3 : 1;
2792 unsigned LATF4 : 1;
2793 unsigned LATF5 : 1;
2794 unsigned LATF6 : 1;
2795 unsigned LATF7 : 1;
2796 } __LATFbits_t;
2798 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
2800 #define _LATF0 0x01
2801 #define _LATF1 0x02
2802 #define _LATF2 0x04
2803 #define _LATF3 0x08
2804 #define _LATF4 0x10
2805 #define _LATF5 0x20
2806 #define _LATF6 0x40
2807 #define _LATF7 0x80
2809 //==============================================================================
2812 //==============================================================================
2813 // LATG Bits
2815 extern __at(0x0F8F) __sfr LATG;
2817 typedef struct
2819 unsigned LATG0 : 1;
2820 unsigned LATG1 : 1;
2821 unsigned LATG2 : 1;
2822 unsigned LATG3 : 1;
2823 unsigned LATG4 : 1;
2824 unsigned LATG5 : 1;
2825 unsigned LATG6 : 1;
2826 unsigned LATG7 : 1;
2827 } __LATGbits_t;
2829 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
2831 #define _LATG0 0x01
2832 #define _LATG1 0x02
2833 #define _LATG2 0x04
2834 #define _LATG3 0x08
2835 #define _LATG4 0x10
2836 #define _LATG5 0x20
2837 #define _LATG6 0x40
2838 #define _LATG7 0x80
2840 //==============================================================================
2843 //==============================================================================
2844 // LATH Bits
2846 extern __at(0x0F90) __sfr LATH;
2848 typedef struct
2850 unsigned LATH0 : 1;
2851 unsigned LATH1 : 1;
2852 unsigned LATH2 : 1;
2853 unsigned LATH3 : 1;
2854 unsigned LATH4 : 1;
2855 unsigned LATH5 : 1;
2856 unsigned LATH6 : 1;
2857 unsigned LATH7 : 1;
2858 } __LATHbits_t;
2860 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
2862 #define _LATH0 0x01
2863 #define _LATH1 0x02
2864 #define _LATH2 0x04
2865 #define _LATH3 0x08
2866 #define _LATH4 0x10
2867 #define _LATH5 0x20
2868 #define _LATH6 0x40
2869 #define _LATH7 0x80
2871 //==============================================================================
2874 //==============================================================================
2875 // LATJ Bits
2877 extern __at(0x0F91) __sfr LATJ;
2879 typedef struct
2881 unsigned LATJ0 : 1;
2882 unsigned LATJ1 : 1;
2883 unsigned LATJ2 : 1;
2884 unsigned LATJ3 : 1;
2885 unsigned LATJ4 : 1;
2886 unsigned LATJ5 : 1;
2887 unsigned LATJ6 : 1;
2888 unsigned LATJ7 : 1;
2889 } __LATJbits_t;
2891 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
2893 #define _LATJ0 0x01
2894 #define _LATJ1 0x02
2895 #define _LATJ2 0x04
2896 #define _LATJ3 0x08
2897 #define _LATJ4 0x10
2898 #define _LATJ5 0x20
2899 #define _LATJ6 0x40
2900 #define _LATJ7 0x80
2902 //==============================================================================
2905 //==============================================================================
2906 // DDRA Bits
2908 extern __at(0x0F92) __sfr DDRA;
2910 typedef union
2912 struct
2914 unsigned TRISA0 : 1;
2915 unsigned TRISA1 : 1;
2916 unsigned TRISA2 : 1;
2917 unsigned TRISA3 : 1;
2918 unsigned TRISA4 : 1;
2919 unsigned TRISA5 : 1;
2920 unsigned : 1;
2921 unsigned : 1;
2924 struct
2926 unsigned RA0 : 1;
2927 unsigned RA1 : 1;
2928 unsigned RA2 : 1;
2929 unsigned RA3 : 1;
2930 unsigned RA4 : 1;
2931 unsigned RA5 : 1;
2932 unsigned : 1;
2933 unsigned : 1;
2936 struct
2938 unsigned TRISA : 6;
2939 unsigned : 2;
2942 struct
2944 unsigned RA : 6;
2945 unsigned : 2;
2947 } __DDRAbits_t;
2949 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2951 #define _TRISA0 0x01
2952 #define _RA0 0x01
2953 #define _TRISA1 0x02
2954 #define _RA1 0x02
2955 #define _TRISA2 0x04
2956 #define _RA2 0x04
2957 #define _TRISA3 0x08
2958 #define _RA3 0x08
2959 #define _TRISA4 0x10
2960 #define _RA4 0x10
2961 #define _TRISA5 0x20
2962 #define _RA5 0x20
2964 //==============================================================================
2967 //==============================================================================
2968 // TRISA Bits
2970 extern __at(0x0F92) __sfr TRISA;
2972 typedef union
2974 struct
2976 unsigned TRISA0 : 1;
2977 unsigned TRISA1 : 1;
2978 unsigned TRISA2 : 1;
2979 unsigned TRISA3 : 1;
2980 unsigned TRISA4 : 1;
2981 unsigned TRISA5 : 1;
2982 unsigned : 1;
2983 unsigned : 1;
2986 struct
2988 unsigned RA0 : 1;
2989 unsigned RA1 : 1;
2990 unsigned RA2 : 1;
2991 unsigned RA3 : 1;
2992 unsigned RA4 : 1;
2993 unsigned RA5 : 1;
2994 unsigned : 1;
2995 unsigned : 1;
2998 struct
3000 unsigned RA : 6;
3001 unsigned : 2;
3004 struct
3006 unsigned TRISA : 6;
3007 unsigned : 2;
3009 } __TRISAbits_t;
3011 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
3013 #define _TRISA_TRISA0 0x01
3014 #define _TRISA_RA0 0x01
3015 #define _TRISA_TRISA1 0x02
3016 #define _TRISA_RA1 0x02
3017 #define _TRISA_TRISA2 0x04
3018 #define _TRISA_RA2 0x04
3019 #define _TRISA_TRISA3 0x08
3020 #define _TRISA_RA3 0x08
3021 #define _TRISA_TRISA4 0x10
3022 #define _TRISA_RA4 0x10
3023 #define _TRISA_TRISA5 0x20
3024 #define _TRISA_RA5 0x20
3026 //==============================================================================
3029 //==============================================================================
3030 // DDRB Bits
3032 extern __at(0x0F93) __sfr DDRB;
3034 typedef union
3036 struct
3038 unsigned TRISB0 : 1;
3039 unsigned TRISB1 : 1;
3040 unsigned TRISB2 : 1;
3041 unsigned TRISB3 : 1;
3042 unsigned TRISB4 : 1;
3043 unsigned TRISB5 : 1;
3044 unsigned TRISB6 : 1;
3045 unsigned TRISB7 : 1;
3048 struct
3050 unsigned RB0 : 1;
3051 unsigned RB1 : 1;
3052 unsigned RB2 : 1;
3053 unsigned RB3 : 1;
3054 unsigned RB4 : 1;
3055 unsigned RB5 : 1;
3056 unsigned RB6 : 1;
3057 unsigned RB7 : 1;
3059 } __DDRBbits_t;
3061 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
3063 #define _TRISB0 0x01
3064 #define _RB0 0x01
3065 #define _TRISB1 0x02
3066 #define _RB1 0x02
3067 #define _TRISB2 0x04
3068 #define _RB2 0x04
3069 #define _TRISB3 0x08
3070 #define _RB3 0x08
3071 #define _TRISB4 0x10
3072 #define _RB4 0x10
3073 #define _TRISB5 0x20
3074 #define _RB5 0x20
3075 #define _TRISB6 0x40
3076 #define _RB6 0x40
3077 #define _TRISB7 0x80
3078 #define _RB7 0x80
3080 //==============================================================================
3083 //==============================================================================
3084 // TRISB Bits
3086 extern __at(0x0F93) __sfr TRISB;
3088 typedef union
3090 struct
3092 unsigned TRISB0 : 1;
3093 unsigned TRISB1 : 1;
3094 unsigned TRISB2 : 1;
3095 unsigned TRISB3 : 1;
3096 unsigned TRISB4 : 1;
3097 unsigned TRISB5 : 1;
3098 unsigned TRISB6 : 1;
3099 unsigned TRISB7 : 1;
3102 struct
3104 unsigned RB0 : 1;
3105 unsigned RB1 : 1;
3106 unsigned RB2 : 1;
3107 unsigned RB3 : 1;
3108 unsigned RB4 : 1;
3109 unsigned RB5 : 1;
3110 unsigned RB6 : 1;
3111 unsigned RB7 : 1;
3113 } __TRISBbits_t;
3115 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
3117 #define _TRISB_TRISB0 0x01
3118 #define _TRISB_RB0 0x01
3119 #define _TRISB_TRISB1 0x02
3120 #define _TRISB_RB1 0x02
3121 #define _TRISB_TRISB2 0x04
3122 #define _TRISB_RB2 0x04
3123 #define _TRISB_TRISB3 0x08
3124 #define _TRISB_RB3 0x08
3125 #define _TRISB_TRISB4 0x10
3126 #define _TRISB_RB4 0x10
3127 #define _TRISB_TRISB5 0x20
3128 #define _TRISB_RB5 0x20
3129 #define _TRISB_TRISB6 0x40
3130 #define _TRISB_RB6 0x40
3131 #define _TRISB_TRISB7 0x80
3132 #define _TRISB_RB7 0x80
3134 //==============================================================================
3137 //==============================================================================
3138 // DDRC Bits
3140 extern __at(0x0F94) __sfr DDRC;
3142 typedef union
3144 struct
3146 unsigned TRISC0 : 1;
3147 unsigned TRISC1 : 1;
3148 unsigned TRISC2 : 1;
3149 unsigned TRISC3 : 1;
3150 unsigned TRISC4 : 1;
3151 unsigned TRISC5 : 1;
3152 unsigned TRISC6 : 1;
3153 unsigned TRISC7 : 1;
3156 struct
3158 unsigned RC0 : 1;
3159 unsigned RC1 : 1;
3160 unsigned RC2 : 1;
3161 unsigned RC3 : 1;
3162 unsigned RC4 : 1;
3163 unsigned RC5 : 1;
3164 unsigned RC6 : 1;
3165 unsigned RC7 : 1;
3167 } __DDRCbits_t;
3169 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
3171 #define _TRISC0 0x01
3172 #define _RC0 0x01
3173 #define _TRISC1 0x02
3174 #define _RC1 0x02
3175 #define _TRISC2 0x04
3176 #define _RC2 0x04
3177 #define _TRISC3 0x08
3178 #define _RC3 0x08
3179 #define _TRISC4 0x10
3180 #define _RC4 0x10
3181 #define _TRISC5 0x20
3182 #define _RC5 0x20
3183 #define _TRISC6 0x40
3184 #define _RC6 0x40
3185 #define _TRISC7 0x80
3186 #define _RC7 0x80
3188 //==============================================================================
3191 //==============================================================================
3192 // TRISC Bits
3194 extern __at(0x0F94) __sfr TRISC;
3196 typedef union
3198 struct
3200 unsigned TRISC0 : 1;
3201 unsigned TRISC1 : 1;
3202 unsigned TRISC2 : 1;
3203 unsigned TRISC3 : 1;
3204 unsigned TRISC4 : 1;
3205 unsigned TRISC5 : 1;
3206 unsigned TRISC6 : 1;
3207 unsigned TRISC7 : 1;
3210 struct
3212 unsigned RC0 : 1;
3213 unsigned RC1 : 1;
3214 unsigned RC2 : 1;
3215 unsigned RC3 : 1;
3216 unsigned RC4 : 1;
3217 unsigned RC5 : 1;
3218 unsigned RC6 : 1;
3219 unsigned RC7 : 1;
3221 } __TRISCbits_t;
3223 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
3225 #define _TRISC_TRISC0 0x01
3226 #define _TRISC_RC0 0x01
3227 #define _TRISC_TRISC1 0x02
3228 #define _TRISC_RC1 0x02
3229 #define _TRISC_TRISC2 0x04
3230 #define _TRISC_RC2 0x04
3231 #define _TRISC_TRISC3 0x08
3232 #define _TRISC_RC3 0x08
3233 #define _TRISC_TRISC4 0x10
3234 #define _TRISC_RC4 0x10
3235 #define _TRISC_TRISC5 0x20
3236 #define _TRISC_RC5 0x20
3237 #define _TRISC_TRISC6 0x40
3238 #define _TRISC_RC6 0x40
3239 #define _TRISC_TRISC7 0x80
3240 #define _TRISC_RC7 0x80
3242 //==============================================================================
3245 //==============================================================================
3246 // DDRD Bits
3248 extern __at(0x0F95) __sfr DDRD;
3250 typedef union
3252 struct
3254 unsigned TRISD0 : 1;
3255 unsigned TRISD1 : 1;
3256 unsigned TRISD2 : 1;
3257 unsigned TRISD3 : 1;
3258 unsigned TRISD4 : 1;
3259 unsigned TRISD5 : 1;
3260 unsigned TRISD6 : 1;
3261 unsigned TRISD7 : 1;
3264 struct
3266 unsigned RD0 : 1;
3267 unsigned RD1 : 1;
3268 unsigned RD2 : 1;
3269 unsigned RD3 : 1;
3270 unsigned RD4 : 1;
3271 unsigned RD5 : 1;
3272 unsigned RD6 : 1;
3273 unsigned RD7 : 1;
3275 } __DDRDbits_t;
3277 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
3279 #define _TRISD0 0x01
3280 #define _RD0 0x01
3281 #define _TRISD1 0x02
3282 #define _RD1 0x02
3283 #define _TRISD2 0x04
3284 #define _RD2 0x04
3285 #define _TRISD3 0x08
3286 #define _RD3 0x08
3287 #define _TRISD4 0x10
3288 #define _RD4 0x10
3289 #define _TRISD5 0x20
3290 #define _RD5 0x20
3291 #define _TRISD6 0x40
3292 #define _RD6 0x40
3293 #define _TRISD7 0x80
3294 #define _RD7 0x80
3296 //==============================================================================
3299 //==============================================================================
3300 // TRISD Bits
3302 extern __at(0x0F95) __sfr TRISD;
3304 typedef union
3306 struct
3308 unsigned TRISD0 : 1;
3309 unsigned TRISD1 : 1;
3310 unsigned TRISD2 : 1;
3311 unsigned TRISD3 : 1;
3312 unsigned TRISD4 : 1;
3313 unsigned TRISD5 : 1;
3314 unsigned TRISD6 : 1;
3315 unsigned TRISD7 : 1;
3318 struct
3320 unsigned RD0 : 1;
3321 unsigned RD1 : 1;
3322 unsigned RD2 : 1;
3323 unsigned RD3 : 1;
3324 unsigned RD4 : 1;
3325 unsigned RD5 : 1;
3326 unsigned RD6 : 1;
3327 unsigned RD7 : 1;
3329 } __TRISDbits_t;
3331 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
3333 #define _TRISD_TRISD0 0x01
3334 #define _TRISD_RD0 0x01
3335 #define _TRISD_TRISD1 0x02
3336 #define _TRISD_RD1 0x02
3337 #define _TRISD_TRISD2 0x04
3338 #define _TRISD_RD2 0x04
3339 #define _TRISD_TRISD3 0x08
3340 #define _TRISD_RD3 0x08
3341 #define _TRISD_TRISD4 0x10
3342 #define _TRISD_RD4 0x10
3343 #define _TRISD_TRISD5 0x20
3344 #define _TRISD_RD5 0x20
3345 #define _TRISD_TRISD6 0x40
3346 #define _TRISD_RD6 0x40
3347 #define _TRISD_TRISD7 0x80
3348 #define _TRISD_RD7 0x80
3350 //==============================================================================
3353 //==============================================================================
3354 // DDRE Bits
3356 extern __at(0x0F96) __sfr DDRE;
3358 typedef union
3360 struct
3362 unsigned TRISE0 : 1;
3363 unsigned TRISE1 : 1;
3364 unsigned TRISE2 : 1;
3365 unsigned TRISE3 : 1;
3366 unsigned TRISE4 : 1;
3367 unsigned TRISE5 : 1;
3368 unsigned TRISE6 : 1;
3369 unsigned TRISE7 : 1;
3372 struct
3374 unsigned RE0 : 1;
3375 unsigned RE1 : 1;
3376 unsigned RE2 : 1;
3377 unsigned RE3 : 1;
3378 unsigned RE4 : 1;
3379 unsigned RE5 : 1;
3380 unsigned RE6 : 1;
3381 unsigned RE7 : 1;
3383 } __DDREbits_t;
3385 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
3387 #define _TRISE0 0x01
3388 #define _RE0 0x01
3389 #define _TRISE1 0x02
3390 #define _RE1 0x02
3391 #define _TRISE2 0x04
3392 #define _RE2 0x04
3393 #define _TRISE3 0x08
3394 #define _RE3 0x08
3395 #define _TRISE4 0x10
3396 #define _RE4 0x10
3397 #define _TRISE5 0x20
3398 #define _RE5 0x20
3399 #define _TRISE6 0x40
3400 #define _RE6 0x40
3401 #define _TRISE7 0x80
3402 #define _RE7 0x80
3404 //==============================================================================
3407 //==============================================================================
3408 // TRISE Bits
3410 extern __at(0x0F96) __sfr TRISE;
3412 typedef union
3414 struct
3416 unsigned TRISE0 : 1;
3417 unsigned TRISE1 : 1;
3418 unsigned TRISE2 : 1;
3419 unsigned TRISE3 : 1;
3420 unsigned TRISE4 : 1;
3421 unsigned TRISE5 : 1;
3422 unsigned TRISE6 : 1;
3423 unsigned TRISE7 : 1;
3426 struct
3428 unsigned RE0 : 1;
3429 unsigned RE1 : 1;
3430 unsigned RE2 : 1;
3431 unsigned RE3 : 1;
3432 unsigned RE4 : 1;
3433 unsigned RE5 : 1;
3434 unsigned RE6 : 1;
3435 unsigned RE7 : 1;
3437 } __TRISEbits_t;
3439 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
3441 #define _TRISE_TRISE0 0x01
3442 #define _TRISE_RE0 0x01
3443 #define _TRISE_TRISE1 0x02
3444 #define _TRISE_RE1 0x02
3445 #define _TRISE_TRISE2 0x04
3446 #define _TRISE_RE2 0x04
3447 #define _TRISE_TRISE3 0x08
3448 #define _TRISE_RE3 0x08
3449 #define _TRISE_TRISE4 0x10
3450 #define _TRISE_RE4 0x10
3451 #define _TRISE_TRISE5 0x20
3452 #define _TRISE_RE5 0x20
3453 #define _TRISE_TRISE6 0x40
3454 #define _TRISE_RE6 0x40
3455 #define _TRISE_TRISE7 0x80
3456 #define _TRISE_RE7 0x80
3458 //==============================================================================
3461 //==============================================================================
3462 // DDRF Bits
3464 extern __at(0x0F97) __sfr DDRF;
3466 typedef union
3468 struct
3470 unsigned TRISF0 : 1;
3471 unsigned TRISF1 : 1;
3472 unsigned TRISF2 : 1;
3473 unsigned TRISF3 : 1;
3474 unsigned TRISF4 : 1;
3475 unsigned TRISF5 : 1;
3476 unsigned TRISF6 : 1;
3477 unsigned TRISF7 : 1;
3480 struct
3482 unsigned RF0 : 1;
3483 unsigned RF1 : 1;
3484 unsigned RF2 : 1;
3485 unsigned RF3 : 1;
3486 unsigned RF4 : 1;
3487 unsigned RF5 : 1;
3488 unsigned RF6 : 1;
3489 unsigned RF7 : 1;
3491 } __DDRFbits_t;
3493 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
3495 #define _TRISF0 0x01
3496 #define _RF0 0x01
3497 #define _TRISF1 0x02
3498 #define _RF1 0x02
3499 #define _TRISF2 0x04
3500 #define _RF2 0x04
3501 #define _TRISF3 0x08
3502 #define _RF3 0x08
3503 #define _TRISF4 0x10
3504 #define _RF4 0x10
3505 #define _TRISF5 0x20
3506 #define _RF5 0x20
3507 #define _TRISF6 0x40
3508 #define _RF6 0x40
3509 #define _TRISF7 0x80
3510 #define _RF7 0x80
3512 //==============================================================================
3515 //==============================================================================
3516 // TRISF Bits
3518 extern __at(0x0F97) __sfr TRISF;
3520 typedef union
3522 struct
3524 unsigned TRISF0 : 1;
3525 unsigned TRISF1 : 1;
3526 unsigned TRISF2 : 1;
3527 unsigned TRISF3 : 1;
3528 unsigned TRISF4 : 1;
3529 unsigned TRISF5 : 1;
3530 unsigned TRISF6 : 1;
3531 unsigned TRISF7 : 1;
3534 struct
3536 unsigned RF0 : 1;
3537 unsigned RF1 : 1;
3538 unsigned RF2 : 1;
3539 unsigned RF3 : 1;
3540 unsigned RF4 : 1;
3541 unsigned RF5 : 1;
3542 unsigned RF6 : 1;
3543 unsigned RF7 : 1;
3545 } __TRISFbits_t;
3547 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
3549 #define _TRISF_TRISF0 0x01
3550 #define _TRISF_RF0 0x01
3551 #define _TRISF_TRISF1 0x02
3552 #define _TRISF_RF1 0x02
3553 #define _TRISF_TRISF2 0x04
3554 #define _TRISF_RF2 0x04
3555 #define _TRISF_TRISF3 0x08
3556 #define _TRISF_RF3 0x08
3557 #define _TRISF_TRISF4 0x10
3558 #define _TRISF_RF4 0x10
3559 #define _TRISF_TRISF5 0x20
3560 #define _TRISF_RF5 0x20
3561 #define _TRISF_TRISF6 0x40
3562 #define _TRISF_RF6 0x40
3563 #define _TRISF_TRISF7 0x80
3564 #define _TRISF_RF7 0x80
3566 //==============================================================================
3569 //==============================================================================
3570 // DDRG Bits
3572 extern __at(0x0F98) __sfr DDRG;
3574 typedef union
3576 struct
3578 unsigned TRISG0 : 1;
3579 unsigned TRISG1 : 1;
3580 unsigned TRISG2 : 1;
3581 unsigned TRISG3 : 1;
3582 unsigned TRISG4 : 1;
3583 unsigned TRISG5 : 1;
3584 unsigned TRISG6 : 1;
3585 unsigned TRISG7 : 1;
3588 struct
3590 unsigned RG0 : 1;
3591 unsigned RG1 : 1;
3592 unsigned RG2 : 1;
3593 unsigned RG3 : 1;
3594 unsigned RG4 : 1;
3595 unsigned RG5 : 1;
3596 unsigned RG6 : 1;
3597 unsigned RG7 : 1;
3599 } __DDRGbits_t;
3601 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
3603 #define _TRISG0 0x01
3604 #define _RG0 0x01
3605 #define _TRISG1 0x02
3606 #define _RG1 0x02
3607 #define _TRISG2 0x04
3608 #define _RG2 0x04
3609 #define _TRISG3 0x08
3610 #define _RG3 0x08
3611 #define _TRISG4 0x10
3612 #define _RG4 0x10
3613 #define _TRISG5 0x20
3614 #define _RG5 0x20
3615 #define _TRISG6 0x40
3616 #define _RG6 0x40
3617 #define _TRISG7 0x80
3618 #define _RG7 0x80
3620 //==============================================================================
3623 //==============================================================================
3624 // TRISG Bits
3626 extern __at(0x0F98) __sfr TRISG;
3628 typedef union
3630 struct
3632 unsigned TRISG0 : 1;
3633 unsigned TRISG1 : 1;
3634 unsigned TRISG2 : 1;
3635 unsigned TRISG3 : 1;
3636 unsigned TRISG4 : 1;
3637 unsigned TRISG5 : 1;
3638 unsigned TRISG6 : 1;
3639 unsigned TRISG7 : 1;
3642 struct
3644 unsigned RG0 : 1;
3645 unsigned RG1 : 1;
3646 unsigned RG2 : 1;
3647 unsigned RG3 : 1;
3648 unsigned RG4 : 1;
3649 unsigned RG5 : 1;
3650 unsigned RG6 : 1;
3651 unsigned RG7 : 1;
3653 } __TRISGbits_t;
3655 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
3657 #define _TRISG_TRISG0 0x01
3658 #define _TRISG_RG0 0x01
3659 #define _TRISG_TRISG1 0x02
3660 #define _TRISG_RG1 0x02
3661 #define _TRISG_TRISG2 0x04
3662 #define _TRISG_RG2 0x04
3663 #define _TRISG_TRISG3 0x08
3664 #define _TRISG_RG3 0x08
3665 #define _TRISG_TRISG4 0x10
3666 #define _TRISG_RG4 0x10
3667 #define _TRISG_TRISG5 0x20
3668 #define _TRISG_RG5 0x20
3669 #define _TRISG_TRISG6 0x40
3670 #define _TRISG_RG6 0x40
3671 #define _TRISG_TRISG7 0x80
3672 #define _TRISG_RG7 0x80
3674 //==============================================================================
3677 //==============================================================================
3678 // DDRH Bits
3680 extern __at(0x0F99) __sfr DDRH;
3682 typedef union
3684 struct
3686 unsigned TRISH0 : 1;
3687 unsigned TRISH1 : 1;
3688 unsigned TRISH2 : 1;
3689 unsigned TRISH3 : 1;
3690 unsigned TRISH4 : 1;
3691 unsigned TRISH5 : 1;
3692 unsigned TRISH6 : 1;
3693 unsigned TRISH7 : 1;
3696 struct
3698 unsigned RH0 : 1;
3699 unsigned RH1 : 1;
3700 unsigned RH2 : 1;
3701 unsigned RH3 : 1;
3702 unsigned RH4 : 1;
3703 unsigned RH5 : 1;
3704 unsigned RH6 : 1;
3705 unsigned RH7 : 1;
3707 } __DDRHbits_t;
3709 extern __at(0x0F99) volatile __DDRHbits_t DDRHbits;
3711 #define _TRISH0 0x01
3712 #define _RH0 0x01
3713 #define _TRISH1 0x02
3714 #define _RH1 0x02
3715 #define _TRISH2 0x04
3716 #define _RH2 0x04
3717 #define _TRISH3 0x08
3718 #define _RH3 0x08
3719 #define _TRISH4 0x10
3720 #define _RH4 0x10
3721 #define _TRISH5 0x20
3722 #define _RH5 0x20
3723 #define _TRISH6 0x40
3724 #define _RH6 0x40
3725 #define _TRISH7 0x80
3726 #define _RH7 0x80
3728 //==============================================================================
3731 //==============================================================================
3732 // TRISH Bits
3734 extern __at(0x0F99) __sfr TRISH;
3736 typedef union
3738 struct
3740 unsigned TRISH0 : 1;
3741 unsigned TRISH1 : 1;
3742 unsigned TRISH2 : 1;
3743 unsigned TRISH3 : 1;
3744 unsigned TRISH4 : 1;
3745 unsigned TRISH5 : 1;
3746 unsigned TRISH6 : 1;
3747 unsigned TRISH7 : 1;
3750 struct
3752 unsigned RH0 : 1;
3753 unsigned RH1 : 1;
3754 unsigned RH2 : 1;
3755 unsigned RH3 : 1;
3756 unsigned RH4 : 1;
3757 unsigned RH5 : 1;
3758 unsigned RH6 : 1;
3759 unsigned RH7 : 1;
3761 } __TRISHbits_t;
3763 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
3765 #define _TRISH_TRISH0 0x01
3766 #define _TRISH_RH0 0x01
3767 #define _TRISH_TRISH1 0x02
3768 #define _TRISH_RH1 0x02
3769 #define _TRISH_TRISH2 0x04
3770 #define _TRISH_RH2 0x04
3771 #define _TRISH_TRISH3 0x08
3772 #define _TRISH_RH3 0x08
3773 #define _TRISH_TRISH4 0x10
3774 #define _TRISH_RH4 0x10
3775 #define _TRISH_TRISH5 0x20
3776 #define _TRISH_RH5 0x20
3777 #define _TRISH_TRISH6 0x40
3778 #define _TRISH_RH6 0x40
3779 #define _TRISH_TRISH7 0x80
3780 #define _TRISH_RH7 0x80
3782 //==============================================================================
3785 //==============================================================================
3786 // DDRJ Bits
3788 extern __at(0x0F9A) __sfr DDRJ;
3790 typedef union
3792 struct
3794 unsigned TRISJ0 : 1;
3795 unsigned TRISJ1 : 1;
3796 unsigned TRISJ2 : 1;
3797 unsigned TRISJ3 : 1;
3798 unsigned TRISJ4 : 1;
3799 unsigned TRISJ5 : 1;
3800 unsigned TRISJ6 : 1;
3801 unsigned TRISJ7 : 1;
3804 struct
3806 unsigned RJ0 : 1;
3807 unsigned RJ1 : 1;
3808 unsigned RJ2 : 1;
3809 unsigned RJ3 : 1;
3810 unsigned RJ4 : 1;
3811 unsigned RJ5 : 1;
3812 unsigned RJ6 : 1;
3813 unsigned RJ7 : 1;
3815 } __DDRJbits_t;
3817 extern __at(0x0F9A) volatile __DDRJbits_t DDRJbits;
3819 #define _TRISJ0 0x01
3820 #define _RJ0 0x01
3821 #define _TRISJ1 0x02
3822 #define _RJ1 0x02
3823 #define _TRISJ2 0x04
3824 #define _RJ2 0x04
3825 #define _TRISJ3 0x08
3826 #define _RJ3 0x08
3827 #define _TRISJ4 0x10
3828 #define _RJ4 0x10
3829 #define _TRISJ5 0x20
3830 #define _RJ5 0x20
3831 #define _TRISJ6 0x40
3832 #define _RJ6 0x40
3833 #define _TRISJ7 0x80
3834 #define _RJ7 0x80
3836 //==============================================================================
3839 //==============================================================================
3840 // TRISJ Bits
3842 extern __at(0x0F9A) __sfr TRISJ;
3844 typedef union
3846 struct
3848 unsigned TRISJ0 : 1;
3849 unsigned TRISJ1 : 1;
3850 unsigned TRISJ2 : 1;
3851 unsigned TRISJ3 : 1;
3852 unsigned TRISJ4 : 1;
3853 unsigned TRISJ5 : 1;
3854 unsigned TRISJ6 : 1;
3855 unsigned TRISJ7 : 1;
3858 struct
3860 unsigned RJ0 : 1;
3861 unsigned RJ1 : 1;
3862 unsigned RJ2 : 1;
3863 unsigned RJ3 : 1;
3864 unsigned RJ4 : 1;
3865 unsigned RJ5 : 1;
3866 unsigned RJ6 : 1;
3867 unsigned RJ7 : 1;
3869 } __TRISJbits_t;
3871 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
3873 #define _TRISJ_TRISJ0 0x01
3874 #define _TRISJ_RJ0 0x01
3875 #define _TRISJ_TRISJ1 0x02
3876 #define _TRISJ_RJ1 0x02
3877 #define _TRISJ_TRISJ2 0x04
3878 #define _TRISJ_RJ2 0x04
3879 #define _TRISJ_TRISJ3 0x08
3880 #define _TRISJ_RJ3 0x08
3881 #define _TRISJ_TRISJ4 0x10
3882 #define _TRISJ_RJ4 0x10
3883 #define _TRISJ_TRISJ5 0x20
3884 #define _TRISJ_RJ5 0x20
3885 #define _TRISJ_TRISJ6 0x40
3886 #define _TRISJ_RJ6 0x40
3887 #define _TRISJ_TRISJ7 0x80
3888 #define _TRISJ_RJ7 0x80
3890 //==============================================================================
3893 //==============================================================================
3894 // OSCTUNE Bits
3896 extern __at(0x0F9B) __sfr OSCTUNE;
3898 typedef struct
3900 unsigned : 1;
3901 unsigned : 1;
3902 unsigned : 1;
3903 unsigned : 1;
3904 unsigned PPRE : 1;
3905 unsigned PPST0 : 1;
3906 unsigned PLLEN : 1;
3907 unsigned PPST1 : 1;
3908 } __OSCTUNEbits_t;
3910 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3912 #define _PPRE 0x10
3913 #define _PPST0 0x20
3914 #define _PLLEN 0x40
3915 #define _PPST1 0x80
3917 //==============================================================================
3920 //==============================================================================
3921 // MEMCON Bits
3923 extern __at(0x0F9C) __sfr MEMCON;
3925 typedef union
3927 struct
3929 unsigned WM0 : 1;
3930 unsigned WM1 : 1;
3931 unsigned : 1;
3932 unsigned : 1;
3933 unsigned WAIT0 : 1;
3934 unsigned WAIT1 : 1;
3935 unsigned : 1;
3936 unsigned EBDIS : 1;
3939 struct
3941 unsigned WM : 2;
3942 unsigned : 6;
3945 struct
3947 unsigned : 4;
3948 unsigned WAIT : 2;
3949 unsigned : 2;
3951 } __MEMCONbits_t;
3953 extern __at(0x0F9C) volatile __MEMCONbits_t MEMCONbits;
3955 #define _WM0 0x01
3956 #define _WM1 0x02
3957 #define _WAIT0 0x10
3958 #define _WAIT1 0x20
3959 #define _EBDIS 0x80
3961 //==============================================================================
3964 //==============================================================================
3965 // PIE1 Bits
3967 extern __at(0x0F9D) __sfr PIE1;
3969 typedef union
3971 struct
3973 unsigned TMR1IE : 1;
3974 unsigned TMR2IE : 1;
3975 unsigned CCP1IE : 1;
3976 unsigned SSP1IE : 1;
3977 unsigned TX1IE : 1;
3978 unsigned RC1IE : 1;
3979 unsigned ADIE : 1;
3980 unsigned PSPIE : 1;
3983 struct
3985 unsigned : 1;
3986 unsigned : 1;
3987 unsigned : 1;
3988 unsigned SSPIE : 1;
3989 unsigned TXIE : 1;
3990 unsigned RCIE : 1;
3991 unsigned : 1;
3992 unsigned : 1;
3994 } __PIE1bits_t;
3996 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3998 #define _PIE1_TMR1IE 0x01
3999 #define _PIE1_TMR2IE 0x02
4000 #define _PIE1_CCP1IE 0x04
4001 #define _PIE1_SSP1IE 0x08
4002 #define _PIE1_SSPIE 0x08
4003 #define _PIE1_TX1IE 0x10
4004 #define _PIE1_TXIE 0x10
4005 #define _PIE1_RC1IE 0x20
4006 #define _PIE1_RCIE 0x20
4007 #define _PIE1_ADIE 0x40
4008 #define _PIE1_PSPIE 0x80
4010 //==============================================================================
4013 //==============================================================================
4014 // PIR1 Bits
4016 extern __at(0x0F9E) __sfr PIR1;
4018 typedef union
4020 struct
4022 unsigned TMR1IF : 1;
4023 unsigned TMR2IF : 1;
4024 unsigned CCP1IF : 1;
4025 unsigned SSP1IF : 1;
4026 unsigned TX1IF : 1;
4027 unsigned RC1IF : 1;
4028 unsigned ADIF : 1;
4029 unsigned PSPIF : 1;
4032 struct
4034 unsigned : 1;
4035 unsigned : 1;
4036 unsigned : 1;
4037 unsigned SSPIF : 1;
4038 unsigned TXIF : 1;
4039 unsigned RCIF : 1;
4040 unsigned : 1;
4041 unsigned : 1;
4043 } __PIR1bits_t;
4045 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
4047 #define _PIR1_TMR1IF 0x01
4048 #define _PIR1_TMR2IF 0x02
4049 #define _PIR1_CCP1IF 0x04
4050 #define _PIR1_SSP1IF 0x08
4051 #define _PIR1_SSPIF 0x08
4052 #define _PIR1_TX1IF 0x10
4053 #define _PIR1_TXIF 0x10
4054 #define _PIR1_RC1IF 0x20
4055 #define _PIR1_RCIF 0x20
4056 #define _PIR1_ADIF 0x40
4057 #define _PIR1_PSPIF 0x80
4059 //==============================================================================
4062 //==============================================================================
4063 // IPR1 Bits
4065 extern __at(0x0F9F) __sfr IPR1;
4067 typedef union
4069 struct
4071 unsigned TMR1IP : 1;
4072 unsigned TMR2IP : 1;
4073 unsigned CCP1IP : 1;
4074 unsigned SSP1IP : 1;
4075 unsigned TX1IP : 1;
4076 unsigned RC1IP : 1;
4077 unsigned ADIP : 1;
4078 unsigned PSPIP : 1;
4081 struct
4083 unsigned : 1;
4084 unsigned : 1;
4085 unsigned : 1;
4086 unsigned SSPIP : 1;
4087 unsigned TXIP : 1;
4088 unsigned RCIP : 1;
4089 unsigned : 1;
4090 unsigned : 1;
4092 } __IPR1bits_t;
4094 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
4096 #define _TMR1IP 0x01
4097 #define _TMR2IP 0x02
4098 #define _CCP1IP 0x04
4099 #define _SSP1IP 0x08
4100 #define _SSPIP 0x08
4101 #define _TX1IP 0x10
4102 #define _TXIP 0x10
4103 #define _RC1IP 0x20
4104 #define _RCIP 0x20
4105 #define _ADIP 0x40
4106 #define _PSPIP 0x80
4108 //==============================================================================
4111 //==============================================================================
4112 // PIE2 Bits
4114 extern __at(0x0FA0) __sfr PIE2;
4116 typedef union
4118 struct
4120 unsigned CCP2IE : 1;
4121 unsigned TMR3IE : 1;
4122 unsigned : 1;
4123 unsigned BCL1IE : 1;
4124 unsigned : 1;
4125 unsigned ETHIE : 1;
4126 unsigned CMIE : 1;
4127 unsigned OSCFIE : 1;
4130 struct
4132 unsigned : 1;
4133 unsigned : 1;
4134 unsigned : 1;
4135 unsigned BCLIE : 1;
4136 unsigned : 1;
4137 unsigned : 1;
4138 unsigned : 1;
4139 unsigned : 1;
4141 } __PIE2bits_t;
4143 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
4145 #define _CCP2IE 0x01
4146 #define _TMR3IE 0x02
4147 #define _BCL1IE 0x08
4148 #define _BCLIE 0x08
4149 #define _ETHIE 0x20
4150 #define _CMIE 0x40
4151 #define _OSCFIE 0x80
4153 //==============================================================================
4156 //==============================================================================
4157 // PIR2 Bits
4159 extern __at(0x0FA1) __sfr PIR2;
4161 typedef union
4163 struct
4165 unsigned CCP2IF : 1;
4166 unsigned TMR3IF : 1;
4167 unsigned : 1;
4168 unsigned BCL1IF : 1;
4169 unsigned : 1;
4170 unsigned ETHIF : 1;
4171 unsigned CMIF : 1;
4172 unsigned OSCFIF : 1;
4175 struct
4177 unsigned : 1;
4178 unsigned : 1;
4179 unsigned : 1;
4180 unsigned BCLIF : 1;
4181 unsigned : 1;
4182 unsigned : 1;
4183 unsigned : 1;
4184 unsigned : 1;
4186 } __PIR2bits_t;
4188 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
4190 #define _CCP2IF 0x01
4191 #define _TMR3IF 0x02
4192 #define _BCL1IF 0x08
4193 #define _BCLIF 0x08
4194 #define _ETHIF 0x20
4195 #define _CMIF 0x40
4196 #define _OSCFIF 0x80
4198 //==============================================================================
4201 //==============================================================================
4202 // IPR2 Bits
4204 extern __at(0x0FA2) __sfr IPR2;
4206 typedef union
4208 struct
4210 unsigned CCP2IP : 1;
4211 unsigned TMR3IP : 1;
4212 unsigned : 1;
4213 unsigned BCL1IP : 1;
4214 unsigned : 1;
4215 unsigned ETHIP : 1;
4216 unsigned CMIP : 1;
4217 unsigned OSCFIP : 1;
4220 struct
4222 unsigned : 1;
4223 unsigned : 1;
4224 unsigned : 1;
4225 unsigned BCLIP : 1;
4226 unsigned : 1;
4227 unsigned : 1;
4228 unsigned : 1;
4229 unsigned : 1;
4231 } __IPR2bits_t;
4233 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
4235 #define _CCP2IP 0x01
4236 #define _TMR3IP 0x02
4237 #define _BCL1IP 0x08
4238 #define _BCLIP 0x08
4239 #define _ETHIP 0x20
4240 #define _CMIP 0x40
4241 #define _OSCFIP 0x80
4243 //==============================================================================
4246 //==============================================================================
4247 // PIE3 Bits
4249 extern __at(0x0FA3) __sfr PIE3;
4251 typedef struct
4253 unsigned CCP3IE : 1;
4254 unsigned CCP4IE : 1;
4255 unsigned CCP5IE : 1;
4256 unsigned TMR4IE : 1;
4257 unsigned TX2IE : 1;
4258 unsigned RC2IE : 1;
4259 unsigned BCL2IE : 1;
4260 unsigned SSP2IE : 1;
4261 } __PIE3bits_t;
4263 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
4265 #define _CCP3IE 0x01
4266 #define _CCP4IE 0x02
4267 #define _CCP5IE 0x04
4268 #define _TMR4IE 0x08
4269 #define _TX2IE 0x10
4270 #define _RC2IE 0x20
4271 #define _BCL2IE 0x40
4272 #define _SSP2IE 0x80
4274 //==============================================================================
4277 //==============================================================================
4278 // PIR3 Bits
4280 extern __at(0x0FA4) __sfr PIR3;
4282 typedef struct
4284 unsigned CCP3IF : 1;
4285 unsigned CCP4IF : 1;
4286 unsigned CCP5IF : 1;
4287 unsigned TMR4IF : 1;
4288 unsigned TX2IF : 1;
4289 unsigned RC2IF : 1;
4290 unsigned BCL2IF : 1;
4291 unsigned SSP2IF : 1;
4292 } __PIR3bits_t;
4294 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
4296 #define _CCP3IF 0x01
4297 #define _CCP4IF 0x02
4298 #define _CCP5IF 0x04
4299 #define _TMR4IF 0x08
4300 #define _TX2IF 0x10
4301 #define _RC2IF 0x20
4302 #define _BCL2IF 0x40
4303 #define _SSP2IF 0x80
4305 //==============================================================================
4308 //==============================================================================
4309 // IPR3 Bits
4311 extern __at(0x0FA5) __sfr IPR3;
4313 typedef struct
4315 unsigned CCP3IP : 1;
4316 unsigned CCP4IP : 1;
4317 unsigned CCP5IP : 1;
4318 unsigned TMR4IP : 1;
4319 unsigned TX2IP : 1;
4320 unsigned RC2IP : 1;
4321 unsigned BCL2IP : 1;
4322 unsigned SSP2IP : 1;
4323 } __IPR3bits_t;
4325 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
4327 #define _CCP3IP 0x01
4328 #define _CCP4IP 0x02
4329 #define _CCP5IP 0x04
4330 #define _TMR4IP 0x08
4331 #define _TX2IP 0x10
4332 #define _RC2IP 0x20
4333 #define _BCL2IP 0x40
4334 #define _SSP2IP 0x80
4336 //==============================================================================
4339 //==============================================================================
4340 // EECON1 Bits
4342 extern __at(0x0FA6) __sfr EECON1;
4344 typedef struct
4346 unsigned : 1;
4347 unsigned WR : 1;
4348 unsigned WREN : 1;
4349 unsigned WRERR : 1;
4350 unsigned FREE : 1;
4351 unsigned : 1;
4352 unsigned : 1;
4353 unsigned : 1;
4354 } __EECON1bits_t;
4356 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
4358 #define _WR 0x02
4359 #define _WREN 0x04
4360 #define _WRERR 0x08
4361 #define _FREE 0x10
4363 //==============================================================================
4365 extern __at(0x0FA7) __sfr EECON2;
4367 //==============================================================================
4368 // RCSTA Bits
4370 extern __at(0x0FAB) __sfr RCSTA;
4372 typedef union
4374 struct
4376 unsigned RX9D : 1;
4377 unsigned OERR : 1;
4378 unsigned FERR : 1;
4379 unsigned ADDEN : 1;
4380 unsigned CREN : 1;
4381 unsigned SREN : 1;
4382 unsigned RX9 : 1;
4383 unsigned SPEN : 1;
4386 struct
4388 unsigned RCD8 : 1;
4389 unsigned OERR1 : 1;
4390 unsigned FERR1 : 1;
4391 unsigned ADDEN1 : 1;
4392 unsigned CREN1 : 1;
4393 unsigned SREN1 : 1;
4394 unsigned RC9 : 1;
4395 unsigned SPEN1 : 1;
4398 struct
4400 unsigned RX9D1 : 1;
4401 unsigned : 1;
4402 unsigned : 1;
4403 unsigned : 1;
4404 unsigned : 1;
4405 unsigned : 1;
4406 unsigned NOT_RC8 : 1;
4407 unsigned : 1;
4410 struct
4412 unsigned : 1;
4413 unsigned : 1;
4414 unsigned : 1;
4415 unsigned : 1;
4416 unsigned : 1;
4417 unsigned : 1;
4418 unsigned RC8_9 : 1;
4419 unsigned : 1;
4422 struct
4424 unsigned : 1;
4425 unsigned : 1;
4426 unsigned : 1;
4427 unsigned : 1;
4428 unsigned : 1;
4429 unsigned : 1;
4430 unsigned RX91 : 1;
4431 unsigned : 1;
4433 } __RCSTAbits_t;
4435 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
4437 #define _RX9D 0x01
4438 #define _RCD8 0x01
4439 #define _RX9D1 0x01
4440 #define _OERR 0x02
4441 #define _OERR1 0x02
4442 #define _FERR 0x04
4443 #define _FERR1 0x04
4444 #define _ADDEN 0x08
4445 #define _ADDEN1 0x08
4446 #define _CREN 0x10
4447 #define _CREN1 0x10
4448 #define _SREN 0x20
4449 #define _SREN1 0x20
4450 #define _RX9 0x40
4451 #define _RC9 0x40
4452 #define _NOT_RC8 0x40
4453 #define _RC8_9 0x40
4454 #define _RX91 0x40
4455 #define _SPEN 0x80
4456 #define _SPEN1 0x80
4458 //==============================================================================
4461 //==============================================================================
4462 // RCSTA1 Bits
4464 extern __at(0x0FAB) __sfr RCSTA1;
4466 typedef union
4468 struct
4470 unsigned RX9D : 1;
4471 unsigned OERR : 1;
4472 unsigned FERR : 1;
4473 unsigned ADDEN : 1;
4474 unsigned CREN : 1;
4475 unsigned SREN : 1;
4476 unsigned RX9 : 1;
4477 unsigned SPEN : 1;
4480 struct
4482 unsigned RCD8 : 1;
4483 unsigned OERR1 : 1;
4484 unsigned FERR1 : 1;
4485 unsigned ADDEN1 : 1;
4486 unsigned CREN1 : 1;
4487 unsigned SREN1 : 1;
4488 unsigned RC9 : 1;
4489 unsigned SPEN1 : 1;
4492 struct
4494 unsigned RX9D1 : 1;
4495 unsigned : 1;
4496 unsigned : 1;
4497 unsigned : 1;
4498 unsigned : 1;
4499 unsigned : 1;
4500 unsigned NOT_RC8 : 1;
4501 unsigned : 1;
4504 struct
4506 unsigned : 1;
4507 unsigned : 1;
4508 unsigned : 1;
4509 unsigned : 1;
4510 unsigned : 1;
4511 unsigned : 1;
4512 unsigned RC8_9 : 1;
4513 unsigned : 1;
4516 struct
4518 unsigned : 1;
4519 unsigned : 1;
4520 unsigned : 1;
4521 unsigned : 1;
4522 unsigned : 1;
4523 unsigned : 1;
4524 unsigned RX91 : 1;
4525 unsigned : 1;
4527 } __RCSTA1bits_t;
4529 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
4531 #define _RCSTA1_RX9D 0x01
4532 #define _RCSTA1_RCD8 0x01
4533 #define _RCSTA1_RX9D1 0x01
4534 #define _RCSTA1_OERR 0x02
4535 #define _RCSTA1_OERR1 0x02
4536 #define _RCSTA1_FERR 0x04
4537 #define _RCSTA1_FERR1 0x04
4538 #define _RCSTA1_ADDEN 0x08
4539 #define _RCSTA1_ADDEN1 0x08
4540 #define _RCSTA1_CREN 0x10
4541 #define _RCSTA1_CREN1 0x10
4542 #define _RCSTA1_SREN 0x20
4543 #define _RCSTA1_SREN1 0x20
4544 #define _RCSTA1_RX9 0x40
4545 #define _RCSTA1_RC9 0x40
4546 #define _RCSTA1_NOT_RC8 0x40
4547 #define _RCSTA1_RC8_9 0x40
4548 #define _RCSTA1_RX91 0x40
4549 #define _RCSTA1_SPEN 0x80
4550 #define _RCSTA1_SPEN1 0x80
4552 //==============================================================================
4555 //==============================================================================
4556 // TXSTA Bits
4558 extern __at(0x0FAC) __sfr TXSTA;
4560 typedef union
4562 struct
4564 unsigned TX9D : 1;
4565 unsigned TRMT : 1;
4566 unsigned BRGH : 1;
4567 unsigned SENDB : 1;
4568 unsigned SYNC : 1;
4569 unsigned TXEN : 1;
4570 unsigned TX9 : 1;
4571 unsigned CSRC : 1;
4574 struct
4576 unsigned TXD8 : 1;
4577 unsigned TRMT1 : 1;
4578 unsigned BRGH1 : 1;
4579 unsigned SENDB1 : 1;
4580 unsigned SYNC1 : 1;
4581 unsigned TXEN1 : 1;
4582 unsigned TX8_9 : 1;
4583 unsigned CSRC1 : 1;
4586 struct
4588 unsigned TX9D1 : 1;
4589 unsigned : 1;
4590 unsigned : 1;
4591 unsigned : 1;
4592 unsigned : 1;
4593 unsigned : 1;
4594 unsigned NOT_TX8 : 1;
4595 unsigned : 1;
4598 struct
4600 unsigned : 1;
4601 unsigned : 1;
4602 unsigned : 1;
4603 unsigned : 1;
4604 unsigned : 1;
4605 unsigned : 1;
4606 unsigned TX91 : 1;
4607 unsigned : 1;
4609 } __TXSTAbits_t;
4611 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
4613 #define _TX9D 0x01
4614 #define _TXD8 0x01
4615 #define _TX9D1 0x01
4616 #define _TRMT 0x02
4617 #define _TRMT1 0x02
4618 #define _BRGH 0x04
4619 #define _BRGH1 0x04
4620 #define _SENDB 0x08
4621 #define _SENDB1 0x08
4622 #define _SYNC 0x10
4623 #define _SYNC1 0x10
4624 #define _TXEN 0x20
4625 #define _TXEN1 0x20
4626 #define _TX9 0x40
4627 #define _TX8_9 0x40
4628 #define _NOT_TX8 0x40
4629 #define _TX91 0x40
4630 #define _CSRC 0x80
4631 #define _CSRC1 0x80
4633 //==============================================================================
4636 //==============================================================================
4637 // TXSTA1 Bits
4639 extern __at(0x0FAC) __sfr TXSTA1;
4641 typedef union
4643 struct
4645 unsigned TX9D : 1;
4646 unsigned TRMT : 1;
4647 unsigned BRGH : 1;
4648 unsigned SENDB : 1;
4649 unsigned SYNC : 1;
4650 unsigned TXEN : 1;
4651 unsigned TX9 : 1;
4652 unsigned CSRC : 1;
4655 struct
4657 unsigned TXD8 : 1;
4658 unsigned TRMT1 : 1;
4659 unsigned BRGH1 : 1;
4660 unsigned SENDB1 : 1;
4661 unsigned SYNC1 : 1;
4662 unsigned TXEN1 : 1;
4663 unsigned TX8_9 : 1;
4664 unsigned CSRC1 : 1;
4667 struct
4669 unsigned TX9D1 : 1;
4670 unsigned : 1;
4671 unsigned : 1;
4672 unsigned : 1;
4673 unsigned : 1;
4674 unsigned : 1;
4675 unsigned NOT_TX8 : 1;
4676 unsigned : 1;
4679 struct
4681 unsigned : 1;
4682 unsigned : 1;
4683 unsigned : 1;
4684 unsigned : 1;
4685 unsigned : 1;
4686 unsigned : 1;
4687 unsigned TX91 : 1;
4688 unsigned : 1;
4690 } __TXSTA1bits_t;
4692 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
4694 #define _TXSTA1_TX9D 0x01
4695 #define _TXSTA1_TXD8 0x01
4696 #define _TXSTA1_TX9D1 0x01
4697 #define _TXSTA1_TRMT 0x02
4698 #define _TXSTA1_TRMT1 0x02
4699 #define _TXSTA1_BRGH 0x04
4700 #define _TXSTA1_BRGH1 0x04
4701 #define _TXSTA1_SENDB 0x08
4702 #define _TXSTA1_SENDB1 0x08
4703 #define _TXSTA1_SYNC 0x10
4704 #define _TXSTA1_SYNC1 0x10
4705 #define _TXSTA1_TXEN 0x20
4706 #define _TXSTA1_TXEN1 0x20
4707 #define _TXSTA1_TX9 0x40
4708 #define _TXSTA1_TX8_9 0x40
4709 #define _TXSTA1_NOT_TX8 0x40
4710 #define _TXSTA1_TX91 0x40
4711 #define _TXSTA1_CSRC 0x80
4712 #define _TXSTA1_CSRC1 0x80
4714 //==============================================================================
4716 extern __at(0x0FAD) __sfr TXREG;
4717 extern __at(0x0FAD) __sfr TXREG1;
4718 extern __at(0x0FAE) __sfr RCREG;
4719 extern __at(0x0FAE) __sfr RCREG1;
4720 extern __at(0x0FAF) __sfr SPBRG;
4721 extern __at(0x0FAF) __sfr SPBRG1;
4723 //==============================================================================
4724 // PSPCON Bits
4726 extern __at(0x0FB0) __sfr PSPCON;
4728 typedef struct
4730 unsigned : 1;
4731 unsigned : 1;
4732 unsigned : 1;
4733 unsigned : 1;
4734 unsigned PSPMODE : 1;
4735 unsigned IBOV : 1;
4736 unsigned OBF : 1;
4737 unsigned IBF : 1;
4738 } __PSPCONbits_t;
4740 extern __at(0x0FB0) volatile __PSPCONbits_t PSPCONbits;
4742 #define _PSPMODE 0x10
4743 #define _IBOV 0x20
4744 #define _OBF 0x40
4745 #define _IBF 0x80
4747 //==============================================================================
4750 //==============================================================================
4751 // T3CON Bits
4753 extern __at(0x0FB1) __sfr T3CON;
4755 typedef union
4757 struct
4759 unsigned TMR3ON : 1;
4760 unsigned TMR3CS : 1;
4761 unsigned NOT_T3SYNC : 1;
4762 unsigned T3CCP1 : 1;
4763 unsigned T3CKPS0 : 1;
4764 unsigned T3CKPS1 : 1;
4765 unsigned T3CCP2 : 1;
4766 unsigned RD16 : 1;
4769 struct
4771 unsigned : 1;
4772 unsigned : 1;
4773 unsigned T3SYNC : 1;
4774 unsigned : 1;
4775 unsigned : 1;
4776 unsigned : 1;
4777 unsigned : 1;
4778 unsigned : 1;
4781 struct
4783 unsigned : 1;
4784 unsigned : 1;
4785 unsigned T3INSYNC : 1;
4786 unsigned : 1;
4787 unsigned : 1;
4788 unsigned : 1;
4789 unsigned : 1;
4790 unsigned : 1;
4793 struct
4795 unsigned : 4;
4796 unsigned T3CKPS : 2;
4797 unsigned : 2;
4799 } __T3CONbits_t;
4801 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
4803 #define _T3CON_TMR3ON 0x01
4804 #define _T3CON_TMR3CS 0x02
4805 #define _T3CON_NOT_T3SYNC 0x04
4806 #define _T3CON_T3SYNC 0x04
4807 #define _T3CON_T3INSYNC 0x04
4808 #define _T3CON_T3CCP1 0x08
4809 #define _T3CON_T3CKPS0 0x10
4810 #define _T3CON_T3CKPS1 0x20
4811 #define _T3CON_T3CCP2 0x40
4812 #define _T3CON_RD16 0x80
4814 //==============================================================================
4816 extern __at(0x0FB2) __sfr TMR3;
4817 extern __at(0x0FB2) __sfr TMR3L;
4818 extern __at(0x0FB3) __sfr TMR3H;
4820 //==============================================================================
4821 // CMCON Bits
4823 extern __at(0x0FB4) __sfr CMCON;
4825 typedef union
4827 struct
4829 unsigned CM0 : 1;
4830 unsigned CM1 : 1;
4831 unsigned CM2 : 1;
4832 unsigned CIS : 1;
4833 unsigned C1INV : 1;
4834 unsigned C2INV : 1;
4835 unsigned C1OUT : 1;
4836 unsigned C2OUT : 1;
4839 struct
4841 unsigned CM : 3;
4842 unsigned : 5;
4844 } __CMCONbits_t;
4846 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
4848 #define _CM0 0x01
4849 #define _CM1 0x02
4850 #define _CM2 0x04
4851 #define _CIS 0x08
4852 #define _C1INV 0x10
4853 #define _C2INV 0x20
4854 #define _C1OUT 0x40
4855 #define _C2OUT 0x80
4857 //==============================================================================
4860 //==============================================================================
4861 // CVRCON Bits
4863 extern __at(0x0FB5) __sfr CVRCON;
4865 typedef union
4867 struct
4869 unsigned CVR0 : 1;
4870 unsigned CVR1 : 1;
4871 unsigned CVR2 : 1;
4872 unsigned CVR3 : 1;
4873 unsigned CVRSS : 1;
4874 unsigned CVRR : 1;
4875 unsigned CVROE : 1;
4876 unsigned CVREN : 1;
4879 struct
4881 unsigned CVR : 4;
4882 unsigned : 4;
4884 } __CVRCONbits_t;
4886 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
4888 #define _CVR0 0x01
4889 #define _CVR1 0x02
4890 #define _CVR2 0x04
4891 #define _CVR3 0x08
4892 #define _CVRSS 0x10
4893 #define _CVRR 0x20
4894 #define _CVROE 0x40
4895 #define _CVREN 0x80
4897 //==============================================================================
4900 //==============================================================================
4901 // ECCP1AS Bits
4903 extern __at(0x0FB6) __sfr ECCP1AS;
4905 typedef union
4907 struct
4909 unsigned PSSBD0 : 1;
4910 unsigned PSSBD1 : 1;
4911 unsigned PSSAC0 : 1;
4912 unsigned PSSAC1 : 1;
4913 unsigned ECCPAS0 : 1;
4914 unsigned ECCPAS1 : 1;
4915 unsigned ECCPAS2 : 1;
4916 unsigned ECCPASE : 1;
4919 struct
4921 unsigned PSS1BD0 : 1;
4922 unsigned PSS1BD1 : 1;
4923 unsigned PSS1AC0 : 1;
4924 unsigned PSS1AC1 : 1;
4925 unsigned ECCP1AS0 : 1;
4926 unsigned ECCP1AS1 : 1;
4927 unsigned ECCP1AS2 : 1;
4928 unsigned ECCP1ASE : 1;
4931 struct
4933 unsigned PSSBD : 2;
4934 unsigned : 6;
4937 struct
4939 unsigned PSS1BD : 2;
4940 unsigned : 6;
4943 struct
4945 unsigned : 2;
4946 unsigned PSSAC : 2;
4947 unsigned : 4;
4950 struct
4952 unsigned : 2;
4953 unsigned PSS1AC : 2;
4954 unsigned : 4;
4957 struct
4959 unsigned : 4;
4960 unsigned ECCPAS : 3;
4961 unsigned : 1;
4964 struct
4966 unsigned : 4;
4967 unsigned ECCP1AS : 3;
4968 unsigned : 1;
4970 } __ECCP1ASbits_t;
4972 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
4974 #define _PSSBD0 0x01
4975 #define _PSS1BD0 0x01
4976 #define _PSSBD1 0x02
4977 #define _PSS1BD1 0x02
4978 #define _PSSAC0 0x04
4979 #define _PSS1AC0 0x04
4980 #define _PSSAC1 0x08
4981 #define _PSS1AC1 0x08
4982 #define _ECCPAS0 0x10
4983 #define _ECCP1AS0 0x10
4984 #define _ECCPAS1 0x20
4985 #define _ECCP1AS1 0x20
4986 #define _ECCPAS2 0x40
4987 #define _ECCP1AS2 0x40
4988 #define _ECCPASE 0x80
4989 #define _ECCP1ASE 0x80
4991 //==============================================================================
4994 //==============================================================================
4995 // CCP3CON Bits
4997 extern __at(0x0FB7) __sfr CCP3CON;
4999 typedef union
5001 struct
5003 unsigned CCP3M0 : 1;
5004 unsigned CCP3M1 : 1;
5005 unsigned CCP3M2 : 1;
5006 unsigned CCP3M3 : 1;
5007 unsigned DC3B0 : 1;
5008 unsigned DC3B1 : 1;
5009 unsigned P3M0 : 1;
5010 unsigned P3M1 : 1;
5013 struct
5015 unsigned : 1;
5016 unsigned : 1;
5017 unsigned : 1;
5018 unsigned : 1;
5019 unsigned CCP3Y : 1;
5020 unsigned CCP3X : 1;
5021 unsigned : 1;
5022 unsigned : 1;
5025 struct
5027 unsigned CCP3M : 4;
5028 unsigned : 4;
5031 struct
5033 unsigned : 4;
5034 unsigned DC3B : 2;
5035 unsigned : 2;
5038 struct
5040 unsigned : 6;
5041 unsigned P3M : 2;
5043 } __CCP3CONbits_t;
5045 extern __at(0x0FB7) volatile __CCP3CONbits_t CCP3CONbits;
5047 #define _CCP3M0 0x01
5048 #define _CCP3M1 0x02
5049 #define _CCP3M2 0x04
5050 #define _CCP3M3 0x08
5051 #define _DC3B0 0x10
5052 #define _CCP3Y 0x10
5053 #define _DC3B1 0x20
5054 #define _CCP3X 0x20
5055 #define _P3M0 0x40
5056 #define _P3M1 0x80
5058 //==============================================================================
5061 //==============================================================================
5062 // ECCP3CON Bits
5064 extern __at(0x0FB7) __sfr ECCP3CON;
5066 typedef union
5068 struct
5070 unsigned CCP3M0 : 1;
5071 unsigned CCP3M1 : 1;
5072 unsigned CCP3M2 : 1;
5073 unsigned CCP3M3 : 1;
5074 unsigned DC3B0 : 1;
5075 unsigned DC3B1 : 1;
5076 unsigned P3M0 : 1;
5077 unsigned P3M1 : 1;
5080 struct
5082 unsigned : 1;
5083 unsigned : 1;
5084 unsigned : 1;
5085 unsigned : 1;
5086 unsigned CCP3Y : 1;
5087 unsigned CCP3X : 1;
5088 unsigned : 1;
5089 unsigned : 1;
5092 struct
5094 unsigned CCP3M : 4;
5095 unsigned : 4;
5098 struct
5100 unsigned : 4;
5101 unsigned DC3B : 2;
5102 unsigned : 2;
5105 struct
5107 unsigned : 6;
5108 unsigned P3M : 2;
5110 } __ECCP3CONbits_t;
5112 extern __at(0x0FB7) volatile __ECCP3CONbits_t ECCP3CONbits;
5114 #define _ECCP3CON_CCP3M0 0x01
5115 #define _ECCP3CON_CCP3M1 0x02
5116 #define _ECCP3CON_CCP3M2 0x04
5117 #define _ECCP3CON_CCP3M3 0x08
5118 #define _ECCP3CON_DC3B0 0x10
5119 #define _ECCP3CON_CCP3Y 0x10
5120 #define _ECCP3CON_DC3B1 0x20
5121 #define _ECCP3CON_CCP3X 0x20
5122 #define _ECCP3CON_P3M0 0x40
5123 #define _ECCP3CON_P3M1 0x80
5125 //==============================================================================
5127 extern __at(0x0FB8) __sfr CCPR3;
5128 extern __at(0x0FB8) __sfr CCPR3L;
5129 extern __at(0x0FB9) __sfr CCPR3H;
5131 //==============================================================================
5132 // CCP2CON Bits
5134 extern __at(0x0FBA) __sfr CCP2CON;
5136 typedef union
5138 struct
5140 unsigned CCP2M0 : 1;
5141 unsigned CCP2M1 : 1;
5142 unsigned CCP2M2 : 1;
5143 unsigned CCP2M3 : 1;
5144 unsigned DC2B0 : 1;
5145 unsigned DC2B1 : 1;
5146 unsigned P2M0 : 1;
5147 unsigned P2M1 : 1;
5150 struct
5152 unsigned : 1;
5153 unsigned : 1;
5154 unsigned : 1;
5155 unsigned : 1;
5156 unsigned CCP2Y : 1;
5157 unsigned CCP2X : 1;
5158 unsigned : 1;
5159 unsigned : 1;
5162 struct
5164 unsigned CCP2M : 4;
5165 unsigned : 4;
5168 struct
5170 unsigned : 4;
5171 unsigned DC2B : 2;
5172 unsigned : 2;
5175 struct
5177 unsigned : 6;
5178 unsigned P2M : 2;
5180 } __CCP2CONbits_t;
5182 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
5184 #define _CCP2M0 0x01
5185 #define _CCP2M1 0x02
5186 #define _CCP2M2 0x04
5187 #define _CCP2M3 0x08
5188 #define _DC2B0 0x10
5189 #define _CCP2Y 0x10
5190 #define _DC2B1 0x20
5191 #define _CCP2X 0x20
5192 #define _P2M0 0x40
5193 #define _P2M1 0x80
5195 //==============================================================================
5198 //==============================================================================
5199 // ECCP2CON Bits
5201 extern __at(0x0FBA) __sfr ECCP2CON;
5203 typedef union
5205 struct
5207 unsigned CCP2M0 : 1;
5208 unsigned CCP2M1 : 1;
5209 unsigned CCP2M2 : 1;
5210 unsigned CCP2M3 : 1;
5211 unsigned DC2B0 : 1;
5212 unsigned DC2B1 : 1;
5213 unsigned P2M0 : 1;
5214 unsigned P2M1 : 1;
5217 struct
5219 unsigned : 1;
5220 unsigned : 1;
5221 unsigned : 1;
5222 unsigned : 1;
5223 unsigned CCP2Y : 1;
5224 unsigned CCP2X : 1;
5225 unsigned : 1;
5226 unsigned : 1;
5229 struct
5231 unsigned CCP2M : 4;
5232 unsigned : 4;
5235 struct
5237 unsigned : 4;
5238 unsigned DC2B : 2;
5239 unsigned : 2;
5242 struct
5244 unsigned : 6;
5245 unsigned P2M : 2;
5247 } __ECCP2CONbits_t;
5249 extern __at(0x0FBA) volatile __ECCP2CONbits_t ECCP2CONbits;
5251 #define _ECCP2CON_CCP2M0 0x01
5252 #define _ECCP2CON_CCP2M1 0x02
5253 #define _ECCP2CON_CCP2M2 0x04
5254 #define _ECCP2CON_CCP2M3 0x08
5255 #define _ECCP2CON_DC2B0 0x10
5256 #define _ECCP2CON_CCP2Y 0x10
5257 #define _ECCP2CON_DC2B1 0x20
5258 #define _ECCP2CON_CCP2X 0x20
5259 #define _ECCP2CON_P2M0 0x40
5260 #define _ECCP2CON_P2M1 0x80
5262 //==============================================================================
5264 extern __at(0x0FBB) __sfr CCPR2;
5265 extern __at(0x0FBB) __sfr CCPR2L;
5266 extern __at(0x0FBC) __sfr CCPR2H;
5268 //==============================================================================
5269 // CCP1CON Bits
5271 extern __at(0x0FBD) __sfr CCP1CON;
5273 typedef union
5275 struct
5277 unsigned CCP1M0 : 1;
5278 unsigned CCP1M1 : 1;
5279 unsigned CCP1M2 : 1;
5280 unsigned CCP1M3 : 1;
5281 unsigned DC1B0 : 1;
5282 unsigned DC1B1 : 1;
5283 unsigned P1M0 : 1;
5284 unsigned P1M1 : 1;
5287 struct
5289 unsigned : 1;
5290 unsigned : 1;
5291 unsigned : 1;
5292 unsigned : 1;
5293 unsigned CCP1Y : 1;
5294 unsigned CCP1X : 1;
5295 unsigned : 1;
5296 unsigned : 1;
5299 struct
5301 unsigned CCP1M : 4;
5302 unsigned : 4;
5305 struct
5307 unsigned : 4;
5308 unsigned DC1B : 2;
5309 unsigned : 2;
5312 struct
5314 unsigned : 6;
5315 unsigned P1M : 2;
5317 } __CCP1CONbits_t;
5319 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
5321 #define _CCP1M0 0x01
5322 #define _CCP1M1 0x02
5323 #define _CCP1M2 0x04
5324 #define _CCP1M3 0x08
5325 #define _DC1B0 0x10
5326 #define _CCP1Y 0x10
5327 #define _DC1B1 0x20
5328 #define _CCP1X 0x20
5329 #define _P1M0 0x40
5330 #define _P1M1 0x80
5332 //==============================================================================
5335 //==============================================================================
5336 // ECCP1CON Bits
5338 extern __at(0x0FBD) __sfr ECCP1CON;
5340 typedef union
5342 struct
5344 unsigned CCP1M0 : 1;
5345 unsigned CCP1M1 : 1;
5346 unsigned CCP1M2 : 1;
5347 unsigned CCP1M3 : 1;
5348 unsigned DC1B0 : 1;
5349 unsigned DC1B1 : 1;
5350 unsigned P1M0 : 1;
5351 unsigned P1M1 : 1;
5354 struct
5356 unsigned : 1;
5357 unsigned : 1;
5358 unsigned : 1;
5359 unsigned : 1;
5360 unsigned CCP1Y : 1;
5361 unsigned CCP1X : 1;
5362 unsigned : 1;
5363 unsigned : 1;
5366 struct
5368 unsigned CCP1M : 4;
5369 unsigned : 4;
5372 struct
5374 unsigned : 4;
5375 unsigned DC1B : 2;
5376 unsigned : 2;
5379 struct
5381 unsigned : 6;
5382 unsigned P1M : 2;
5384 } __ECCP1CONbits_t;
5386 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits;
5388 #define _ECCP1CON_CCP1M0 0x01
5389 #define _ECCP1CON_CCP1M1 0x02
5390 #define _ECCP1CON_CCP1M2 0x04
5391 #define _ECCP1CON_CCP1M3 0x08
5392 #define _ECCP1CON_DC1B0 0x10
5393 #define _ECCP1CON_CCP1Y 0x10
5394 #define _ECCP1CON_DC1B1 0x20
5395 #define _ECCP1CON_CCP1X 0x20
5396 #define _ECCP1CON_P1M0 0x40
5397 #define _ECCP1CON_P1M1 0x80
5399 //==============================================================================
5401 extern __at(0x0FBE) __sfr CCPR1;
5402 extern __at(0x0FBE) __sfr CCPR1L;
5403 extern __at(0x0FBF) __sfr CCPR1H;
5405 //==============================================================================
5406 // ADCON2 Bits
5408 extern __at(0x0FC0) __sfr ADCON2;
5410 typedef union
5412 struct
5414 unsigned ADCS0 : 1;
5415 unsigned ADCS1 : 1;
5416 unsigned ADCS2 : 1;
5417 unsigned ACQT0 : 1;
5418 unsigned ACQT1 : 1;
5419 unsigned ACQT2 : 1;
5420 unsigned : 1;
5421 unsigned ADFM : 1;
5424 struct
5426 unsigned ADCS : 3;
5427 unsigned : 5;
5430 struct
5432 unsigned : 3;
5433 unsigned ACQT : 3;
5434 unsigned : 2;
5436 } __ADCON2bits_t;
5438 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
5440 #define _ADCS0 0x01
5441 #define _ADCS1 0x02
5442 #define _ADCS2 0x04
5443 #define _ACQT0 0x08
5444 #define _ACQT1 0x10
5445 #define _ACQT2 0x20
5446 #define _ADFM 0x80
5448 //==============================================================================
5451 //==============================================================================
5452 // ADCON1 Bits
5454 extern __at(0x0FC1) __sfr ADCON1;
5456 typedef union
5458 struct
5460 unsigned PCFG0 : 1;
5461 unsigned PCFG1 : 1;
5462 unsigned PCFG2 : 1;
5463 unsigned PCFG3 : 1;
5464 unsigned VCFG0 : 1;
5465 unsigned VCFG1 : 1;
5466 unsigned : 1;
5467 unsigned : 1;
5470 struct
5472 unsigned PCFG : 4;
5473 unsigned : 4;
5476 struct
5478 unsigned : 4;
5479 unsigned VCFG : 2;
5480 unsigned : 2;
5482 } __ADCON1bits_t;
5484 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5486 #define _PCFG0 0x01
5487 #define _PCFG1 0x02
5488 #define _PCFG2 0x04
5489 #define _PCFG3 0x08
5490 #define _VCFG0 0x10
5491 #define _VCFG1 0x20
5493 //==============================================================================
5496 //==============================================================================
5497 // ADCON0 Bits
5499 extern __at(0x0FC2) __sfr ADCON0;
5501 typedef union
5503 struct
5505 unsigned ADON : 1;
5506 unsigned GO_NOT_DONE : 1;
5507 unsigned CHS0 : 1;
5508 unsigned CHS1 : 1;
5509 unsigned CHS2 : 1;
5510 unsigned CHS3 : 1;
5511 unsigned : 1;
5512 unsigned ADCAL : 1;
5515 struct
5517 unsigned : 1;
5518 unsigned DONE : 1;
5519 unsigned : 1;
5520 unsigned : 1;
5521 unsigned : 1;
5522 unsigned : 1;
5523 unsigned : 1;
5524 unsigned : 1;
5527 struct
5529 unsigned : 1;
5530 unsigned GO_DONE : 1;
5531 unsigned : 1;
5532 unsigned : 1;
5533 unsigned : 1;
5534 unsigned : 1;
5535 unsigned : 1;
5536 unsigned : 1;
5539 struct
5541 unsigned : 1;
5542 unsigned GO : 1;
5543 unsigned : 1;
5544 unsigned : 1;
5545 unsigned : 1;
5546 unsigned : 1;
5547 unsigned : 1;
5548 unsigned : 1;
5551 struct
5553 unsigned : 1;
5554 unsigned NOT_DONE : 1;
5555 unsigned : 1;
5556 unsigned : 1;
5557 unsigned : 1;
5558 unsigned : 1;
5559 unsigned : 1;
5560 unsigned : 1;
5563 struct
5565 unsigned : 2;
5566 unsigned CHS : 4;
5567 unsigned : 2;
5569 } __ADCON0bits_t;
5571 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
5573 #define _ADON 0x01
5574 #define _GO_NOT_DONE 0x02
5575 #define _DONE 0x02
5576 #define _GO_DONE 0x02
5577 #define _GO 0x02
5578 #define _NOT_DONE 0x02
5579 #define _CHS0 0x04
5580 #define _CHS1 0x08
5581 #define _CHS2 0x10
5582 #define _CHS3 0x20
5583 #define _ADCAL 0x80
5585 //==============================================================================
5587 extern __at(0x0FC3) __sfr ADRES;
5588 extern __at(0x0FC3) __sfr ADRESL;
5589 extern __at(0x0FC4) __sfr ADRESH;
5591 //==============================================================================
5592 // SSP1CON2 Bits
5594 extern __at(0x0FC5) __sfr SSP1CON2;
5596 typedef union
5598 struct
5600 unsigned SEN : 1;
5601 unsigned RSEN : 1;
5602 unsigned PEN : 1;
5603 unsigned RCEN : 1;
5604 unsigned ACKEN : 1;
5605 unsigned ACKDT : 1;
5606 unsigned ACKSTAT : 1;
5607 unsigned GCEN : 1;
5610 struct
5612 unsigned : 1;
5613 unsigned ADMSK1 : 1;
5614 unsigned ADMSK2 : 1;
5615 unsigned ADMSK3 : 1;
5616 unsigned ADMSK4 : 1;
5617 unsigned ADMSK5 : 1;
5618 unsigned : 1;
5619 unsigned : 1;
5621 } __SSP1CON2bits_t;
5623 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
5625 #define _SEN 0x01
5626 #define _RSEN 0x02
5627 #define _ADMSK1 0x02
5628 #define _PEN 0x04
5629 #define _ADMSK2 0x04
5630 #define _RCEN 0x08
5631 #define _ADMSK3 0x08
5632 #define _ACKEN 0x10
5633 #define _ADMSK4 0x10
5634 #define _ACKDT 0x20
5635 #define _ADMSK5 0x20
5636 #define _ACKSTAT 0x40
5637 #define _GCEN 0x80
5639 //==============================================================================
5642 //==============================================================================
5643 // SSPCON2 Bits
5645 extern __at(0x0FC5) __sfr SSPCON2;
5647 typedef union
5649 struct
5651 unsigned SEN : 1;
5652 unsigned RSEN : 1;
5653 unsigned PEN : 1;
5654 unsigned RCEN : 1;
5655 unsigned ACKEN : 1;
5656 unsigned ACKDT : 1;
5657 unsigned ACKSTAT : 1;
5658 unsigned GCEN : 1;
5661 struct
5663 unsigned : 1;
5664 unsigned ADMSK1 : 1;
5665 unsigned ADMSK2 : 1;
5666 unsigned ADMSK3 : 1;
5667 unsigned ADMSK4 : 1;
5668 unsigned ADMSK5 : 1;
5669 unsigned : 1;
5670 unsigned : 1;
5672 } __SSPCON2bits_t;
5674 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5676 #define _SSPCON2_SEN 0x01
5677 #define _SSPCON2_RSEN 0x02
5678 #define _SSPCON2_ADMSK1 0x02
5679 #define _SSPCON2_PEN 0x04
5680 #define _SSPCON2_ADMSK2 0x04
5681 #define _SSPCON2_RCEN 0x08
5682 #define _SSPCON2_ADMSK3 0x08
5683 #define _SSPCON2_ACKEN 0x10
5684 #define _SSPCON2_ADMSK4 0x10
5685 #define _SSPCON2_ACKDT 0x20
5686 #define _SSPCON2_ADMSK5 0x20
5687 #define _SSPCON2_ACKSTAT 0x40
5688 #define _SSPCON2_GCEN 0x80
5690 //==============================================================================
5693 //==============================================================================
5694 // SSP1CON1 Bits
5696 extern __at(0x0FC6) __sfr SSP1CON1;
5698 typedef union
5700 struct
5702 unsigned SSPM0 : 1;
5703 unsigned SSPM1 : 1;
5704 unsigned SSPM2 : 1;
5705 unsigned SSPM3 : 1;
5706 unsigned CKP : 1;
5707 unsigned SSPEN : 1;
5708 unsigned SSPOV : 1;
5709 unsigned WCOL : 1;
5712 struct
5714 unsigned SSPM : 4;
5715 unsigned : 4;
5717 } __SSP1CON1bits_t;
5719 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
5721 #define _SSPM0 0x01
5722 #define _SSPM1 0x02
5723 #define _SSPM2 0x04
5724 #define _SSPM3 0x08
5725 #define _CKP 0x10
5726 #define _SSPEN 0x20
5727 #define _SSPOV 0x40
5728 #define _WCOL 0x80
5730 //==============================================================================
5733 //==============================================================================
5734 // SSPCON1 Bits
5736 extern __at(0x0FC6) __sfr SSPCON1;
5738 typedef union
5740 struct
5742 unsigned SSPM0 : 1;
5743 unsigned SSPM1 : 1;
5744 unsigned SSPM2 : 1;
5745 unsigned SSPM3 : 1;
5746 unsigned CKP : 1;
5747 unsigned SSPEN : 1;
5748 unsigned SSPOV : 1;
5749 unsigned WCOL : 1;
5752 struct
5754 unsigned SSPM : 4;
5755 unsigned : 4;
5757 } __SSPCON1bits_t;
5759 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
5761 #define _SSPCON1_SSPM0 0x01
5762 #define _SSPCON1_SSPM1 0x02
5763 #define _SSPCON1_SSPM2 0x04
5764 #define _SSPCON1_SSPM3 0x08
5765 #define _SSPCON1_CKP 0x10
5766 #define _SSPCON1_SSPEN 0x20
5767 #define _SSPCON1_SSPOV 0x40
5768 #define _SSPCON1_WCOL 0x80
5770 //==============================================================================
5773 //==============================================================================
5774 // SSP1STAT Bits
5776 extern __at(0x0FC7) __sfr SSP1STAT;
5778 typedef union
5780 struct
5782 unsigned BF : 1;
5783 unsigned UA : 1;
5784 unsigned R_NOT_W : 1;
5785 unsigned S : 1;
5786 unsigned P : 1;
5787 unsigned D_NOT_A : 1;
5788 unsigned CKE : 1;
5789 unsigned SMP : 1;
5792 struct
5794 unsigned : 1;
5795 unsigned : 1;
5796 unsigned R_W : 1;
5797 unsigned I2C_START : 1;
5798 unsigned I2C_STOP : 1;
5799 unsigned D_A : 1;
5800 unsigned : 1;
5801 unsigned : 1;
5804 struct
5806 unsigned : 1;
5807 unsigned : 1;
5808 unsigned I2C_READ : 1;
5809 unsigned : 1;
5810 unsigned : 1;
5811 unsigned I2C_DAT : 1;
5812 unsigned : 1;
5813 unsigned : 1;
5816 struct
5818 unsigned : 1;
5819 unsigned : 1;
5820 unsigned NOT_W : 1;
5821 unsigned : 1;
5822 unsigned : 1;
5823 unsigned NOT_A : 1;
5824 unsigned : 1;
5825 unsigned : 1;
5828 struct
5830 unsigned : 1;
5831 unsigned : 1;
5832 unsigned NOT_WRITE : 1;
5833 unsigned : 1;
5834 unsigned : 1;
5835 unsigned NOT_ADDRESS : 1;
5836 unsigned : 1;
5837 unsigned : 1;
5840 struct
5842 unsigned : 1;
5843 unsigned : 1;
5844 unsigned READ_WRITE : 1;
5845 unsigned : 1;
5846 unsigned : 1;
5847 unsigned DATA_ADDRESS : 1;
5848 unsigned : 1;
5849 unsigned : 1;
5852 struct
5854 unsigned : 1;
5855 unsigned : 1;
5856 unsigned R : 1;
5857 unsigned : 1;
5858 unsigned : 1;
5859 unsigned D : 1;
5860 unsigned : 1;
5861 unsigned : 1;
5863 } __SSP1STATbits_t;
5865 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
5867 #define _BF 0x01
5868 #define _UA 0x02
5869 #define _R_NOT_W 0x04
5870 #define _R_W 0x04
5871 #define _I2C_READ 0x04
5872 #define _NOT_W 0x04
5873 #define _NOT_WRITE 0x04
5874 #define _READ_WRITE 0x04
5875 #define _R 0x04
5876 #define _S 0x08
5877 #define _I2C_START 0x08
5878 #define _P 0x10
5879 #define _I2C_STOP 0x10
5880 #define _D_NOT_A 0x20
5881 #define _D_A 0x20
5882 #define _I2C_DAT 0x20
5883 #define _NOT_A 0x20
5884 #define _NOT_ADDRESS 0x20
5885 #define _DATA_ADDRESS 0x20
5886 #define _D 0x20
5887 #define _CKE 0x40
5888 #define _SMP 0x80
5890 //==============================================================================
5893 //==============================================================================
5894 // SSPSTAT Bits
5896 extern __at(0x0FC7) __sfr SSPSTAT;
5898 typedef union
5900 struct
5902 unsigned BF : 1;
5903 unsigned UA : 1;
5904 unsigned R_NOT_W : 1;
5905 unsigned S : 1;
5906 unsigned P : 1;
5907 unsigned D_NOT_A : 1;
5908 unsigned CKE : 1;
5909 unsigned SMP : 1;
5912 struct
5914 unsigned : 1;
5915 unsigned : 1;
5916 unsigned R_W : 1;
5917 unsigned I2C_START : 1;
5918 unsigned I2C_STOP : 1;
5919 unsigned D_A : 1;
5920 unsigned : 1;
5921 unsigned : 1;
5924 struct
5926 unsigned : 1;
5927 unsigned : 1;
5928 unsigned I2C_READ : 1;
5929 unsigned : 1;
5930 unsigned : 1;
5931 unsigned I2C_DAT : 1;
5932 unsigned : 1;
5933 unsigned : 1;
5936 struct
5938 unsigned : 1;
5939 unsigned : 1;
5940 unsigned NOT_W : 1;
5941 unsigned : 1;
5942 unsigned : 1;
5943 unsigned NOT_A : 1;
5944 unsigned : 1;
5945 unsigned : 1;
5948 struct
5950 unsigned : 1;
5951 unsigned : 1;
5952 unsigned NOT_WRITE : 1;
5953 unsigned : 1;
5954 unsigned : 1;
5955 unsigned NOT_ADDRESS : 1;
5956 unsigned : 1;
5957 unsigned : 1;
5960 struct
5962 unsigned : 1;
5963 unsigned : 1;
5964 unsigned READ_WRITE : 1;
5965 unsigned : 1;
5966 unsigned : 1;
5967 unsigned DATA_ADDRESS : 1;
5968 unsigned : 1;
5969 unsigned : 1;
5972 struct
5974 unsigned : 1;
5975 unsigned : 1;
5976 unsigned R : 1;
5977 unsigned : 1;
5978 unsigned : 1;
5979 unsigned D : 1;
5980 unsigned : 1;
5981 unsigned : 1;
5983 } __SSPSTATbits_t;
5985 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5987 #define _SSPSTAT_BF 0x01
5988 #define _SSPSTAT_UA 0x02
5989 #define _SSPSTAT_R_NOT_W 0x04
5990 #define _SSPSTAT_R_W 0x04
5991 #define _SSPSTAT_I2C_READ 0x04
5992 #define _SSPSTAT_NOT_W 0x04
5993 #define _SSPSTAT_NOT_WRITE 0x04
5994 #define _SSPSTAT_READ_WRITE 0x04
5995 #define _SSPSTAT_R 0x04
5996 #define _SSPSTAT_S 0x08
5997 #define _SSPSTAT_I2C_START 0x08
5998 #define _SSPSTAT_P 0x10
5999 #define _SSPSTAT_I2C_STOP 0x10
6000 #define _SSPSTAT_D_NOT_A 0x20
6001 #define _SSPSTAT_D_A 0x20
6002 #define _SSPSTAT_I2C_DAT 0x20
6003 #define _SSPSTAT_NOT_A 0x20
6004 #define _SSPSTAT_NOT_ADDRESS 0x20
6005 #define _SSPSTAT_DATA_ADDRESS 0x20
6006 #define _SSPSTAT_D 0x20
6007 #define _SSPSTAT_CKE 0x40
6008 #define _SSPSTAT_SMP 0x80
6010 //==============================================================================
6012 extern __at(0x0FC8) __sfr SSP1ADD;
6013 extern __at(0x0FC8) __sfr SSPADD;
6014 extern __at(0x0FC9) __sfr SSP1BUF;
6015 extern __at(0x0FC9) __sfr SSPBUF;
6017 //==============================================================================
6018 // T2CON Bits
6020 extern __at(0x0FCA) __sfr T2CON;
6022 typedef union
6024 struct
6026 unsigned T2CKPS0 : 1;
6027 unsigned T2CKPS1 : 1;
6028 unsigned TMR2ON : 1;
6029 unsigned T2OUTPS0 : 1;
6030 unsigned T2OUTPS1 : 1;
6031 unsigned T2OUTPS2 : 1;
6032 unsigned T2OUTPS3 : 1;
6033 unsigned : 1;
6036 struct
6038 unsigned T2CKPS : 2;
6039 unsigned : 6;
6042 struct
6044 unsigned : 3;
6045 unsigned T2OUTPS : 4;
6046 unsigned : 1;
6048 } __T2CONbits_t;
6050 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
6052 #define _T2CKPS0 0x01
6053 #define _T2CKPS1 0x02
6054 #define _TMR2ON 0x04
6055 #define _T2OUTPS0 0x08
6056 #define _T2OUTPS1 0x10
6057 #define _T2OUTPS2 0x20
6058 #define _T2OUTPS3 0x40
6060 //==============================================================================
6062 extern __at(0x0FCB) __sfr PR2;
6063 extern __at(0x0FCC) __sfr TMR2;
6065 //==============================================================================
6066 // T1CON Bits
6068 extern __at(0x0FCD) __sfr T1CON;
6070 typedef union
6072 struct
6074 unsigned TMR1ON : 1;
6075 unsigned TMR1CS : 1;
6076 unsigned NOT_T1SYNC : 1;
6077 unsigned T1OSCEN : 1;
6078 unsigned T1CKPS0 : 1;
6079 unsigned T1CKPS1 : 1;
6080 unsigned T1RUN : 1;
6081 unsigned RD16 : 1;
6084 struct
6086 unsigned : 1;
6087 unsigned : 1;
6088 unsigned T1SYNC : 1;
6089 unsigned : 1;
6090 unsigned : 1;
6091 unsigned : 1;
6092 unsigned : 1;
6093 unsigned : 1;
6096 struct
6098 unsigned : 1;
6099 unsigned : 1;
6100 unsigned T1INSYNC : 1;
6101 unsigned : 1;
6102 unsigned : 1;
6103 unsigned : 1;
6104 unsigned : 1;
6105 unsigned : 1;
6108 struct
6110 unsigned : 4;
6111 unsigned T1CKPS : 2;
6112 unsigned : 2;
6114 } __T1CONbits_t;
6116 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6118 #define _TMR1ON 0x01
6119 #define _TMR1CS 0x02
6120 #define _NOT_T1SYNC 0x04
6121 #define _T1SYNC 0x04
6122 #define _T1INSYNC 0x04
6123 #define _T1OSCEN 0x08
6124 #define _T1CKPS0 0x10
6125 #define _T1CKPS1 0x20
6126 #define _T1RUN 0x40
6127 #define _RD16 0x80
6129 //==============================================================================
6131 extern __at(0x0FCE) __sfr TMR1;
6132 extern __at(0x0FCE) __sfr TMR1L;
6133 extern __at(0x0FCF) __sfr TMR1H;
6135 //==============================================================================
6136 // RCON Bits
6138 extern __at(0x0FD0) __sfr RCON;
6140 typedef union
6142 struct
6144 unsigned NOT_BOR : 1;
6145 unsigned NOT_POR : 1;
6146 unsigned NOT_PD : 1;
6147 unsigned NOT_TO : 1;
6148 unsigned NOT_RI : 1;
6149 unsigned NOT_CM : 1;
6150 unsigned : 1;
6151 unsigned IPEN : 1;
6154 struct
6156 unsigned BOR : 1;
6157 unsigned POR : 1;
6158 unsigned PD : 1;
6159 unsigned TO : 1;
6160 unsigned RI : 1;
6161 unsigned CM : 1;
6162 unsigned : 1;
6163 unsigned : 1;
6165 } __RCONbits_t;
6167 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6169 #define _NOT_BOR 0x01
6170 #define _BOR 0x01
6171 #define _NOT_POR 0x02
6172 #define _POR 0x02
6173 #define _NOT_PD 0x04
6174 #define _PD 0x04
6175 #define _NOT_TO 0x08
6176 #define _TO 0x08
6177 #define _NOT_RI 0x10
6178 #define _RI 0x10
6179 #define _NOT_CM 0x20
6180 #define _CM 0x20
6181 #define _IPEN 0x80
6183 //==============================================================================
6186 //==============================================================================
6187 // WDTCON Bits
6189 extern __at(0x0FD1) __sfr WDTCON;
6191 typedef union
6193 struct
6195 unsigned SWDTEN : 1;
6196 unsigned : 1;
6197 unsigned : 1;
6198 unsigned : 1;
6199 unsigned : 1;
6200 unsigned : 1;
6201 unsigned : 1;
6202 unsigned : 1;
6205 struct
6207 unsigned SWDTE : 1;
6208 unsigned : 1;
6209 unsigned : 1;
6210 unsigned : 1;
6211 unsigned : 1;
6212 unsigned : 1;
6213 unsigned : 1;
6214 unsigned : 1;
6216 } __WDTCONbits_t;
6218 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
6220 #define _SWDTEN 0x01
6221 #define _SWDTE 0x01
6223 //==============================================================================
6226 //==============================================================================
6227 // ECON1 Bits
6229 extern __at(0x0FD2) __sfr ECON1;
6231 typedef struct
6233 unsigned : 1;
6234 unsigned : 1;
6235 unsigned RXEN : 1;
6236 unsigned TXRTS : 1;
6237 unsigned CSUMEN : 1;
6238 unsigned DMAST : 1;
6239 unsigned RXRST : 1;
6240 unsigned TXRST : 1;
6241 } __ECON1bits_t;
6243 extern __at(0x0FD2) volatile __ECON1bits_t ECON1bits;
6245 #define _RXEN 0x04
6246 #define _TXRTS 0x08
6247 #define _CSUMEN 0x10
6248 #define _DMAST 0x20
6249 #define _RXRST 0x40
6250 #define _TXRST 0x80
6252 //==============================================================================
6255 //==============================================================================
6256 // OSCCON Bits
6258 extern __at(0x0FD3) __sfr OSCCON;
6260 typedef union
6262 struct
6264 unsigned SCS0 : 1;
6265 unsigned SCS1 : 1;
6266 unsigned : 1;
6267 unsigned OSTS : 1;
6268 unsigned : 1;
6269 unsigned : 1;
6270 unsigned : 1;
6271 unsigned IDLEN : 1;
6274 struct
6276 unsigned SCS : 2;
6277 unsigned : 6;
6279 } __OSCCONbits_t;
6281 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
6283 #define _SCS0 0x01
6284 #define _SCS1 0x02
6285 #define _OSTS 0x08
6286 #define _IDLEN 0x80
6288 //==============================================================================
6291 //==============================================================================
6292 // T0CON Bits
6294 extern __at(0x0FD5) __sfr T0CON;
6296 typedef union
6298 struct
6300 unsigned T0PS0 : 1;
6301 unsigned T0PS1 : 1;
6302 unsigned T0PS2 : 1;
6303 unsigned PSA : 1;
6304 unsigned T0SE : 1;
6305 unsigned T0CS : 1;
6306 unsigned T08BIT : 1;
6307 unsigned TMR0ON : 1;
6310 struct
6312 unsigned T0PS : 3;
6313 unsigned : 5;
6315 } __T0CONbits_t;
6317 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
6319 #define _T0PS0 0x01
6320 #define _T0PS1 0x02
6321 #define _T0PS2 0x04
6322 #define _PSA 0x08
6323 #define _T0SE 0x10
6324 #define _T0CS 0x20
6325 #define _T08BIT 0x40
6326 #define _TMR0ON 0x80
6328 //==============================================================================
6330 extern __at(0x0FD6) __sfr TMR0;
6331 extern __at(0x0FD6) __sfr TMR0L;
6332 extern __at(0x0FD7) __sfr TMR0H;
6334 //==============================================================================
6335 // STATUS Bits
6337 extern __at(0x0FD8) __sfr STATUS;
6339 typedef struct
6341 unsigned C : 1;
6342 unsigned DC : 1;
6343 unsigned Z : 1;
6344 unsigned OV : 1;
6345 unsigned N : 1;
6346 unsigned : 1;
6347 unsigned : 1;
6348 unsigned : 1;
6349 } __STATUSbits_t;
6351 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
6353 #define _C 0x01
6354 #define _DC 0x02
6355 #define _Z 0x04
6356 #define _OV 0x08
6357 #define _N 0x10
6359 //==============================================================================
6361 extern __at(0x0FD9) __sfr FSR2L;
6362 extern __at(0x0FDA) __sfr FSR2H;
6363 extern __at(0x0FDB) __sfr PLUSW2;
6364 extern __at(0x0FDC) __sfr PREINC2;
6365 extern __at(0x0FDD) __sfr POSTDEC2;
6366 extern __at(0x0FDE) __sfr POSTINC2;
6367 extern __at(0x0FDF) __sfr INDF2;
6368 extern __at(0x0FE0) __sfr BSR;
6369 extern __at(0x0FE1) __sfr FSR1L;
6370 extern __at(0x0FE2) __sfr FSR1H;
6371 extern __at(0x0FE3) __sfr PLUSW1;
6372 extern __at(0x0FE4) __sfr PREINC1;
6373 extern __at(0x0FE5) __sfr POSTDEC1;
6374 extern __at(0x0FE6) __sfr POSTINC1;
6375 extern __at(0x0FE7) __sfr INDF1;
6376 extern __at(0x0FE8) __sfr WREG;
6377 extern __at(0x0FE9) __sfr FSR0L;
6378 extern __at(0x0FEA) __sfr FSR0H;
6379 extern __at(0x0FEB) __sfr PLUSW0;
6380 extern __at(0x0FEC) __sfr PREINC0;
6381 extern __at(0x0FED) __sfr POSTDEC0;
6382 extern __at(0x0FEE) __sfr POSTINC0;
6383 extern __at(0x0FEF) __sfr INDF0;
6385 //==============================================================================
6386 // INTCON3 Bits
6388 extern __at(0x0FF0) __sfr INTCON3;
6390 typedef union
6392 struct
6394 unsigned INT1IF : 1;
6395 unsigned INT2IF : 1;
6396 unsigned INT3IF : 1;
6397 unsigned INT1IE : 1;
6398 unsigned INT2IE : 1;
6399 unsigned INT3IE : 1;
6400 unsigned INT1IP : 1;
6401 unsigned INT2IP : 1;
6404 struct
6406 unsigned INT1F : 1;
6407 unsigned INT2F : 1;
6408 unsigned INT3F : 1;
6409 unsigned INT1E : 1;
6410 unsigned INT2E : 1;
6411 unsigned INT3E : 1;
6412 unsigned INT1P : 1;
6413 unsigned INT2P : 1;
6415 } __INTCON3bits_t;
6417 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6419 #define _INT1IF 0x01
6420 #define _INT1F 0x01
6421 #define _INT2IF 0x02
6422 #define _INT2F 0x02
6423 #define _INT3IF 0x04
6424 #define _INT3F 0x04
6425 #define _INT1IE 0x08
6426 #define _INT1E 0x08
6427 #define _INT2IE 0x10
6428 #define _INT2E 0x10
6429 #define _INT3IE 0x20
6430 #define _INT3E 0x20
6431 #define _INT1IP 0x40
6432 #define _INT1P 0x40
6433 #define _INT2IP 0x80
6434 #define _INT2P 0x80
6436 //==============================================================================
6439 //==============================================================================
6440 // INTCON2 Bits
6442 extern __at(0x0FF1) __sfr INTCON2;
6444 typedef union
6446 struct
6448 unsigned RBIP : 1;
6449 unsigned INT3IP : 1;
6450 unsigned TMR0IP : 1;
6451 unsigned INTEDG3 : 1;
6452 unsigned INTEDG2 : 1;
6453 unsigned INTEDG1 : 1;
6454 unsigned INTEDG0 : 1;
6455 unsigned NOT_RBPU : 1;
6458 struct
6460 unsigned : 1;
6461 unsigned : 1;
6462 unsigned T0IP : 1;
6463 unsigned : 1;
6464 unsigned : 1;
6465 unsigned : 1;
6466 unsigned : 1;
6467 unsigned RBPU : 1;
6469 } __INTCON2bits_t;
6471 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6473 #define _RBIP 0x01
6474 #define _INT3IP 0x02
6475 #define _TMR0IP 0x04
6476 #define _T0IP 0x04
6477 #define _INTEDG3 0x08
6478 #define _INTEDG2 0x10
6479 #define _INTEDG1 0x20
6480 #define _INTEDG0 0x40
6481 #define _NOT_RBPU 0x80
6482 #define _RBPU 0x80
6484 //==============================================================================
6487 //==============================================================================
6488 // INTCON Bits
6490 extern __at(0x0FF2) __sfr INTCON;
6492 typedef union
6494 struct
6496 unsigned RBIF : 1;
6497 unsigned INT0IF : 1;
6498 unsigned TMR0IF : 1;
6499 unsigned RBIE : 1;
6500 unsigned INT0IE : 1;
6501 unsigned TMR0IE : 1;
6502 unsigned PEIE_GIEL : 1;
6503 unsigned GIE_GIEH : 1;
6506 struct
6508 unsigned : 1;
6509 unsigned INT0F : 1;
6510 unsigned T0IF : 1;
6511 unsigned : 1;
6512 unsigned INT0E : 1;
6513 unsigned T0IE : 1;
6514 unsigned PEIE : 1;
6515 unsigned GIE : 1;
6518 struct
6520 unsigned : 1;
6521 unsigned : 1;
6522 unsigned : 1;
6523 unsigned : 1;
6524 unsigned : 1;
6525 unsigned : 1;
6526 unsigned GIEL : 1;
6527 unsigned GIEH : 1;
6529 } __INTCONbits_t;
6531 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6533 #define _RBIF 0x01
6534 #define _INT0IF 0x02
6535 #define _INT0F 0x02
6536 #define _TMR0IF 0x04
6537 #define _T0IF 0x04
6538 #define _RBIE 0x08
6539 #define _INT0IE 0x10
6540 #define _INT0E 0x10
6541 #define _TMR0IE 0x20
6542 #define _T0IE 0x20
6543 #define _PEIE_GIEL 0x40
6544 #define _PEIE 0x40
6545 #define _GIEL 0x40
6546 #define _GIE_GIEH 0x80
6547 #define _GIE 0x80
6548 #define _GIEH 0x80
6550 //==============================================================================
6552 extern __at(0x0FF3) __sfr PROD;
6553 extern __at(0x0FF3) __sfr PRODL;
6554 extern __at(0x0FF4) __sfr PRODH;
6555 extern __at(0x0FF5) __sfr TABLAT;
6556 extern __at(0x0FF6) __sfr TBLPTR;
6557 extern __at(0x0FF6) __sfr TBLPTRL;
6558 extern __at(0x0FF7) __sfr TBLPTRH;
6559 extern __at(0x0FF8) __sfr TBLPTRU;
6560 extern __at(0x0FF9) __sfr PC;
6561 extern __at(0x0FF9) __sfr PCL;
6562 extern __at(0x0FFA) __sfr PCLATH;
6563 extern __at(0x0FFB) __sfr PCLATU;
6565 //==============================================================================
6566 // STKPTR Bits
6568 extern __at(0x0FFC) __sfr STKPTR;
6570 typedef union
6572 struct
6574 unsigned STKPTR0 : 1;
6575 unsigned STKPTR1 : 1;
6576 unsigned STKPTR2 : 1;
6577 unsigned STKPTR3 : 1;
6578 unsigned STKPTR4 : 1;
6579 unsigned : 1;
6580 unsigned STKUNF : 1;
6581 unsigned STKFUL : 1;
6584 struct
6586 unsigned SP0 : 1;
6587 unsigned SP1 : 1;
6588 unsigned SP2 : 1;
6589 unsigned SP3 : 1;
6590 unsigned SP4 : 1;
6591 unsigned : 1;
6592 unsigned : 1;
6593 unsigned STKOVF : 1;
6596 struct
6598 unsigned SP : 5;
6599 unsigned : 3;
6602 struct
6604 unsigned STKPTR : 5;
6605 unsigned : 3;
6607 } __STKPTRbits_t;
6609 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6611 #define _STKPTR0 0x01
6612 #define _SP0 0x01
6613 #define _STKPTR1 0x02
6614 #define _SP1 0x02
6615 #define _STKPTR2 0x04
6616 #define _SP2 0x04
6617 #define _STKPTR3 0x08
6618 #define _SP3 0x08
6619 #define _STKPTR4 0x10
6620 #define _SP4 0x10
6621 #define _STKUNF 0x40
6622 #define _STKFUL 0x80
6623 #define _STKOVF 0x80
6625 //==============================================================================
6627 extern __at(0x0FFD) __sfr TOS;
6628 extern __at(0x0FFD) __sfr TOSL;
6629 extern __at(0x0FFE) __sfr TOSH;
6630 extern __at(0x0FFF) __sfr TOSU;
6632 //==============================================================================
6634 // Configuration Addresses
6636 //==============================================================================
6638 #define __CONFIG1L 0x017FF8
6639 #define __CONFIG1H 0x017FF9
6640 #define __CONFIG2L 0x017FFA
6641 #define __CONFIG2H 0x017FFB
6642 #define __CONFIG3L 0x017FFC
6643 #define __CONFIG3H 0x017FFD
6645 //==============================================================================
6647 #endif // #ifndef __PIC18F96J65_H__