Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f86j65.h
blob0103dbf928355890e93ec9ef079dba853626087d
1 /*
2 * This declarations of the PIC18F86J65 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:38 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 __PIC18F86J65_H__
26 #define __PIC18F86J65_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 // ECCP2DEL Bits
523 extern __at(0x0F67) __sfr ECCP2DEL;
525 typedef union
527 struct
529 unsigned PDC0 : 1;
530 unsigned PDC1 : 1;
531 unsigned PDC2 : 1;
532 unsigned PDC3 : 1;
533 unsigned PDC4 : 1;
534 unsigned PDC5 : 1;
535 unsigned PDC6 : 1;
536 unsigned PRSEN : 1;
539 struct
541 unsigned P2DC0 : 1;
542 unsigned P2DC1 : 1;
543 unsigned P2DC2 : 1;
544 unsigned P2DC3 : 1;
545 unsigned P2DC4 : 1;
546 unsigned P2DC5 : 1;
547 unsigned P2DC6 : 1;
548 unsigned P2RSEN : 1;
551 struct
553 unsigned P2DC : 7;
554 unsigned : 1;
557 struct
559 unsigned PDC : 7;
560 unsigned : 1;
562 } __ECCP2DELbits_t;
564 extern __at(0x0F67) volatile __ECCP2DELbits_t ECCP2DELbits;
566 #define _ECCP2DEL_PDC0 0x01
567 #define _ECCP2DEL_P2DC0 0x01
568 #define _ECCP2DEL_PDC1 0x02
569 #define _ECCP2DEL_P2DC1 0x02
570 #define _ECCP2DEL_PDC2 0x04
571 #define _ECCP2DEL_P2DC2 0x04
572 #define _ECCP2DEL_PDC3 0x08
573 #define _ECCP2DEL_P2DC3 0x08
574 #define _ECCP2DEL_PDC4 0x10
575 #define _ECCP2DEL_P2DC4 0x10
576 #define _ECCP2DEL_PDC5 0x20
577 #define _ECCP2DEL_P2DC5 0x20
578 #define _ECCP2DEL_PDC6 0x40
579 #define _ECCP2DEL_P2DC6 0x40
580 #define _ECCP2DEL_PRSEN 0x80
581 #define _ECCP2DEL_P2RSEN 0x80
583 //==============================================================================
586 //==============================================================================
587 // ECCP2AS Bits
589 extern __at(0x0F68) __sfr ECCP2AS;
591 typedef union
593 struct
595 unsigned PSSBD0 : 1;
596 unsigned PSSBD1 : 1;
597 unsigned PSSAC0 : 1;
598 unsigned PSSAC1 : 1;
599 unsigned ECCPAS0 : 1;
600 unsigned ECCPAS1 : 1;
601 unsigned ECCPAS2 : 1;
602 unsigned ECCPASE : 1;
605 struct
607 unsigned PSS2BD0 : 1;
608 unsigned PSS2BD1 : 1;
609 unsigned PSS2AC0 : 1;
610 unsigned PSS2AC1 : 1;
611 unsigned ECCP2AS0 : 1;
612 unsigned ECCP2AS1 : 1;
613 unsigned ECCP2AS2 : 1;
614 unsigned ECCP2ASE : 1;
617 struct
619 unsigned PSS2BD : 2;
620 unsigned : 6;
623 struct
625 unsigned PSSBD : 2;
626 unsigned : 6;
629 struct
631 unsigned : 2;
632 unsigned PSS2AC : 2;
633 unsigned : 4;
636 struct
638 unsigned : 2;
639 unsigned PSSAC : 2;
640 unsigned : 4;
643 struct
645 unsigned : 4;
646 unsigned ECCP2AS : 3;
647 unsigned : 1;
650 struct
652 unsigned : 4;
653 unsigned ECCPAS : 3;
654 unsigned : 1;
656 } __ECCP2ASbits_t;
658 extern __at(0x0F68) volatile __ECCP2ASbits_t ECCP2ASbits;
660 #define _ECCP2AS_PSSBD0 0x01
661 #define _ECCP2AS_PSS2BD0 0x01
662 #define _ECCP2AS_PSSBD1 0x02
663 #define _ECCP2AS_PSS2BD1 0x02
664 #define _ECCP2AS_PSSAC0 0x04
665 #define _ECCP2AS_PSS2AC0 0x04
666 #define _ECCP2AS_PSSAC1 0x08
667 #define _ECCP2AS_PSS2AC1 0x08
668 #define _ECCP2AS_ECCPAS0 0x10
669 #define _ECCP2AS_ECCP2AS0 0x10
670 #define _ECCP2AS_ECCPAS1 0x20
671 #define _ECCP2AS_ECCP2AS1 0x20
672 #define _ECCP2AS_ECCPAS2 0x40
673 #define _ECCP2AS_ECCP2AS2 0x40
674 #define _ECCP2AS_ECCPASE 0x80
675 #define _ECCP2AS_ECCP2ASE 0x80
677 //==============================================================================
680 //==============================================================================
681 // ECCP3DEL Bits
683 extern __at(0x0F69) __sfr ECCP3DEL;
685 typedef union
687 struct
689 unsigned PDC0 : 1;
690 unsigned PDC1 : 1;
691 unsigned PDC2 : 1;
692 unsigned PDC3 : 1;
693 unsigned PDC4 : 1;
694 unsigned PDC5 : 1;
695 unsigned PDC6 : 1;
696 unsigned PRSEN : 1;
699 struct
701 unsigned P3DC0 : 1;
702 unsigned P3DC1 : 1;
703 unsigned P3DC2 : 1;
704 unsigned P3DC3 : 1;
705 unsigned P3DC4 : 1;
706 unsigned P3DC5 : 1;
707 unsigned P3DC6 : 1;
708 unsigned P3RSEN : 1;
711 struct
713 unsigned PDC : 7;
714 unsigned : 1;
717 struct
719 unsigned P3DC : 7;
720 unsigned : 1;
722 } __ECCP3DELbits_t;
724 extern __at(0x0F69) volatile __ECCP3DELbits_t ECCP3DELbits;
726 #define _ECCP3DEL_PDC0 0x01
727 #define _ECCP3DEL_P3DC0 0x01
728 #define _ECCP3DEL_PDC1 0x02
729 #define _ECCP3DEL_P3DC1 0x02
730 #define _ECCP3DEL_PDC2 0x04
731 #define _ECCP3DEL_P3DC2 0x04
732 #define _ECCP3DEL_PDC3 0x08
733 #define _ECCP3DEL_P3DC3 0x08
734 #define _ECCP3DEL_PDC4 0x10
735 #define _ECCP3DEL_P3DC4 0x10
736 #define _ECCP3DEL_PDC5 0x20
737 #define _ECCP3DEL_P3DC5 0x20
738 #define _ECCP3DEL_PDC6 0x40
739 #define _ECCP3DEL_P3DC6 0x40
740 #define _ECCP3DEL_PRSEN 0x80
741 #define _ECCP3DEL_P3RSEN 0x80
743 //==============================================================================
746 //==============================================================================
747 // ECCP3AS Bits
749 extern __at(0x0F6A) __sfr ECCP3AS;
751 typedef union
753 struct
755 unsigned PSSBD0 : 1;
756 unsigned PSSBD1 : 1;
757 unsigned PSSAC0 : 1;
758 unsigned PSSAC1 : 1;
759 unsigned ECCPAS0 : 1;
760 unsigned ECCPAS1 : 1;
761 unsigned ECCPAS2 : 1;
762 unsigned ECCPASE : 1;
765 struct
767 unsigned PSS3BD0 : 1;
768 unsigned PSS3BD1 : 1;
769 unsigned PSS3AC0 : 1;
770 unsigned PSS3AC1 : 1;
771 unsigned ECCP3AS0 : 1;
772 unsigned ECCP3AS1 : 1;
773 unsigned ECCP3AS2 : 1;
774 unsigned ECCP3ASE : 1;
777 struct
779 unsigned PSS3BD : 2;
780 unsigned : 6;
783 struct
785 unsigned PSSBD : 2;
786 unsigned : 6;
789 struct
791 unsigned : 2;
792 unsigned PSSAC : 2;
793 unsigned : 4;
796 struct
798 unsigned : 2;
799 unsigned PSS3AC : 2;
800 unsigned : 4;
803 struct
805 unsigned : 4;
806 unsigned ECCP3AS : 3;
807 unsigned : 1;
810 struct
812 unsigned : 4;
813 unsigned ECCPAS : 3;
814 unsigned : 1;
816 } __ECCP3ASbits_t;
818 extern __at(0x0F6A) volatile __ECCP3ASbits_t ECCP3ASbits;
820 #define _ECCP3AS_PSSBD0 0x01
821 #define _ECCP3AS_PSS3BD0 0x01
822 #define _ECCP3AS_PSSBD1 0x02
823 #define _ECCP3AS_PSS3BD1 0x02
824 #define _ECCP3AS_PSSAC0 0x04
825 #define _ECCP3AS_PSS3AC0 0x04
826 #define _ECCP3AS_PSSAC1 0x08
827 #define _ECCP3AS_PSS3AC1 0x08
828 #define _ECCP3AS_ECCPAS0 0x10
829 #define _ECCP3AS_ECCP3AS0 0x10
830 #define _ECCP3AS_ECCPAS1 0x20
831 #define _ECCP3AS_ECCP3AS1 0x20
832 #define _ECCP3AS_ECCPAS2 0x40
833 #define _ECCP3AS_ECCP3AS2 0x40
834 #define _ECCP3AS_ECCPASE 0x80
835 #define _ECCP3AS_ECCP3ASE 0x80
837 //==============================================================================
840 //==============================================================================
841 // RCSTA2 Bits
843 extern __at(0x0F6B) __sfr RCSTA2;
845 typedef union
847 struct
849 unsigned RX9D : 1;
850 unsigned OERR : 1;
851 unsigned FERR : 1;
852 unsigned ADDEN : 1;
853 unsigned CREN : 1;
854 unsigned SREN : 1;
855 unsigned RX9 : 1;
856 unsigned SPEN : 1;
859 struct
861 unsigned RCD8 : 1;
862 unsigned OERR2 : 1;
863 unsigned FERR2 : 1;
864 unsigned ADDEN2 : 1;
865 unsigned CREN2 : 1;
866 unsigned SREN2 : 1;
867 unsigned RC9 : 1;
868 unsigned SPEN2 : 1;
871 struct
873 unsigned RX9D2 : 1;
874 unsigned : 1;
875 unsigned : 1;
876 unsigned : 1;
877 unsigned : 1;
878 unsigned : 1;
879 unsigned NOT_RC8 : 1;
880 unsigned : 1;
883 struct
885 unsigned : 1;
886 unsigned : 1;
887 unsigned : 1;
888 unsigned : 1;
889 unsigned : 1;
890 unsigned : 1;
891 unsigned RC8_9 : 1;
892 unsigned : 1;
895 struct
897 unsigned : 1;
898 unsigned : 1;
899 unsigned : 1;
900 unsigned : 1;
901 unsigned : 1;
902 unsigned : 1;
903 unsigned RX92 : 1;
904 unsigned : 1;
906 } __RCSTA2bits_t;
908 extern __at(0x0F6B) volatile __RCSTA2bits_t RCSTA2bits;
910 #define _RCSTA2_RX9D 0x01
911 #define _RCSTA2_RCD8 0x01
912 #define _RCSTA2_RX9D2 0x01
913 #define _RCSTA2_OERR 0x02
914 #define _RCSTA2_OERR2 0x02
915 #define _RCSTA2_FERR 0x04
916 #define _RCSTA2_FERR2 0x04
917 #define _RCSTA2_ADDEN 0x08
918 #define _RCSTA2_ADDEN2 0x08
919 #define _RCSTA2_CREN 0x10
920 #define _RCSTA2_CREN2 0x10
921 #define _RCSTA2_SREN 0x20
922 #define _RCSTA2_SREN2 0x20
923 #define _RCSTA2_RX9 0x40
924 #define _RCSTA2_RC9 0x40
925 #define _RCSTA2_NOT_RC8 0x40
926 #define _RCSTA2_RC8_9 0x40
927 #define _RCSTA2_RX92 0x40
928 #define _RCSTA2_SPEN 0x80
929 #define _RCSTA2_SPEN2 0x80
931 //==============================================================================
934 //==============================================================================
935 // TXSTA2 Bits
937 extern __at(0x0F6C) __sfr TXSTA2;
939 typedef union
941 struct
943 unsigned TX9D : 1;
944 unsigned TRMT : 1;
945 unsigned BRGH : 1;
946 unsigned SENDB : 1;
947 unsigned SYNC : 1;
948 unsigned TXEN : 1;
949 unsigned TX9 : 1;
950 unsigned CSRC : 1;
953 struct
955 unsigned TXD8 : 1;
956 unsigned TRMT2 : 1;
957 unsigned BRGH2 : 1;
958 unsigned SENDB2 : 1;
959 unsigned SYNC2 : 1;
960 unsigned TXEN2 : 1;
961 unsigned TX8_9 : 1;
962 unsigned CSRC2 : 1;
965 struct
967 unsigned TX9D2 : 1;
968 unsigned : 1;
969 unsigned : 1;
970 unsigned : 1;
971 unsigned : 1;
972 unsigned : 1;
973 unsigned NOT_TX8 : 1;
974 unsigned : 1;
977 struct
979 unsigned : 1;
980 unsigned : 1;
981 unsigned : 1;
982 unsigned : 1;
983 unsigned : 1;
984 unsigned : 1;
985 unsigned TX92 : 1;
986 unsigned : 1;
988 } __TXSTA2bits_t;
990 extern __at(0x0F6C) volatile __TXSTA2bits_t TXSTA2bits;
992 #define _TXSTA2_TX9D 0x01
993 #define _TXSTA2_TXD8 0x01
994 #define _TXSTA2_TX9D2 0x01
995 #define _TXSTA2_TRMT 0x02
996 #define _TXSTA2_TRMT2 0x02
997 #define _TXSTA2_BRGH 0x04
998 #define _TXSTA2_BRGH2 0x04
999 #define _TXSTA2_SENDB 0x08
1000 #define _TXSTA2_SENDB2 0x08
1001 #define _TXSTA2_SYNC 0x10
1002 #define _TXSTA2_SYNC2 0x10
1003 #define _TXSTA2_TXEN 0x20
1004 #define _TXSTA2_TXEN2 0x20
1005 #define _TXSTA2_TX9 0x40
1006 #define _TXSTA2_TX8_9 0x40
1007 #define _TXSTA2_NOT_TX8 0x40
1008 #define _TXSTA2_TX92 0x40
1009 #define _TXSTA2_CSRC 0x80
1010 #define _TXSTA2_CSRC2 0x80
1012 //==============================================================================
1014 extern __at(0x0F6D) __sfr TXREG2;
1015 extern __at(0x0F6E) __sfr RCREG2;
1016 extern __at(0x0F6F) __sfr SPBRG2;
1018 //==============================================================================
1019 // CCP5CON Bits
1021 extern __at(0x0F70) __sfr CCP5CON;
1023 typedef union
1025 struct
1027 unsigned CCP5M0 : 1;
1028 unsigned CCP5M1 : 1;
1029 unsigned CCP5M2 : 1;
1030 unsigned CCP5M3 : 1;
1031 unsigned CCP5Y : 1;
1032 unsigned CCP5X : 1;
1033 unsigned : 1;
1034 unsigned : 1;
1037 struct
1039 unsigned : 1;
1040 unsigned : 1;
1041 unsigned : 1;
1042 unsigned : 1;
1043 unsigned DC5B0 : 1;
1044 unsigned DC5B1 : 1;
1045 unsigned : 1;
1046 unsigned : 1;
1049 struct
1051 unsigned CCP5M : 4;
1052 unsigned : 4;
1055 struct
1057 unsigned : 4;
1058 unsigned DC5B : 2;
1059 unsigned : 2;
1061 } __CCP5CONbits_t;
1063 extern __at(0x0F70) volatile __CCP5CONbits_t CCP5CONbits;
1065 #define _CCP5M0 0x01
1066 #define _CCP5M1 0x02
1067 #define _CCP5M2 0x04
1068 #define _CCP5M3 0x08
1069 #define _CCP5Y 0x10
1070 #define _DC5B0 0x10
1071 #define _CCP5X 0x20
1072 #define _DC5B1 0x20
1074 //==============================================================================
1076 extern __at(0x0F71) __sfr CCPR5;
1077 extern __at(0x0F71) __sfr CCPR5L;
1078 extern __at(0x0F72) __sfr CCPR5H;
1080 //==============================================================================
1081 // CCP4CON Bits
1083 extern __at(0x0F73) __sfr CCP4CON;
1085 typedef union
1087 struct
1089 unsigned CCP4M0 : 1;
1090 unsigned CCP4M1 : 1;
1091 unsigned CCP4M2 : 1;
1092 unsigned CCP4M3 : 1;
1093 unsigned DC4B0 : 1;
1094 unsigned DC4B1 : 1;
1095 unsigned : 1;
1096 unsigned : 1;
1099 struct
1101 unsigned : 1;
1102 unsigned : 1;
1103 unsigned : 1;
1104 unsigned : 1;
1105 unsigned CCP4Y : 1;
1106 unsigned CCP4X : 1;
1107 unsigned : 1;
1108 unsigned : 1;
1111 struct
1113 unsigned CCP4M : 4;
1114 unsigned : 4;
1117 struct
1119 unsigned : 4;
1120 unsigned DC4B : 2;
1121 unsigned : 2;
1123 } __CCP4CONbits_t;
1125 extern __at(0x0F73) volatile __CCP4CONbits_t CCP4CONbits;
1127 #define _CCP4M0 0x01
1128 #define _CCP4M1 0x02
1129 #define _CCP4M2 0x04
1130 #define _CCP4M3 0x08
1131 #define _DC4B0 0x10
1132 #define _CCP4Y 0x10
1133 #define _DC4B1 0x20
1134 #define _CCP4X 0x20
1136 //==============================================================================
1138 extern __at(0x0F74) __sfr CCPR4;
1139 extern __at(0x0F74) __sfr CCPR4L;
1140 extern __at(0x0F75) __sfr CCPR4H;
1142 //==============================================================================
1143 // T4CON Bits
1145 extern __at(0x0F76) __sfr T4CON;
1147 typedef union
1149 struct
1151 unsigned T4CKPS0 : 1;
1152 unsigned T4CKPS1 : 1;
1153 unsigned TMR4ON : 1;
1154 unsigned T4OUTPS0 : 1;
1155 unsigned T4OUTPS1 : 1;
1156 unsigned T4OUTPS2 : 1;
1157 unsigned T4OUTPS3 : 1;
1158 unsigned : 1;
1161 struct
1163 unsigned T4CKPS : 2;
1164 unsigned : 6;
1167 struct
1169 unsigned : 3;
1170 unsigned T4OUTPS : 4;
1171 unsigned : 1;
1173 } __T4CONbits_t;
1175 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
1177 #define _T4CKPS0 0x01
1178 #define _T4CKPS1 0x02
1179 #define _TMR4ON 0x04
1180 #define _T4OUTPS0 0x08
1181 #define _T4OUTPS1 0x10
1182 #define _T4OUTPS2 0x20
1183 #define _T4OUTPS3 0x40
1185 //==============================================================================
1187 extern __at(0x0F77) __sfr PR4;
1188 extern __at(0x0F78) __sfr TMR4;
1190 //==============================================================================
1191 // ECCP1DEL Bits
1193 extern __at(0x0F79) __sfr ECCP1DEL;
1195 typedef union
1197 struct
1199 unsigned PDC0 : 1;
1200 unsigned PDC1 : 1;
1201 unsigned PDC2 : 1;
1202 unsigned PDC3 : 1;
1203 unsigned PDC4 : 1;
1204 unsigned PDC5 : 1;
1205 unsigned PDC6 : 1;
1206 unsigned PRSEN : 1;
1209 struct
1211 unsigned P1DC0 : 1;
1212 unsigned P1DC1 : 1;
1213 unsigned P1DC2 : 1;
1214 unsigned P1DC3 : 1;
1215 unsigned P1DC4 : 1;
1216 unsigned P1DC5 : 1;
1217 unsigned P1DC6 : 1;
1218 unsigned P1RSEN : 1;
1221 struct
1223 unsigned PDC : 7;
1224 unsigned : 1;
1227 struct
1229 unsigned P1DC : 7;
1230 unsigned : 1;
1232 } __ECCP1DELbits_t;
1234 extern __at(0x0F79) volatile __ECCP1DELbits_t ECCP1DELbits;
1236 #define _PDC0 0x01
1237 #define _P1DC0 0x01
1238 #define _PDC1 0x02
1239 #define _P1DC1 0x02
1240 #define _PDC2 0x04
1241 #define _P1DC2 0x04
1242 #define _PDC3 0x08
1243 #define _P1DC3 0x08
1244 #define _PDC4 0x10
1245 #define _P1DC4 0x10
1246 #define _PDC5 0x20
1247 #define _P1DC5 0x20
1248 #define _PDC6 0x40
1249 #define _P1DC6 0x40
1250 #define _PRSEN 0x80
1251 #define _P1RSEN 0x80
1253 //==============================================================================
1255 extern __at(0x0F7A) __sfr ERDPT;
1256 extern __at(0x0F7A) __sfr ERDPTL;
1257 extern __at(0x0F7B) __sfr ERDPTH;
1259 //==============================================================================
1260 // BAUDCON2 Bits
1262 extern __at(0x0F7C) __sfr BAUDCON2;
1264 typedef union
1266 struct
1268 unsigned ABDEN : 1;
1269 unsigned WUE : 1;
1270 unsigned : 1;
1271 unsigned BRG16 : 1;
1272 unsigned TXCKP : 1;
1273 unsigned RXDTP : 1;
1274 unsigned RCIDL : 1;
1275 unsigned ABDOVF : 1;
1278 struct
1280 unsigned ABDEN2 : 1;
1281 unsigned WUE2 : 1;
1282 unsigned : 1;
1283 unsigned BRG162 : 1;
1284 unsigned SCKP : 1;
1285 unsigned RXDTP2 : 1;
1286 unsigned RCMT : 1;
1287 unsigned ABDOVF2 : 1;
1290 struct
1292 unsigned : 1;
1293 unsigned : 1;
1294 unsigned : 1;
1295 unsigned : 1;
1296 unsigned TXCKP2 : 1;
1297 unsigned : 1;
1298 unsigned RCIDL2 : 1;
1299 unsigned : 1;
1301 } __BAUDCON2bits_t;
1303 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
1305 #define _BAUDCON2_ABDEN 0x01
1306 #define _BAUDCON2_ABDEN2 0x01
1307 #define _BAUDCON2_WUE 0x02
1308 #define _BAUDCON2_WUE2 0x02
1309 #define _BAUDCON2_BRG16 0x08
1310 #define _BAUDCON2_BRG162 0x08
1311 #define _BAUDCON2_TXCKP 0x10
1312 #define _BAUDCON2_SCKP 0x10
1313 #define _BAUDCON2_TXCKP2 0x10
1314 #define _BAUDCON2_RXDTP 0x20
1315 #define _BAUDCON2_RXDTP2 0x20
1316 #define _BAUDCON2_RCIDL 0x40
1317 #define _BAUDCON2_RCMT 0x40
1318 #define _BAUDCON2_RCIDL2 0x40
1319 #define _BAUDCON2_ABDOVF 0x80
1320 #define _BAUDCON2_ABDOVF2 0x80
1322 //==============================================================================
1325 //==============================================================================
1326 // BAUDCTL2 Bits
1328 extern __at(0x0F7C) __sfr BAUDCTL2;
1330 typedef union
1332 struct
1334 unsigned ABDEN : 1;
1335 unsigned WUE : 1;
1336 unsigned : 1;
1337 unsigned BRG16 : 1;
1338 unsigned TXCKP : 1;
1339 unsigned RXDTP : 1;
1340 unsigned RCIDL : 1;
1341 unsigned ABDOVF : 1;
1344 struct
1346 unsigned ABDEN2 : 1;
1347 unsigned WUE2 : 1;
1348 unsigned : 1;
1349 unsigned BRG162 : 1;
1350 unsigned SCKP : 1;
1351 unsigned RXDTP2 : 1;
1352 unsigned RCMT : 1;
1353 unsigned ABDOVF2 : 1;
1356 struct
1358 unsigned : 1;
1359 unsigned : 1;
1360 unsigned : 1;
1361 unsigned : 1;
1362 unsigned TXCKP2 : 1;
1363 unsigned : 1;
1364 unsigned RCIDL2 : 1;
1365 unsigned : 1;
1367 } __BAUDCTL2bits_t;
1369 extern __at(0x0F7C) volatile __BAUDCTL2bits_t BAUDCTL2bits;
1371 #define _BAUDCTL2_ABDEN 0x01
1372 #define _BAUDCTL2_ABDEN2 0x01
1373 #define _BAUDCTL2_WUE 0x02
1374 #define _BAUDCTL2_WUE2 0x02
1375 #define _BAUDCTL2_BRG16 0x08
1376 #define _BAUDCTL2_BRG162 0x08
1377 #define _BAUDCTL2_TXCKP 0x10
1378 #define _BAUDCTL2_SCKP 0x10
1379 #define _BAUDCTL2_TXCKP2 0x10
1380 #define _BAUDCTL2_RXDTP 0x20
1381 #define _BAUDCTL2_RXDTP2 0x20
1382 #define _BAUDCTL2_RCIDL 0x40
1383 #define _BAUDCTL2_RCMT 0x40
1384 #define _BAUDCTL2_RCIDL2 0x40
1385 #define _BAUDCTL2_ABDOVF 0x80
1386 #define _BAUDCTL2_ABDOVF2 0x80
1388 //==============================================================================
1390 extern __at(0x0F7D) __sfr SPBRGH2;
1392 //==============================================================================
1393 // BAUDCON Bits
1395 extern __at(0x0F7E) __sfr BAUDCON;
1397 typedef union
1399 struct
1401 unsigned ABDEN : 1;
1402 unsigned WUE : 1;
1403 unsigned : 1;
1404 unsigned BRG16 : 1;
1405 unsigned TXCKP : 1;
1406 unsigned RXDTP : 1;
1407 unsigned RCIDL : 1;
1408 unsigned ABDOVF : 1;
1411 struct
1413 unsigned : 1;
1414 unsigned : 1;
1415 unsigned : 1;
1416 unsigned : 1;
1417 unsigned SCKP : 1;
1418 unsigned : 1;
1419 unsigned RCMT : 1;
1420 unsigned : 1;
1422 } __BAUDCONbits_t;
1424 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
1426 #define _ABDEN 0x01
1427 #define _WUE 0x02
1428 #define _BRG16 0x08
1429 #define _TXCKP 0x10
1430 #define _SCKP 0x10
1431 #define _RXDTP 0x20
1432 #define _RCIDL 0x40
1433 #define _RCMT 0x40
1434 #define _ABDOVF 0x80
1436 //==============================================================================
1439 //==============================================================================
1440 // BAUDCON1 Bits
1442 extern __at(0x0F7E) __sfr BAUDCON1;
1444 typedef union
1446 struct
1448 unsigned ABDEN : 1;
1449 unsigned WUE : 1;
1450 unsigned : 1;
1451 unsigned BRG16 : 1;
1452 unsigned TXCKP : 1;
1453 unsigned RXDTP : 1;
1454 unsigned RCIDL : 1;
1455 unsigned ABDOVF : 1;
1458 struct
1460 unsigned : 1;
1461 unsigned : 1;
1462 unsigned : 1;
1463 unsigned : 1;
1464 unsigned SCKP : 1;
1465 unsigned : 1;
1466 unsigned RCMT : 1;
1467 unsigned : 1;
1469 } __BAUDCON1bits_t;
1471 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1473 #define _BAUDCON1_ABDEN 0x01
1474 #define _BAUDCON1_WUE 0x02
1475 #define _BAUDCON1_BRG16 0x08
1476 #define _BAUDCON1_TXCKP 0x10
1477 #define _BAUDCON1_SCKP 0x10
1478 #define _BAUDCON1_RXDTP 0x20
1479 #define _BAUDCON1_RCIDL 0x40
1480 #define _BAUDCON1_RCMT 0x40
1481 #define _BAUDCON1_ABDOVF 0x80
1483 //==============================================================================
1486 //==============================================================================
1487 // BAUDCTL Bits
1489 extern __at(0x0F7E) __sfr BAUDCTL;
1491 typedef union
1493 struct
1495 unsigned ABDEN : 1;
1496 unsigned WUE : 1;
1497 unsigned : 1;
1498 unsigned BRG16 : 1;
1499 unsigned TXCKP : 1;
1500 unsigned RXDTP : 1;
1501 unsigned RCIDL : 1;
1502 unsigned ABDOVF : 1;
1505 struct
1507 unsigned : 1;
1508 unsigned : 1;
1509 unsigned : 1;
1510 unsigned : 1;
1511 unsigned SCKP : 1;
1512 unsigned : 1;
1513 unsigned RCMT : 1;
1514 unsigned : 1;
1516 } __BAUDCTLbits_t;
1518 extern __at(0x0F7E) volatile __BAUDCTLbits_t BAUDCTLbits;
1520 #define _BAUDCTL_ABDEN 0x01
1521 #define _BAUDCTL_WUE 0x02
1522 #define _BAUDCTL_BRG16 0x08
1523 #define _BAUDCTL_TXCKP 0x10
1524 #define _BAUDCTL_SCKP 0x10
1525 #define _BAUDCTL_RXDTP 0x20
1526 #define _BAUDCTL_RCIDL 0x40
1527 #define _BAUDCTL_RCMT 0x40
1528 #define _BAUDCTL_ABDOVF 0x80
1530 //==============================================================================
1533 //==============================================================================
1534 // BAUDCTL1 Bits
1536 extern __at(0x0F7E) __sfr BAUDCTL1;
1538 typedef union
1540 struct
1542 unsigned ABDEN : 1;
1543 unsigned WUE : 1;
1544 unsigned : 1;
1545 unsigned BRG16 : 1;
1546 unsigned TXCKP : 1;
1547 unsigned RXDTP : 1;
1548 unsigned RCIDL : 1;
1549 unsigned ABDOVF : 1;
1552 struct
1554 unsigned : 1;
1555 unsigned : 1;
1556 unsigned : 1;
1557 unsigned : 1;
1558 unsigned SCKP : 1;
1559 unsigned : 1;
1560 unsigned RCMT : 1;
1561 unsigned : 1;
1563 } __BAUDCTL1bits_t;
1565 extern __at(0x0F7E) volatile __BAUDCTL1bits_t BAUDCTL1bits;
1567 #define _BAUDCTL1_ABDEN 0x01
1568 #define _BAUDCTL1_WUE 0x02
1569 #define _BAUDCTL1_BRG16 0x08
1570 #define _BAUDCTL1_TXCKP 0x10
1571 #define _BAUDCTL1_SCKP 0x10
1572 #define _BAUDCTL1_RXDTP 0x20
1573 #define _BAUDCTL1_RCIDL 0x40
1574 #define _BAUDCTL1_RCMT 0x40
1575 #define _BAUDCTL1_ABDOVF 0x80
1577 //==============================================================================
1579 extern __at(0x0F7F) __sfr SPBRGH;
1580 extern __at(0x0F7F) __sfr SPBRGH1;
1582 //==============================================================================
1583 // PORTA Bits
1585 extern __at(0x0F80) __sfr PORTA;
1587 typedef union
1589 struct
1591 unsigned RA0 : 1;
1592 unsigned RA1 : 1;
1593 unsigned RA2 : 1;
1594 unsigned RA3 : 1;
1595 unsigned RA4 : 1;
1596 unsigned RA5 : 1;
1597 unsigned : 1;
1598 unsigned RJPU : 1;
1601 struct
1603 unsigned AN0 : 1;
1604 unsigned AN1 : 1;
1605 unsigned AN2 : 1;
1606 unsigned AN3 : 1;
1607 unsigned T0CKI : 1;
1608 unsigned AN4 : 1;
1609 unsigned : 1;
1610 unsigned : 1;
1613 struct
1615 unsigned LEDA : 1;
1616 unsigned LEDB : 1;
1617 unsigned VREFM : 1;
1618 unsigned VREFP : 1;
1619 unsigned : 1;
1620 unsigned : 1;
1621 unsigned : 1;
1622 unsigned : 1;
1625 struct
1627 unsigned RA : 6;
1628 unsigned : 2;
1630 } __PORTAbits_t;
1632 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1634 #define _PORTA_RA0 0x01
1635 #define _PORTA_AN0 0x01
1636 #define _PORTA_LEDA 0x01
1637 #define _PORTA_RA1 0x02
1638 #define _PORTA_AN1 0x02
1639 #define _PORTA_LEDB 0x02
1640 #define _PORTA_RA2 0x04
1641 #define _PORTA_AN2 0x04
1642 #define _PORTA_VREFM 0x04
1643 #define _PORTA_RA3 0x08
1644 #define _PORTA_AN3 0x08
1645 #define _PORTA_VREFP 0x08
1646 #define _PORTA_RA4 0x10
1647 #define _PORTA_T0CKI 0x10
1648 #define _PORTA_RA5 0x20
1649 #define _PORTA_AN4 0x20
1650 #define _PORTA_RJPU 0x80
1652 //==============================================================================
1655 //==============================================================================
1656 // PORTB Bits
1658 extern __at(0x0F81) __sfr PORTB;
1660 typedef union
1662 struct
1664 unsigned RB0 : 1;
1665 unsigned RB1 : 1;
1666 unsigned RB2 : 1;
1667 unsigned RB3 : 1;
1668 unsigned RB4 : 1;
1669 unsigned RB5 : 1;
1670 unsigned RB6 : 1;
1671 unsigned RB7 : 1;
1674 struct
1676 unsigned INT0 : 1;
1677 unsigned INT1 : 1;
1678 unsigned INT2 : 1;
1679 unsigned INT3 : 1;
1680 unsigned KBI0 : 1;
1681 unsigned KBI1 : 1;
1682 unsigned KBI2 : 1;
1683 unsigned KBI3 : 1;
1686 struct
1688 unsigned FLT0 : 1;
1689 unsigned : 1;
1690 unsigned : 1;
1691 unsigned : 1;
1692 unsigned : 1;
1693 unsigned : 1;
1694 unsigned PGC : 1;
1695 unsigned PGD : 1;
1698 struct
1700 unsigned INT : 4;
1701 unsigned : 4;
1704 struct
1706 unsigned : 4;
1707 unsigned KBI : 4;
1709 } __PORTBbits_t;
1711 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1713 #define _PORTB_RB0 0x01
1714 #define _PORTB_INT0 0x01
1715 #define _PORTB_FLT0 0x01
1716 #define _PORTB_RB1 0x02
1717 #define _PORTB_INT1 0x02
1718 #define _PORTB_RB2 0x04
1719 #define _PORTB_INT2 0x04
1720 #define _PORTB_RB3 0x08
1721 #define _PORTB_INT3 0x08
1722 #define _PORTB_RB4 0x10
1723 #define _PORTB_KBI0 0x10
1724 #define _PORTB_RB5 0x20
1725 #define _PORTB_KBI1 0x20
1726 #define _PORTB_RB6 0x40
1727 #define _PORTB_KBI2 0x40
1728 #define _PORTB_PGC 0x40
1729 #define _PORTB_RB7 0x80
1730 #define _PORTB_KBI3 0x80
1731 #define _PORTB_PGD 0x80
1733 //==============================================================================
1736 //==============================================================================
1737 // PORTC Bits
1739 extern __at(0x0F82) __sfr PORTC;
1741 typedef union
1743 struct
1745 unsigned RC0 : 1;
1746 unsigned RC1 : 1;
1747 unsigned RC2 : 1;
1748 unsigned RC3 : 1;
1749 unsigned RC4 : 1;
1750 unsigned RC5 : 1;
1751 unsigned RC6 : 1;
1752 unsigned RC7 : 1;
1755 struct
1757 unsigned T1OSO : 1;
1758 unsigned T1OSI : 1;
1759 unsigned CCP1 : 1;
1760 unsigned SCK : 1;
1761 unsigned SDI : 1;
1762 unsigned SDO : 1;
1763 unsigned TX : 1;
1764 unsigned RX : 1;
1767 struct
1769 unsigned T13CKI : 1;
1770 unsigned CCP2 : 1;
1771 unsigned ECCP1 : 1;
1772 unsigned SCL : 1;
1773 unsigned SDA : 1;
1774 unsigned SDO1 : 1;
1775 unsigned CK : 1;
1776 unsigned RX1 : 1;
1779 struct
1781 unsigned : 1;
1782 unsigned ECCP2 : 1;
1783 unsigned : 1;
1784 unsigned SCK1 : 1;
1785 unsigned SDI1 : 1;
1786 unsigned : 1;
1787 unsigned TX1 : 1;
1788 unsigned DT1 : 1;
1791 struct
1793 unsigned : 1;
1794 unsigned : 1;
1795 unsigned : 1;
1796 unsigned SCL1 : 1;
1797 unsigned SDA1 : 1;
1798 unsigned : 1;
1799 unsigned CK1 : 1;
1800 unsigned : 1;
1802 } __PORTCbits_t;
1804 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1806 #define _PORTC_RC0 0x01
1807 #define _PORTC_T1OSO 0x01
1808 #define _PORTC_T13CKI 0x01
1809 #define _PORTC_RC1 0x02
1810 #define _PORTC_T1OSI 0x02
1811 #define _PORTC_CCP2 0x02
1812 #define _PORTC_ECCP2 0x02
1813 #define _PORTC_RC2 0x04
1814 #define _PORTC_CCP1 0x04
1815 #define _PORTC_ECCP1 0x04
1816 #define _PORTC_RC3 0x08
1817 #define _PORTC_SCK 0x08
1818 #define _PORTC_SCL 0x08
1819 #define _PORTC_SCK1 0x08
1820 #define _PORTC_SCL1 0x08
1821 #define _PORTC_RC4 0x10
1822 #define _PORTC_SDI 0x10
1823 #define _PORTC_SDA 0x10
1824 #define _PORTC_SDI1 0x10
1825 #define _PORTC_SDA1 0x10
1826 #define _PORTC_RC5 0x20
1827 #define _PORTC_SDO 0x20
1828 #define _PORTC_SDO1 0x20
1829 #define _PORTC_RC6 0x40
1830 #define _PORTC_TX 0x40
1831 #define _PORTC_CK 0x40
1832 #define _PORTC_TX1 0x40
1833 #define _PORTC_CK1 0x40
1834 #define _PORTC_RC7 0x80
1835 #define _PORTC_RX 0x80
1836 #define _PORTC_RX1 0x80
1837 #define _PORTC_DT1 0x80
1839 //==============================================================================
1842 //==============================================================================
1843 // PORTD Bits
1845 extern __at(0x0F83) __sfr PORTD;
1847 typedef union
1849 struct
1851 unsigned RD0 : 1;
1852 unsigned RD1 : 1;
1853 unsigned RD2 : 1;
1854 unsigned : 1;
1855 unsigned : 1;
1856 unsigned : 1;
1857 unsigned : 1;
1858 unsigned : 1;
1861 struct
1863 unsigned RD : 3;
1864 unsigned : 5;
1866 } __PORTDbits_t;
1868 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1870 #define _PORTD_RD0 0x01
1871 #define _PORTD_RD1 0x02
1872 #define _PORTD_RD2 0x04
1874 //==============================================================================
1877 //==============================================================================
1878 // PORTE Bits
1880 extern __at(0x0F84) __sfr PORTE;
1882 typedef union
1884 struct
1886 unsigned RE0 : 1;
1887 unsigned RE1 : 1;
1888 unsigned RE2 : 1;
1889 unsigned RE3 : 1;
1890 unsigned RE4 : 1;
1891 unsigned RE5 : 1;
1892 unsigned RE6 : 1;
1893 unsigned RE7 : 1;
1896 struct
1898 unsigned : 1;
1899 unsigned : 1;
1900 unsigned : 1;
1901 unsigned : 1;
1902 unsigned : 1;
1903 unsigned : 1;
1904 unsigned : 1;
1905 unsigned CCP2 : 1;
1908 struct
1910 unsigned : 1;
1911 unsigned : 1;
1912 unsigned : 1;
1913 unsigned : 1;
1914 unsigned : 1;
1915 unsigned : 1;
1916 unsigned : 1;
1917 unsigned ECCP2 : 1;
1919 } __PORTEbits_t;
1921 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1923 #define _PORTE_RE0 0x01
1924 #define _PORTE_RE1 0x02
1925 #define _PORTE_RE2 0x04
1926 #define _PORTE_RE3 0x08
1927 #define _PORTE_RE4 0x10
1928 #define _PORTE_RE5 0x20
1929 #define _PORTE_RE6 0x40
1930 #define _PORTE_RE7 0x80
1931 #define _PORTE_CCP2 0x80
1932 #define _PORTE_ECCP2 0x80
1934 //==============================================================================
1937 //==============================================================================
1938 // PORTF Bits
1940 extern __at(0x0F85) __sfr PORTF;
1942 typedef union
1944 struct
1946 unsigned : 1;
1947 unsigned RF1 : 1;
1948 unsigned RF2 : 1;
1949 unsigned RF3 : 1;
1950 unsigned RF4 : 1;
1951 unsigned RF5 : 1;
1952 unsigned RF6 : 1;
1953 unsigned RF7 : 1;
1956 struct
1958 unsigned : 1;
1959 unsigned AN6 : 1;
1960 unsigned AN7 : 1;
1961 unsigned AN8 : 1;
1962 unsigned AN9 : 1;
1963 unsigned AN10 : 1;
1964 unsigned AN11 : 1;
1965 unsigned SS : 1;
1968 struct
1970 unsigned : 1;
1971 unsigned : 1;
1972 unsigned : 1;
1973 unsigned : 1;
1974 unsigned : 1;
1975 unsigned CVREF : 1;
1976 unsigned : 1;
1977 unsigned NOT_SS : 1;
1980 struct
1982 unsigned : 1;
1983 unsigned : 1;
1984 unsigned : 1;
1985 unsigned : 1;
1986 unsigned : 1;
1987 unsigned : 1;
1988 unsigned : 1;
1989 unsigned SS1 : 1;
1992 struct
1994 unsigned : 1;
1995 unsigned : 1;
1996 unsigned : 1;
1997 unsigned : 1;
1998 unsigned : 1;
1999 unsigned : 1;
2000 unsigned : 1;
2001 unsigned NOT_SS1 : 1;
2003 } __PORTFbits_t;
2005 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
2007 #define _PORTF_RF1 0x02
2008 #define _PORTF_AN6 0x02
2009 #define _PORTF_RF2 0x04
2010 #define _PORTF_AN7 0x04
2011 #define _PORTF_RF3 0x08
2012 #define _PORTF_AN8 0x08
2013 #define _PORTF_RF4 0x10
2014 #define _PORTF_AN9 0x10
2015 #define _PORTF_RF5 0x20
2016 #define _PORTF_AN10 0x20
2017 #define _PORTF_CVREF 0x20
2018 #define _PORTF_RF6 0x40
2019 #define _PORTF_AN11 0x40
2020 #define _PORTF_RF7 0x80
2021 #define _PORTF_SS 0x80
2022 #define _PORTF_NOT_SS 0x80
2023 #define _PORTF_SS1 0x80
2024 #define _PORTF_NOT_SS1 0x80
2026 //==============================================================================
2029 //==============================================================================
2030 // PORTG Bits
2032 extern __at(0x0F86) __sfr PORTG;
2034 typedef union
2036 struct
2038 unsigned RG0 : 1;
2039 unsigned RG1 : 1;
2040 unsigned RG2 : 1;
2041 unsigned RG3 : 1;
2042 unsigned RG4 : 1;
2043 unsigned : 1;
2044 unsigned : 1;
2045 unsigned : 1;
2048 struct
2050 unsigned CCP3 : 1;
2051 unsigned TX2 : 1;
2052 unsigned RX2 : 1;
2053 unsigned CCP4 : 1;
2054 unsigned CCP5 : 1;
2055 unsigned : 1;
2056 unsigned : 1;
2057 unsigned : 1;
2060 struct
2062 unsigned ECCP3 : 1;
2063 unsigned CK2 : 1;
2064 unsigned DT2 : 1;
2065 unsigned : 1;
2066 unsigned : 1;
2067 unsigned : 1;
2068 unsigned : 1;
2069 unsigned : 1;
2072 struct
2074 unsigned RG : 5;
2075 unsigned : 3;
2077 } __PORTGbits_t;
2079 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
2081 #define _PORTG_RG0 0x01
2082 #define _PORTG_CCP3 0x01
2083 #define _PORTG_ECCP3 0x01
2084 #define _PORTG_RG1 0x02
2085 #define _PORTG_TX2 0x02
2086 #define _PORTG_CK2 0x02
2087 #define _PORTG_RG2 0x04
2088 #define _PORTG_RX2 0x04
2089 #define _PORTG_DT2 0x04
2090 #define _PORTG_RG3 0x08
2091 #define _PORTG_CCP4 0x08
2092 #define _PORTG_RG4 0x10
2093 #define _PORTG_CCP5 0x10
2095 //==============================================================================
2098 //==============================================================================
2099 // PORTH Bits
2101 extern __at(0x0F87) __sfr PORTH;
2103 typedef union
2105 struct
2107 unsigned RH0 : 1;
2108 unsigned RH1 : 1;
2109 unsigned RH2 : 1;
2110 unsigned RH3 : 1;
2111 unsigned RH4 : 1;
2112 unsigned RH5 : 1;
2113 unsigned RH6 : 1;
2114 unsigned RH7 : 1;
2117 struct
2119 unsigned : 1;
2120 unsigned : 1;
2121 unsigned : 1;
2122 unsigned : 1;
2123 unsigned AN12 : 1;
2124 unsigned AN13 : 1;
2125 unsigned AN14 : 1;
2126 unsigned AN15 : 1;
2128 } __PORTHbits_t;
2130 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
2132 #define _PORTH_RH0 0x01
2133 #define _PORTH_RH1 0x02
2134 #define _PORTH_RH2 0x04
2135 #define _PORTH_RH3 0x08
2136 #define _PORTH_RH4 0x10
2137 #define _PORTH_AN12 0x10
2138 #define _PORTH_RH5 0x20
2139 #define _PORTH_AN13 0x20
2140 #define _PORTH_RH6 0x40
2141 #define _PORTH_AN14 0x40
2142 #define _PORTH_RH7 0x80
2143 #define _PORTH_AN15 0x80
2145 //==============================================================================
2148 //==============================================================================
2149 // PORTJ Bits
2151 extern __at(0x0F88) __sfr PORTJ;
2153 typedef struct
2155 unsigned : 1;
2156 unsigned : 1;
2157 unsigned : 1;
2158 unsigned : 1;
2159 unsigned RJ4 : 1;
2160 unsigned RJ5 : 1;
2161 unsigned : 1;
2162 unsigned : 1;
2163 } __PORTJbits_t;
2165 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
2167 #define _PORTJ_RJ4 0x10
2168 #define _PORTJ_RJ5 0x20
2170 //==============================================================================
2173 //==============================================================================
2174 // LATA Bits
2176 extern __at(0x0F89) __sfr LATA;
2178 typedef union
2180 struct
2182 unsigned LATA0 : 1;
2183 unsigned LATA1 : 1;
2184 unsigned LATA2 : 1;
2185 unsigned LATA3 : 1;
2186 unsigned LATA4 : 1;
2187 unsigned LATA5 : 1;
2188 unsigned REPU : 1;
2189 unsigned RDPU : 1;
2192 struct
2194 unsigned LATA : 6;
2195 unsigned : 2;
2197 } __LATAbits_t;
2199 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2201 #define _LATA0 0x01
2202 #define _LATA1 0x02
2203 #define _LATA2 0x04
2204 #define _LATA3 0x08
2205 #define _LATA4 0x10
2206 #define _LATA5 0x20
2207 #define _REPU 0x40
2208 #define _RDPU 0x80
2210 //==============================================================================
2213 //==============================================================================
2214 // LATB Bits
2216 extern __at(0x0F8A) __sfr LATB;
2218 typedef struct
2220 unsigned LATB0 : 1;
2221 unsigned LATB1 : 1;
2222 unsigned LATB2 : 1;
2223 unsigned LATB3 : 1;
2224 unsigned LATB4 : 1;
2225 unsigned LATB5 : 1;
2226 unsigned LATB6 : 1;
2227 unsigned LATB7 : 1;
2228 } __LATBbits_t;
2230 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2232 #define _LATB0 0x01
2233 #define _LATB1 0x02
2234 #define _LATB2 0x04
2235 #define _LATB3 0x08
2236 #define _LATB4 0x10
2237 #define _LATB5 0x20
2238 #define _LATB6 0x40
2239 #define _LATB7 0x80
2241 //==============================================================================
2244 //==============================================================================
2245 // LATC Bits
2247 extern __at(0x0F8B) __sfr LATC;
2249 typedef struct
2251 unsigned LATC0 : 1;
2252 unsigned LATC1 : 1;
2253 unsigned LATC2 : 1;
2254 unsigned LATC3 : 1;
2255 unsigned LATC4 : 1;
2256 unsigned LATC5 : 1;
2257 unsigned LATC6 : 1;
2258 unsigned LATC7 : 1;
2259 } __LATCbits_t;
2261 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2263 #define _LATC0 0x01
2264 #define _LATC1 0x02
2265 #define _LATC2 0x04
2266 #define _LATC3 0x08
2267 #define _LATC4 0x10
2268 #define _LATC5 0x20
2269 #define _LATC6 0x40
2270 #define _LATC7 0x80
2272 //==============================================================================
2275 //==============================================================================
2276 // LATD Bits
2278 extern __at(0x0F8C) __sfr LATD;
2280 typedef union
2282 struct
2284 unsigned LATD0 : 1;
2285 unsigned LATD1 : 1;
2286 unsigned LATD2 : 1;
2287 unsigned : 1;
2288 unsigned : 1;
2289 unsigned : 1;
2290 unsigned : 1;
2291 unsigned : 1;
2294 struct
2296 unsigned LATD : 3;
2297 unsigned : 5;
2299 } __LATDbits_t;
2301 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
2303 #define _LATD0 0x01
2304 #define _LATD1 0x02
2305 #define _LATD2 0x04
2307 //==============================================================================
2310 //==============================================================================
2311 // LATE Bits
2313 extern __at(0x0F8D) __sfr LATE;
2315 typedef struct
2317 unsigned LATE0 : 1;
2318 unsigned LATE1 : 1;
2319 unsigned LATE2 : 1;
2320 unsigned LATE3 : 1;
2321 unsigned LATE4 : 1;
2322 unsigned LATE5 : 1;
2323 unsigned LATE6 : 1;
2324 unsigned LATE7 : 1;
2325 } __LATEbits_t;
2327 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
2329 #define _LATE0 0x01
2330 #define _LATE1 0x02
2331 #define _LATE2 0x04
2332 #define _LATE3 0x08
2333 #define _LATE4 0x10
2334 #define _LATE5 0x20
2335 #define _LATE6 0x40
2336 #define _LATE7 0x80
2338 //==============================================================================
2341 //==============================================================================
2342 // LATF Bits
2344 extern __at(0x0F8E) __sfr LATF;
2346 typedef struct
2348 unsigned : 1;
2349 unsigned LATF1 : 1;
2350 unsigned LATF2 : 1;
2351 unsigned LATF3 : 1;
2352 unsigned LATF4 : 1;
2353 unsigned LATF5 : 1;
2354 unsigned LATF6 : 1;
2355 unsigned LATF7 : 1;
2356 } __LATFbits_t;
2358 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
2360 #define _LATF1 0x02
2361 #define _LATF2 0x04
2362 #define _LATF3 0x08
2363 #define _LATF4 0x10
2364 #define _LATF5 0x20
2365 #define _LATF6 0x40
2366 #define _LATF7 0x80
2368 //==============================================================================
2371 //==============================================================================
2372 // LATG Bits
2374 extern __at(0x0F8F) __sfr LATG;
2376 typedef union
2378 struct
2380 unsigned LATG0 : 1;
2381 unsigned LATG1 : 1;
2382 unsigned LATG2 : 1;
2383 unsigned LATG3 : 1;
2384 unsigned LATG4 : 1;
2385 unsigned : 1;
2386 unsigned : 1;
2387 unsigned : 1;
2390 struct
2392 unsigned LATG : 5;
2393 unsigned : 3;
2395 } __LATGbits_t;
2397 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
2399 #define _LATG0 0x01
2400 #define _LATG1 0x02
2401 #define _LATG2 0x04
2402 #define _LATG3 0x08
2403 #define _LATG4 0x10
2405 //==============================================================================
2408 //==============================================================================
2409 // LATH Bits
2411 extern __at(0x0F90) __sfr LATH;
2413 typedef struct
2415 unsigned LATH0 : 1;
2416 unsigned LATH1 : 1;
2417 unsigned LATH2 : 1;
2418 unsigned LATH3 : 1;
2419 unsigned LATH4 : 1;
2420 unsigned LATH5 : 1;
2421 unsigned LATH6 : 1;
2422 unsigned LATH7 : 1;
2423 } __LATHbits_t;
2425 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
2427 #define _LATH0 0x01
2428 #define _LATH1 0x02
2429 #define _LATH2 0x04
2430 #define _LATH3 0x08
2431 #define _LATH4 0x10
2432 #define _LATH5 0x20
2433 #define _LATH6 0x40
2434 #define _LATH7 0x80
2436 //==============================================================================
2439 //==============================================================================
2440 // LATJ Bits
2442 extern __at(0x0F91) __sfr LATJ;
2444 typedef struct
2446 unsigned : 1;
2447 unsigned : 1;
2448 unsigned : 1;
2449 unsigned : 1;
2450 unsigned LATJ4 : 1;
2451 unsigned LATJ5 : 1;
2452 unsigned : 1;
2453 unsigned : 1;
2454 } __LATJbits_t;
2456 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
2458 #define _LATJ4 0x10
2459 #define _LATJ5 0x20
2461 //==============================================================================
2464 //==============================================================================
2465 // DDRA Bits
2467 extern __at(0x0F92) __sfr DDRA;
2469 typedef union
2471 struct
2473 unsigned TRISA0 : 1;
2474 unsigned TRISA1 : 1;
2475 unsigned TRISA2 : 1;
2476 unsigned TRISA3 : 1;
2477 unsigned TRISA4 : 1;
2478 unsigned TRISA5 : 1;
2479 unsigned : 1;
2480 unsigned : 1;
2483 struct
2485 unsigned RA0 : 1;
2486 unsigned RA1 : 1;
2487 unsigned RA2 : 1;
2488 unsigned RA3 : 1;
2489 unsigned RA4 : 1;
2490 unsigned RA5 : 1;
2491 unsigned : 1;
2492 unsigned : 1;
2495 struct
2497 unsigned TRISA : 6;
2498 unsigned : 2;
2501 struct
2503 unsigned RA : 6;
2504 unsigned : 2;
2506 } __DDRAbits_t;
2508 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2510 #define _TRISA0 0x01
2511 #define _RA0 0x01
2512 #define _TRISA1 0x02
2513 #define _RA1 0x02
2514 #define _TRISA2 0x04
2515 #define _RA2 0x04
2516 #define _TRISA3 0x08
2517 #define _RA3 0x08
2518 #define _TRISA4 0x10
2519 #define _RA4 0x10
2520 #define _TRISA5 0x20
2521 #define _RA5 0x20
2523 //==============================================================================
2526 //==============================================================================
2527 // TRISA Bits
2529 extern __at(0x0F92) __sfr TRISA;
2531 typedef union
2533 struct
2535 unsigned TRISA0 : 1;
2536 unsigned TRISA1 : 1;
2537 unsigned TRISA2 : 1;
2538 unsigned TRISA3 : 1;
2539 unsigned TRISA4 : 1;
2540 unsigned TRISA5 : 1;
2541 unsigned : 1;
2542 unsigned : 1;
2545 struct
2547 unsigned RA0 : 1;
2548 unsigned RA1 : 1;
2549 unsigned RA2 : 1;
2550 unsigned RA3 : 1;
2551 unsigned RA4 : 1;
2552 unsigned RA5 : 1;
2553 unsigned : 1;
2554 unsigned : 1;
2557 struct
2559 unsigned RA : 6;
2560 unsigned : 2;
2563 struct
2565 unsigned TRISA : 6;
2566 unsigned : 2;
2568 } __TRISAbits_t;
2570 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2572 #define _TRISA_TRISA0 0x01
2573 #define _TRISA_RA0 0x01
2574 #define _TRISA_TRISA1 0x02
2575 #define _TRISA_RA1 0x02
2576 #define _TRISA_TRISA2 0x04
2577 #define _TRISA_RA2 0x04
2578 #define _TRISA_TRISA3 0x08
2579 #define _TRISA_RA3 0x08
2580 #define _TRISA_TRISA4 0x10
2581 #define _TRISA_RA4 0x10
2582 #define _TRISA_TRISA5 0x20
2583 #define _TRISA_RA5 0x20
2585 //==============================================================================
2588 //==============================================================================
2589 // DDRB Bits
2591 extern __at(0x0F93) __sfr DDRB;
2593 typedef union
2595 struct
2597 unsigned TRISB0 : 1;
2598 unsigned TRISB1 : 1;
2599 unsigned TRISB2 : 1;
2600 unsigned TRISB3 : 1;
2601 unsigned TRISB4 : 1;
2602 unsigned TRISB5 : 1;
2603 unsigned TRISB6 : 1;
2604 unsigned TRISB7 : 1;
2607 struct
2609 unsigned RB0 : 1;
2610 unsigned RB1 : 1;
2611 unsigned RB2 : 1;
2612 unsigned RB3 : 1;
2613 unsigned RB4 : 1;
2614 unsigned RB5 : 1;
2615 unsigned RB6 : 1;
2616 unsigned RB7 : 1;
2618 } __DDRBbits_t;
2620 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2622 #define _TRISB0 0x01
2623 #define _RB0 0x01
2624 #define _TRISB1 0x02
2625 #define _RB1 0x02
2626 #define _TRISB2 0x04
2627 #define _RB2 0x04
2628 #define _TRISB3 0x08
2629 #define _RB3 0x08
2630 #define _TRISB4 0x10
2631 #define _RB4 0x10
2632 #define _TRISB5 0x20
2633 #define _RB5 0x20
2634 #define _TRISB6 0x40
2635 #define _RB6 0x40
2636 #define _TRISB7 0x80
2637 #define _RB7 0x80
2639 //==============================================================================
2642 //==============================================================================
2643 // TRISB Bits
2645 extern __at(0x0F93) __sfr TRISB;
2647 typedef union
2649 struct
2651 unsigned TRISB0 : 1;
2652 unsigned TRISB1 : 1;
2653 unsigned TRISB2 : 1;
2654 unsigned TRISB3 : 1;
2655 unsigned TRISB4 : 1;
2656 unsigned TRISB5 : 1;
2657 unsigned TRISB6 : 1;
2658 unsigned TRISB7 : 1;
2661 struct
2663 unsigned RB0 : 1;
2664 unsigned RB1 : 1;
2665 unsigned RB2 : 1;
2666 unsigned RB3 : 1;
2667 unsigned RB4 : 1;
2668 unsigned RB5 : 1;
2669 unsigned RB6 : 1;
2670 unsigned RB7 : 1;
2672 } __TRISBbits_t;
2674 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2676 #define _TRISB_TRISB0 0x01
2677 #define _TRISB_RB0 0x01
2678 #define _TRISB_TRISB1 0x02
2679 #define _TRISB_RB1 0x02
2680 #define _TRISB_TRISB2 0x04
2681 #define _TRISB_RB2 0x04
2682 #define _TRISB_TRISB3 0x08
2683 #define _TRISB_RB3 0x08
2684 #define _TRISB_TRISB4 0x10
2685 #define _TRISB_RB4 0x10
2686 #define _TRISB_TRISB5 0x20
2687 #define _TRISB_RB5 0x20
2688 #define _TRISB_TRISB6 0x40
2689 #define _TRISB_RB6 0x40
2690 #define _TRISB_TRISB7 0x80
2691 #define _TRISB_RB7 0x80
2693 //==============================================================================
2696 //==============================================================================
2697 // DDRC Bits
2699 extern __at(0x0F94) __sfr DDRC;
2701 typedef union
2703 struct
2705 unsigned TRISC0 : 1;
2706 unsigned TRISC1 : 1;
2707 unsigned TRISC2 : 1;
2708 unsigned TRISC3 : 1;
2709 unsigned TRISC4 : 1;
2710 unsigned TRISC5 : 1;
2711 unsigned TRISC6 : 1;
2712 unsigned TRISC7 : 1;
2715 struct
2717 unsigned RC0 : 1;
2718 unsigned RC1 : 1;
2719 unsigned RC2 : 1;
2720 unsigned RC3 : 1;
2721 unsigned RC4 : 1;
2722 unsigned RC5 : 1;
2723 unsigned RC6 : 1;
2724 unsigned RC7 : 1;
2726 } __DDRCbits_t;
2728 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2730 #define _TRISC0 0x01
2731 #define _RC0 0x01
2732 #define _TRISC1 0x02
2733 #define _RC1 0x02
2734 #define _TRISC2 0x04
2735 #define _RC2 0x04
2736 #define _TRISC3 0x08
2737 #define _RC3 0x08
2738 #define _TRISC4 0x10
2739 #define _RC4 0x10
2740 #define _TRISC5 0x20
2741 #define _RC5 0x20
2742 #define _TRISC6 0x40
2743 #define _RC6 0x40
2744 #define _TRISC7 0x80
2745 #define _RC7 0x80
2747 //==============================================================================
2750 //==============================================================================
2751 // TRISC Bits
2753 extern __at(0x0F94) __sfr TRISC;
2755 typedef union
2757 struct
2759 unsigned TRISC0 : 1;
2760 unsigned TRISC1 : 1;
2761 unsigned TRISC2 : 1;
2762 unsigned TRISC3 : 1;
2763 unsigned TRISC4 : 1;
2764 unsigned TRISC5 : 1;
2765 unsigned TRISC6 : 1;
2766 unsigned TRISC7 : 1;
2769 struct
2771 unsigned RC0 : 1;
2772 unsigned RC1 : 1;
2773 unsigned RC2 : 1;
2774 unsigned RC3 : 1;
2775 unsigned RC4 : 1;
2776 unsigned RC5 : 1;
2777 unsigned RC6 : 1;
2778 unsigned RC7 : 1;
2780 } __TRISCbits_t;
2782 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2784 #define _TRISC_TRISC0 0x01
2785 #define _TRISC_RC0 0x01
2786 #define _TRISC_TRISC1 0x02
2787 #define _TRISC_RC1 0x02
2788 #define _TRISC_TRISC2 0x04
2789 #define _TRISC_RC2 0x04
2790 #define _TRISC_TRISC3 0x08
2791 #define _TRISC_RC3 0x08
2792 #define _TRISC_TRISC4 0x10
2793 #define _TRISC_RC4 0x10
2794 #define _TRISC_TRISC5 0x20
2795 #define _TRISC_RC5 0x20
2796 #define _TRISC_TRISC6 0x40
2797 #define _TRISC_RC6 0x40
2798 #define _TRISC_TRISC7 0x80
2799 #define _TRISC_RC7 0x80
2801 //==============================================================================
2804 //==============================================================================
2805 // DDRD Bits
2807 extern __at(0x0F95) __sfr DDRD;
2809 typedef union
2811 struct
2813 unsigned TRISD0 : 1;
2814 unsigned TRISD1 : 1;
2815 unsigned TRISD2 : 1;
2816 unsigned : 1;
2817 unsigned : 1;
2818 unsigned : 1;
2819 unsigned : 1;
2820 unsigned : 1;
2823 struct
2825 unsigned RD0 : 1;
2826 unsigned RD1 : 1;
2827 unsigned RD2 : 1;
2828 unsigned : 1;
2829 unsigned : 1;
2830 unsigned : 1;
2831 unsigned : 1;
2832 unsigned : 1;
2835 struct
2837 unsigned TRISD : 3;
2838 unsigned : 5;
2841 struct
2843 unsigned RD : 3;
2844 unsigned : 5;
2846 } __DDRDbits_t;
2848 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
2850 #define _TRISD0 0x01
2851 #define _RD0 0x01
2852 #define _TRISD1 0x02
2853 #define _RD1 0x02
2854 #define _TRISD2 0x04
2855 #define _RD2 0x04
2857 //==============================================================================
2860 //==============================================================================
2861 // TRISD Bits
2863 extern __at(0x0F95) __sfr TRISD;
2865 typedef union
2867 struct
2869 unsigned TRISD0 : 1;
2870 unsigned TRISD1 : 1;
2871 unsigned TRISD2 : 1;
2872 unsigned : 1;
2873 unsigned : 1;
2874 unsigned : 1;
2875 unsigned : 1;
2876 unsigned : 1;
2879 struct
2881 unsigned RD0 : 1;
2882 unsigned RD1 : 1;
2883 unsigned RD2 : 1;
2884 unsigned : 1;
2885 unsigned : 1;
2886 unsigned : 1;
2887 unsigned : 1;
2888 unsigned : 1;
2891 struct
2893 unsigned RD : 3;
2894 unsigned : 5;
2897 struct
2899 unsigned TRISD : 3;
2900 unsigned : 5;
2902 } __TRISDbits_t;
2904 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2906 #define _TRISD_TRISD0 0x01
2907 #define _TRISD_RD0 0x01
2908 #define _TRISD_TRISD1 0x02
2909 #define _TRISD_RD1 0x02
2910 #define _TRISD_TRISD2 0x04
2911 #define _TRISD_RD2 0x04
2913 //==============================================================================
2916 //==============================================================================
2917 // DDRE Bits
2919 extern __at(0x0F96) __sfr DDRE;
2921 typedef union
2923 struct
2925 unsigned TRISE0 : 1;
2926 unsigned TRISE1 : 1;
2927 unsigned TRISE2 : 1;
2928 unsigned TRISE3 : 1;
2929 unsigned TRISE4 : 1;
2930 unsigned TRISE5 : 1;
2931 unsigned TRISE6 : 1;
2932 unsigned TRISE7 : 1;
2935 struct
2937 unsigned RE0 : 1;
2938 unsigned RE1 : 1;
2939 unsigned RE2 : 1;
2940 unsigned RE3 : 1;
2941 unsigned RE4 : 1;
2942 unsigned RE5 : 1;
2943 unsigned RE6 : 1;
2944 unsigned RE7 : 1;
2946 } __DDREbits_t;
2948 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
2950 #define _TRISE0 0x01
2951 #define _RE0 0x01
2952 #define _TRISE1 0x02
2953 #define _RE1 0x02
2954 #define _TRISE2 0x04
2955 #define _RE2 0x04
2956 #define _TRISE3 0x08
2957 #define _RE3 0x08
2958 #define _TRISE4 0x10
2959 #define _RE4 0x10
2960 #define _TRISE5 0x20
2961 #define _RE5 0x20
2962 #define _TRISE6 0x40
2963 #define _RE6 0x40
2964 #define _TRISE7 0x80
2965 #define _RE7 0x80
2967 //==============================================================================
2970 //==============================================================================
2971 // TRISE Bits
2973 extern __at(0x0F96) __sfr TRISE;
2975 typedef union
2977 struct
2979 unsigned TRISE0 : 1;
2980 unsigned TRISE1 : 1;
2981 unsigned TRISE2 : 1;
2982 unsigned TRISE3 : 1;
2983 unsigned TRISE4 : 1;
2984 unsigned TRISE5 : 1;
2985 unsigned TRISE6 : 1;
2986 unsigned TRISE7 : 1;
2989 struct
2991 unsigned RE0 : 1;
2992 unsigned RE1 : 1;
2993 unsigned RE2 : 1;
2994 unsigned RE3 : 1;
2995 unsigned RE4 : 1;
2996 unsigned RE5 : 1;
2997 unsigned RE6 : 1;
2998 unsigned RE7 : 1;
3000 } __TRISEbits_t;
3002 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
3004 #define _TRISE_TRISE0 0x01
3005 #define _TRISE_RE0 0x01
3006 #define _TRISE_TRISE1 0x02
3007 #define _TRISE_RE1 0x02
3008 #define _TRISE_TRISE2 0x04
3009 #define _TRISE_RE2 0x04
3010 #define _TRISE_TRISE3 0x08
3011 #define _TRISE_RE3 0x08
3012 #define _TRISE_TRISE4 0x10
3013 #define _TRISE_RE4 0x10
3014 #define _TRISE_TRISE5 0x20
3015 #define _TRISE_RE5 0x20
3016 #define _TRISE_TRISE6 0x40
3017 #define _TRISE_RE6 0x40
3018 #define _TRISE_TRISE7 0x80
3019 #define _TRISE_RE7 0x80
3021 //==============================================================================
3024 //==============================================================================
3025 // DDRF Bits
3027 extern __at(0x0F97) __sfr DDRF;
3029 typedef union
3031 struct
3033 unsigned : 1;
3034 unsigned TRISF1 : 1;
3035 unsigned TRISF2 : 1;
3036 unsigned TRISF3 : 1;
3037 unsigned TRISF4 : 1;
3038 unsigned TRISF5 : 1;
3039 unsigned TRISF6 : 1;
3040 unsigned TRISF7 : 1;
3043 struct
3045 unsigned : 1;
3046 unsigned RF1 : 1;
3047 unsigned RF2 : 1;
3048 unsigned RF3 : 1;
3049 unsigned RF4 : 1;
3050 unsigned RF5 : 1;
3051 unsigned RF6 : 1;
3052 unsigned RF7 : 1;
3054 } __DDRFbits_t;
3056 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
3058 #define _TRISF1 0x02
3059 #define _RF1 0x02
3060 #define _TRISF2 0x04
3061 #define _RF2 0x04
3062 #define _TRISF3 0x08
3063 #define _RF3 0x08
3064 #define _TRISF4 0x10
3065 #define _RF4 0x10
3066 #define _TRISF5 0x20
3067 #define _RF5 0x20
3068 #define _TRISF6 0x40
3069 #define _RF6 0x40
3070 #define _TRISF7 0x80
3071 #define _RF7 0x80
3073 //==============================================================================
3076 //==============================================================================
3077 // TRISF Bits
3079 extern __at(0x0F97) __sfr TRISF;
3081 typedef union
3083 struct
3085 unsigned : 1;
3086 unsigned TRISF1 : 1;
3087 unsigned TRISF2 : 1;
3088 unsigned TRISF3 : 1;
3089 unsigned TRISF4 : 1;
3090 unsigned TRISF5 : 1;
3091 unsigned TRISF6 : 1;
3092 unsigned TRISF7 : 1;
3095 struct
3097 unsigned : 1;
3098 unsigned RF1 : 1;
3099 unsigned RF2 : 1;
3100 unsigned RF3 : 1;
3101 unsigned RF4 : 1;
3102 unsigned RF5 : 1;
3103 unsigned RF6 : 1;
3104 unsigned RF7 : 1;
3106 } __TRISFbits_t;
3108 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
3110 #define _TRISF_TRISF1 0x02
3111 #define _TRISF_RF1 0x02
3112 #define _TRISF_TRISF2 0x04
3113 #define _TRISF_RF2 0x04
3114 #define _TRISF_TRISF3 0x08
3115 #define _TRISF_RF3 0x08
3116 #define _TRISF_TRISF4 0x10
3117 #define _TRISF_RF4 0x10
3118 #define _TRISF_TRISF5 0x20
3119 #define _TRISF_RF5 0x20
3120 #define _TRISF_TRISF6 0x40
3121 #define _TRISF_RF6 0x40
3122 #define _TRISF_TRISF7 0x80
3123 #define _TRISF_RF7 0x80
3125 //==============================================================================
3128 //==============================================================================
3129 // DDRG Bits
3131 extern __at(0x0F98) __sfr DDRG;
3133 typedef union
3135 struct
3137 unsigned TRISG0 : 1;
3138 unsigned TRISG1 : 1;
3139 unsigned TRISG2 : 1;
3140 unsigned TRISG3 : 1;
3141 unsigned TRISG4 : 1;
3142 unsigned : 1;
3143 unsigned : 1;
3144 unsigned : 1;
3147 struct
3149 unsigned RG0 : 1;
3150 unsigned RG1 : 1;
3151 unsigned RG2 : 1;
3152 unsigned RG3 : 1;
3153 unsigned RG4 : 1;
3154 unsigned : 1;
3155 unsigned : 1;
3156 unsigned : 1;
3159 struct
3161 unsigned TRISG : 5;
3162 unsigned : 3;
3165 struct
3167 unsigned RG : 5;
3168 unsigned : 3;
3170 } __DDRGbits_t;
3172 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
3174 #define _TRISG0 0x01
3175 #define _RG0 0x01
3176 #define _TRISG1 0x02
3177 #define _RG1 0x02
3178 #define _TRISG2 0x04
3179 #define _RG2 0x04
3180 #define _TRISG3 0x08
3181 #define _RG3 0x08
3182 #define _TRISG4 0x10
3183 #define _RG4 0x10
3185 //==============================================================================
3188 //==============================================================================
3189 // TRISG Bits
3191 extern __at(0x0F98) __sfr TRISG;
3193 typedef union
3195 struct
3197 unsigned TRISG0 : 1;
3198 unsigned TRISG1 : 1;
3199 unsigned TRISG2 : 1;
3200 unsigned TRISG3 : 1;
3201 unsigned TRISG4 : 1;
3202 unsigned : 1;
3203 unsigned : 1;
3204 unsigned : 1;
3207 struct
3209 unsigned RG0 : 1;
3210 unsigned RG1 : 1;
3211 unsigned RG2 : 1;
3212 unsigned RG3 : 1;
3213 unsigned RG4 : 1;
3214 unsigned : 1;
3215 unsigned : 1;
3216 unsigned : 1;
3219 struct
3221 unsigned TRISG : 5;
3222 unsigned : 3;
3225 struct
3227 unsigned RG : 5;
3228 unsigned : 3;
3230 } __TRISGbits_t;
3232 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
3234 #define _TRISG_TRISG0 0x01
3235 #define _TRISG_RG0 0x01
3236 #define _TRISG_TRISG1 0x02
3237 #define _TRISG_RG1 0x02
3238 #define _TRISG_TRISG2 0x04
3239 #define _TRISG_RG2 0x04
3240 #define _TRISG_TRISG3 0x08
3241 #define _TRISG_RG3 0x08
3242 #define _TRISG_TRISG4 0x10
3243 #define _TRISG_RG4 0x10
3245 //==============================================================================
3248 //==============================================================================
3249 // DDRH Bits
3251 extern __at(0x0F99) __sfr DDRH;
3253 typedef union
3255 struct
3257 unsigned TRISH0 : 1;
3258 unsigned TRISH1 : 1;
3259 unsigned TRISH2 : 1;
3260 unsigned TRISH3 : 1;
3261 unsigned TRISH4 : 1;
3262 unsigned TRISH5 : 1;
3263 unsigned TRISH6 : 1;
3264 unsigned TRISH7 : 1;
3267 struct
3269 unsigned RH0 : 1;
3270 unsigned RH1 : 1;
3271 unsigned RH2 : 1;
3272 unsigned RH3 : 1;
3273 unsigned RH4 : 1;
3274 unsigned RH5 : 1;
3275 unsigned RH6 : 1;
3276 unsigned RH7 : 1;
3278 } __DDRHbits_t;
3280 extern __at(0x0F99) volatile __DDRHbits_t DDRHbits;
3282 #define _TRISH0 0x01
3283 #define _RH0 0x01
3284 #define _TRISH1 0x02
3285 #define _RH1 0x02
3286 #define _TRISH2 0x04
3287 #define _RH2 0x04
3288 #define _TRISH3 0x08
3289 #define _RH3 0x08
3290 #define _TRISH4 0x10
3291 #define _RH4 0x10
3292 #define _TRISH5 0x20
3293 #define _RH5 0x20
3294 #define _TRISH6 0x40
3295 #define _RH6 0x40
3296 #define _TRISH7 0x80
3297 #define _RH7 0x80
3299 //==============================================================================
3302 //==============================================================================
3303 // TRISH Bits
3305 extern __at(0x0F99) __sfr TRISH;
3307 typedef union
3309 struct
3311 unsigned TRISH0 : 1;
3312 unsigned TRISH1 : 1;
3313 unsigned TRISH2 : 1;
3314 unsigned TRISH3 : 1;
3315 unsigned TRISH4 : 1;
3316 unsigned TRISH5 : 1;
3317 unsigned TRISH6 : 1;
3318 unsigned TRISH7 : 1;
3321 struct
3323 unsigned RH0 : 1;
3324 unsigned RH1 : 1;
3325 unsigned RH2 : 1;
3326 unsigned RH3 : 1;
3327 unsigned RH4 : 1;
3328 unsigned RH5 : 1;
3329 unsigned RH6 : 1;
3330 unsigned RH7 : 1;
3332 } __TRISHbits_t;
3334 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
3336 #define _TRISH_TRISH0 0x01
3337 #define _TRISH_RH0 0x01
3338 #define _TRISH_TRISH1 0x02
3339 #define _TRISH_RH1 0x02
3340 #define _TRISH_TRISH2 0x04
3341 #define _TRISH_RH2 0x04
3342 #define _TRISH_TRISH3 0x08
3343 #define _TRISH_RH3 0x08
3344 #define _TRISH_TRISH4 0x10
3345 #define _TRISH_RH4 0x10
3346 #define _TRISH_TRISH5 0x20
3347 #define _TRISH_RH5 0x20
3348 #define _TRISH_TRISH6 0x40
3349 #define _TRISH_RH6 0x40
3350 #define _TRISH_TRISH7 0x80
3351 #define _TRISH_RH7 0x80
3353 //==============================================================================
3356 //==============================================================================
3357 // DDRJ Bits
3359 extern __at(0x0F9A) __sfr DDRJ;
3361 typedef union
3363 struct
3365 unsigned : 1;
3366 unsigned : 1;
3367 unsigned : 1;
3368 unsigned : 1;
3369 unsigned TRISJ4 : 1;
3370 unsigned TRISJ5 : 1;
3371 unsigned : 1;
3372 unsigned : 1;
3375 struct
3377 unsigned : 1;
3378 unsigned : 1;
3379 unsigned : 1;
3380 unsigned : 1;
3381 unsigned RJ4 : 1;
3382 unsigned RJ5 : 1;
3383 unsigned : 1;
3384 unsigned : 1;
3386 } __DDRJbits_t;
3388 extern __at(0x0F9A) volatile __DDRJbits_t DDRJbits;
3390 #define _TRISJ4 0x10
3391 #define _RJ4 0x10
3392 #define _TRISJ5 0x20
3393 #define _RJ5 0x20
3395 //==============================================================================
3398 //==============================================================================
3399 // TRISJ Bits
3401 extern __at(0x0F9A) __sfr TRISJ;
3403 typedef union
3405 struct
3407 unsigned : 1;
3408 unsigned : 1;
3409 unsigned : 1;
3410 unsigned : 1;
3411 unsigned TRISJ4 : 1;
3412 unsigned TRISJ5 : 1;
3413 unsigned : 1;
3414 unsigned : 1;
3417 struct
3419 unsigned : 1;
3420 unsigned : 1;
3421 unsigned : 1;
3422 unsigned : 1;
3423 unsigned RJ4 : 1;
3424 unsigned RJ5 : 1;
3425 unsigned : 1;
3426 unsigned : 1;
3428 } __TRISJbits_t;
3430 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
3432 #define _TRISJ_TRISJ4 0x10
3433 #define _TRISJ_RJ4 0x10
3434 #define _TRISJ_TRISJ5 0x20
3435 #define _TRISJ_RJ5 0x20
3437 //==============================================================================
3440 //==============================================================================
3441 // OSCTUNE Bits
3443 extern __at(0x0F9B) __sfr OSCTUNE;
3445 typedef struct
3447 unsigned : 1;
3448 unsigned : 1;
3449 unsigned : 1;
3450 unsigned : 1;
3451 unsigned PPRE : 1;
3452 unsigned PPST0 : 1;
3453 unsigned PLLEN : 1;
3454 unsigned PPST1 : 1;
3455 } __OSCTUNEbits_t;
3457 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3459 #define _PPRE 0x10
3460 #define _PPST0 0x20
3461 #define _PLLEN 0x40
3462 #define _PPST1 0x80
3464 //==============================================================================
3467 //==============================================================================
3468 // PIE1 Bits
3470 extern __at(0x0F9D) __sfr PIE1;
3472 typedef union
3474 struct
3476 unsigned TMR1IE : 1;
3477 unsigned TMR2IE : 1;
3478 unsigned CCP1IE : 1;
3479 unsigned SSP1IE : 1;
3480 unsigned TX1IE : 1;
3481 unsigned RC1IE : 1;
3482 unsigned ADIE : 1;
3483 unsigned : 1;
3486 struct
3488 unsigned : 1;
3489 unsigned : 1;
3490 unsigned : 1;
3491 unsigned SSPIE : 1;
3492 unsigned TXIE : 1;
3493 unsigned RCIE : 1;
3494 unsigned : 1;
3495 unsigned : 1;
3497 } __PIE1bits_t;
3499 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3501 #define _PIE1_TMR1IE 0x01
3502 #define _PIE1_TMR2IE 0x02
3503 #define _PIE1_CCP1IE 0x04
3504 #define _PIE1_SSP1IE 0x08
3505 #define _PIE1_SSPIE 0x08
3506 #define _PIE1_TX1IE 0x10
3507 #define _PIE1_TXIE 0x10
3508 #define _PIE1_RC1IE 0x20
3509 #define _PIE1_RCIE 0x20
3510 #define _PIE1_ADIE 0x40
3512 //==============================================================================
3515 //==============================================================================
3516 // PIR1 Bits
3518 extern __at(0x0F9E) __sfr PIR1;
3520 typedef union
3522 struct
3524 unsigned TMR1IF : 1;
3525 unsigned TMR2IF : 1;
3526 unsigned CCP1IF : 1;
3527 unsigned SSP1IF : 1;
3528 unsigned TX1IF : 1;
3529 unsigned RC1IF : 1;
3530 unsigned ADIF : 1;
3531 unsigned : 1;
3534 struct
3536 unsigned : 1;
3537 unsigned : 1;
3538 unsigned : 1;
3539 unsigned SSPIF : 1;
3540 unsigned TXIF : 1;
3541 unsigned RCIF : 1;
3542 unsigned : 1;
3543 unsigned : 1;
3545 } __PIR1bits_t;
3547 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
3549 #define _PIR1_TMR1IF 0x01
3550 #define _PIR1_TMR2IF 0x02
3551 #define _PIR1_CCP1IF 0x04
3552 #define _PIR1_SSP1IF 0x08
3553 #define _PIR1_SSPIF 0x08
3554 #define _PIR1_TX1IF 0x10
3555 #define _PIR1_TXIF 0x10
3556 #define _PIR1_RC1IF 0x20
3557 #define _PIR1_RCIF 0x20
3558 #define _PIR1_ADIF 0x40
3560 //==============================================================================
3563 //==============================================================================
3564 // IPR1 Bits
3566 extern __at(0x0F9F) __sfr IPR1;
3568 typedef union
3570 struct
3572 unsigned TMR1IP : 1;
3573 unsigned TMR2IP : 1;
3574 unsigned CCP1IP : 1;
3575 unsigned SSP1IP : 1;
3576 unsigned TX1IP : 1;
3577 unsigned RC1IP : 1;
3578 unsigned ADIP : 1;
3579 unsigned : 1;
3582 struct
3584 unsigned : 1;
3585 unsigned : 1;
3586 unsigned : 1;
3587 unsigned SSPIP : 1;
3588 unsigned TXIP : 1;
3589 unsigned RCIP : 1;
3590 unsigned : 1;
3591 unsigned : 1;
3593 } __IPR1bits_t;
3595 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
3597 #define _TMR1IP 0x01
3598 #define _TMR2IP 0x02
3599 #define _CCP1IP 0x04
3600 #define _SSP1IP 0x08
3601 #define _SSPIP 0x08
3602 #define _TX1IP 0x10
3603 #define _TXIP 0x10
3604 #define _RC1IP 0x20
3605 #define _RCIP 0x20
3606 #define _ADIP 0x40
3608 //==============================================================================
3611 //==============================================================================
3612 // PIE2 Bits
3614 extern __at(0x0FA0) __sfr PIE2;
3616 typedef union
3618 struct
3620 unsigned CCP2IE : 1;
3621 unsigned TMR3IE : 1;
3622 unsigned : 1;
3623 unsigned BCL1IE : 1;
3624 unsigned : 1;
3625 unsigned ETHIE : 1;
3626 unsigned CMIE : 1;
3627 unsigned OSCFIE : 1;
3630 struct
3632 unsigned : 1;
3633 unsigned : 1;
3634 unsigned : 1;
3635 unsigned BCLIE : 1;
3636 unsigned : 1;
3637 unsigned : 1;
3638 unsigned : 1;
3639 unsigned : 1;
3641 } __PIE2bits_t;
3643 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3645 #define _CCP2IE 0x01
3646 #define _TMR3IE 0x02
3647 #define _BCL1IE 0x08
3648 #define _BCLIE 0x08
3649 #define _ETHIE 0x20
3650 #define _CMIE 0x40
3651 #define _OSCFIE 0x80
3653 //==============================================================================
3656 //==============================================================================
3657 // PIR2 Bits
3659 extern __at(0x0FA1) __sfr PIR2;
3661 typedef union
3663 struct
3665 unsigned CCP2IF : 1;
3666 unsigned TMR3IF : 1;
3667 unsigned : 1;
3668 unsigned BCL1IF : 1;
3669 unsigned : 1;
3670 unsigned ETHIF : 1;
3671 unsigned CMIF : 1;
3672 unsigned OSCFIF : 1;
3675 struct
3677 unsigned : 1;
3678 unsigned : 1;
3679 unsigned : 1;
3680 unsigned BCLIF : 1;
3681 unsigned : 1;
3682 unsigned : 1;
3683 unsigned : 1;
3684 unsigned : 1;
3686 } __PIR2bits_t;
3688 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3690 #define _CCP2IF 0x01
3691 #define _TMR3IF 0x02
3692 #define _BCL1IF 0x08
3693 #define _BCLIF 0x08
3694 #define _ETHIF 0x20
3695 #define _CMIF 0x40
3696 #define _OSCFIF 0x80
3698 //==============================================================================
3701 //==============================================================================
3702 // IPR2 Bits
3704 extern __at(0x0FA2) __sfr IPR2;
3706 typedef union
3708 struct
3710 unsigned CCP2IP : 1;
3711 unsigned TMR3IP : 1;
3712 unsigned : 1;
3713 unsigned BCL1IP : 1;
3714 unsigned : 1;
3715 unsigned ETHIP : 1;
3716 unsigned CMIP : 1;
3717 unsigned OSCFIP : 1;
3720 struct
3722 unsigned : 1;
3723 unsigned : 1;
3724 unsigned : 1;
3725 unsigned BCLIP : 1;
3726 unsigned : 1;
3727 unsigned : 1;
3728 unsigned : 1;
3729 unsigned : 1;
3731 } __IPR2bits_t;
3733 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3735 #define _CCP2IP 0x01
3736 #define _TMR3IP 0x02
3737 #define _BCL1IP 0x08
3738 #define _BCLIP 0x08
3739 #define _ETHIP 0x20
3740 #define _CMIP 0x40
3741 #define _OSCFIP 0x80
3743 //==============================================================================
3746 //==============================================================================
3747 // PIE3 Bits
3749 extern __at(0x0FA3) __sfr PIE3;
3751 typedef struct
3753 unsigned CCP3IE : 1;
3754 unsigned CCP4IE : 1;
3755 unsigned CCP5IE : 1;
3756 unsigned TMR4IE : 1;
3757 unsigned TX2IE : 1;
3758 unsigned RC2IE : 1;
3759 unsigned : 1;
3760 unsigned : 1;
3761 } __PIE3bits_t;
3763 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3765 #define _CCP3IE 0x01
3766 #define _CCP4IE 0x02
3767 #define _CCP5IE 0x04
3768 #define _TMR4IE 0x08
3769 #define _TX2IE 0x10
3770 #define _RC2IE 0x20
3772 //==============================================================================
3775 //==============================================================================
3776 // PIR3 Bits
3778 extern __at(0x0FA4) __sfr PIR3;
3780 typedef struct
3782 unsigned CCP3IF : 1;
3783 unsigned CCP4IF : 1;
3784 unsigned CCP5IF : 1;
3785 unsigned TMR4IF : 1;
3786 unsigned TX2IF : 1;
3787 unsigned RC2IF : 1;
3788 unsigned : 1;
3789 unsigned : 1;
3790 } __PIR3bits_t;
3792 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3794 #define _CCP3IF 0x01
3795 #define _CCP4IF 0x02
3796 #define _CCP5IF 0x04
3797 #define _TMR4IF 0x08
3798 #define _TX2IF 0x10
3799 #define _RC2IF 0x20
3801 //==============================================================================
3804 //==============================================================================
3805 // IPR3 Bits
3807 extern __at(0x0FA5) __sfr IPR3;
3809 typedef struct
3811 unsigned CCP3IP : 1;
3812 unsigned CCP4IP : 1;
3813 unsigned CCP5IP : 1;
3814 unsigned TMR4IP : 1;
3815 unsigned TX2IP : 1;
3816 unsigned RC2IP : 1;
3817 unsigned : 1;
3818 unsigned : 1;
3819 } __IPR3bits_t;
3821 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3823 #define _CCP3IP 0x01
3824 #define _CCP4IP 0x02
3825 #define _CCP5IP 0x04
3826 #define _TMR4IP 0x08
3827 #define _TX2IP 0x10
3828 #define _RC2IP 0x20
3830 //==============================================================================
3833 //==============================================================================
3834 // EECON1 Bits
3836 extern __at(0x0FA6) __sfr EECON1;
3838 typedef struct
3840 unsigned : 1;
3841 unsigned WR : 1;
3842 unsigned WREN : 1;
3843 unsigned WRERR : 1;
3844 unsigned FREE : 1;
3845 unsigned : 1;
3846 unsigned : 1;
3847 unsigned : 1;
3848 } __EECON1bits_t;
3850 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3852 #define _WR 0x02
3853 #define _WREN 0x04
3854 #define _WRERR 0x08
3855 #define _FREE 0x10
3857 //==============================================================================
3859 extern __at(0x0FA7) __sfr EECON2;
3861 //==============================================================================
3862 // RCSTA Bits
3864 extern __at(0x0FAB) __sfr RCSTA;
3866 typedef union
3868 struct
3870 unsigned RX9D : 1;
3871 unsigned OERR : 1;
3872 unsigned FERR : 1;
3873 unsigned ADDEN : 1;
3874 unsigned CREN : 1;
3875 unsigned SREN : 1;
3876 unsigned RX9 : 1;
3877 unsigned SPEN : 1;
3880 struct
3882 unsigned RCD8 : 1;
3883 unsigned OERR1 : 1;
3884 unsigned FERR1 : 1;
3885 unsigned ADDEN1 : 1;
3886 unsigned CREN1 : 1;
3887 unsigned SREN1 : 1;
3888 unsigned RC9 : 1;
3889 unsigned SPEN1 : 1;
3892 struct
3894 unsigned RX9D1 : 1;
3895 unsigned : 1;
3896 unsigned : 1;
3897 unsigned : 1;
3898 unsigned : 1;
3899 unsigned : 1;
3900 unsigned NOT_RC8 : 1;
3901 unsigned : 1;
3904 struct
3906 unsigned : 1;
3907 unsigned : 1;
3908 unsigned : 1;
3909 unsigned : 1;
3910 unsigned : 1;
3911 unsigned : 1;
3912 unsigned RC8_9 : 1;
3913 unsigned : 1;
3916 struct
3918 unsigned : 1;
3919 unsigned : 1;
3920 unsigned : 1;
3921 unsigned : 1;
3922 unsigned : 1;
3923 unsigned : 1;
3924 unsigned RX91 : 1;
3925 unsigned : 1;
3927 } __RCSTAbits_t;
3929 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
3931 #define _RX9D 0x01
3932 #define _RCD8 0x01
3933 #define _RX9D1 0x01
3934 #define _OERR 0x02
3935 #define _OERR1 0x02
3936 #define _FERR 0x04
3937 #define _FERR1 0x04
3938 #define _ADDEN 0x08
3939 #define _ADDEN1 0x08
3940 #define _CREN 0x10
3941 #define _CREN1 0x10
3942 #define _SREN 0x20
3943 #define _SREN1 0x20
3944 #define _RX9 0x40
3945 #define _RC9 0x40
3946 #define _NOT_RC8 0x40
3947 #define _RC8_9 0x40
3948 #define _RX91 0x40
3949 #define _SPEN 0x80
3950 #define _SPEN1 0x80
3952 //==============================================================================
3955 //==============================================================================
3956 // RCSTA1 Bits
3958 extern __at(0x0FAB) __sfr RCSTA1;
3960 typedef union
3962 struct
3964 unsigned RX9D : 1;
3965 unsigned OERR : 1;
3966 unsigned FERR : 1;
3967 unsigned ADDEN : 1;
3968 unsigned CREN : 1;
3969 unsigned SREN : 1;
3970 unsigned RX9 : 1;
3971 unsigned SPEN : 1;
3974 struct
3976 unsigned RCD8 : 1;
3977 unsigned OERR1 : 1;
3978 unsigned FERR1 : 1;
3979 unsigned ADDEN1 : 1;
3980 unsigned CREN1 : 1;
3981 unsigned SREN1 : 1;
3982 unsigned RC9 : 1;
3983 unsigned SPEN1 : 1;
3986 struct
3988 unsigned RX9D1 : 1;
3989 unsigned : 1;
3990 unsigned : 1;
3991 unsigned : 1;
3992 unsigned : 1;
3993 unsigned : 1;
3994 unsigned NOT_RC8 : 1;
3995 unsigned : 1;
3998 struct
4000 unsigned : 1;
4001 unsigned : 1;
4002 unsigned : 1;
4003 unsigned : 1;
4004 unsigned : 1;
4005 unsigned : 1;
4006 unsigned RC8_9 : 1;
4007 unsigned : 1;
4010 struct
4012 unsigned : 1;
4013 unsigned : 1;
4014 unsigned : 1;
4015 unsigned : 1;
4016 unsigned : 1;
4017 unsigned : 1;
4018 unsigned RX91 : 1;
4019 unsigned : 1;
4021 } __RCSTA1bits_t;
4023 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
4025 #define _RCSTA1_RX9D 0x01
4026 #define _RCSTA1_RCD8 0x01
4027 #define _RCSTA1_RX9D1 0x01
4028 #define _RCSTA1_OERR 0x02
4029 #define _RCSTA1_OERR1 0x02
4030 #define _RCSTA1_FERR 0x04
4031 #define _RCSTA1_FERR1 0x04
4032 #define _RCSTA1_ADDEN 0x08
4033 #define _RCSTA1_ADDEN1 0x08
4034 #define _RCSTA1_CREN 0x10
4035 #define _RCSTA1_CREN1 0x10
4036 #define _RCSTA1_SREN 0x20
4037 #define _RCSTA1_SREN1 0x20
4038 #define _RCSTA1_RX9 0x40
4039 #define _RCSTA1_RC9 0x40
4040 #define _RCSTA1_NOT_RC8 0x40
4041 #define _RCSTA1_RC8_9 0x40
4042 #define _RCSTA1_RX91 0x40
4043 #define _RCSTA1_SPEN 0x80
4044 #define _RCSTA1_SPEN1 0x80
4046 //==============================================================================
4049 //==============================================================================
4050 // TXSTA Bits
4052 extern __at(0x0FAC) __sfr TXSTA;
4054 typedef union
4056 struct
4058 unsigned TX9D : 1;
4059 unsigned TRMT : 1;
4060 unsigned BRGH : 1;
4061 unsigned SENDB : 1;
4062 unsigned SYNC : 1;
4063 unsigned TXEN : 1;
4064 unsigned TX9 : 1;
4065 unsigned CSRC : 1;
4068 struct
4070 unsigned TXD8 : 1;
4071 unsigned TRMT1 : 1;
4072 unsigned BRGH1 : 1;
4073 unsigned SENDB1 : 1;
4074 unsigned SYNC1 : 1;
4075 unsigned TXEN1 : 1;
4076 unsigned TX8_9 : 1;
4077 unsigned CSRC1 : 1;
4080 struct
4082 unsigned TX9D1 : 1;
4083 unsigned : 1;
4084 unsigned : 1;
4085 unsigned : 1;
4086 unsigned : 1;
4087 unsigned : 1;
4088 unsigned NOT_TX8 : 1;
4089 unsigned : 1;
4092 struct
4094 unsigned : 1;
4095 unsigned : 1;
4096 unsigned : 1;
4097 unsigned : 1;
4098 unsigned : 1;
4099 unsigned : 1;
4100 unsigned TX91 : 1;
4101 unsigned : 1;
4103 } __TXSTAbits_t;
4105 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
4107 #define _TX9D 0x01
4108 #define _TXD8 0x01
4109 #define _TX9D1 0x01
4110 #define _TRMT 0x02
4111 #define _TRMT1 0x02
4112 #define _BRGH 0x04
4113 #define _BRGH1 0x04
4114 #define _SENDB 0x08
4115 #define _SENDB1 0x08
4116 #define _SYNC 0x10
4117 #define _SYNC1 0x10
4118 #define _TXEN 0x20
4119 #define _TXEN1 0x20
4120 #define _TX9 0x40
4121 #define _TX8_9 0x40
4122 #define _NOT_TX8 0x40
4123 #define _TX91 0x40
4124 #define _CSRC 0x80
4125 #define _CSRC1 0x80
4127 //==============================================================================
4130 //==============================================================================
4131 // TXSTA1 Bits
4133 extern __at(0x0FAC) __sfr TXSTA1;
4135 typedef union
4137 struct
4139 unsigned TX9D : 1;
4140 unsigned TRMT : 1;
4141 unsigned BRGH : 1;
4142 unsigned SENDB : 1;
4143 unsigned SYNC : 1;
4144 unsigned TXEN : 1;
4145 unsigned TX9 : 1;
4146 unsigned CSRC : 1;
4149 struct
4151 unsigned TXD8 : 1;
4152 unsigned TRMT1 : 1;
4153 unsigned BRGH1 : 1;
4154 unsigned SENDB1 : 1;
4155 unsigned SYNC1 : 1;
4156 unsigned TXEN1 : 1;
4157 unsigned TX8_9 : 1;
4158 unsigned CSRC1 : 1;
4161 struct
4163 unsigned TX9D1 : 1;
4164 unsigned : 1;
4165 unsigned : 1;
4166 unsigned : 1;
4167 unsigned : 1;
4168 unsigned : 1;
4169 unsigned NOT_TX8 : 1;
4170 unsigned : 1;
4173 struct
4175 unsigned : 1;
4176 unsigned : 1;
4177 unsigned : 1;
4178 unsigned : 1;
4179 unsigned : 1;
4180 unsigned : 1;
4181 unsigned TX91 : 1;
4182 unsigned : 1;
4184 } __TXSTA1bits_t;
4186 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
4188 #define _TXSTA1_TX9D 0x01
4189 #define _TXSTA1_TXD8 0x01
4190 #define _TXSTA1_TX9D1 0x01
4191 #define _TXSTA1_TRMT 0x02
4192 #define _TXSTA1_TRMT1 0x02
4193 #define _TXSTA1_BRGH 0x04
4194 #define _TXSTA1_BRGH1 0x04
4195 #define _TXSTA1_SENDB 0x08
4196 #define _TXSTA1_SENDB1 0x08
4197 #define _TXSTA1_SYNC 0x10
4198 #define _TXSTA1_SYNC1 0x10
4199 #define _TXSTA1_TXEN 0x20
4200 #define _TXSTA1_TXEN1 0x20
4201 #define _TXSTA1_TX9 0x40
4202 #define _TXSTA1_TX8_9 0x40
4203 #define _TXSTA1_NOT_TX8 0x40
4204 #define _TXSTA1_TX91 0x40
4205 #define _TXSTA1_CSRC 0x80
4206 #define _TXSTA1_CSRC1 0x80
4208 //==============================================================================
4210 extern __at(0x0FAD) __sfr TXREG;
4211 extern __at(0x0FAD) __sfr TXREG1;
4212 extern __at(0x0FAE) __sfr RCREG;
4213 extern __at(0x0FAE) __sfr RCREG1;
4214 extern __at(0x0FAF) __sfr SPBRG;
4215 extern __at(0x0FAF) __sfr SPBRG1;
4217 //==============================================================================
4218 // T3CON Bits
4220 extern __at(0x0FB1) __sfr T3CON;
4222 typedef union
4224 struct
4226 unsigned TMR3ON : 1;
4227 unsigned TMR3CS : 1;
4228 unsigned NOT_T3SYNC : 1;
4229 unsigned T3CCP1 : 1;
4230 unsigned T3CKPS0 : 1;
4231 unsigned T3CKPS1 : 1;
4232 unsigned T3CCP2 : 1;
4233 unsigned RD16 : 1;
4236 struct
4238 unsigned : 1;
4239 unsigned : 1;
4240 unsigned T3SYNC : 1;
4241 unsigned : 1;
4242 unsigned : 1;
4243 unsigned : 1;
4244 unsigned : 1;
4245 unsigned : 1;
4248 struct
4250 unsigned : 1;
4251 unsigned : 1;
4252 unsigned T3INSYNC : 1;
4253 unsigned : 1;
4254 unsigned : 1;
4255 unsigned : 1;
4256 unsigned : 1;
4257 unsigned : 1;
4260 struct
4262 unsigned : 4;
4263 unsigned T3CKPS : 2;
4264 unsigned : 2;
4266 } __T3CONbits_t;
4268 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
4270 #define _T3CON_TMR3ON 0x01
4271 #define _T3CON_TMR3CS 0x02
4272 #define _T3CON_NOT_T3SYNC 0x04
4273 #define _T3CON_T3SYNC 0x04
4274 #define _T3CON_T3INSYNC 0x04
4275 #define _T3CON_T3CCP1 0x08
4276 #define _T3CON_T3CKPS0 0x10
4277 #define _T3CON_T3CKPS1 0x20
4278 #define _T3CON_T3CCP2 0x40
4279 #define _T3CON_RD16 0x80
4281 //==============================================================================
4283 extern __at(0x0FB2) __sfr TMR3;
4284 extern __at(0x0FB2) __sfr TMR3L;
4285 extern __at(0x0FB3) __sfr TMR3H;
4287 //==============================================================================
4288 // CMCON Bits
4290 extern __at(0x0FB4) __sfr CMCON;
4292 typedef union
4294 struct
4296 unsigned CM0 : 1;
4297 unsigned CM1 : 1;
4298 unsigned CM2 : 1;
4299 unsigned CIS : 1;
4300 unsigned C1INV : 1;
4301 unsigned C2INV : 1;
4302 unsigned C1OUT : 1;
4303 unsigned C2OUT : 1;
4306 struct
4308 unsigned CM : 3;
4309 unsigned : 5;
4311 } __CMCONbits_t;
4313 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
4315 #define _CM0 0x01
4316 #define _CM1 0x02
4317 #define _CM2 0x04
4318 #define _CIS 0x08
4319 #define _C1INV 0x10
4320 #define _C2INV 0x20
4321 #define _C1OUT 0x40
4322 #define _C2OUT 0x80
4324 //==============================================================================
4327 //==============================================================================
4328 // CVRCON Bits
4330 extern __at(0x0FB5) __sfr CVRCON;
4332 typedef union
4334 struct
4336 unsigned CVR0 : 1;
4337 unsigned CVR1 : 1;
4338 unsigned CVR2 : 1;
4339 unsigned CVR3 : 1;
4340 unsigned CVRSS : 1;
4341 unsigned CVRR : 1;
4342 unsigned CVROE : 1;
4343 unsigned CVREN : 1;
4346 struct
4348 unsigned CVR : 4;
4349 unsigned : 4;
4351 } __CVRCONbits_t;
4353 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
4355 #define _CVR0 0x01
4356 #define _CVR1 0x02
4357 #define _CVR2 0x04
4358 #define _CVR3 0x08
4359 #define _CVRSS 0x10
4360 #define _CVRR 0x20
4361 #define _CVROE 0x40
4362 #define _CVREN 0x80
4364 //==============================================================================
4367 //==============================================================================
4368 // ECCP1AS Bits
4370 extern __at(0x0FB6) __sfr ECCP1AS;
4372 typedef union
4374 struct
4376 unsigned PSSBD0 : 1;
4377 unsigned PSSBD1 : 1;
4378 unsigned PSSAC0 : 1;
4379 unsigned PSSAC1 : 1;
4380 unsigned ECCPAS0 : 1;
4381 unsigned ECCPAS1 : 1;
4382 unsigned ECCPAS2 : 1;
4383 unsigned ECCPASE : 1;
4386 struct
4388 unsigned PSS1BD0 : 1;
4389 unsigned PSS1BD1 : 1;
4390 unsigned PSS1AC0 : 1;
4391 unsigned PSS1AC1 : 1;
4392 unsigned ECCP1AS0 : 1;
4393 unsigned ECCP1AS1 : 1;
4394 unsigned ECCP1AS2 : 1;
4395 unsigned ECCP1ASE : 1;
4398 struct
4400 unsigned PSSBD : 2;
4401 unsigned : 6;
4404 struct
4406 unsigned PSS1BD : 2;
4407 unsigned : 6;
4410 struct
4412 unsigned : 2;
4413 unsigned PSS1AC : 2;
4414 unsigned : 4;
4417 struct
4419 unsigned : 2;
4420 unsigned PSSAC : 2;
4421 unsigned : 4;
4424 struct
4426 unsigned : 4;
4427 unsigned ECCP1AS : 3;
4428 unsigned : 1;
4431 struct
4433 unsigned : 4;
4434 unsigned ECCPAS : 3;
4435 unsigned : 1;
4437 } __ECCP1ASbits_t;
4439 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
4441 #define _PSSBD0 0x01
4442 #define _PSS1BD0 0x01
4443 #define _PSSBD1 0x02
4444 #define _PSS1BD1 0x02
4445 #define _PSSAC0 0x04
4446 #define _PSS1AC0 0x04
4447 #define _PSSAC1 0x08
4448 #define _PSS1AC1 0x08
4449 #define _ECCPAS0 0x10
4450 #define _ECCP1AS0 0x10
4451 #define _ECCPAS1 0x20
4452 #define _ECCP1AS1 0x20
4453 #define _ECCPAS2 0x40
4454 #define _ECCP1AS2 0x40
4455 #define _ECCPASE 0x80
4456 #define _ECCP1ASE 0x80
4458 //==============================================================================
4461 //==============================================================================
4462 // CCP3CON Bits
4464 extern __at(0x0FB7) __sfr CCP3CON;
4466 typedef union
4468 struct
4470 unsigned CCP3M0 : 1;
4471 unsigned CCP3M1 : 1;
4472 unsigned CCP3M2 : 1;
4473 unsigned CCP3M3 : 1;
4474 unsigned DC3B0 : 1;
4475 unsigned DC3B1 : 1;
4476 unsigned P3M0 : 1;
4477 unsigned P3M1 : 1;
4480 struct
4482 unsigned : 1;
4483 unsigned : 1;
4484 unsigned : 1;
4485 unsigned : 1;
4486 unsigned CCP3Y : 1;
4487 unsigned CCP3X : 1;
4488 unsigned : 1;
4489 unsigned : 1;
4492 struct
4494 unsigned CCP3M : 4;
4495 unsigned : 4;
4498 struct
4500 unsigned : 4;
4501 unsigned DC3B : 2;
4502 unsigned : 2;
4505 struct
4507 unsigned : 6;
4508 unsigned P3M : 2;
4510 } __CCP3CONbits_t;
4512 extern __at(0x0FB7) volatile __CCP3CONbits_t CCP3CONbits;
4514 #define _CCP3M0 0x01
4515 #define _CCP3M1 0x02
4516 #define _CCP3M2 0x04
4517 #define _CCP3M3 0x08
4518 #define _DC3B0 0x10
4519 #define _CCP3Y 0x10
4520 #define _DC3B1 0x20
4521 #define _CCP3X 0x20
4522 #define _P3M0 0x40
4523 #define _P3M1 0x80
4525 //==============================================================================
4528 //==============================================================================
4529 // ECCP3CON Bits
4531 extern __at(0x0FB7) __sfr ECCP3CON;
4533 typedef union
4535 struct
4537 unsigned CCP3M0 : 1;
4538 unsigned CCP3M1 : 1;
4539 unsigned CCP3M2 : 1;
4540 unsigned CCP3M3 : 1;
4541 unsigned DC3B0 : 1;
4542 unsigned DC3B1 : 1;
4543 unsigned P3M0 : 1;
4544 unsigned P3M1 : 1;
4547 struct
4549 unsigned : 1;
4550 unsigned : 1;
4551 unsigned : 1;
4552 unsigned : 1;
4553 unsigned CCP3Y : 1;
4554 unsigned CCP3X : 1;
4555 unsigned : 1;
4556 unsigned : 1;
4559 struct
4561 unsigned CCP3M : 4;
4562 unsigned : 4;
4565 struct
4567 unsigned : 4;
4568 unsigned DC3B : 2;
4569 unsigned : 2;
4572 struct
4574 unsigned : 6;
4575 unsigned P3M : 2;
4577 } __ECCP3CONbits_t;
4579 extern __at(0x0FB7) volatile __ECCP3CONbits_t ECCP3CONbits;
4581 #define _ECCP3CON_CCP3M0 0x01
4582 #define _ECCP3CON_CCP3M1 0x02
4583 #define _ECCP3CON_CCP3M2 0x04
4584 #define _ECCP3CON_CCP3M3 0x08
4585 #define _ECCP3CON_DC3B0 0x10
4586 #define _ECCP3CON_CCP3Y 0x10
4587 #define _ECCP3CON_DC3B1 0x20
4588 #define _ECCP3CON_CCP3X 0x20
4589 #define _ECCP3CON_P3M0 0x40
4590 #define _ECCP3CON_P3M1 0x80
4592 //==============================================================================
4594 extern __at(0x0FB8) __sfr CCPR3;
4595 extern __at(0x0FB8) __sfr CCPR3L;
4596 extern __at(0x0FB9) __sfr CCPR3H;
4598 //==============================================================================
4599 // CCP2CON Bits
4601 extern __at(0x0FBA) __sfr CCP2CON;
4603 typedef union
4605 struct
4607 unsigned CCP2M0 : 1;
4608 unsigned CCP2M1 : 1;
4609 unsigned CCP2M2 : 1;
4610 unsigned CCP2M3 : 1;
4611 unsigned DC2B0 : 1;
4612 unsigned DC2B1 : 1;
4613 unsigned P2M0 : 1;
4614 unsigned P2M1 : 1;
4617 struct
4619 unsigned : 1;
4620 unsigned : 1;
4621 unsigned : 1;
4622 unsigned : 1;
4623 unsigned CCP2Y : 1;
4624 unsigned CCP2X : 1;
4625 unsigned : 1;
4626 unsigned : 1;
4629 struct
4631 unsigned CCP2M : 4;
4632 unsigned : 4;
4635 struct
4637 unsigned : 4;
4638 unsigned DC2B : 2;
4639 unsigned : 2;
4642 struct
4644 unsigned : 6;
4645 unsigned P2M : 2;
4647 } __CCP2CONbits_t;
4649 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
4651 #define _CCP2M0 0x01
4652 #define _CCP2M1 0x02
4653 #define _CCP2M2 0x04
4654 #define _CCP2M3 0x08
4655 #define _DC2B0 0x10
4656 #define _CCP2Y 0x10
4657 #define _DC2B1 0x20
4658 #define _CCP2X 0x20
4659 #define _P2M0 0x40
4660 #define _P2M1 0x80
4662 //==============================================================================
4665 //==============================================================================
4666 // ECCP2CON Bits
4668 extern __at(0x0FBA) __sfr ECCP2CON;
4670 typedef union
4672 struct
4674 unsigned CCP2M0 : 1;
4675 unsigned CCP2M1 : 1;
4676 unsigned CCP2M2 : 1;
4677 unsigned CCP2M3 : 1;
4678 unsigned DC2B0 : 1;
4679 unsigned DC2B1 : 1;
4680 unsigned P2M0 : 1;
4681 unsigned P2M1 : 1;
4684 struct
4686 unsigned : 1;
4687 unsigned : 1;
4688 unsigned : 1;
4689 unsigned : 1;
4690 unsigned CCP2Y : 1;
4691 unsigned CCP2X : 1;
4692 unsigned : 1;
4693 unsigned : 1;
4696 struct
4698 unsigned CCP2M : 4;
4699 unsigned : 4;
4702 struct
4704 unsigned : 4;
4705 unsigned DC2B : 2;
4706 unsigned : 2;
4709 struct
4711 unsigned : 6;
4712 unsigned P2M : 2;
4714 } __ECCP2CONbits_t;
4716 extern __at(0x0FBA) volatile __ECCP2CONbits_t ECCP2CONbits;
4718 #define _ECCP2CON_CCP2M0 0x01
4719 #define _ECCP2CON_CCP2M1 0x02
4720 #define _ECCP2CON_CCP2M2 0x04
4721 #define _ECCP2CON_CCP2M3 0x08
4722 #define _ECCP2CON_DC2B0 0x10
4723 #define _ECCP2CON_CCP2Y 0x10
4724 #define _ECCP2CON_DC2B1 0x20
4725 #define _ECCP2CON_CCP2X 0x20
4726 #define _ECCP2CON_P2M0 0x40
4727 #define _ECCP2CON_P2M1 0x80
4729 //==============================================================================
4731 extern __at(0x0FBB) __sfr CCPR2;
4732 extern __at(0x0FBB) __sfr CCPR2L;
4733 extern __at(0x0FBC) __sfr CCPR2H;
4735 //==============================================================================
4736 // CCP1CON Bits
4738 extern __at(0x0FBD) __sfr CCP1CON;
4740 typedef union
4742 struct
4744 unsigned CCP1M0 : 1;
4745 unsigned CCP1M1 : 1;
4746 unsigned CCP1M2 : 1;
4747 unsigned CCP1M3 : 1;
4748 unsigned DC1B0 : 1;
4749 unsigned DC1B1 : 1;
4750 unsigned P1M0 : 1;
4751 unsigned P1M1 : 1;
4754 struct
4756 unsigned : 1;
4757 unsigned : 1;
4758 unsigned : 1;
4759 unsigned : 1;
4760 unsigned CCP1Y : 1;
4761 unsigned CCP1X : 1;
4762 unsigned : 1;
4763 unsigned : 1;
4766 struct
4768 unsigned CCP1M : 4;
4769 unsigned : 4;
4772 struct
4774 unsigned : 4;
4775 unsigned DC1B : 2;
4776 unsigned : 2;
4779 struct
4781 unsigned : 6;
4782 unsigned P1M : 2;
4784 } __CCP1CONbits_t;
4786 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
4788 #define _CCP1M0 0x01
4789 #define _CCP1M1 0x02
4790 #define _CCP1M2 0x04
4791 #define _CCP1M3 0x08
4792 #define _DC1B0 0x10
4793 #define _CCP1Y 0x10
4794 #define _DC1B1 0x20
4795 #define _CCP1X 0x20
4796 #define _P1M0 0x40
4797 #define _P1M1 0x80
4799 //==============================================================================
4802 //==============================================================================
4803 // ECCP1CON Bits
4805 extern __at(0x0FBD) __sfr ECCP1CON;
4807 typedef union
4809 struct
4811 unsigned CCP1M0 : 1;
4812 unsigned CCP1M1 : 1;
4813 unsigned CCP1M2 : 1;
4814 unsigned CCP1M3 : 1;
4815 unsigned DC1B0 : 1;
4816 unsigned DC1B1 : 1;
4817 unsigned P1M0 : 1;
4818 unsigned P1M1 : 1;
4821 struct
4823 unsigned : 1;
4824 unsigned : 1;
4825 unsigned : 1;
4826 unsigned : 1;
4827 unsigned CCP1Y : 1;
4828 unsigned CCP1X : 1;
4829 unsigned : 1;
4830 unsigned : 1;
4833 struct
4835 unsigned CCP1M : 4;
4836 unsigned : 4;
4839 struct
4841 unsigned : 4;
4842 unsigned DC1B : 2;
4843 unsigned : 2;
4846 struct
4848 unsigned : 6;
4849 unsigned P1M : 2;
4851 } __ECCP1CONbits_t;
4853 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits;
4855 #define _ECCP1CON_CCP1M0 0x01
4856 #define _ECCP1CON_CCP1M1 0x02
4857 #define _ECCP1CON_CCP1M2 0x04
4858 #define _ECCP1CON_CCP1M3 0x08
4859 #define _ECCP1CON_DC1B0 0x10
4860 #define _ECCP1CON_CCP1Y 0x10
4861 #define _ECCP1CON_DC1B1 0x20
4862 #define _ECCP1CON_CCP1X 0x20
4863 #define _ECCP1CON_P1M0 0x40
4864 #define _ECCP1CON_P1M1 0x80
4866 //==============================================================================
4868 extern __at(0x0FBE) __sfr CCPR1;
4869 extern __at(0x0FBE) __sfr CCPR1L;
4870 extern __at(0x0FBF) __sfr CCPR1H;
4872 //==============================================================================
4873 // ADCON2 Bits
4875 extern __at(0x0FC0) __sfr ADCON2;
4877 typedef union
4879 struct
4881 unsigned ADCS0 : 1;
4882 unsigned ADCS1 : 1;
4883 unsigned ADCS2 : 1;
4884 unsigned ACQT0 : 1;
4885 unsigned ACQT1 : 1;
4886 unsigned ACQT2 : 1;
4887 unsigned : 1;
4888 unsigned ADFM : 1;
4891 struct
4893 unsigned ADCS : 3;
4894 unsigned : 5;
4897 struct
4899 unsigned : 3;
4900 unsigned ACQT : 3;
4901 unsigned : 2;
4903 } __ADCON2bits_t;
4905 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4907 #define _ADCS0 0x01
4908 #define _ADCS1 0x02
4909 #define _ADCS2 0x04
4910 #define _ACQT0 0x08
4911 #define _ACQT1 0x10
4912 #define _ACQT2 0x20
4913 #define _ADFM 0x80
4915 //==============================================================================
4918 //==============================================================================
4919 // ADCON1 Bits
4921 extern __at(0x0FC1) __sfr ADCON1;
4923 typedef union
4925 struct
4927 unsigned PCFG0 : 1;
4928 unsigned PCFG1 : 1;
4929 unsigned PCFG2 : 1;
4930 unsigned PCFG3 : 1;
4931 unsigned VCFG0 : 1;
4932 unsigned VCFG1 : 1;
4933 unsigned : 1;
4934 unsigned : 1;
4937 struct
4939 unsigned PCFG : 4;
4940 unsigned : 4;
4943 struct
4945 unsigned : 4;
4946 unsigned VCFG : 2;
4947 unsigned : 2;
4949 } __ADCON1bits_t;
4951 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4953 #define _PCFG0 0x01
4954 #define _PCFG1 0x02
4955 #define _PCFG2 0x04
4956 #define _PCFG3 0x08
4957 #define _VCFG0 0x10
4958 #define _VCFG1 0x20
4960 //==============================================================================
4963 //==============================================================================
4964 // ADCON0 Bits
4966 extern __at(0x0FC2) __sfr ADCON0;
4968 typedef union
4970 struct
4972 unsigned ADON : 1;
4973 unsigned GO_NOT_DONE : 1;
4974 unsigned CHS0 : 1;
4975 unsigned CHS1 : 1;
4976 unsigned CHS2 : 1;
4977 unsigned CHS3 : 1;
4978 unsigned : 1;
4979 unsigned ADCAL : 1;
4982 struct
4984 unsigned : 1;
4985 unsigned DONE : 1;
4986 unsigned : 1;
4987 unsigned : 1;
4988 unsigned : 1;
4989 unsigned : 1;
4990 unsigned : 1;
4991 unsigned : 1;
4994 struct
4996 unsigned : 1;
4997 unsigned GO_DONE : 1;
4998 unsigned : 1;
4999 unsigned : 1;
5000 unsigned : 1;
5001 unsigned : 1;
5002 unsigned : 1;
5003 unsigned : 1;
5006 struct
5008 unsigned : 1;
5009 unsigned GO : 1;
5010 unsigned : 1;
5011 unsigned : 1;
5012 unsigned : 1;
5013 unsigned : 1;
5014 unsigned : 1;
5015 unsigned : 1;
5018 struct
5020 unsigned : 1;
5021 unsigned NOT_DONE : 1;
5022 unsigned : 1;
5023 unsigned : 1;
5024 unsigned : 1;
5025 unsigned : 1;
5026 unsigned : 1;
5027 unsigned : 1;
5030 struct
5032 unsigned : 2;
5033 unsigned CHS : 4;
5034 unsigned : 2;
5036 } __ADCON0bits_t;
5038 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
5040 #define _ADON 0x01
5041 #define _GO_NOT_DONE 0x02
5042 #define _DONE 0x02
5043 #define _GO_DONE 0x02
5044 #define _GO 0x02
5045 #define _NOT_DONE 0x02
5046 #define _CHS0 0x04
5047 #define _CHS1 0x08
5048 #define _CHS2 0x10
5049 #define _CHS3 0x20
5050 #define _ADCAL 0x80
5052 //==============================================================================
5054 extern __at(0x0FC3) __sfr ADRES;
5055 extern __at(0x0FC3) __sfr ADRESL;
5056 extern __at(0x0FC4) __sfr ADRESH;
5058 //==============================================================================
5059 // SSP1CON2 Bits
5061 extern __at(0x0FC5) __sfr SSP1CON2;
5063 typedef union
5065 struct
5067 unsigned SEN : 1;
5068 unsigned RSEN : 1;
5069 unsigned PEN : 1;
5070 unsigned RCEN : 1;
5071 unsigned ACKEN : 1;
5072 unsigned ACKDT : 1;
5073 unsigned ACKSTAT : 1;
5074 unsigned GCEN : 1;
5077 struct
5079 unsigned : 1;
5080 unsigned ADMSK1 : 1;
5081 unsigned ADMSK2 : 1;
5082 unsigned ADMSK3 : 1;
5083 unsigned ADMSK4 : 1;
5084 unsigned ADMSK5 : 1;
5085 unsigned : 1;
5086 unsigned : 1;
5088 } __SSP1CON2bits_t;
5090 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
5092 #define _SEN 0x01
5093 #define _RSEN 0x02
5094 #define _ADMSK1 0x02
5095 #define _PEN 0x04
5096 #define _ADMSK2 0x04
5097 #define _RCEN 0x08
5098 #define _ADMSK3 0x08
5099 #define _ACKEN 0x10
5100 #define _ADMSK4 0x10
5101 #define _ACKDT 0x20
5102 #define _ADMSK5 0x20
5103 #define _ACKSTAT 0x40
5104 #define _GCEN 0x80
5106 //==============================================================================
5109 //==============================================================================
5110 // SSPCON2 Bits
5112 extern __at(0x0FC5) __sfr SSPCON2;
5114 typedef union
5116 struct
5118 unsigned SEN : 1;
5119 unsigned RSEN : 1;
5120 unsigned PEN : 1;
5121 unsigned RCEN : 1;
5122 unsigned ACKEN : 1;
5123 unsigned ACKDT : 1;
5124 unsigned ACKSTAT : 1;
5125 unsigned GCEN : 1;
5128 struct
5130 unsigned : 1;
5131 unsigned ADMSK1 : 1;
5132 unsigned ADMSK2 : 1;
5133 unsigned ADMSK3 : 1;
5134 unsigned ADMSK4 : 1;
5135 unsigned ADMSK5 : 1;
5136 unsigned : 1;
5137 unsigned : 1;
5139 } __SSPCON2bits_t;
5141 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5143 #define _SSPCON2_SEN 0x01
5144 #define _SSPCON2_RSEN 0x02
5145 #define _SSPCON2_ADMSK1 0x02
5146 #define _SSPCON2_PEN 0x04
5147 #define _SSPCON2_ADMSK2 0x04
5148 #define _SSPCON2_RCEN 0x08
5149 #define _SSPCON2_ADMSK3 0x08
5150 #define _SSPCON2_ACKEN 0x10
5151 #define _SSPCON2_ADMSK4 0x10
5152 #define _SSPCON2_ACKDT 0x20
5153 #define _SSPCON2_ADMSK5 0x20
5154 #define _SSPCON2_ACKSTAT 0x40
5155 #define _SSPCON2_GCEN 0x80
5157 //==============================================================================
5160 //==============================================================================
5161 // SSP1CON1 Bits
5163 extern __at(0x0FC6) __sfr SSP1CON1;
5165 typedef union
5167 struct
5169 unsigned SSPM0 : 1;
5170 unsigned SSPM1 : 1;
5171 unsigned SSPM2 : 1;
5172 unsigned SSPM3 : 1;
5173 unsigned CKP : 1;
5174 unsigned SSPEN : 1;
5175 unsigned SSPOV : 1;
5176 unsigned WCOL : 1;
5179 struct
5181 unsigned SSPM : 4;
5182 unsigned : 4;
5184 } __SSP1CON1bits_t;
5186 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
5188 #define _SSPM0 0x01
5189 #define _SSPM1 0x02
5190 #define _SSPM2 0x04
5191 #define _SSPM3 0x08
5192 #define _CKP 0x10
5193 #define _SSPEN 0x20
5194 #define _SSPOV 0x40
5195 #define _WCOL 0x80
5197 //==============================================================================
5200 //==============================================================================
5201 // SSPCON1 Bits
5203 extern __at(0x0FC6) __sfr SSPCON1;
5205 typedef union
5207 struct
5209 unsigned SSPM0 : 1;
5210 unsigned SSPM1 : 1;
5211 unsigned SSPM2 : 1;
5212 unsigned SSPM3 : 1;
5213 unsigned CKP : 1;
5214 unsigned SSPEN : 1;
5215 unsigned SSPOV : 1;
5216 unsigned WCOL : 1;
5219 struct
5221 unsigned SSPM : 4;
5222 unsigned : 4;
5224 } __SSPCON1bits_t;
5226 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
5228 #define _SSPCON1_SSPM0 0x01
5229 #define _SSPCON1_SSPM1 0x02
5230 #define _SSPCON1_SSPM2 0x04
5231 #define _SSPCON1_SSPM3 0x08
5232 #define _SSPCON1_CKP 0x10
5233 #define _SSPCON1_SSPEN 0x20
5234 #define _SSPCON1_SSPOV 0x40
5235 #define _SSPCON1_WCOL 0x80
5237 //==============================================================================
5240 //==============================================================================
5241 // SSP1STAT Bits
5243 extern __at(0x0FC7) __sfr SSP1STAT;
5245 typedef union
5247 struct
5249 unsigned BF : 1;
5250 unsigned UA : 1;
5251 unsigned R_NOT_W : 1;
5252 unsigned S : 1;
5253 unsigned P : 1;
5254 unsigned D_NOT_A : 1;
5255 unsigned CKE : 1;
5256 unsigned SMP : 1;
5259 struct
5261 unsigned : 1;
5262 unsigned : 1;
5263 unsigned R_W : 1;
5264 unsigned I2C_START : 1;
5265 unsigned I2C_STOP : 1;
5266 unsigned D_A : 1;
5267 unsigned : 1;
5268 unsigned : 1;
5271 struct
5273 unsigned : 1;
5274 unsigned : 1;
5275 unsigned I2C_READ : 1;
5276 unsigned : 1;
5277 unsigned : 1;
5278 unsigned I2C_DAT : 1;
5279 unsigned : 1;
5280 unsigned : 1;
5283 struct
5285 unsigned : 1;
5286 unsigned : 1;
5287 unsigned NOT_W : 1;
5288 unsigned : 1;
5289 unsigned : 1;
5290 unsigned NOT_A : 1;
5291 unsigned : 1;
5292 unsigned : 1;
5295 struct
5297 unsigned : 1;
5298 unsigned : 1;
5299 unsigned NOT_WRITE : 1;
5300 unsigned : 1;
5301 unsigned : 1;
5302 unsigned NOT_ADDRESS : 1;
5303 unsigned : 1;
5304 unsigned : 1;
5307 struct
5309 unsigned : 1;
5310 unsigned : 1;
5311 unsigned READ_WRITE : 1;
5312 unsigned : 1;
5313 unsigned : 1;
5314 unsigned DATA_ADDRESS : 1;
5315 unsigned : 1;
5316 unsigned : 1;
5319 struct
5321 unsigned : 1;
5322 unsigned : 1;
5323 unsigned R : 1;
5324 unsigned : 1;
5325 unsigned : 1;
5326 unsigned D : 1;
5327 unsigned : 1;
5328 unsigned : 1;
5330 } __SSP1STATbits_t;
5332 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
5334 #define _BF 0x01
5335 #define _UA 0x02
5336 #define _R_NOT_W 0x04
5337 #define _R_W 0x04
5338 #define _I2C_READ 0x04
5339 #define _NOT_W 0x04
5340 #define _NOT_WRITE 0x04
5341 #define _READ_WRITE 0x04
5342 #define _R 0x04
5343 #define _S 0x08
5344 #define _I2C_START 0x08
5345 #define _P 0x10
5346 #define _I2C_STOP 0x10
5347 #define _D_NOT_A 0x20
5348 #define _D_A 0x20
5349 #define _I2C_DAT 0x20
5350 #define _NOT_A 0x20
5351 #define _NOT_ADDRESS 0x20
5352 #define _DATA_ADDRESS 0x20
5353 #define _D 0x20
5354 #define _CKE 0x40
5355 #define _SMP 0x80
5357 //==============================================================================
5360 //==============================================================================
5361 // SSPSTAT Bits
5363 extern __at(0x0FC7) __sfr SSPSTAT;
5365 typedef union
5367 struct
5369 unsigned BF : 1;
5370 unsigned UA : 1;
5371 unsigned R_NOT_W : 1;
5372 unsigned S : 1;
5373 unsigned P : 1;
5374 unsigned D_NOT_A : 1;
5375 unsigned CKE : 1;
5376 unsigned SMP : 1;
5379 struct
5381 unsigned : 1;
5382 unsigned : 1;
5383 unsigned R_W : 1;
5384 unsigned I2C_START : 1;
5385 unsigned I2C_STOP : 1;
5386 unsigned D_A : 1;
5387 unsigned : 1;
5388 unsigned : 1;
5391 struct
5393 unsigned : 1;
5394 unsigned : 1;
5395 unsigned I2C_READ : 1;
5396 unsigned : 1;
5397 unsigned : 1;
5398 unsigned I2C_DAT : 1;
5399 unsigned : 1;
5400 unsigned : 1;
5403 struct
5405 unsigned : 1;
5406 unsigned : 1;
5407 unsigned NOT_W : 1;
5408 unsigned : 1;
5409 unsigned : 1;
5410 unsigned NOT_A : 1;
5411 unsigned : 1;
5412 unsigned : 1;
5415 struct
5417 unsigned : 1;
5418 unsigned : 1;
5419 unsigned NOT_WRITE : 1;
5420 unsigned : 1;
5421 unsigned : 1;
5422 unsigned NOT_ADDRESS : 1;
5423 unsigned : 1;
5424 unsigned : 1;
5427 struct
5429 unsigned : 1;
5430 unsigned : 1;
5431 unsigned READ_WRITE : 1;
5432 unsigned : 1;
5433 unsigned : 1;
5434 unsigned DATA_ADDRESS : 1;
5435 unsigned : 1;
5436 unsigned : 1;
5439 struct
5441 unsigned : 1;
5442 unsigned : 1;
5443 unsigned R : 1;
5444 unsigned : 1;
5445 unsigned : 1;
5446 unsigned D : 1;
5447 unsigned : 1;
5448 unsigned : 1;
5450 } __SSPSTATbits_t;
5452 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5454 #define _SSPSTAT_BF 0x01
5455 #define _SSPSTAT_UA 0x02
5456 #define _SSPSTAT_R_NOT_W 0x04
5457 #define _SSPSTAT_R_W 0x04
5458 #define _SSPSTAT_I2C_READ 0x04
5459 #define _SSPSTAT_NOT_W 0x04
5460 #define _SSPSTAT_NOT_WRITE 0x04
5461 #define _SSPSTAT_READ_WRITE 0x04
5462 #define _SSPSTAT_R 0x04
5463 #define _SSPSTAT_S 0x08
5464 #define _SSPSTAT_I2C_START 0x08
5465 #define _SSPSTAT_P 0x10
5466 #define _SSPSTAT_I2C_STOP 0x10
5467 #define _SSPSTAT_D_NOT_A 0x20
5468 #define _SSPSTAT_D_A 0x20
5469 #define _SSPSTAT_I2C_DAT 0x20
5470 #define _SSPSTAT_NOT_A 0x20
5471 #define _SSPSTAT_NOT_ADDRESS 0x20
5472 #define _SSPSTAT_DATA_ADDRESS 0x20
5473 #define _SSPSTAT_D 0x20
5474 #define _SSPSTAT_CKE 0x40
5475 #define _SSPSTAT_SMP 0x80
5477 //==============================================================================
5479 extern __at(0x0FC8) __sfr SSP1ADD;
5480 extern __at(0x0FC8) __sfr SSPADD;
5481 extern __at(0x0FC9) __sfr SSP1BUF;
5482 extern __at(0x0FC9) __sfr SSPBUF;
5484 //==============================================================================
5485 // T2CON Bits
5487 extern __at(0x0FCA) __sfr T2CON;
5489 typedef union
5491 struct
5493 unsigned T2CKPS0 : 1;
5494 unsigned T2CKPS1 : 1;
5495 unsigned TMR2ON : 1;
5496 unsigned T2OUTPS0 : 1;
5497 unsigned T2OUTPS1 : 1;
5498 unsigned T2OUTPS2 : 1;
5499 unsigned T2OUTPS3 : 1;
5500 unsigned : 1;
5503 struct
5505 unsigned T2CKPS : 2;
5506 unsigned : 6;
5509 struct
5511 unsigned : 3;
5512 unsigned T2OUTPS : 4;
5513 unsigned : 1;
5515 } __T2CONbits_t;
5517 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5519 #define _T2CKPS0 0x01
5520 #define _T2CKPS1 0x02
5521 #define _TMR2ON 0x04
5522 #define _T2OUTPS0 0x08
5523 #define _T2OUTPS1 0x10
5524 #define _T2OUTPS2 0x20
5525 #define _T2OUTPS3 0x40
5527 //==============================================================================
5529 extern __at(0x0FCB) __sfr PR2;
5530 extern __at(0x0FCC) __sfr TMR2;
5532 //==============================================================================
5533 // T1CON Bits
5535 extern __at(0x0FCD) __sfr T1CON;
5537 typedef union
5539 struct
5541 unsigned TMR1ON : 1;
5542 unsigned TMR1CS : 1;
5543 unsigned NOT_T1SYNC : 1;
5544 unsigned T1OSCEN : 1;
5545 unsigned T1CKPS0 : 1;
5546 unsigned T1CKPS1 : 1;
5547 unsigned T1RUN : 1;
5548 unsigned RD16 : 1;
5551 struct
5553 unsigned : 1;
5554 unsigned : 1;
5555 unsigned T1SYNC : 1;
5556 unsigned : 1;
5557 unsigned : 1;
5558 unsigned : 1;
5559 unsigned : 1;
5560 unsigned : 1;
5563 struct
5565 unsigned : 1;
5566 unsigned : 1;
5567 unsigned T1INSYNC : 1;
5568 unsigned : 1;
5569 unsigned : 1;
5570 unsigned : 1;
5571 unsigned : 1;
5572 unsigned : 1;
5575 struct
5577 unsigned : 4;
5578 unsigned T1CKPS : 2;
5579 unsigned : 2;
5581 } __T1CONbits_t;
5583 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5585 #define _TMR1ON 0x01
5586 #define _TMR1CS 0x02
5587 #define _NOT_T1SYNC 0x04
5588 #define _T1SYNC 0x04
5589 #define _T1INSYNC 0x04
5590 #define _T1OSCEN 0x08
5591 #define _T1CKPS0 0x10
5592 #define _T1CKPS1 0x20
5593 #define _T1RUN 0x40
5594 #define _RD16 0x80
5596 //==============================================================================
5598 extern __at(0x0FCE) __sfr TMR1;
5599 extern __at(0x0FCE) __sfr TMR1L;
5600 extern __at(0x0FCF) __sfr TMR1H;
5602 //==============================================================================
5603 // RCON Bits
5605 extern __at(0x0FD0) __sfr RCON;
5607 typedef union
5609 struct
5611 unsigned NOT_BOR : 1;
5612 unsigned NOT_POR : 1;
5613 unsigned NOT_PD : 1;
5614 unsigned NOT_TO : 1;
5615 unsigned NOT_RI : 1;
5616 unsigned NOT_CM : 1;
5617 unsigned : 1;
5618 unsigned IPEN : 1;
5621 struct
5623 unsigned BOR : 1;
5624 unsigned POR : 1;
5625 unsigned PD : 1;
5626 unsigned TO : 1;
5627 unsigned RI : 1;
5628 unsigned CM : 1;
5629 unsigned : 1;
5630 unsigned : 1;
5632 } __RCONbits_t;
5634 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5636 #define _NOT_BOR 0x01
5637 #define _BOR 0x01
5638 #define _NOT_POR 0x02
5639 #define _POR 0x02
5640 #define _NOT_PD 0x04
5641 #define _PD 0x04
5642 #define _NOT_TO 0x08
5643 #define _TO 0x08
5644 #define _NOT_RI 0x10
5645 #define _RI 0x10
5646 #define _NOT_CM 0x20
5647 #define _CM 0x20
5648 #define _IPEN 0x80
5650 //==============================================================================
5653 //==============================================================================
5654 // WDTCON Bits
5656 extern __at(0x0FD1) __sfr WDTCON;
5658 typedef union
5660 struct
5662 unsigned SWDTEN : 1;
5663 unsigned : 1;
5664 unsigned : 1;
5665 unsigned : 1;
5666 unsigned : 1;
5667 unsigned : 1;
5668 unsigned : 1;
5669 unsigned : 1;
5672 struct
5674 unsigned SWDTE : 1;
5675 unsigned : 1;
5676 unsigned : 1;
5677 unsigned : 1;
5678 unsigned : 1;
5679 unsigned : 1;
5680 unsigned : 1;
5681 unsigned : 1;
5683 } __WDTCONbits_t;
5685 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5687 #define _SWDTEN 0x01
5688 #define _SWDTE 0x01
5690 //==============================================================================
5693 //==============================================================================
5694 // ECON1 Bits
5696 extern __at(0x0FD2) __sfr ECON1;
5698 typedef struct
5700 unsigned : 1;
5701 unsigned : 1;
5702 unsigned RXEN : 1;
5703 unsigned TXRTS : 1;
5704 unsigned CSUMEN : 1;
5705 unsigned DMAST : 1;
5706 unsigned RXRST : 1;
5707 unsigned TXRST : 1;
5708 } __ECON1bits_t;
5710 extern __at(0x0FD2) volatile __ECON1bits_t ECON1bits;
5712 #define _RXEN 0x04
5713 #define _TXRTS 0x08
5714 #define _CSUMEN 0x10
5715 #define _DMAST 0x20
5716 #define _RXRST 0x40
5717 #define _TXRST 0x80
5719 //==============================================================================
5722 //==============================================================================
5723 // OSCCON Bits
5725 extern __at(0x0FD3) __sfr OSCCON;
5727 typedef union
5729 struct
5731 unsigned SCS0 : 1;
5732 unsigned SCS1 : 1;
5733 unsigned : 1;
5734 unsigned OSTS : 1;
5735 unsigned : 1;
5736 unsigned : 1;
5737 unsigned : 1;
5738 unsigned IDLEN : 1;
5741 struct
5743 unsigned SCS : 2;
5744 unsigned : 6;
5746 } __OSCCONbits_t;
5748 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5750 #define _SCS0 0x01
5751 #define _SCS1 0x02
5752 #define _OSTS 0x08
5753 #define _IDLEN 0x80
5755 //==============================================================================
5758 //==============================================================================
5759 // T0CON Bits
5761 extern __at(0x0FD5) __sfr T0CON;
5763 typedef union
5765 struct
5767 unsigned T0PS0 : 1;
5768 unsigned T0PS1 : 1;
5769 unsigned T0PS2 : 1;
5770 unsigned PSA : 1;
5771 unsigned T0SE : 1;
5772 unsigned T0CS : 1;
5773 unsigned T08BIT : 1;
5774 unsigned TMR0ON : 1;
5777 struct
5779 unsigned T0PS : 3;
5780 unsigned : 5;
5782 } __T0CONbits_t;
5784 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5786 #define _T0PS0 0x01
5787 #define _T0PS1 0x02
5788 #define _T0PS2 0x04
5789 #define _PSA 0x08
5790 #define _T0SE 0x10
5791 #define _T0CS 0x20
5792 #define _T08BIT 0x40
5793 #define _TMR0ON 0x80
5795 //==============================================================================
5797 extern __at(0x0FD6) __sfr TMR0;
5798 extern __at(0x0FD6) __sfr TMR0L;
5799 extern __at(0x0FD7) __sfr TMR0H;
5801 //==============================================================================
5802 // STATUS Bits
5804 extern __at(0x0FD8) __sfr STATUS;
5806 typedef struct
5808 unsigned C : 1;
5809 unsigned DC : 1;
5810 unsigned Z : 1;
5811 unsigned OV : 1;
5812 unsigned N : 1;
5813 unsigned : 1;
5814 unsigned : 1;
5815 unsigned : 1;
5816 } __STATUSbits_t;
5818 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5820 #define _C 0x01
5821 #define _DC 0x02
5822 #define _Z 0x04
5823 #define _OV 0x08
5824 #define _N 0x10
5826 //==============================================================================
5828 extern __at(0x0FD9) __sfr FSR2L;
5829 extern __at(0x0FDA) __sfr FSR2H;
5830 extern __at(0x0FDB) __sfr PLUSW2;
5831 extern __at(0x0FDC) __sfr PREINC2;
5832 extern __at(0x0FDD) __sfr POSTDEC2;
5833 extern __at(0x0FDE) __sfr POSTINC2;
5834 extern __at(0x0FDF) __sfr INDF2;
5835 extern __at(0x0FE0) __sfr BSR;
5836 extern __at(0x0FE1) __sfr FSR1L;
5837 extern __at(0x0FE2) __sfr FSR1H;
5838 extern __at(0x0FE3) __sfr PLUSW1;
5839 extern __at(0x0FE4) __sfr PREINC1;
5840 extern __at(0x0FE5) __sfr POSTDEC1;
5841 extern __at(0x0FE6) __sfr POSTINC1;
5842 extern __at(0x0FE7) __sfr INDF1;
5843 extern __at(0x0FE8) __sfr WREG;
5844 extern __at(0x0FE9) __sfr FSR0L;
5845 extern __at(0x0FEA) __sfr FSR0H;
5846 extern __at(0x0FEB) __sfr PLUSW0;
5847 extern __at(0x0FEC) __sfr PREINC0;
5848 extern __at(0x0FED) __sfr POSTDEC0;
5849 extern __at(0x0FEE) __sfr POSTINC0;
5850 extern __at(0x0FEF) __sfr INDF0;
5852 //==============================================================================
5853 // INTCON3 Bits
5855 extern __at(0x0FF0) __sfr INTCON3;
5857 typedef union
5859 struct
5861 unsigned INT1IF : 1;
5862 unsigned INT2IF : 1;
5863 unsigned INT3IF : 1;
5864 unsigned INT1IE : 1;
5865 unsigned INT2IE : 1;
5866 unsigned INT3IE : 1;
5867 unsigned INT1IP : 1;
5868 unsigned INT2IP : 1;
5871 struct
5873 unsigned INT1F : 1;
5874 unsigned INT2F : 1;
5875 unsigned INT3F : 1;
5876 unsigned INT1E : 1;
5877 unsigned INT2E : 1;
5878 unsigned INT3E : 1;
5879 unsigned INT1P : 1;
5880 unsigned INT2P : 1;
5882 } __INTCON3bits_t;
5884 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5886 #define _INT1IF 0x01
5887 #define _INT1F 0x01
5888 #define _INT2IF 0x02
5889 #define _INT2F 0x02
5890 #define _INT3IF 0x04
5891 #define _INT3F 0x04
5892 #define _INT1IE 0x08
5893 #define _INT1E 0x08
5894 #define _INT2IE 0x10
5895 #define _INT2E 0x10
5896 #define _INT3IE 0x20
5897 #define _INT3E 0x20
5898 #define _INT1IP 0x40
5899 #define _INT1P 0x40
5900 #define _INT2IP 0x80
5901 #define _INT2P 0x80
5903 //==============================================================================
5906 //==============================================================================
5907 // INTCON2 Bits
5909 extern __at(0x0FF1) __sfr INTCON2;
5911 typedef union
5913 struct
5915 unsigned RBIP : 1;
5916 unsigned INT3IP : 1;
5917 unsigned TMR0IP : 1;
5918 unsigned INTEDG3 : 1;
5919 unsigned INTEDG2 : 1;
5920 unsigned INTEDG1 : 1;
5921 unsigned INTEDG0 : 1;
5922 unsigned NOT_RBPU : 1;
5925 struct
5927 unsigned : 1;
5928 unsigned : 1;
5929 unsigned T0IP : 1;
5930 unsigned : 1;
5931 unsigned : 1;
5932 unsigned : 1;
5933 unsigned : 1;
5934 unsigned RBPU : 1;
5936 } __INTCON2bits_t;
5938 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5940 #define _RBIP 0x01
5941 #define _INT3IP 0x02
5942 #define _TMR0IP 0x04
5943 #define _T0IP 0x04
5944 #define _INTEDG3 0x08
5945 #define _INTEDG2 0x10
5946 #define _INTEDG1 0x20
5947 #define _INTEDG0 0x40
5948 #define _NOT_RBPU 0x80
5949 #define _RBPU 0x80
5951 //==============================================================================
5954 //==============================================================================
5955 // INTCON Bits
5957 extern __at(0x0FF2) __sfr INTCON;
5959 typedef union
5961 struct
5963 unsigned RBIF : 1;
5964 unsigned INT0IF : 1;
5965 unsigned TMR0IF : 1;
5966 unsigned RBIE : 1;
5967 unsigned INT0IE : 1;
5968 unsigned TMR0IE : 1;
5969 unsigned PEIE_GIEL : 1;
5970 unsigned GIE_GIEH : 1;
5973 struct
5975 unsigned : 1;
5976 unsigned INT0F : 1;
5977 unsigned T0IF : 1;
5978 unsigned : 1;
5979 unsigned INT0E : 1;
5980 unsigned T0IE : 1;
5981 unsigned PEIE : 1;
5982 unsigned GIE : 1;
5985 struct
5987 unsigned : 1;
5988 unsigned : 1;
5989 unsigned : 1;
5990 unsigned : 1;
5991 unsigned : 1;
5992 unsigned : 1;
5993 unsigned GIEL : 1;
5994 unsigned GIEH : 1;
5996 } __INTCONbits_t;
5998 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6000 #define _RBIF 0x01
6001 #define _INT0IF 0x02
6002 #define _INT0F 0x02
6003 #define _TMR0IF 0x04
6004 #define _T0IF 0x04
6005 #define _RBIE 0x08
6006 #define _INT0IE 0x10
6007 #define _INT0E 0x10
6008 #define _TMR0IE 0x20
6009 #define _T0IE 0x20
6010 #define _PEIE_GIEL 0x40
6011 #define _PEIE 0x40
6012 #define _GIEL 0x40
6013 #define _GIE_GIEH 0x80
6014 #define _GIE 0x80
6015 #define _GIEH 0x80
6017 //==============================================================================
6019 extern __at(0x0FF3) __sfr PROD;
6020 extern __at(0x0FF3) __sfr PRODL;
6021 extern __at(0x0FF4) __sfr PRODH;
6022 extern __at(0x0FF5) __sfr TABLAT;
6023 extern __at(0x0FF6) __sfr TBLPTR;
6024 extern __at(0x0FF6) __sfr TBLPTRL;
6025 extern __at(0x0FF7) __sfr TBLPTRH;
6026 extern __at(0x0FF8) __sfr TBLPTRU;
6027 extern __at(0x0FF9) __sfr PC;
6028 extern __at(0x0FF9) __sfr PCL;
6029 extern __at(0x0FFA) __sfr PCLATH;
6030 extern __at(0x0FFB) __sfr PCLATU;
6032 //==============================================================================
6033 // STKPTR Bits
6035 extern __at(0x0FFC) __sfr STKPTR;
6037 typedef union
6039 struct
6041 unsigned STKPTR0 : 1;
6042 unsigned STKPTR1 : 1;
6043 unsigned STKPTR2 : 1;
6044 unsigned STKPTR3 : 1;
6045 unsigned STKPTR4 : 1;
6046 unsigned : 1;
6047 unsigned STKUNF : 1;
6048 unsigned STKFUL : 1;
6051 struct
6053 unsigned SP0 : 1;
6054 unsigned SP1 : 1;
6055 unsigned SP2 : 1;
6056 unsigned SP3 : 1;
6057 unsigned SP4 : 1;
6058 unsigned : 1;
6059 unsigned : 1;
6060 unsigned STKOVF : 1;
6063 struct
6065 unsigned STKPTR : 5;
6066 unsigned : 3;
6069 struct
6071 unsigned SP : 5;
6072 unsigned : 3;
6074 } __STKPTRbits_t;
6076 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6078 #define _STKPTR0 0x01
6079 #define _SP0 0x01
6080 #define _STKPTR1 0x02
6081 #define _SP1 0x02
6082 #define _STKPTR2 0x04
6083 #define _SP2 0x04
6084 #define _STKPTR3 0x08
6085 #define _SP3 0x08
6086 #define _STKPTR4 0x10
6087 #define _SP4 0x10
6088 #define _STKUNF 0x40
6089 #define _STKFUL 0x80
6090 #define _STKOVF 0x80
6092 //==============================================================================
6094 extern __at(0x0FFD) __sfr TOS;
6095 extern __at(0x0FFD) __sfr TOSL;
6096 extern __at(0x0FFE) __sfr TOSH;
6097 extern __at(0x0FFF) __sfr TOSU;
6099 //==============================================================================
6101 // Configuration Addresses
6103 //==============================================================================
6105 #define __CONFIG1L 0x017FF8
6106 #define __CONFIG1H 0x017FF9
6107 #define __CONFIG2L 0x017FFA
6108 #define __CONFIG2H 0x017FFB
6109 #define __CONFIG3L 0x017FFC
6110 #define __CONFIG3H 0x017FFD
6112 //==============================================================================
6114 #endif // #ifndef __PIC18F86J65_H__