struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f66j65.h
blobe0f6d5abbd46f6b131e2d5a0fc33c8f1ba209066
1 /*
2 * This declarations of the PIC18F66J65 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:33 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 __PIC18F66J65_H__
26 #define __PIC18F66J65_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 PDC : 7;
554 unsigned : 1;
557 struct
559 unsigned P2DC : 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 PSSAC : 2;
633 unsigned : 4;
636 struct
638 unsigned : 2;
639 unsigned PSS2AC : 2;
640 unsigned : 4;
643 struct
645 unsigned : 4;
646 unsigned ECCPAS : 3;
647 unsigned : 1;
650 struct
652 unsigned : 4;
653 unsigned ECCP2AS : 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 P3DC : 7;
714 unsigned : 1;
717 struct
719 unsigned PDC : 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 PSSBD : 2;
780 unsigned : 6;
783 struct
785 unsigned PSS3BD : 2;
786 unsigned : 6;
789 struct
791 unsigned : 2;
792 unsigned PSS3AC : 2;
793 unsigned : 4;
796 struct
798 unsigned : 2;
799 unsigned PSSAC : 2;
800 unsigned : 4;
803 struct
805 unsigned : 4;
806 unsigned ECCPAS : 3;
807 unsigned : 1;
810 struct
812 unsigned : 4;
813 unsigned ECCP3AS : 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 // CCP5CON Bits
843 extern __at(0x0F70) __sfr CCP5CON;
845 typedef union
847 struct
849 unsigned CCP5M0 : 1;
850 unsigned CCP5M1 : 1;
851 unsigned CCP5M2 : 1;
852 unsigned CCP5M3 : 1;
853 unsigned CCP5Y : 1;
854 unsigned CCP5X : 1;
855 unsigned : 1;
856 unsigned : 1;
859 struct
861 unsigned : 1;
862 unsigned : 1;
863 unsigned : 1;
864 unsigned : 1;
865 unsigned DC5B0 : 1;
866 unsigned DC5B1 : 1;
867 unsigned : 1;
868 unsigned : 1;
871 struct
873 unsigned CCP5M : 4;
874 unsigned : 4;
877 struct
879 unsigned : 4;
880 unsigned DC5B : 2;
881 unsigned : 2;
883 } __CCP5CONbits_t;
885 extern __at(0x0F70) volatile __CCP5CONbits_t CCP5CONbits;
887 #define _CCP5M0 0x01
888 #define _CCP5M1 0x02
889 #define _CCP5M2 0x04
890 #define _CCP5M3 0x08
891 #define _CCP5Y 0x10
892 #define _DC5B0 0x10
893 #define _CCP5X 0x20
894 #define _DC5B1 0x20
896 //==============================================================================
898 extern __at(0x0F71) __sfr CCPR5;
899 extern __at(0x0F71) __sfr CCPR5L;
900 extern __at(0x0F72) __sfr CCPR5H;
902 //==============================================================================
903 // CCP4CON Bits
905 extern __at(0x0F73) __sfr CCP4CON;
907 typedef union
909 struct
911 unsigned CCP4M0 : 1;
912 unsigned CCP4M1 : 1;
913 unsigned CCP4M2 : 1;
914 unsigned CCP4M3 : 1;
915 unsigned DC4B0 : 1;
916 unsigned DC4B1 : 1;
917 unsigned : 1;
918 unsigned : 1;
921 struct
923 unsigned : 1;
924 unsigned : 1;
925 unsigned : 1;
926 unsigned : 1;
927 unsigned CCP4Y : 1;
928 unsigned CCP4X : 1;
929 unsigned : 1;
930 unsigned : 1;
933 struct
935 unsigned CCP4M : 4;
936 unsigned : 4;
939 struct
941 unsigned : 4;
942 unsigned DC4B : 2;
943 unsigned : 2;
945 } __CCP4CONbits_t;
947 extern __at(0x0F73) volatile __CCP4CONbits_t CCP4CONbits;
949 #define _CCP4M0 0x01
950 #define _CCP4M1 0x02
951 #define _CCP4M2 0x04
952 #define _CCP4M3 0x08
953 #define _DC4B0 0x10
954 #define _CCP4Y 0x10
955 #define _DC4B1 0x20
956 #define _CCP4X 0x20
958 //==============================================================================
960 extern __at(0x0F74) __sfr CCPR4;
961 extern __at(0x0F74) __sfr CCPR4L;
962 extern __at(0x0F75) __sfr CCPR4H;
964 //==============================================================================
965 // T4CON Bits
967 extern __at(0x0F76) __sfr T4CON;
969 typedef union
971 struct
973 unsigned T4CKPS0 : 1;
974 unsigned T4CKPS1 : 1;
975 unsigned TMR4ON : 1;
976 unsigned T4OUTPS0 : 1;
977 unsigned T4OUTPS1 : 1;
978 unsigned T4OUTPS2 : 1;
979 unsigned T4OUTPS3 : 1;
980 unsigned : 1;
983 struct
985 unsigned T4CKPS : 2;
986 unsigned : 6;
989 struct
991 unsigned : 3;
992 unsigned T4OUTPS : 4;
993 unsigned : 1;
995 } __T4CONbits_t;
997 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
999 #define _T4CKPS0 0x01
1000 #define _T4CKPS1 0x02
1001 #define _TMR4ON 0x04
1002 #define _T4OUTPS0 0x08
1003 #define _T4OUTPS1 0x10
1004 #define _T4OUTPS2 0x20
1005 #define _T4OUTPS3 0x40
1007 //==============================================================================
1009 extern __at(0x0F77) __sfr PR4;
1010 extern __at(0x0F78) __sfr TMR4;
1012 //==============================================================================
1013 // ECCP1DEL Bits
1015 extern __at(0x0F79) __sfr ECCP1DEL;
1017 typedef union
1019 struct
1021 unsigned PDC0 : 1;
1022 unsigned PDC1 : 1;
1023 unsigned PDC2 : 1;
1024 unsigned PDC3 : 1;
1025 unsigned PDC4 : 1;
1026 unsigned PDC5 : 1;
1027 unsigned PDC6 : 1;
1028 unsigned PRSEN : 1;
1031 struct
1033 unsigned P1DC0 : 1;
1034 unsigned P1DC1 : 1;
1035 unsigned P1DC2 : 1;
1036 unsigned P1DC3 : 1;
1037 unsigned P1DC4 : 1;
1038 unsigned P1DC5 : 1;
1039 unsigned P1DC6 : 1;
1040 unsigned P1RSEN : 1;
1043 struct
1045 unsigned P1DC : 7;
1046 unsigned : 1;
1049 struct
1051 unsigned PDC : 7;
1052 unsigned : 1;
1054 } __ECCP1DELbits_t;
1056 extern __at(0x0F79) volatile __ECCP1DELbits_t ECCP1DELbits;
1058 #define _PDC0 0x01
1059 #define _P1DC0 0x01
1060 #define _PDC1 0x02
1061 #define _P1DC1 0x02
1062 #define _PDC2 0x04
1063 #define _P1DC2 0x04
1064 #define _PDC3 0x08
1065 #define _P1DC3 0x08
1066 #define _PDC4 0x10
1067 #define _P1DC4 0x10
1068 #define _PDC5 0x20
1069 #define _P1DC5 0x20
1070 #define _PDC6 0x40
1071 #define _P1DC6 0x40
1072 #define _PRSEN 0x80
1073 #define _P1RSEN 0x80
1075 //==============================================================================
1077 extern __at(0x0F7A) __sfr ERDPT;
1078 extern __at(0x0F7A) __sfr ERDPTL;
1079 extern __at(0x0F7B) __sfr ERDPTH;
1081 //==============================================================================
1082 // BAUDCON Bits
1084 extern __at(0x0F7E) __sfr BAUDCON;
1086 typedef union
1088 struct
1090 unsigned ABDEN : 1;
1091 unsigned WUE : 1;
1092 unsigned : 1;
1093 unsigned BRG16 : 1;
1094 unsigned TXCKP : 1;
1095 unsigned RXDTP : 1;
1096 unsigned RCIDL : 1;
1097 unsigned ABDOVF : 1;
1100 struct
1102 unsigned : 1;
1103 unsigned : 1;
1104 unsigned : 1;
1105 unsigned : 1;
1106 unsigned SCKP : 1;
1107 unsigned : 1;
1108 unsigned RCMT : 1;
1109 unsigned : 1;
1111 } __BAUDCONbits_t;
1113 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
1115 #define _ABDEN 0x01
1116 #define _WUE 0x02
1117 #define _BRG16 0x08
1118 #define _TXCKP 0x10
1119 #define _SCKP 0x10
1120 #define _RXDTP 0x20
1121 #define _RCIDL 0x40
1122 #define _RCMT 0x40
1123 #define _ABDOVF 0x80
1125 //==============================================================================
1128 //==============================================================================
1129 // BAUDCON1 Bits
1131 extern __at(0x0F7E) __sfr BAUDCON1;
1133 typedef union
1135 struct
1137 unsigned ABDEN : 1;
1138 unsigned WUE : 1;
1139 unsigned : 1;
1140 unsigned BRG16 : 1;
1141 unsigned TXCKP : 1;
1142 unsigned RXDTP : 1;
1143 unsigned RCIDL : 1;
1144 unsigned ABDOVF : 1;
1147 struct
1149 unsigned : 1;
1150 unsigned : 1;
1151 unsigned : 1;
1152 unsigned : 1;
1153 unsigned SCKP : 1;
1154 unsigned : 1;
1155 unsigned RCMT : 1;
1156 unsigned : 1;
1158 } __BAUDCON1bits_t;
1160 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1162 #define _BAUDCON1_ABDEN 0x01
1163 #define _BAUDCON1_WUE 0x02
1164 #define _BAUDCON1_BRG16 0x08
1165 #define _BAUDCON1_TXCKP 0x10
1166 #define _BAUDCON1_SCKP 0x10
1167 #define _BAUDCON1_RXDTP 0x20
1168 #define _BAUDCON1_RCIDL 0x40
1169 #define _BAUDCON1_RCMT 0x40
1170 #define _BAUDCON1_ABDOVF 0x80
1172 //==============================================================================
1175 //==============================================================================
1176 // BAUDCTL Bits
1178 extern __at(0x0F7E) __sfr BAUDCTL;
1180 typedef union
1182 struct
1184 unsigned ABDEN : 1;
1185 unsigned WUE : 1;
1186 unsigned : 1;
1187 unsigned BRG16 : 1;
1188 unsigned TXCKP : 1;
1189 unsigned RXDTP : 1;
1190 unsigned RCIDL : 1;
1191 unsigned ABDOVF : 1;
1194 struct
1196 unsigned : 1;
1197 unsigned : 1;
1198 unsigned : 1;
1199 unsigned : 1;
1200 unsigned SCKP : 1;
1201 unsigned : 1;
1202 unsigned RCMT : 1;
1203 unsigned : 1;
1205 } __BAUDCTLbits_t;
1207 extern __at(0x0F7E) volatile __BAUDCTLbits_t BAUDCTLbits;
1209 #define _BAUDCTL_ABDEN 0x01
1210 #define _BAUDCTL_WUE 0x02
1211 #define _BAUDCTL_BRG16 0x08
1212 #define _BAUDCTL_TXCKP 0x10
1213 #define _BAUDCTL_SCKP 0x10
1214 #define _BAUDCTL_RXDTP 0x20
1215 #define _BAUDCTL_RCIDL 0x40
1216 #define _BAUDCTL_RCMT 0x40
1217 #define _BAUDCTL_ABDOVF 0x80
1219 //==============================================================================
1222 //==============================================================================
1223 // BAUDCTL1 Bits
1225 extern __at(0x0F7E) __sfr BAUDCTL1;
1227 typedef union
1229 struct
1231 unsigned ABDEN : 1;
1232 unsigned WUE : 1;
1233 unsigned : 1;
1234 unsigned BRG16 : 1;
1235 unsigned TXCKP : 1;
1236 unsigned RXDTP : 1;
1237 unsigned RCIDL : 1;
1238 unsigned ABDOVF : 1;
1241 struct
1243 unsigned : 1;
1244 unsigned : 1;
1245 unsigned : 1;
1246 unsigned : 1;
1247 unsigned SCKP : 1;
1248 unsigned : 1;
1249 unsigned RCMT : 1;
1250 unsigned : 1;
1252 } __BAUDCTL1bits_t;
1254 extern __at(0x0F7E) volatile __BAUDCTL1bits_t BAUDCTL1bits;
1256 #define _BAUDCTL1_ABDEN 0x01
1257 #define _BAUDCTL1_WUE 0x02
1258 #define _BAUDCTL1_BRG16 0x08
1259 #define _BAUDCTL1_TXCKP 0x10
1260 #define _BAUDCTL1_SCKP 0x10
1261 #define _BAUDCTL1_RXDTP 0x20
1262 #define _BAUDCTL1_RCIDL 0x40
1263 #define _BAUDCTL1_RCMT 0x40
1264 #define _BAUDCTL1_ABDOVF 0x80
1266 //==============================================================================
1268 extern __at(0x0F7F) __sfr SPBRGH;
1269 extern __at(0x0F7F) __sfr SPBRGH1;
1271 //==============================================================================
1272 // PORTA Bits
1274 extern __at(0x0F80) __sfr PORTA;
1276 typedef union
1278 struct
1280 unsigned RA0 : 1;
1281 unsigned RA1 : 1;
1282 unsigned RA2 : 1;
1283 unsigned RA3 : 1;
1284 unsigned RA4 : 1;
1285 unsigned RA5 : 1;
1286 unsigned : 1;
1287 unsigned : 1;
1290 struct
1292 unsigned AN0 : 1;
1293 unsigned AN1 : 1;
1294 unsigned AN2 : 1;
1295 unsigned AN3 : 1;
1296 unsigned T0CKI : 1;
1297 unsigned AN4 : 1;
1298 unsigned : 1;
1299 unsigned : 1;
1302 struct
1304 unsigned LEDA : 1;
1305 unsigned LEDB : 1;
1306 unsigned VREFM : 1;
1307 unsigned VREFP : 1;
1308 unsigned : 1;
1309 unsigned : 1;
1310 unsigned : 1;
1311 unsigned : 1;
1314 struct
1316 unsigned RA : 6;
1317 unsigned : 2;
1319 } __PORTAbits_t;
1321 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1323 #define _PORTA_RA0 0x01
1324 #define _PORTA_AN0 0x01
1325 #define _PORTA_LEDA 0x01
1326 #define _PORTA_RA1 0x02
1327 #define _PORTA_AN1 0x02
1328 #define _PORTA_LEDB 0x02
1329 #define _PORTA_RA2 0x04
1330 #define _PORTA_AN2 0x04
1331 #define _PORTA_VREFM 0x04
1332 #define _PORTA_RA3 0x08
1333 #define _PORTA_AN3 0x08
1334 #define _PORTA_VREFP 0x08
1335 #define _PORTA_RA4 0x10
1336 #define _PORTA_T0CKI 0x10
1337 #define _PORTA_RA5 0x20
1338 #define _PORTA_AN4 0x20
1340 //==============================================================================
1343 //==============================================================================
1344 // PORTB Bits
1346 extern __at(0x0F81) __sfr PORTB;
1348 typedef union
1350 struct
1352 unsigned RB0 : 1;
1353 unsigned RB1 : 1;
1354 unsigned RB2 : 1;
1355 unsigned RB3 : 1;
1356 unsigned RB4 : 1;
1357 unsigned RB5 : 1;
1358 unsigned RB6 : 1;
1359 unsigned RB7 : 1;
1362 struct
1364 unsigned INT0 : 1;
1365 unsigned INT1 : 1;
1366 unsigned INT2 : 1;
1367 unsigned INT3 : 1;
1368 unsigned KBI0 : 1;
1369 unsigned KBI1 : 1;
1370 unsigned KBI2 : 1;
1371 unsigned KBI3 : 1;
1374 struct
1376 unsigned FLT0 : 1;
1377 unsigned : 1;
1378 unsigned : 1;
1379 unsigned : 1;
1380 unsigned : 1;
1381 unsigned : 1;
1382 unsigned PGC : 1;
1383 unsigned PGD : 1;
1386 struct
1388 unsigned INT : 4;
1389 unsigned : 4;
1392 struct
1394 unsigned : 4;
1395 unsigned KBI : 4;
1397 } __PORTBbits_t;
1399 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1401 #define _PORTB_RB0 0x01
1402 #define _PORTB_INT0 0x01
1403 #define _PORTB_FLT0 0x01
1404 #define _PORTB_RB1 0x02
1405 #define _PORTB_INT1 0x02
1406 #define _PORTB_RB2 0x04
1407 #define _PORTB_INT2 0x04
1408 #define _PORTB_RB3 0x08
1409 #define _PORTB_INT3 0x08
1410 #define _PORTB_RB4 0x10
1411 #define _PORTB_KBI0 0x10
1412 #define _PORTB_RB5 0x20
1413 #define _PORTB_KBI1 0x20
1414 #define _PORTB_RB6 0x40
1415 #define _PORTB_KBI2 0x40
1416 #define _PORTB_PGC 0x40
1417 #define _PORTB_RB7 0x80
1418 #define _PORTB_KBI3 0x80
1419 #define _PORTB_PGD 0x80
1421 //==============================================================================
1424 //==============================================================================
1425 // PORTC Bits
1427 extern __at(0x0F82) __sfr PORTC;
1429 typedef union
1431 struct
1433 unsigned RC0 : 1;
1434 unsigned RC1 : 1;
1435 unsigned RC2 : 1;
1436 unsigned RC3 : 1;
1437 unsigned RC4 : 1;
1438 unsigned RC5 : 1;
1439 unsigned RC6 : 1;
1440 unsigned RC7 : 1;
1443 struct
1445 unsigned T1OSO : 1;
1446 unsigned T1OSI : 1;
1447 unsigned CCP1 : 1;
1448 unsigned SCK : 1;
1449 unsigned SDI : 1;
1450 unsigned SDO : 1;
1451 unsigned TX : 1;
1452 unsigned RX : 1;
1455 struct
1457 unsigned T13CKI : 1;
1458 unsigned CCP2 : 1;
1459 unsigned ECCP1 : 1;
1460 unsigned SCL : 1;
1461 unsigned SDA : 1;
1462 unsigned SDO1 : 1;
1463 unsigned CK : 1;
1464 unsigned RX1 : 1;
1467 struct
1469 unsigned : 1;
1470 unsigned ECCP2 : 1;
1471 unsigned : 1;
1472 unsigned SCK1 : 1;
1473 unsigned SDI1 : 1;
1474 unsigned : 1;
1475 unsigned TX1 : 1;
1476 unsigned DT1 : 1;
1479 struct
1481 unsigned : 1;
1482 unsigned : 1;
1483 unsigned : 1;
1484 unsigned SCL1 : 1;
1485 unsigned SDA1 : 1;
1486 unsigned : 1;
1487 unsigned CK1 : 1;
1488 unsigned : 1;
1490 } __PORTCbits_t;
1492 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1494 #define _PORTC_RC0 0x01
1495 #define _PORTC_T1OSO 0x01
1496 #define _PORTC_T13CKI 0x01
1497 #define _PORTC_RC1 0x02
1498 #define _PORTC_T1OSI 0x02
1499 #define _PORTC_CCP2 0x02
1500 #define _PORTC_ECCP2 0x02
1501 #define _PORTC_RC2 0x04
1502 #define _PORTC_CCP1 0x04
1503 #define _PORTC_ECCP1 0x04
1504 #define _PORTC_RC3 0x08
1505 #define _PORTC_SCK 0x08
1506 #define _PORTC_SCL 0x08
1507 #define _PORTC_SCK1 0x08
1508 #define _PORTC_SCL1 0x08
1509 #define _PORTC_RC4 0x10
1510 #define _PORTC_SDI 0x10
1511 #define _PORTC_SDA 0x10
1512 #define _PORTC_SDI1 0x10
1513 #define _PORTC_SDA1 0x10
1514 #define _PORTC_RC5 0x20
1515 #define _PORTC_SDO 0x20
1516 #define _PORTC_SDO1 0x20
1517 #define _PORTC_RC6 0x40
1518 #define _PORTC_TX 0x40
1519 #define _PORTC_CK 0x40
1520 #define _PORTC_TX1 0x40
1521 #define _PORTC_CK1 0x40
1522 #define _PORTC_RC7 0x80
1523 #define _PORTC_RX 0x80
1524 #define _PORTC_RX1 0x80
1525 #define _PORTC_DT1 0x80
1527 //==============================================================================
1530 //==============================================================================
1531 // PORTD Bits
1533 extern __at(0x0F83) __sfr PORTD;
1535 typedef union
1537 struct
1539 unsigned RD0 : 1;
1540 unsigned RD1 : 1;
1541 unsigned RD2 : 1;
1542 unsigned : 1;
1543 unsigned : 1;
1544 unsigned : 1;
1545 unsigned : 1;
1546 unsigned : 1;
1549 struct
1551 unsigned : 1;
1552 unsigned CCP3 : 1;
1553 unsigned CCP4 : 1;
1554 unsigned : 1;
1555 unsigned : 1;
1556 unsigned : 1;
1557 unsigned : 1;
1558 unsigned : 1;
1561 struct
1563 unsigned : 1;
1564 unsigned ECCP3 : 1;
1565 unsigned : 1;
1566 unsigned : 1;
1567 unsigned : 1;
1568 unsigned : 1;
1569 unsigned : 1;
1570 unsigned : 1;
1573 struct
1575 unsigned RD : 3;
1576 unsigned : 5;
1578 } __PORTDbits_t;
1580 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1582 #define _PORTD_RD0 0x01
1583 #define _PORTD_RD1 0x02
1584 #define _PORTD_CCP3 0x02
1585 #define _PORTD_ECCP3 0x02
1586 #define _PORTD_RD2 0x04
1587 #define _PORTD_CCP4 0x04
1589 //==============================================================================
1592 //==============================================================================
1593 // PORTE Bits
1595 extern __at(0x0F84) __sfr PORTE;
1597 typedef union
1599 struct
1601 unsigned RE0 : 1;
1602 unsigned RE1 : 1;
1603 unsigned RE2 : 1;
1604 unsigned RE3 : 1;
1605 unsigned RE4 : 1;
1606 unsigned RE5 : 1;
1607 unsigned : 1;
1608 unsigned : 1;
1611 struct
1613 unsigned RE : 6;
1614 unsigned : 2;
1616 } __PORTEbits_t;
1618 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1620 #define _PORTE_RE0 0x01
1621 #define _PORTE_RE1 0x02
1622 #define _PORTE_RE2 0x04
1623 #define _PORTE_RE3 0x08
1624 #define _PORTE_RE4 0x10
1625 #define _PORTE_RE5 0x20
1627 //==============================================================================
1630 //==============================================================================
1631 // PORTF Bits
1633 extern __at(0x0F85) __sfr PORTF;
1635 typedef union
1637 struct
1639 unsigned : 1;
1640 unsigned RF1 : 1;
1641 unsigned RF2 : 1;
1642 unsigned RF3 : 1;
1643 unsigned RF4 : 1;
1644 unsigned RF5 : 1;
1645 unsigned RF6 : 1;
1646 unsigned RF7 : 1;
1649 struct
1651 unsigned : 1;
1652 unsigned AN6 : 1;
1653 unsigned AN7 : 1;
1654 unsigned AN8 : 1;
1655 unsigned AN9 : 1;
1656 unsigned AN10 : 1;
1657 unsigned AN11 : 1;
1658 unsigned SS : 1;
1661 struct
1663 unsigned : 1;
1664 unsigned : 1;
1665 unsigned : 1;
1666 unsigned : 1;
1667 unsigned : 1;
1668 unsigned CVREF : 1;
1669 unsigned : 1;
1670 unsigned NOT_SS : 1;
1673 struct
1675 unsigned : 1;
1676 unsigned : 1;
1677 unsigned : 1;
1678 unsigned : 1;
1679 unsigned : 1;
1680 unsigned : 1;
1681 unsigned : 1;
1682 unsigned SS1 : 1;
1685 struct
1687 unsigned : 1;
1688 unsigned : 1;
1689 unsigned : 1;
1690 unsigned : 1;
1691 unsigned : 1;
1692 unsigned : 1;
1693 unsigned : 1;
1694 unsigned NOT_SS1 : 1;
1696 } __PORTFbits_t;
1698 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
1700 #define _PORTF_RF1 0x02
1701 #define _PORTF_AN6 0x02
1702 #define _PORTF_RF2 0x04
1703 #define _PORTF_AN7 0x04
1704 #define _PORTF_RF3 0x08
1705 #define _PORTF_AN8 0x08
1706 #define _PORTF_RF4 0x10
1707 #define _PORTF_AN9 0x10
1708 #define _PORTF_RF5 0x20
1709 #define _PORTF_AN10 0x20
1710 #define _PORTF_CVREF 0x20
1711 #define _PORTF_RF6 0x40
1712 #define _PORTF_AN11 0x40
1713 #define _PORTF_RF7 0x80
1714 #define _PORTF_SS 0x80
1715 #define _PORTF_NOT_SS 0x80
1716 #define _PORTF_SS1 0x80
1717 #define _PORTF_NOT_SS1 0x80
1719 //==============================================================================
1722 //==============================================================================
1723 // PORTG Bits
1725 extern __at(0x0F86) __sfr PORTG;
1727 typedef union
1729 struct
1731 unsigned : 1;
1732 unsigned : 1;
1733 unsigned : 1;
1734 unsigned : 1;
1735 unsigned RG4 : 1;
1736 unsigned : 1;
1737 unsigned : 1;
1738 unsigned : 1;
1741 struct
1743 unsigned : 1;
1744 unsigned : 1;
1745 unsigned : 1;
1746 unsigned : 1;
1747 unsigned CCP5 : 1;
1748 unsigned : 1;
1749 unsigned : 1;
1750 unsigned : 1;
1752 } __PORTGbits_t;
1754 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
1756 #define _PORTG_RG4 0x10
1757 #define _PORTG_CCP5 0x10
1759 //==============================================================================
1762 //==============================================================================
1763 // LATA Bits
1765 extern __at(0x0F89) __sfr LATA;
1767 typedef union
1769 struct
1771 unsigned LATA0 : 1;
1772 unsigned LATA1 : 1;
1773 unsigned LATA2 : 1;
1774 unsigned LATA3 : 1;
1775 unsigned LATA4 : 1;
1776 unsigned LATA5 : 1;
1777 unsigned REPU : 1;
1778 unsigned RDPU : 1;
1781 struct
1783 unsigned LATA : 6;
1784 unsigned : 2;
1786 } __LATAbits_t;
1788 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1790 #define _LATA0 0x01
1791 #define _LATA1 0x02
1792 #define _LATA2 0x04
1793 #define _LATA3 0x08
1794 #define _LATA4 0x10
1795 #define _LATA5 0x20
1796 #define _REPU 0x40
1797 #define _RDPU 0x80
1799 //==============================================================================
1802 //==============================================================================
1803 // LATB Bits
1805 extern __at(0x0F8A) __sfr LATB;
1807 typedef struct
1809 unsigned LATB0 : 1;
1810 unsigned LATB1 : 1;
1811 unsigned LATB2 : 1;
1812 unsigned LATB3 : 1;
1813 unsigned LATB4 : 1;
1814 unsigned LATB5 : 1;
1815 unsigned LATB6 : 1;
1816 unsigned LATB7 : 1;
1817 } __LATBbits_t;
1819 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1821 #define _LATB0 0x01
1822 #define _LATB1 0x02
1823 #define _LATB2 0x04
1824 #define _LATB3 0x08
1825 #define _LATB4 0x10
1826 #define _LATB5 0x20
1827 #define _LATB6 0x40
1828 #define _LATB7 0x80
1830 //==============================================================================
1833 //==============================================================================
1834 // LATC Bits
1836 extern __at(0x0F8B) __sfr LATC;
1838 typedef struct
1840 unsigned LATC0 : 1;
1841 unsigned LATC1 : 1;
1842 unsigned LATC2 : 1;
1843 unsigned LATC3 : 1;
1844 unsigned LATC4 : 1;
1845 unsigned LATC5 : 1;
1846 unsigned LATC6 : 1;
1847 unsigned LATC7 : 1;
1848 } __LATCbits_t;
1850 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1852 #define _LATC0 0x01
1853 #define _LATC1 0x02
1854 #define _LATC2 0x04
1855 #define _LATC3 0x08
1856 #define _LATC4 0x10
1857 #define _LATC5 0x20
1858 #define _LATC6 0x40
1859 #define _LATC7 0x80
1861 //==============================================================================
1864 //==============================================================================
1865 // LATD Bits
1867 extern __at(0x0F8C) __sfr LATD;
1869 typedef union
1871 struct
1873 unsigned LATD0 : 1;
1874 unsigned LATD1 : 1;
1875 unsigned LATD2 : 1;
1876 unsigned : 1;
1877 unsigned : 1;
1878 unsigned : 1;
1879 unsigned : 1;
1880 unsigned : 1;
1883 struct
1885 unsigned LATD : 3;
1886 unsigned : 5;
1888 } __LATDbits_t;
1890 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
1892 #define _LATD0 0x01
1893 #define _LATD1 0x02
1894 #define _LATD2 0x04
1896 //==============================================================================
1899 //==============================================================================
1900 // LATE Bits
1902 extern __at(0x0F8D) __sfr LATE;
1904 typedef union
1906 struct
1908 unsigned LATE0 : 1;
1909 unsigned LATE1 : 1;
1910 unsigned LATE2 : 1;
1911 unsigned LATE3 : 1;
1912 unsigned LATE4 : 1;
1913 unsigned LATE5 : 1;
1914 unsigned : 1;
1915 unsigned : 1;
1918 struct
1920 unsigned LATE : 6;
1921 unsigned : 2;
1923 } __LATEbits_t;
1925 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1927 #define _LATE0 0x01
1928 #define _LATE1 0x02
1929 #define _LATE2 0x04
1930 #define _LATE3 0x08
1931 #define _LATE4 0x10
1932 #define _LATE5 0x20
1934 //==============================================================================
1937 //==============================================================================
1938 // LATF Bits
1940 extern __at(0x0F8E) __sfr LATF;
1942 typedef struct
1944 unsigned : 1;
1945 unsigned LATF1 : 1;
1946 unsigned LATF2 : 1;
1947 unsigned LATF3 : 1;
1948 unsigned LATF4 : 1;
1949 unsigned LATF5 : 1;
1950 unsigned LATF6 : 1;
1951 unsigned LATF7 : 1;
1952 } __LATFbits_t;
1954 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
1956 #define _LATF1 0x02
1957 #define _LATF2 0x04
1958 #define _LATF3 0x08
1959 #define _LATF4 0x10
1960 #define _LATF5 0x20
1961 #define _LATF6 0x40
1962 #define _LATF7 0x80
1964 //==============================================================================
1967 //==============================================================================
1968 // LATG Bits
1970 extern __at(0x0F8F) __sfr LATG;
1972 typedef struct
1974 unsigned : 1;
1975 unsigned : 1;
1976 unsigned : 1;
1977 unsigned : 1;
1978 unsigned LATG4 : 1;
1979 unsigned : 1;
1980 unsigned : 1;
1981 unsigned : 1;
1982 } __LATGbits_t;
1984 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
1986 #define _LATG4 0x10
1988 //==============================================================================
1991 //==============================================================================
1992 // DDRA Bits
1994 extern __at(0x0F92) __sfr DDRA;
1996 typedef union
1998 struct
2000 unsigned TRISA0 : 1;
2001 unsigned TRISA1 : 1;
2002 unsigned TRISA2 : 1;
2003 unsigned TRISA3 : 1;
2004 unsigned TRISA4 : 1;
2005 unsigned TRISA5 : 1;
2006 unsigned : 1;
2007 unsigned : 1;
2010 struct
2012 unsigned RA0 : 1;
2013 unsigned RA1 : 1;
2014 unsigned RA2 : 1;
2015 unsigned RA3 : 1;
2016 unsigned RA4 : 1;
2017 unsigned RA5 : 1;
2018 unsigned : 1;
2019 unsigned : 1;
2022 struct
2024 unsigned TRISA : 6;
2025 unsigned : 2;
2028 struct
2030 unsigned RA : 6;
2031 unsigned : 2;
2033 } __DDRAbits_t;
2035 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2037 #define _TRISA0 0x01
2038 #define _RA0 0x01
2039 #define _TRISA1 0x02
2040 #define _RA1 0x02
2041 #define _TRISA2 0x04
2042 #define _RA2 0x04
2043 #define _TRISA3 0x08
2044 #define _RA3 0x08
2045 #define _TRISA4 0x10
2046 #define _RA4 0x10
2047 #define _TRISA5 0x20
2048 #define _RA5 0x20
2050 //==============================================================================
2053 //==============================================================================
2054 // TRISA Bits
2056 extern __at(0x0F92) __sfr TRISA;
2058 typedef union
2060 struct
2062 unsigned TRISA0 : 1;
2063 unsigned TRISA1 : 1;
2064 unsigned TRISA2 : 1;
2065 unsigned TRISA3 : 1;
2066 unsigned TRISA4 : 1;
2067 unsigned TRISA5 : 1;
2068 unsigned : 1;
2069 unsigned : 1;
2072 struct
2074 unsigned RA0 : 1;
2075 unsigned RA1 : 1;
2076 unsigned RA2 : 1;
2077 unsigned RA3 : 1;
2078 unsigned RA4 : 1;
2079 unsigned RA5 : 1;
2080 unsigned : 1;
2081 unsigned : 1;
2084 struct
2086 unsigned RA : 6;
2087 unsigned : 2;
2090 struct
2092 unsigned TRISA : 6;
2093 unsigned : 2;
2095 } __TRISAbits_t;
2097 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2099 #define _TRISA_TRISA0 0x01
2100 #define _TRISA_RA0 0x01
2101 #define _TRISA_TRISA1 0x02
2102 #define _TRISA_RA1 0x02
2103 #define _TRISA_TRISA2 0x04
2104 #define _TRISA_RA2 0x04
2105 #define _TRISA_TRISA3 0x08
2106 #define _TRISA_RA3 0x08
2107 #define _TRISA_TRISA4 0x10
2108 #define _TRISA_RA4 0x10
2109 #define _TRISA_TRISA5 0x20
2110 #define _TRISA_RA5 0x20
2112 //==============================================================================
2115 //==============================================================================
2116 // DDRB Bits
2118 extern __at(0x0F93) __sfr DDRB;
2120 typedef union
2122 struct
2124 unsigned TRISB0 : 1;
2125 unsigned TRISB1 : 1;
2126 unsigned TRISB2 : 1;
2127 unsigned TRISB3 : 1;
2128 unsigned TRISB4 : 1;
2129 unsigned TRISB5 : 1;
2130 unsigned TRISB6 : 1;
2131 unsigned TRISB7 : 1;
2134 struct
2136 unsigned RB0 : 1;
2137 unsigned RB1 : 1;
2138 unsigned RB2 : 1;
2139 unsigned RB3 : 1;
2140 unsigned RB4 : 1;
2141 unsigned RB5 : 1;
2142 unsigned RB6 : 1;
2143 unsigned RB7 : 1;
2145 } __DDRBbits_t;
2147 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2149 #define _TRISB0 0x01
2150 #define _RB0 0x01
2151 #define _TRISB1 0x02
2152 #define _RB1 0x02
2153 #define _TRISB2 0x04
2154 #define _RB2 0x04
2155 #define _TRISB3 0x08
2156 #define _RB3 0x08
2157 #define _TRISB4 0x10
2158 #define _RB4 0x10
2159 #define _TRISB5 0x20
2160 #define _RB5 0x20
2161 #define _TRISB6 0x40
2162 #define _RB6 0x40
2163 #define _TRISB7 0x80
2164 #define _RB7 0x80
2166 //==============================================================================
2169 //==============================================================================
2170 // TRISB Bits
2172 extern __at(0x0F93) __sfr TRISB;
2174 typedef union
2176 struct
2178 unsigned TRISB0 : 1;
2179 unsigned TRISB1 : 1;
2180 unsigned TRISB2 : 1;
2181 unsigned TRISB3 : 1;
2182 unsigned TRISB4 : 1;
2183 unsigned TRISB5 : 1;
2184 unsigned TRISB6 : 1;
2185 unsigned TRISB7 : 1;
2188 struct
2190 unsigned RB0 : 1;
2191 unsigned RB1 : 1;
2192 unsigned RB2 : 1;
2193 unsigned RB3 : 1;
2194 unsigned RB4 : 1;
2195 unsigned RB5 : 1;
2196 unsigned RB6 : 1;
2197 unsigned RB7 : 1;
2199 } __TRISBbits_t;
2201 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2203 #define _TRISB_TRISB0 0x01
2204 #define _TRISB_RB0 0x01
2205 #define _TRISB_TRISB1 0x02
2206 #define _TRISB_RB1 0x02
2207 #define _TRISB_TRISB2 0x04
2208 #define _TRISB_RB2 0x04
2209 #define _TRISB_TRISB3 0x08
2210 #define _TRISB_RB3 0x08
2211 #define _TRISB_TRISB4 0x10
2212 #define _TRISB_RB4 0x10
2213 #define _TRISB_TRISB5 0x20
2214 #define _TRISB_RB5 0x20
2215 #define _TRISB_TRISB6 0x40
2216 #define _TRISB_RB6 0x40
2217 #define _TRISB_TRISB7 0x80
2218 #define _TRISB_RB7 0x80
2220 //==============================================================================
2223 //==============================================================================
2224 // DDRC Bits
2226 extern __at(0x0F94) __sfr DDRC;
2228 typedef union
2230 struct
2232 unsigned TRISC0 : 1;
2233 unsigned TRISC1 : 1;
2234 unsigned TRISC2 : 1;
2235 unsigned TRISC3 : 1;
2236 unsigned TRISC4 : 1;
2237 unsigned TRISC5 : 1;
2238 unsigned TRISC6 : 1;
2239 unsigned TRISC7 : 1;
2242 struct
2244 unsigned RC0 : 1;
2245 unsigned RC1 : 1;
2246 unsigned RC2 : 1;
2247 unsigned RC3 : 1;
2248 unsigned RC4 : 1;
2249 unsigned RC5 : 1;
2250 unsigned RC6 : 1;
2251 unsigned RC7 : 1;
2253 } __DDRCbits_t;
2255 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2257 #define _TRISC0 0x01
2258 #define _RC0 0x01
2259 #define _TRISC1 0x02
2260 #define _RC1 0x02
2261 #define _TRISC2 0x04
2262 #define _RC2 0x04
2263 #define _TRISC3 0x08
2264 #define _RC3 0x08
2265 #define _TRISC4 0x10
2266 #define _RC4 0x10
2267 #define _TRISC5 0x20
2268 #define _RC5 0x20
2269 #define _TRISC6 0x40
2270 #define _RC6 0x40
2271 #define _TRISC7 0x80
2272 #define _RC7 0x80
2274 //==============================================================================
2277 //==============================================================================
2278 // TRISC Bits
2280 extern __at(0x0F94) __sfr TRISC;
2282 typedef union
2284 struct
2286 unsigned TRISC0 : 1;
2287 unsigned TRISC1 : 1;
2288 unsigned TRISC2 : 1;
2289 unsigned TRISC3 : 1;
2290 unsigned TRISC4 : 1;
2291 unsigned TRISC5 : 1;
2292 unsigned TRISC6 : 1;
2293 unsigned TRISC7 : 1;
2296 struct
2298 unsigned RC0 : 1;
2299 unsigned RC1 : 1;
2300 unsigned RC2 : 1;
2301 unsigned RC3 : 1;
2302 unsigned RC4 : 1;
2303 unsigned RC5 : 1;
2304 unsigned RC6 : 1;
2305 unsigned RC7 : 1;
2307 } __TRISCbits_t;
2309 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2311 #define _TRISC_TRISC0 0x01
2312 #define _TRISC_RC0 0x01
2313 #define _TRISC_TRISC1 0x02
2314 #define _TRISC_RC1 0x02
2315 #define _TRISC_TRISC2 0x04
2316 #define _TRISC_RC2 0x04
2317 #define _TRISC_TRISC3 0x08
2318 #define _TRISC_RC3 0x08
2319 #define _TRISC_TRISC4 0x10
2320 #define _TRISC_RC4 0x10
2321 #define _TRISC_TRISC5 0x20
2322 #define _TRISC_RC5 0x20
2323 #define _TRISC_TRISC6 0x40
2324 #define _TRISC_RC6 0x40
2325 #define _TRISC_TRISC7 0x80
2326 #define _TRISC_RC7 0x80
2328 //==============================================================================
2331 //==============================================================================
2332 // DDRD Bits
2334 extern __at(0x0F95) __sfr DDRD;
2336 typedef union
2338 struct
2340 unsigned TRISD0 : 1;
2341 unsigned TRISD1 : 1;
2342 unsigned TRISD2 : 1;
2343 unsigned : 1;
2344 unsigned : 1;
2345 unsigned : 1;
2346 unsigned : 1;
2347 unsigned : 1;
2350 struct
2352 unsigned RD0 : 1;
2353 unsigned RD1 : 1;
2354 unsigned RD2 : 1;
2355 unsigned : 1;
2356 unsigned : 1;
2357 unsigned : 1;
2358 unsigned : 1;
2359 unsigned : 1;
2362 struct
2364 unsigned TRISD : 3;
2365 unsigned : 5;
2368 struct
2370 unsigned RD : 3;
2371 unsigned : 5;
2373 } __DDRDbits_t;
2375 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
2377 #define _TRISD0 0x01
2378 #define _RD0 0x01
2379 #define _TRISD1 0x02
2380 #define _RD1 0x02
2381 #define _TRISD2 0x04
2382 #define _RD2 0x04
2384 //==============================================================================
2387 //==============================================================================
2388 // TRISD Bits
2390 extern __at(0x0F95) __sfr TRISD;
2392 typedef union
2394 struct
2396 unsigned TRISD0 : 1;
2397 unsigned TRISD1 : 1;
2398 unsigned TRISD2 : 1;
2399 unsigned : 1;
2400 unsigned : 1;
2401 unsigned : 1;
2402 unsigned : 1;
2403 unsigned : 1;
2406 struct
2408 unsigned RD0 : 1;
2409 unsigned RD1 : 1;
2410 unsigned RD2 : 1;
2411 unsigned : 1;
2412 unsigned : 1;
2413 unsigned : 1;
2414 unsigned : 1;
2415 unsigned : 1;
2418 struct
2420 unsigned RD : 3;
2421 unsigned : 5;
2424 struct
2426 unsigned TRISD : 3;
2427 unsigned : 5;
2429 } __TRISDbits_t;
2431 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2433 #define _TRISD_TRISD0 0x01
2434 #define _TRISD_RD0 0x01
2435 #define _TRISD_TRISD1 0x02
2436 #define _TRISD_RD1 0x02
2437 #define _TRISD_TRISD2 0x04
2438 #define _TRISD_RD2 0x04
2440 //==============================================================================
2443 //==============================================================================
2444 // DDRE Bits
2446 extern __at(0x0F96) __sfr DDRE;
2448 typedef union
2450 struct
2452 unsigned TRISE0 : 1;
2453 unsigned TRISE1 : 1;
2454 unsigned TRISE2 : 1;
2455 unsigned TRISE3 : 1;
2456 unsigned TRISE4 : 1;
2457 unsigned TRISE5 : 1;
2458 unsigned : 1;
2459 unsigned : 1;
2462 struct
2464 unsigned RE0 : 1;
2465 unsigned RE1 : 1;
2466 unsigned RE2 : 1;
2467 unsigned RE3 : 1;
2468 unsigned RE4 : 1;
2469 unsigned RE5 : 1;
2470 unsigned : 1;
2471 unsigned : 1;
2474 struct
2476 unsigned TRISE : 6;
2477 unsigned : 2;
2480 struct
2482 unsigned RE : 6;
2483 unsigned : 2;
2485 } __DDREbits_t;
2487 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
2489 #define _TRISE0 0x01
2490 #define _RE0 0x01
2491 #define _TRISE1 0x02
2492 #define _RE1 0x02
2493 #define _TRISE2 0x04
2494 #define _RE2 0x04
2495 #define _TRISE3 0x08
2496 #define _RE3 0x08
2497 #define _TRISE4 0x10
2498 #define _RE4 0x10
2499 #define _TRISE5 0x20
2500 #define _RE5 0x20
2502 //==============================================================================
2505 //==============================================================================
2506 // TRISE Bits
2508 extern __at(0x0F96) __sfr TRISE;
2510 typedef union
2512 struct
2514 unsigned TRISE0 : 1;
2515 unsigned TRISE1 : 1;
2516 unsigned TRISE2 : 1;
2517 unsigned TRISE3 : 1;
2518 unsigned TRISE4 : 1;
2519 unsigned TRISE5 : 1;
2520 unsigned : 1;
2521 unsigned : 1;
2524 struct
2526 unsigned RE0 : 1;
2527 unsigned RE1 : 1;
2528 unsigned RE2 : 1;
2529 unsigned RE3 : 1;
2530 unsigned RE4 : 1;
2531 unsigned RE5 : 1;
2532 unsigned : 1;
2533 unsigned : 1;
2536 struct
2538 unsigned TRISE : 6;
2539 unsigned : 2;
2542 struct
2544 unsigned RE : 6;
2545 unsigned : 2;
2547 } __TRISEbits_t;
2549 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
2551 #define _TRISE_TRISE0 0x01
2552 #define _TRISE_RE0 0x01
2553 #define _TRISE_TRISE1 0x02
2554 #define _TRISE_RE1 0x02
2555 #define _TRISE_TRISE2 0x04
2556 #define _TRISE_RE2 0x04
2557 #define _TRISE_TRISE3 0x08
2558 #define _TRISE_RE3 0x08
2559 #define _TRISE_TRISE4 0x10
2560 #define _TRISE_RE4 0x10
2561 #define _TRISE_TRISE5 0x20
2562 #define _TRISE_RE5 0x20
2564 //==============================================================================
2567 //==============================================================================
2568 // DDRF Bits
2570 extern __at(0x0F97) __sfr DDRF;
2572 typedef union
2574 struct
2576 unsigned : 1;
2577 unsigned TRISF1 : 1;
2578 unsigned TRISF2 : 1;
2579 unsigned TRISF3 : 1;
2580 unsigned TRISF4 : 1;
2581 unsigned TRISF5 : 1;
2582 unsigned TRISF6 : 1;
2583 unsigned TRISF7 : 1;
2586 struct
2588 unsigned : 1;
2589 unsigned RF1 : 1;
2590 unsigned RF2 : 1;
2591 unsigned RF3 : 1;
2592 unsigned RF4 : 1;
2593 unsigned RF5 : 1;
2594 unsigned RF6 : 1;
2595 unsigned RF7 : 1;
2597 } __DDRFbits_t;
2599 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
2601 #define _TRISF1 0x02
2602 #define _RF1 0x02
2603 #define _TRISF2 0x04
2604 #define _RF2 0x04
2605 #define _TRISF3 0x08
2606 #define _RF3 0x08
2607 #define _TRISF4 0x10
2608 #define _RF4 0x10
2609 #define _TRISF5 0x20
2610 #define _RF5 0x20
2611 #define _TRISF6 0x40
2612 #define _RF6 0x40
2613 #define _TRISF7 0x80
2614 #define _RF7 0x80
2616 //==============================================================================
2619 //==============================================================================
2620 // TRISF Bits
2622 extern __at(0x0F97) __sfr TRISF;
2624 typedef union
2626 struct
2628 unsigned : 1;
2629 unsigned TRISF1 : 1;
2630 unsigned TRISF2 : 1;
2631 unsigned TRISF3 : 1;
2632 unsigned TRISF4 : 1;
2633 unsigned TRISF5 : 1;
2634 unsigned TRISF6 : 1;
2635 unsigned TRISF7 : 1;
2638 struct
2640 unsigned : 1;
2641 unsigned RF1 : 1;
2642 unsigned RF2 : 1;
2643 unsigned RF3 : 1;
2644 unsigned RF4 : 1;
2645 unsigned RF5 : 1;
2646 unsigned RF6 : 1;
2647 unsigned RF7 : 1;
2649 } __TRISFbits_t;
2651 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
2653 #define _TRISF_TRISF1 0x02
2654 #define _TRISF_RF1 0x02
2655 #define _TRISF_TRISF2 0x04
2656 #define _TRISF_RF2 0x04
2657 #define _TRISF_TRISF3 0x08
2658 #define _TRISF_RF3 0x08
2659 #define _TRISF_TRISF4 0x10
2660 #define _TRISF_RF4 0x10
2661 #define _TRISF_TRISF5 0x20
2662 #define _TRISF_RF5 0x20
2663 #define _TRISF_TRISF6 0x40
2664 #define _TRISF_RF6 0x40
2665 #define _TRISF_TRISF7 0x80
2666 #define _TRISF_RF7 0x80
2668 //==============================================================================
2671 //==============================================================================
2672 // DDRG Bits
2674 extern __at(0x0F98) __sfr DDRG;
2676 typedef union
2678 struct
2680 unsigned : 1;
2681 unsigned : 1;
2682 unsigned : 1;
2683 unsigned : 1;
2684 unsigned TRISG4 : 1;
2685 unsigned : 1;
2686 unsigned : 1;
2687 unsigned : 1;
2690 struct
2692 unsigned : 1;
2693 unsigned : 1;
2694 unsigned : 1;
2695 unsigned : 1;
2696 unsigned RG4 : 1;
2697 unsigned : 1;
2698 unsigned : 1;
2699 unsigned : 1;
2701 } __DDRGbits_t;
2703 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
2705 #define _TRISG4 0x10
2706 #define _RG4 0x10
2708 //==============================================================================
2711 //==============================================================================
2712 // TRISG Bits
2714 extern __at(0x0F98) __sfr TRISG;
2716 typedef union
2718 struct
2720 unsigned : 1;
2721 unsigned : 1;
2722 unsigned : 1;
2723 unsigned : 1;
2724 unsigned TRISG4 : 1;
2725 unsigned : 1;
2726 unsigned : 1;
2727 unsigned : 1;
2730 struct
2732 unsigned : 1;
2733 unsigned : 1;
2734 unsigned : 1;
2735 unsigned : 1;
2736 unsigned RG4 : 1;
2737 unsigned : 1;
2738 unsigned : 1;
2739 unsigned : 1;
2741 } __TRISGbits_t;
2743 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
2745 #define _TRISG_TRISG4 0x10
2746 #define _TRISG_RG4 0x10
2748 //==============================================================================
2751 //==============================================================================
2752 // OSCTUNE Bits
2754 extern __at(0x0F9B) __sfr OSCTUNE;
2756 typedef struct
2758 unsigned : 1;
2759 unsigned : 1;
2760 unsigned : 1;
2761 unsigned : 1;
2762 unsigned PPRE : 1;
2763 unsigned PPST0 : 1;
2764 unsigned PLLEN : 1;
2765 unsigned PPST1 : 1;
2766 } __OSCTUNEbits_t;
2768 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
2770 #define _PPRE 0x10
2771 #define _PPST0 0x20
2772 #define _PLLEN 0x40
2773 #define _PPST1 0x80
2775 //==============================================================================
2778 //==============================================================================
2779 // PIE1 Bits
2781 extern __at(0x0F9D) __sfr PIE1;
2783 typedef union
2785 struct
2787 unsigned TMR1IE : 1;
2788 unsigned TMR2IE : 1;
2789 unsigned CCP1IE : 1;
2790 unsigned SSP1IE : 1;
2791 unsigned TX1IE : 1;
2792 unsigned RC1IE : 1;
2793 unsigned ADIE : 1;
2794 unsigned : 1;
2797 struct
2799 unsigned : 1;
2800 unsigned : 1;
2801 unsigned : 1;
2802 unsigned SSPIE : 1;
2803 unsigned TXIE : 1;
2804 unsigned RCIE : 1;
2805 unsigned : 1;
2806 unsigned : 1;
2808 } __PIE1bits_t;
2810 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
2812 #define _PIE1_TMR1IE 0x01
2813 #define _PIE1_TMR2IE 0x02
2814 #define _PIE1_CCP1IE 0x04
2815 #define _PIE1_SSP1IE 0x08
2816 #define _PIE1_SSPIE 0x08
2817 #define _PIE1_TX1IE 0x10
2818 #define _PIE1_TXIE 0x10
2819 #define _PIE1_RC1IE 0x20
2820 #define _PIE1_RCIE 0x20
2821 #define _PIE1_ADIE 0x40
2823 //==============================================================================
2826 //==============================================================================
2827 // PIR1 Bits
2829 extern __at(0x0F9E) __sfr PIR1;
2831 typedef union
2833 struct
2835 unsigned TMR1IF : 1;
2836 unsigned TMR2IF : 1;
2837 unsigned CCP1IF : 1;
2838 unsigned SSP1IF : 1;
2839 unsigned TX1IF : 1;
2840 unsigned RC1IF : 1;
2841 unsigned ADIF : 1;
2842 unsigned : 1;
2845 struct
2847 unsigned : 1;
2848 unsigned : 1;
2849 unsigned : 1;
2850 unsigned SSPIF : 1;
2851 unsigned TXIF : 1;
2852 unsigned RCIF : 1;
2853 unsigned : 1;
2854 unsigned : 1;
2856 } __PIR1bits_t;
2858 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
2860 #define _PIR1_TMR1IF 0x01
2861 #define _PIR1_TMR2IF 0x02
2862 #define _PIR1_CCP1IF 0x04
2863 #define _PIR1_SSP1IF 0x08
2864 #define _PIR1_SSPIF 0x08
2865 #define _PIR1_TX1IF 0x10
2866 #define _PIR1_TXIF 0x10
2867 #define _PIR1_RC1IF 0x20
2868 #define _PIR1_RCIF 0x20
2869 #define _PIR1_ADIF 0x40
2871 //==============================================================================
2874 //==============================================================================
2875 // IPR1 Bits
2877 extern __at(0x0F9F) __sfr IPR1;
2879 typedef union
2881 struct
2883 unsigned TMR1IP : 1;
2884 unsigned TMR2IP : 1;
2885 unsigned CCP1IP : 1;
2886 unsigned SSP1IP : 1;
2887 unsigned TX1IP : 1;
2888 unsigned RC1IP : 1;
2889 unsigned ADIP : 1;
2890 unsigned : 1;
2893 struct
2895 unsigned : 1;
2896 unsigned : 1;
2897 unsigned : 1;
2898 unsigned SSPIP : 1;
2899 unsigned TXIP : 1;
2900 unsigned RCIP : 1;
2901 unsigned : 1;
2902 unsigned : 1;
2904 } __IPR1bits_t;
2906 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2908 #define _TMR1IP 0x01
2909 #define _TMR2IP 0x02
2910 #define _CCP1IP 0x04
2911 #define _SSP1IP 0x08
2912 #define _SSPIP 0x08
2913 #define _TX1IP 0x10
2914 #define _TXIP 0x10
2915 #define _RC1IP 0x20
2916 #define _RCIP 0x20
2917 #define _ADIP 0x40
2919 //==============================================================================
2922 //==============================================================================
2923 // PIE2 Bits
2925 extern __at(0x0FA0) __sfr PIE2;
2927 typedef union
2929 struct
2931 unsigned CCP2IE : 1;
2932 unsigned TMR3IE : 1;
2933 unsigned : 1;
2934 unsigned BCL1IE : 1;
2935 unsigned : 1;
2936 unsigned ETHIE : 1;
2937 unsigned CMIE : 1;
2938 unsigned OSCFIE : 1;
2941 struct
2943 unsigned : 1;
2944 unsigned : 1;
2945 unsigned : 1;
2946 unsigned BCLIE : 1;
2947 unsigned : 1;
2948 unsigned : 1;
2949 unsigned : 1;
2950 unsigned : 1;
2952 } __PIE2bits_t;
2954 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
2956 #define _CCP2IE 0x01
2957 #define _TMR3IE 0x02
2958 #define _BCL1IE 0x08
2959 #define _BCLIE 0x08
2960 #define _ETHIE 0x20
2961 #define _CMIE 0x40
2962 #define _OSCFIE 0x80
2964 //==============================================================================
2967 //==============================================================================
2968 // PIR2 Bits
2970 extern __at(0x0FA1) __sfr PIR2;
2972 typedef union
2974 struct
2976 unsigned CCP2IF : 1;
2977 unsigned TMR3IF : 1;
2978 unsigned : 1;
2979 unsigned BCL1IF : 1;
2980 unsigned : 1;
2981 unsigned ETHIF : 1;
2982 unsigned CMIF : 1;
2983 unsigned OSCFIF : 1;
2986 struct
2988 unsigned : 1;
2989 unsigned : 1;
2990 unsigned : 1;
2991 unsigned BCLIF : 1;
2992 unsigned : 1;
2993 unsigned : 1;
2994 unsigned : 1;
2995 unsigned : 1;
2997 } __PIR2bits_t;
2999 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3001 #define _CCP2IF 0x01
3002 #define _TMR3IF 0x02
3003 #define _BCL1IF 0x08
3004 #define _BCLIF 0x08
3005 #define _ETHIF 0x20
3006 #define _CMIF 0x40
3007 #define _OSCFIF 0x80
3009 //==============================================================================
3012 //==============================================================================
3013 // IPR2 Bits
3015 extern __at(0x0FA2) __sfr IPR2;
3017 typedef union
3019 struct
3021 unsigned CCP2IP : 1;
3022 unsigned TMR3IP : 1;
3023 unsigned : 1;
3024 unsigned BCL1IP : 1;
3025 unsigned : 1;
3026 unsigned ETHIP : 1;
3027 unsigned CMIP : 1;
3028 unsigned OSCFIP : 1;
3031 struct
3033 unsigned : 1;
3034 unsigned : 1;
3035 unsigned : 1;
3036 unsigned BCLIP : 1;
3037 unsigned : 1;
3038 unsigned : 1;
3039 unsigned : 1;
3040 unsigned : 1;
3042 } __IPR2bits_t;
3044 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3046 #define _CCP2IP 0x01
3047 #define _TMR3IP 0x02
3048 #define _BCL1IP 0x08
3049 #define _BCLIP 0x08
3050 #define _ETHIP 0x20
3051 #define _CMIP 0x40
3052 #define _OSCFIP 0x80
3054 //==============================================================================
3057 //==============================================================================
3058 // PIE3 Bits
3060 extern __at(0x0FA3) __sfr PIE3;
3062 typedef struct
3064 unsigned CCP3IE : 1;
3065 unsigned CCP4IE : 1;
3066 unsigned CCP5IE : 1;
3067 unsigned TMR4IE : 1;
3068 unsigned : 1;
3069 unsigned : 1;
3070 unsigned : 1;
3071 unsigned : 1;
3072 } __PIE3bits_t;
3074 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3076 #define _CCP3IE 0x01
3077 #define _CCP4IE 0x02
3078 #define _CCP5IE 0x04
3079 #define _TMR4IE 0x08
3081 //==============================================================================
3084 //==============================================================================
3085 // PIR3 Bits
3087 extern __at(0x0FA4) __sfr PIR3;
3089 typedef struct
3091 unsigned CCP3IF : 1;
3092 unsigned CCP4IF : 1;
3093 unsigned CCP5IF : 1;
3094 unsigned TMR4IF : 1;
3095 unsigned : 1;
3096 unsigned : 1;
3097 unsigned : 1;
3098 unsigned : 1;
3099 } __PIR3bits_t;
3101 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3103 #define _CCP3IF 0x01
3104 #define _CCP4IF 0x02
3105 #define _CCP5IF 0x04
3106 #define _TMR4IF 0x08
3108 //==============================================================================
3111 //==============================================================================
3112 // IPR3 Bits
3114 extern __at(0x0FA5) __sfr IPR3;
3116 typedef struct
3118 unsigned CCP3IP : 1;
3119 unsigned CCP4IP : 1;
3120 unsigned CCP5IP : 1;
3121 unsigned TMR4IP : 1;
3122 unsigned : 1;
3123 unsigned : 1;
3124 unsigned : 1;
3125 unsigned : 1;
3126 } __IPR3bits_t;
3128 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3130 #define _CCP3IP 0x01
3131 #define _CCP4IP 0x02
3132 #define _CCP5IP 0x04
3133 #define _TMR4IP 0x08
3135 //==============================================================================
3138 //==============================================================================
3139 // EECON1 Bits
3141 extern __at(0x0FA6) __sfr EECON1;
3143 typedef struct
3145 unsigned : 1;
3146 unsigned WR : 1;
3147 unsigned WREN : 1;
3148 unsigned WRERR : 1;
3149 unsigned FREE : 1;
3150 unsigned : 1;
3151 unsigned : 1;
3152 unsigned : 1;
3153 } __EECON1bits_t;
3155 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3157 #define _WR 0x02
3158 #define _WREN 0x04
3159 #define _WRERR 0x08
3160 #define _FREE 0x10
3162 //==============================================================================
3164 extern __at(0x0FA7) __sfr EECON2;
3166 //==============================================================================
3167 // RCSTA Bits
3169 extern __at(0x0FAB) __sfr RCSTA;
3171 typedef union
3173 struct
3175 unsigned RX9D : 1;
3176 unsigned OERR : 1;
3177 unsigned FERR : 1;
3178 unsigned ADDEN : 1;
3179 unsigned CREN : 1;
3180 unsigned SREN : 1;
3181 unsigned RX9 : 1;
3182 unsigned SPEN : 1;
3185 struct
3187 unsigned RCD8 : 1;
3188 unsigned OERR1 : 1;
3189 unsigned FERR1 : 1;
3190 unsigned ADDEN1 : 1;
3191 unsigned CREN1 : 1;
3192 unsigned SREN1 : 1;
3193 unsigned RC9 : 1;
3194 unsigned SPEN1 : 1;
3197 struct
3199 unsigned RX9D1 : 1;
3200 unsigned : 1;
3201 unsigned : 1;
3202 unsigned : 1;
3203 unsigned : 1;
3204 unsigned : 1;
3205 unsigned NOT_RC8 : 1;
3206 unsigned : 1;
3209 struct
3211 unsigned : 1;
3212 unsigned : 1;
3213 unsigned : 1;
3214 unsigned : 1;
3215 unsigned : 1;
3216 unsigned : 1;
3217 unsigned RC8_9 : 1;
3218 unsigned : 1;
3221 struct
3223 unsigned : 1;
3224 unsigned : 1;
3225 unsigned : 1;
3226 unsigned : 1;
3227 unsigned : 1;
3228 unsigned : 1;
3229 unsigned RX91 : 1;
3230 unsigned : 1;
3232 } __RCSTAbits_t;
3234 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
3236 #define _RX9D 0x01
3237 #define _RCD8 0x01
3238 #define _RX9D1 0x01
3239 #define _OERR 0x02
3240 #define _OERR1 0x02
3241 #define _FERR 0x04
3242 #define _FERR1 0x04
3243 #define _ADDEN 0x08
3244 #define _ADDEN1 0x08
3245 #define _CREN 0x10
3246 #define _CREN1 0x10
3247 #define _SREN 0x20
3248 #define _SREN1 0x20
3249 #define _RX9 0x40
3250 #define _RC9 0x40
3251 #define _NOT_RC8 0x40
3252 #define _RC8_9 0x40
3253 #define _RX91 0x40
3254 #define _SPEN 0x80
3255 #define _SPEN1 0x80
3257 //==============================================================================
3260 //==============================================================================
3261 // RCSTA1 Bits
3263 extern __at(0x0FAB) __sfr RCSTA1;
3265 typedef union
3267 struct
3269 unsigned RX9D : 1;
3270 unsigned OERR : 1;
3271 unsigned FERR : 1;
3272 unsigned ADDEN : 1;
3273 unsigned CREN : 1;
3274 unsigned SREN : 1;
3275 unsigned RX9 : 1;
3276 unsigned SPEN : 1;
3279 struct
3281 unsigned RCD8 : 1;
3282 unsigned OERR1 : 1;
3283 unsigned FERR1 : 1;
3284 unsigned ADDEN1 : 1;
3285 unsigned CREN1 : 1;
3286 unsigned SREN1 : 1;
3287 unsigned RC9 : 1;
3288 unsigned SPEN1 : 1;
3291 struct
3293 unsigned RX9D1 : 1;
3294 unsigned : 1;
3295 unsigned : 1;
3296 unsigned : 1;
3297 unsigned : 1;
3298 unsigned : 1;
3299 unsigned NOT_RC8 : 1;
3300 unsigned : 1;
3303 struct
3305 unsigned : 1;
3306 unsigned : 1;
3307 unsigned : 1;
3308 unsigned : 1;
3309 unsigned : 1;
3310 unsigned : 1;
3311 unsigned RC8_9 : 1;
3312 unsigned : 1;
3315 struct
3317 unsigned : 1;
3318 unsigned : 1;
3319 unsigned : 1;
3320 unsigned : 1;
3321 unsigned : 1;
3322 unsigned : 1;
3323 unsigned RX91 : 1;
3324 unsigned : 1;
3326 } __RCSTA1bits_t;
3328 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
3330 #define _RCSTA1_RX9D 0x01
3331 #define _RCSTA1_RCD8 0x01
3332 #define _RCSTA1_RX9D1 0x01
3333 #define _RCSTA1_OERR 0x02
3334 #define _RCSTA1_OERR1 0x02
3335 #define _RCSTA1_FERR 0x04
3336 #define _RCSTA1_FERR1 0x04
3337 #define _RCSTA1_ADDEN 0x08
3338 #define _RCSTA1_ADDEN1 0x08
3339 #define _RCSTA1_CREN 0x10
3340 #define _RCSTA1_CREN1 0x10
3341 #define _RCSTA1_SREN 0x20
3342 #define _RCSTA1_SREN1 0x20
3343 #define _RCSTA1_RX9 0x40
3344 #define _RCSTA1_RC9 0x40
3345 #define _RCSTA1_NOT_RC8 0x40
3346 #define _RCSTA1_RC8_9 0x40
3347 #define _RCSTA1_RX91 0x40
3348 #define _RCSTA1_SPEN 0x80
3349 #define _RCSTA1_SPEN1 0x80
3351 //==============================================================================
3354 //==============================================================================
3355 // TXSTA Bits
3357 extern __at(0x0FAC) __sfr TXSTA;
3359 typedef union
3361 struct
3363 unsigned TX9D : 1;
3364 unsigned TRMT : 1;
3365 unsigned BRGH : 1;
3366 unsigned SENDB : 1;
3367 unsigned SYNC : 1;
3368 unsigned TXEN : 1;
3369 unsigned TX9 : 1;
3370 unsigned CSRC : 1;
3373 struct
3375 unsigned TXD8 : 1;
3376 unsigned TRMT1 : 1;
3377 unsigned BRGH1 : 1;
3378 unsigned SENDB1 : 1;
3379 unsigned SYNC1 : 1;
3380 unsigned TXEN1 : 1;
3381 unsigned TX8_9 : 1;
3382 unsigned CSRC1 : 1;
3385 struct
3387 unsigned TX9D1 : 1;
3388 unsigned : 1;
3389 unsigned : 1;
3390 unsigned : 1;
3391 unsigned : 1;
3392 unsigned : 1;
3393 unsigned NOT_TX8 : 1;
3394 unsigned : 1;
3397 struct
3399 unsigned : 1;
3400 unsigned : 1;
3401 unsigned : 1;
3402 unsigned : 1;
3403 unsigned : 1;
3404 unsigned : 1;
3405 unsigned TX91 : 1;
3406 unsigned : 1;
3408 } __TXSTAbits_t;
3410 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
3412 #define _TX9D 0x01
3413 #define _TXD8 0x01
3414 #define _TX9D1 0x01
3415 #define _TRMT 0x02
3416 #define _TRMT1 0x02
3417 #define _BRGH 0x04
3418 #define _BRGH1 0x04
3419 #define _SENDB 0x08
3420 #define _SENDB1 0x08
3421 #define _SYNC 0x10
3422 #define _SYNC1 0x10
3423 #define _TXEN 0x20
3424 #define _TXEN1 0x20
3425 #define _TX9 0x40
3426 #define _TX8_9 0x40
3427 #define _NOT_TX8 0x40
3428 #define _TX91 0x40
3429 #define _CSRC 0x80
3430 #define _CSRC1 0x80
3432 //==============================================================================
3435 //==============================================================================
3436 // TXSTA1 Bits
3438 extern __at(0x0FAC) __sfr TXSTA1;
3440 typedef union
3442 struct
3444 unsigned TX9D : 1;
3445 unsigned TRMT : 1;
3446 unsigned BRGH : 1;
3447 unsigned SENDB : 1;
3448 unsigned SYNC : 1;
3449 unsigned TXEN : 1;
3450 unsigned TX9 : 1;
3451 unsigned CSRC : 1;
3454 struct
3456 unsigned TXD8 : 1;
3457 unsigned TRMT1 : 1;
3458 unsigned BRGH1 : 1;
3459 unsigned SENDB1 : 1;
3460 unsigned SYNC1 : 1;
3461 unsigned TXEN1 : 1;
3462 unsigned TX8_9 : 1;
3463 unsigned CSRC1 : 1;
3466 struct
3468 unsigned TX9D1 : 1;
3469 unsigned : 1;
3470 unsigned : 1;
3471 unsigned : 1;
3472 unsigned : 1;
3473 unsigned : 1;
3474 unsigned NOT_TX8 : 1;
3475 unsigned : 1;
3478 struct
3480 unsigned : 1;
3481 unsigned : 1;
3482 unsigned : 1;
3483 unsigned : 1;
3484 unsigned : 1;
3485 unsigned : 1;
3486 unsigned TX91 : 1;
3487 unsigned : 1;
3489 } __TXSTA1bits_t;
3491 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
3493 #define _TXSTA1_TX9D 0x01
3494 #define _TXSTA1_TXD8 0x01
3495 #define _TXSTA1_TX9D1 0x01
3496 #define _TXSTA1_TRMT 0x02
3497 #define _TXSTA1_TRMT1 0x02
3498 #define _TXSTA1_BRGH 0x04
3499 #define _TXSTA1_BRGH1 0x04
3500 #define _TXSTA1_SENDB 0x08
3501 #define _TXSTA1_SENDB1 0x08
3502 #define _TXSTA1_SYNC 0x10
3503 #define _TXSTA1_SYNC1 0x10
3504 #define _TXSTA1_TXEN 0x20
3505 #define _TXSTA1_TXEN1 0x20
3506 #define _TXSTA1_TX9 0x40
3507 #define _TXSTA1_TX8_9 0x40
3508 #define _TXSTA1_NOT_TX8 0x40
3509 #define _TXSTA1_TX91 0x40
3510 #define _TXSTA1_CSRC 0x80
3511 #define _TXSTA1_CSRC1 0x80
3513 //==============================================================================
3515 extern __at(0x0FAD) __sfr TXREG;
3516 extern __at(0x0FAD) __sfr TXREG1;
3517 extern __at(0x0FAE) __sfr RCREG;
3518 extern __at(0x0FAE) __sfr RCREG1;
3519 extern __at(0x0FAF) __sfr SPBRG;
3520 extern __at(0x0FAF) __sfr SPBRG1;
3522 //==============================================================================
3523 // T3CON Bits
3525 extern __at(0x0FB1) __sfr T3CON;
3527 typedef union
3529 struct
3531 unsigned TMR3ON : 1;
3532 unsigned TMR3CS : 1;
3533 unsigned NOT_T3SYNC : 1;
3534 unsigned T3CCP1 : 1;
3535 unsigned T3CKPS0 : 1;
3536 unsigned T3CKPS1 : 1;
3537 unsigned T3CCP2 : 1;
3538 unsigned RD16 : 1;
3541 struct
3543 unsigned : 1;
3544 unsigned : 1;
3545 unsigned T3SYNC : 1;
3546 unsigned : 1;
3547 unsigned : 1;
3548 unsigned : 1;
3549 unsigned : 1;
3550 unsigned : 1;
3553 struct
3555 unsigned : 1;
3556 unsigned : 1;
3557 unsigned T3INSYNC : 1;
3558 unsigned : 1;
3559 unsigned : 1;
3560 unsigned : 1;
3561 unsigned : 1;
3562 unsigned : 1;
3565 struct
3567 unsigned : 4;
3568 unsigned T3CKPS : 2;
3569 unsigned : 2;
3571 } __T3CONbits_t;
3573 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
3575 #define _T3CON_TMR3ON 0x01
3576 #define _T3CON_TMR3CS 0x02
3577 #define _T3CON_NOT_T3SYNC 0x04
3578 #define _T3CON_T3SYNC 0x04
3579 #define _T3CON_T3INSYNC 0x04
3580 #define _T3CON_T3CCP1 0x08
3581 #define _T3CON_T3CKPS0 0x10
3582 #define _T3CON_T3CKPS1 0x20
3583 #define _T3CON_T3CCP2 0x40
3584 #define _T3CON_RD16 0x80
3586 //==============================================================================
3588 extern __at(0x0FB2) __sfr TMR3;
3589 extern __at(0x0FB2) __sfr TMR3L;
3590 extern __at(0x0FB3) __sfr TMR3H;
3592 //==============================================================================
3593 // CMCON Bits
3595 extern __at(0x0FB4) __sfr CMCON;
3597 typedef union
3599 struct
3601 unsigned CM0 : 1;
3602 unsigned CM1 : 1;
3603 unsigned CM2 : 1;
3604 unsigned CIS : 1;
3605 unsigned C1INV : 1;
3606 unsigned C2INV : 1;
3607 unsigned C1OUT : 1;
3608 unsigned C2OUT : 1;
3611 struct
3613 unsigned CM : 3;
3614 unsigned : 5;
3616 } __CMCONbits_t;
3618 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
3620 #define _CM0 0x01
3621 #define _CM1 0x02
3622 #define _CM2 0x04
3623 #define _CIS 0x08
3624 #define _C1INV 0x10
3625 #define _C2INV 0x20
3626 #define _C1OUT 0x40
3627 #define _C2OUT 0x80
3629 //==============================================================================
3632 //==============================================================================
3633 // CVRCON Bits
3635 extern __at(0x0FB5) __sfr CVRCON;
3637 typedef union
3639 struct
3641 unsigned CVR0 : 1;
3642 unsigned CVR1 : 1;
3643 unsigned CVR2 : 1;
3644 unsigned CVR3 : 1;
3645 unsigned CVRSS : 1;
3646 unsigned CVRR : 1;
3647 unsigned CVROE : 1;
3648 unsigned CVREN : 1;
3651 struct
3653 unsigned CVR : 4;
3654 unsigned : 4;
3656 } __CVRCONbits_t;
3658 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
3660 #define _CVR0 0x01
3661 #define _CVR1 0x02
3662 #define _CVR2 0x04
3663 #define _CVR3 0x08
3664 #define _CVRSS 0x10
3665 #define _CVRR 0x20
3666 #define _CVROE 0x40
3667 #define _CVREN 0x80
3669 //==============================================================================
3672 //==============================================================================
3673 // ECCP1AS Bits
3675 extern __at(0x0FB6) __sfr ECCP1AS;
3677 typedef union
3679 struct
3681 unsigned PSSBD0 : 1;
3682 unsigned PSSBD1 : 1;
3683 unsigned PSSAC0 : 1;
3684 unsigned PSSAC1 : 1;
3685 unsigned ECCPAS0 : 1;
3686 unsigned ECCPAS1 : 1;
3687 unsigned ECCPAS2 : 1;
3688 unsigned ECCPASE : 1;
3691 struct
3693 unsigned PSS1BD0 : 1;
3694 unsigned PSS1BD1 : 1;
3695 unsigned PSS1AC0 : 1;
3696 unsigned PSS1AC1 : 1;
3697 unsigned ECCP1AS0 : 1;
3698 unsigned ECCP1AS1 : 1;
3699 unsigned ECCP1AS2 : 1;
3700 unsigned ECCP1ASE : 1;
3703 struct
3705 unsigned PSS1BD : 2;
3706 unsigned : 6;
3709 struct
3711 unsigned PSSBD : 2;
3712 unsigned : 6;
3715 struct
3717 unsigned : 2;
3718 unsigned PSSAC : 2;
3719 unsigned : 4;
3722 struct
3724 unsigned : 2;
3725 unsigned PSS1AC : 2;
3726 unsigned : 4;
3729 struct
3731 unsigned : 4;
3732 unsigned ECCPAS : 3;
3733 unsigned : 1;
3736 struct
3738 unsigned : 4;
3739 unsigned ECCP1AS : 3;
3740 unsigned : 1;
3742 } __ECCP1ASbits_t;
3744 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
3746 #define _PSSBD0 0x01
3747 #define _PSS1BD0 0x01
3748 #define _PSSBD1 0x02
3749 #define _PSS1BD1 0x02
3750 #define _PSSAC0 0x04
3751 #define _PSS1AC0 0x04
3752 #define _PSSAC1 0x08
3753 #define _PSS1AC1 0x08
3754 #define _ECCPAS0 0x10
3755 #define _ECCP1AS0 0x10
3756 #define _ECCPAS1 0x20
3757 #define _ECCP1AS1 0x20
3758 #define _ECCPAS2 0x40
3759 #define _ECCP1AS2 0x40
3760 #define _ECCPASE 0x80
3761 #define _ECCP1ASE 0x80
3763 //==============================================================================
3766 //==============================================================================
3767 // CCP3CON Bits
3769 extern __at(0x0FB7) __sfr CCP3CON;
3771 typedef union
3773 struct
3775 unsigned CCP3M0 : 1;
3776 unsigned CCP3M1 : 1;
3777 unsigned CCP3M2 : 1;
3778 unsigned CCP3M3 : 1;
3779 unsigned DC3B0 : 1;
3780 unsigned DC3B1 : 1;
3781 unsigned P3M0 : 1;
3782 unsigned P3M1 : 1;
3785 struct
3787 unsigned : 1;
3788 unsigned : 1;
3789 unsigned : 1;
3790 unsigned : 1;
3791 unsigned CCP3Y : 1;
3792 unsigned CCP3X : 1;
3793 unsigned : 1;
3794 unsigned : 1;
3797 struct
3799 unsigned CCP3M : 4;
3800 unsigned : 4;
3803 struct
3805 unsigned : 4;
3806 unsigned DC3B : 2;
3807 unsigned : 2;
3810 struct
3812 unsigned : 6;
3813 unsigned P3M : 2;
3815 } __CCP3CONbits_t;
3817 extern __at(0x0FB7) volatile __CCP3CONbits_t CCP3CONbits;
3819 #define _CCP3M0 0x01
3820 #define _CCP3M1 0x02
3821 #define _CCP3M2 0x04
3822 #define _CCP3M3 0x08
3823 #define _DC3B0 0x10
3824 #define _CCP3Y 0x10
3825 #define _DC3B1 0x20
3826 #define _CCP3X 0x20
3827 #define _P3M0 0x40
3828 #define _P3M1 0x80
3830 //==============================================================================
3833 //==============================================================================
3834 // ECCP3CON Bits
3836 extern __at(0x0FB7) __sfr ECCP3CON;
3838 typedef union
3840 struct
3842 unsigned CCP3M0 : 1;
3843 unsigned CCP3M1 : 1;
3844 unsigned CCP3M2 : 1;
3845 unsigned CCP3M3 : 1;
3846 unsigned DC3B0 : 1;
3847 unsigned DC3B1 : 1;
3848 unsigned P3M0 : 1;
3849 unsigned P3M1 : 1;
3852 struct
3854 unsigned : 1;
3855 unsigned : 1;
3856 unsigned : 1;
3857 unsigned : 1;
3858 unsigned CCP3Y : 1;
3859 unsigned CCP3X : 1;
3860 unsigned : 1;
3861 unsigned : 1;
3864 struct
3866 unsigned CCP3M : 4;
3867 unsigned : 4;
3870 struct
3872 unsigned : 4;
3873 unsigned DC3B : 2;
3874 unsigned : 2;
3877 struct
3879 unsigned : 6;
3880 unsigned P3M : 2;
3882 } __ECCP3CONbits_t;
3884 extern __at(0x0FB7) volatile __ECCP3CONbits_t ECCP3CONbits;
3886 #define _ECCP3CON_CCP3M0 0x01
3887 #define _ECCP3CON_CCP3M1 0x02
3888 #define _ECCP3CON_CCP3M2 0x04
3889 #define _ECCP3CON_CCP3M3 0x08
3890 #define _ECCP3CON_DC3B0 0x10
3891 #define _ECCP3CON_CCP3Y 0x10
3892 #define _ECCP3CON_DC3B1 0x20
3893 #define _ECCP3CON_CCP3X 0x20
3894 #define _ECCP3CON_P3M0 0x40
3895 #define _ECCP3CON_P3M1 0x80
3897 //==============================================================================
3899 extern __at(0x0FB8) __sfr CCPR3;
3900 extern __at(0x0FB8) __sfr CCPR3L;
3901 extern __at(0x0FB9) __sfr CCPR3H;
3903 //==============================================================================
3904 // CCP2CON Bits
3906 extern __at(0x0FBA) __sfr CCP2CON;
3908 typedef union
3910 struct
3912 unsigned CCP2M0 : 1;
3913 unsigned CCP2M1 : 1;
3914 unsigned CCP2M2 : 1;
3915 unsigned CCP2M3 : 1;
3916 unsigned DC2B0 : 1;
3917 unsigned DC2B1 : 1;
3918 unsigned P2M0 : 1;
3919 unsigned P2M1 : 1;
3922 struct
3924 unsigned : 1;
3925 unsigned : 1;
3926 unsigned : 1;
3927 unsigned : 1;
3928 unsigned CCP2Y : 1;
3929 unsigned CCP2X : 1;
3930 unsigned : 1;
3931 unsigned : 1;
3934 struct
3936 unsigned CCP2M : 4;
3937 unsigned : 4;
3940 struct
3942 unsigned : 4;
3943 unsigned DC2B : 2;
3944 unsigned : 2;
3947 struct
3949 unsigned : 6;
3950 unsigned P2M : 2;
3952 } __CCP2CONbits_t;
3954 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
3956 #define _CCP2M0 0x01
3957 #define _CCP2M1 0x02
3958 #define _CCP2M2 0x04
3959 #define _CCP2M3 0x08
3960 #define _DC2B0 0x10
3961 #define _CCP2Y 0x10
3962 #define _DC2B1 0x20
3963 #define _CCP2X 0x20
3964 #define _P2M0 0x40
3965 #define _P2M1 0x80
3967 //==============================================================================
3970 //==============================================================================
3971 // ECCP2CON Bits
3973 extern __at(0x0FBA) __sfr ECCP2CON;
3975 typedef union
3977 struct
3979 unsigned CCP2M0 : 1;
3980 unsigned CCP2M1 : 1;
3981 unsigned CCP2M2 : 1;
3982 unsigned CCP2M3 : 1;
3983 unsigned DC2B0 : 1;
3984 unsigned DC2B1 : 1;
3985 unsigned P2M0 : 1;
3986 unsigned P2M1 : 1;
3989 struct
3991 unsigned : 1;
3992 unsigned : 1;
3993 unsigned : 1;
3994 unsigned : 1;
3995 unsigned CCP2Y : 1;
3996 unsigned CCP2X : 1;
3997 unsigned : 1;
3998 unsigned : 1;
4001 struct
4003 unsigned CCP2M : 4;
4004 unsigned : 4;
4007 struct
4009 unsigned : 4;
4010 unsigned DC2B : 2;
4011 unsigned : 2;
4014 struct
4016 unsigned : 6;
4017 unsigned P2M : 2;
4019 } __ECCP2CONbits_t;
4021 extern __at(0x0FBA) volatile __ECCP2CONbits_t ECCP2CONbits;
4023 #define _ECCP2CON_CCP2M0 0x01
4024 #define _ECCP2CON_CCP2M1 0x02
4025 #define _ECCP2CON_CCP2M2 0x04
4026 #define _ECCP2CON_CCP2M3 0x08
4027 #define _ECCP2CON_DC2B0 0x10
4028 #define _ECCP2CON_CCP2Y 0x10
4029 #define _ECCP2CON_DC2B1 0x20
4030 #define _ECCP2CON_CCP2X 0x20
4031 #define _ECCP2CON_P2M0 0x40
4032 #define _ECCP2CON_P2M1 0x80
4034 //==============================================================================
4036 extern __at(0x0FBB) __sfr CCPR2;
4037 extern __at(0x0FBB) __sfr CCPR2L;
4038 extern __at(0x0FBC) __sfr CCPR2H;
4040 //==============================================================================
4041 // CCP1CON Bits
4043 extern __at(0x0FBD) __sfr CCP1CON;
4045 typedef union
4047 struct
4049 unsigned CCP1M0 : 1;
4050 unsigned CCP1M1 : 1;
4051 unsigned CCP1M2 : 1;
4052 unsigned CCP1M3 : 1;
4053 unsigned DC1B0 : 1;
4054 unsigned DC1B1 : 1;
4055 unsigned P1M0 : 1;
4056 unsigned P1M1 : 1;
4059 struct
4061 unsigned : 1;
4062 unsigned : 1;
4063 unsigned : 1;
4064 unsigned : 1;
4065 unsigned CCP1Y : 1;
4066 unsigned CCP1X : 1;
4067 unsigned : 1;
4068 unsigned : 1;
4071 struct
4073 unsigned CCP1M : 4;
4074 unsigned : 4;
4077 struct
4079 unsigned : 4;
4080 unsigned DC1B : 2;
4081 unsigned : 2;
4084 struct
4086 unsigned : 6;
4087 unsigned P1M : 2;
4089 } __CCP1CONbits_t;
4091 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
4093 #define _CCP1M0 0x01
4094 #define _CCP1M1 0x02
4095 #define _CCP1M2 0x04
4096 #define _CCP1M3 0x08
4097 #define _DC1B0 0x10
4098 #define _CCP1Y 0x10
4099 #define _DC1B1 0x20
4100 #define _CCP1X 0x20
4101 #define _P1M0 0x40
4102 #define _P1M1 0x80
4104 //==============================================================================
4107 //==============================================================================
4108 // ECCP1CON Bits
4110 extern __at(0x0FBD) __sfr ECCP1CON;
4112 typedef union
4114 struct
4116 unsigned CCP1M0 : 1;
4117 unsigned CCP1M1 : 1;
4118 unsigned CCP1M2 : 1;
4119 unsigned CCP1M3 : 1;
4120 unsigned DC1B0 : 1;
4121 unsigned DC1B1 : 1;
4122 unsigned P1M0 : 1;
4123 unsigned P1M1 : 1;
4126 struct
4128 unsigned : 1;
4129 unsigned : 1;
4130 unsigned : 1;
4131 unsigned : 1;
4132 unsigned CCP1Y : 1;
4133 unsigned CCP1X : 1;
4134 unsigned : 1;
4135 unsigned : 1;
4138 struct
4140 unsigned CCP1M : 4;
4141 unsigned : 4;
4144 struct
4146 unsigned : 4;
4147 unsigned DC1B : 2;
4148 unsigned : 2;
4151 struct
4153 unsigned : 6;
4154 unsigned P1M : 2;
4156 } __ECCP1CONbits_t;
4158 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits;
4160 #define _ECCP1CON_CCP1M0 0x01
4161 #define _ECCP1CON_CCP1M1 0x02
4162 #define _ECCP1CON_CCP1M2 0x04
4163 #define _ECCP1CON_CCP1M3 0x08
4164 #define _ECCP1CON_DC1B0 0x10
4165 #define _ECCP1CON_CCP1Y 0x10
4166 #define _ECCP1CON_DC1B1 0x20
4167 #define _ECCP1CON_CCP1X 0x20
4168 #define _ECCP1CON_P1M0 0x40
4169 #define _ECCP1CON_P1M1 0x80
4171 //==============================================================================
4173 extern __at(0x0FBE) __sfr CCPR1;
4174 extern __at(0x0FBE) __sfr CCPR1L;
4175 extern __at(0x0FBF) __sfr CCPR1H;
4177 //==============================================================================
4178 // ADCON2 Bits
4180 extern __at(0x0FC0) __sfr ADCON2;
4182 typedef union
4184 struct
4186 unsigned ADCS0 : 1;
4187 unsigned ADCS1 : 1;
4188 unsigned ADCS2 : 1;
4189 unsigned ACQT0 : 1;
4190 unsigned ACQT1 : 1;
4191 unsigned ACQT2 : 1;
4192 unsigned : 1;
4193 unsigned ADFM : 1;
4196 struct
4198 unsigned ADCS : 3;
4199 unsigned : 5;
4202 struct
4204 unsigned : 3;
4205 unsigned ACQT : 3;
4206 unsigned : 2;
4208 } __ADCON2bits_t;
4210 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4212 #define _ADCS0 0x01
4213 #define _ADCS1 0x02
4214 #define _ADCS2 0x04
4215 #define _ACQT0 0x08
4216 #define _ACQT1 0x10
4217 #define _ACQT2 0x20
4218 #define _ADFM 0x80
4220 //==============================================================================
4223 //==============================================================================
4224 // ADCON1 Bits
4226 extern __at(0x0FC1) __sfr ADCON1;
4228 typedef union
4230 struct
4232 unsigned PCFG0 : 1;
4233 unsigned PCFG1 : 1;
4234 unsigned PCFG2 : 1;
4235 unsigned PCFG3 : 1;
4236 unsigned VCFG0 : 1;
4237 unsigned VCFG1 : 1;
4238 unsigned : 1;
4239 unsigned : 1;
4242 struct
4244 unsigned PCFG : 4;
4245 unsigned : 4;
4248 struct
4250 unsigned : 4;
4251 unsigned VCFG : 2;
4252 unsigned : 2;
4254 } __ADCON1bits_t;
4256 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4258 #define _PCFG0 0x01
4259 #define _PCFG1 0x02
4260 #define _PCFG2 0x04
4261 #define _PCFG3 0x08
4262 #define _VCFG0 0x10
4263 #define _VCFG1 0x20
4265 //==============================================================================
4268 //==============================================================================
4269 // ADCON0 Bits
4271 extern __at(0x0FC2) __sfr ADCON0;
4273 typedef union
4275 struct
4277 unsigned ADON : 1;
4278 unsigned GO_NOT_DONE : 1;
4279 unsigned CHS0 : 1;
4280 unsigned CHS1 : 1;
4281 unsigned CHS2 : 1;
4282 unsigned CHS3 : 1;
4283 unsigned : 1;
4284 unsigned ADCAL : 1;
4287 struct
4289 unsigned : 1;
4290 unsigned DONE : 1;
4291 unsigned : 1;
4292 unsigned : 1;
4293 unsigned : 1;
4294 unsigned : 1;
4295 unsigned : 1;
4296 unsigned : 1;
4299 struct
4301 unsigned : 1;
4302 unsigned GO_DONE : 1;
4303 unsigned : 1;
4304 unsigned : 1;
4305 unsigned : 1;
4306 unsigned : 1;
4307 unsigned : 1;
4308 unsigned : 1;
4311 struct
4313 unsigned : 1;
4314 unsigned GO : 1;
4315 unsigned : 1;
4316 unsigned : 1;
4317 unsigned : 1;
4318 unsigned : 1;
4319 unsigned : 1;
4320 unsigned : 1;
4323 struct
4325 unsigned : 1;
4326 unsigned NOT_DONE : 1;
4327 unsigned : 1;
4328 unsigned : 1;
4329 unsigned : 1;
4330 unsigned : 1;
4331 unsigned : 1;
4332 unsigned : 1;
4335 struct
4337 unsigned : 2;
4338 unsigned CHS : 4;
4339 unsigned : 2;
4341 } __ADCON0bits_t;
4343 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4345 #define _ADON 0x01
4346 #define _GO_NOT_DONE 0x02
4347 #define _DONE 0x02
4348 #define _GO_DONE 0x02
4349 #define _GO 0x02
4350 #define _NOT_DONE 0x02
4351 #define _CHS0 0x04
4352 #define _CHS1 0x08
4353 #define _CHS2 0x10
4354 #define _CHS3 0x20
4355 #define _ADCAL 0x80
4357 //==============================================================================
4359 extern __at(0x0FC3) __sfr ADRES;
4360 extern __at(0x0FC3) __sfr ADRESL;
4361 extern __at(0x0FC4) __sfr ADRESH;
4363 //==============================================================================
4364 // SSP1CON2 Bits
4366 extern __at(0x0FC5) __sfr SSP1CON2;
4368 typedef union
4370 struct
4372 unsigned SEN : 1;
4373 unsigned RSEN : 1;
4374 unsigned PEN : 1;
4375 unsigned RCEN : 1;
4376 unsigned ACKEN : 1;
4377 unsigned ACKDT : 1;
4378 unsigned ACKSTAT : 1;
4379 unsigned GCEN : 1;
4382 struct
4384 unsigned : 1;
4385 unsigned ADMSK1 : 1;
4386 unsigned ADMSK2 : 1;
4387 unsigned ADMSK3 : 1;
4388 unsigned ADMSK4 : 1;
4389 unsigned ADMSK5 : 1;
4390 unsigned : 1;
4391 unsigned : 1;
4393 } __SSP1CON2bits_t;
4395 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
4397 #define _SEN 0x01
4398 #define _RSEN 0x02
4399 #define _ADMSK1 0x02
4400 #define _PEN 0x04
4401 #define _ADMSK2 0x04
4402 #define _RCEN 0x08
4403 #define _ADMSK3 0x08
4404 #define _ACKEN 0x10
4405 #define _ADMSK4 0x10
4406 #define _ACKDT 0x20
4407 #define _ADMSK5 0x20
4408 #define _ACKSTAT 0x40
4409 #define _GCEN 0x80
4411 //==============================================================================
4414 //==============================================================================
4415 // SSPCON2 Bits
4417 extern __at(0x0FC5) __sfr SSPCON2;
4419 typedef union
4421 struct
4423 unsigned SEN : 1;
4424 unsigned RSEN : 1;
4425 unsigned PEN : 1;
4426 unsigned RCEN : 1;
4427 unsigned ACKEN : 1;
4428 unsigned ACKDT : 1;
4429 unsigned ACKSTAT : 1;
4430 unsigned GCEN : 1;
4433 struct
4435 unsigned : 1;
4436 unsigned ADMSK1 : 1;
4437 unsigned ADMSK2 : 1;
4438 unsigned ADMSK3 : 1;
4439 unsigned ADMSK4 : 1;
4440 unsigned ADMSK5 : 1;
4441 unsigned : 1;
4442 unsigned : 1;
4444 } __SSPCON2bits_t;
4446 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4448 #define _SSPCON2_SEN 0x01
4449 #define _SSPCON2_RSEN 0x02
4450 #define _SSPCON2_ADMSK1 0x02
4451 #define _SSPCON2_PEN 0x04
4452 #define _SSPCON2_ADMSK2 0x04
4453 #define _SSPCON2_RCEN 0x08
4454 #define _SSPCON2_ADMSK3 0x08
4455 #define _SSPCON2_ACKEN 0x10
4456 #define _SSPCON2_ADMSK4 0x10
4457 #define _SSPCON2_ACKDT 0x20
4458 #define _SSPCON2_ADMSK5 0x20
4459 #define _SSPCON2_ACKSTAT 0x40
4460 #define _SSPCON2_GCEN 0x80
4462 //==============================================================================
4465 //==============================================================================
4466 // SSP1CON1 Bits
4468 extern __at(0x0FC6) __sfr SSP1CON1;
4470 typedef union
4472 struct
4474 unsigned SSPM0 : 1;
4475 unsigned SSPM1 : 1;
4476 unsigned SSPM2 : 1;
4477 unsigned SSPM3 : 1;
4478 unsigned CKP : 1;
4479 unsigned SSPEN : 1;
4480 unsigned SSPOV : 1;
4481 unsigned WCOL : 1;
4484 struct
4486 unsigned SSPM : 4;
4487 unsigned : 4;
4489 } __SSP1CON1bits_t;
4491 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
4493 #define _SSPM0 0x01
4494 #define _SSPM1 0x02
4495 #define _SSPM2 0x04
4496 #define _SSPM3 0x08
4497 #define _CKP 0x10
4498 #define _SSPEN 0x20
4499 #define _SSPOV 0x40
4500 #define _WCOL 0x80
4502 //==============================================================================
4505 //==============================================================================
4506 // SSPCON1 Bits
4508 extern __at(0x0FC6) __sfr SSPCON1;
4510 typedef union
4512 struct
4514 unsigned SSPM0 : 1;
4515 unsigned SSPM1 : 1;
4516 unsigned SSPM2 : 1;
4517 unsigned SSPM3 : 1;
4518 unsigned CKP : 1;
4519 unsigned SSPEN : 1;
4520 unsigned SSPOV : 1;
4521 unsigned WCOL : 1;
4524 struct
4526 unsigned SSPM : 4;
4527 unsigned : 4;
4529 } __SSPCON1bits_t;
4531 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4533 #define _SSPCON1_SSPM0 0x01
4534 #define _SSPCON1_SSPM1 0x02
4535 #define _SSPCON1_SSPM2 0x04
4536 #define _SSPCON1_SSPM3 0x08
4537 #define _SSPCON1_CKP 0x10
4538 #define _SSPCON1_SSPEN 0x20
4539 #define _SSPCON1_SSPOV 0x40
4540 #define _SSPCON1_WCOL 0x80
4542 //==============================================================================
4545 //==============================================================================
4546 // SSP1STAT Bits
4548 extern __at(0x0FC7) __sfr SSP1STAT;
4550 typedef union
4552 struct
4554 unsigned BF : 1;
4555 unsigned UA : 1;
4556 unsigned R_NOT_W : 1;
4557 unsigned S : 1;
4558 unsigned P : 1;
4559 unsigned D_NOT_A : 1;
4560 unsigned CKE : 1;
4561 unsigned SMP : 1;
4564 struct
4566 unsigned : 1;
4567 unsigned : 1;
4568 unsigned R_W : 1;
4569 unsigned I2C_START : 1;
4570 unsigned I2C_STOP : 1;
4571 unsigned D_A : 1;
4572 unsigned : 1;
4573 unsigned : 1;
4576 struct
4578 unsigned : 1;
4579 unsigned : 1;
4580 unsigned I2C_READ : 1;
4581 unsigned : 1;
4582 unsigned : 1;
4583 unsigned I2C_DAT : 1;
4584 unsigned : 1;
4585 unsigned : 1;
4588 struct
4590 unsigned : 1;
4591 unsigned : 1;
4592 unsigned NOT_W : 1;
4593 unsigned : 1;
4594 unsigned : 1;
4595 unsigned NOT_A : 1;
4596 unsigned : 1;
4597 unsigned : 1;
4600 struct
4602 unsigned : 1;
4603 unsigned : 1;
4604 unsigned NOT_WRITE : 1;
4605 unsigned : 1;
4606 unsigned : 1;
4607 unsigned NOT_ADDRESS : 1;
4608 unsigned : 1;
4609 unsigned : 1;
4612 struct
4614 unsigned : 1;
4615 unsigned : 1;
4616 unsigned READ_WRITE : 1;
4617 unsigned : 1;
4618 unsigned : 1;
4619 unsigned DATA_ADDRESS : 1;
4620 unsigned : 1;
4621 unsigned : 1;
4624 struct
4626 unsigned : 1;
4627 unsigned : 1;
4628 unsigned R : 1;
4629 unsigned : 1;
4630 unsigned : 1;
4631 unsigned D : 1;
4632 unsigned : 1;
4633 unsigned : 1;
4635 } __SSP1STATbits_t;
4637 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
4639 #define _BF 0x01
4640 #define _UA 0x02
4641 #define _R_NOT_W 0x04
4642 #define _R_W 0x04
4643 #define _I2C_READ 0x04
4644 #define _NOT_W 0x04
4645 #define _NOT_WRITE 0x04
4646 #define _READ_WRITE 0x04
4647 #define _R 0x04
4648 #define _S 0x08
4649 #define _I2C_START 0x08
4650 #define _P 0x10
4651 #define _I2C_STOP 0x10
4652 #define _D_NOT_A 0x20
4653 #define _D_A 0x20
4654 #define _I2C_DAT 0x20
4655 #define _NOT_A 0x20
4656 #define _NOT_ADDRESS 0x20
4657 #define _DATA_ADDRESS 0x20
4658 #define _D 0x20
4659 #define _CKE 0x40
4660 #define _SMP 0x80
4662 //==============================================================================
4665 //==============================================================================
4666 // SSPSTAT Bits
4668 extern __at(0x0FC7) __sfr SSPSTAT;
4670 typedef union
4672 struct
4674 unsigned BF : 1;
4675 unsigned UA : 1;
4676 unsigned R_NOT_W : 1;
4677 unsigned S : 1;
4678 unsigned P : 1;
4679 unsigned D_NOT_A : 1;
4680 unsigned CKE : 1;
4681 unsigned SMP : 1;
4684 struct
4686 unsigned : 1;
4687 unsigned : 1;
4688 unsigned R_W : 1;
4689 unsigned I2C_START : 1;
4690 unsigned I2C_STOP : 1;
4691 unsigned D_A : 1;
4692 unsigned : 1;
4693 unsigned : 1;
4696 struct
4698 unsigned : 1;
4699 unsigned : 1;
4700 unsigned I2C_READ : 1;
4701 unsigned : 1;
4702 unsigned : 1;
4703 unsigned I2C_DAT : 1;
4704 unsigned : 1;
4705 unsigned : 1;
4708 struct
4710 unsigned : 1;
4711 unsigned : 1;
4712 unsigned NOT_W : 1;
4713 unsigned : 1;
4714 unsigned : 1;
4715 unsigned NOT_A : 1;
4716 unsigned : 1;
4717 unsigned : 1;
4720 struct
4722 unsigned : 1;
4723 unsigned : 1;
4724 unsigned NOT_WRITE : 1;
4725 unsigned : 1;
4726 unsigned : 1;
4727 unsigned NOT_ADDRESS : 1;
4728 unsigned : 1;
4729 unsigned : 1;
4732 struct
4734 unsigned : 1;
4735 unsigned : 1;
4736 unsigned READ_WRITE : 1;
4737 unsigned : 1;
4738 unsigned : 1;
4739 unsigned DATA_ADDRESS : 1;
4740 unsigned : 1;
4741 unsigned : 1;
4744 struct
4746 unsigned : 1;
4747 unsigned : 1;
4748 unsigned R : 1;
4749 unsigned : 1;
4750 unsigned : 1;
4751 unsigned D : 1;
4752 unsigned : 1;
4753 unsigned : 1;
4755 } __SSPSTATbits_t;
4757 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
4759 #define _SSPSTAT_BF 0x01
4760 #define _SSPSTAT_UA 0x02
4761 #define _SSPSTAT_R_NOT_W 0x04
4762 #define _SSPSTAT_R_W 0x04
4763 #define _SSPSTAT_I2C_READ 0x04
4764 #define _SSPSTAT_NOT_W 0x04
4765 #define _SSPSTAT_NOT_WRITE 0x04
4766 #define _SSPSTAT_READ_WRITE 0x04
4767 #define _SSPSTAT_R 0x04
4768 #define _SSPSTAT_S 0x08
4769 #define _SSPSTAT_I2C_START 0x08
4770 #define _SSPSTAT_P 0x10
4771 #define _SSPSTAT_I2C_STOP 0x10
4772 #define _SSPSTAT_D_NOT_A 0x20
4773 #define _SSPSTAT_D_A 0x20
4774 #define _SSPSTAT_I2C_DAT 0x20
4775 #define _SSPSTAT_NOT_A 0x20
4776 #define _SSPSTAT_NOT_ADDRESS 0x20
4777 #define _SSPSTAT_DATA_ADDRESS 0x20
4778 #define _SSPSTAT_D 0x20
4779 #define _SSPSTAT_CKE 0x40
4780 #define _SSPSTAT_SMP 0x80
4782 //==============================================================================
4784 extern __at(0x0FC8) __sfr SSP1ADD;
4785 extern __at(0x0FC8) __sfr SSPADD;
4786 extern __at(0x0FC9) __sfr SSP1BUF;
4787 extern __at(0x0FC9) __sfr SSPBUF;
4789 //==============================================================================
4790 // T2CON Bits
4792 extern __at(0x0FCA) __sfr T2CON;
4794 typedef union
4796 struct
4798 unsigned T2CKPS0 : 1;
4799 unsigned T2CKPS1 : 1;
4800 unsigned TMR2ON : 1;
4801 unsigned T2OUTPS0 : 1;
4802 unsigned T2OUTPS1 : 1;
4803 unsigned T2OUTPS2 : 1;
4804 unsigned T2OUTPS3 : 1;
4805 unsigned : 1;
4808 struct
4810 unsigned T2CKPS : 2;
4811 unsigned : 6;
4814 struct
4816 unsigned : 3;
4817 unsigned T2OUTPS : 4;
4818 unsigned : 1;
4820 } __T2CONbits_t;
4822 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
4824 #define _T2CKPS0 0x01
4825 #define _T2CKPS1 0x02
4826 #define _TMR2ON 0x04
4827 #define _T2OUTPS0 0x08
4828 #define _T2OUTPS1 0x10
4829 #define _T2OUTPS2 0x20
4830 #define _T2OUTPS3 0x40
4832 //==============================================================================
4834 extern __at(0x0FCB) __sfr PR2;
4835 extern __at(0x0FCC) __sfr TMR2;
4837 //==============================================================================
4838 // T1CON Bits
4840 extern __at(0x0FCD) __sfr T1CON;
4842 typedef union
4844 struct
4846 unsigned TMR1ON : 1;
4847 unsigned TMR1CS : 1;
4848 unsigned NOT_T1SYNC : 1;
4849 unsigned T1OSCEN : 1;
4850 unsigned T1CKPS0 : 1;
4851 unsigned T1CKPS1 : 1;
4852 unsigned T1RUN : 1;
4853 unsigned RD16 : 1;
4856 struct
4858 unsigned : 1;
4859 unsigned : 1;
4860 unsigned T1SYNC : 1;
4861 unsigned : 1;
4862 unsigned : 1;
4863 unsigned : 1;
4864 unsigned : 1;
4865 unsigned : 1;
4868 struct
4870 unsigned : 1;
4871 unsigned : 1;
4872 unsigned T1INSYNC : 1;
4873 unsigned : 1;
4874 unsigned : 1;
4875 unsigned : 1;
4876 unsigned : 1;
4877 unsigned : 1;
4880 struct
4882 unsigned : 4;
4883 unsigned T1CKPS : 2;
4884 unsigned : 2;
4886 } __T1CONbits_t;
4888 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
4890 #define _TMR1ON 0x01
4891 #define _TMR1CS 0x02
4892 #define _NOT_T1SYNC 0x04
4893 #define _T1SYNC 0x04
4894 #define _T1INSYNC 0x04
4895 #define _T1OSCEN 0x08
4896 #define _T1CKPS0 0x10
4897 #define _T1CKPS1 0x20
4898 #define _T1RUN 0x40
4899 #define _RD16 0x80
4901 //==============================================================================
4903 extern __at(0x0FCE) __sfr TMR1;
4904 extern __at(0x0FCE) __sfr TMR1L;
4905 extern __at(0x0FCF) __sfr TMR1H;
4907 //==============================================================================
4908 // RCON Bits
4910 extern __at(0x0FD0) __sfr RCON;
4912 typedef union
4914 struct
4916 unsigned NOT_BOR : 1;
4917 unsigned NOT_POR : 1;
4918 unsigned NOT_PD : 1;
4919 unsigned NOT_TO : 1;
4920 unsigned NOT_RI : 1;
4921 unsigned NOT_CM : 1;
4922 unsigned : 1;
4923 unsigned IPEN : 1;
4926 struct
4928 unsigned BOR : 1;
4929 unsigned POR : 1;
4930 unsigned PD : 1;
4931 unsigned TO : 1;
4932 unsigned RI : 1;
4933 unsigned CM : 1;
4934 unsigned : 1;
4935 unsigned : 1;
4937 } __RCONbits_t;
4939 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
4941 #define _NOT_BOR 0x01
4942 #define _BOR 0x01
4943 #define _NOT_POR 0x02
4944 #define _POR 0x02
4945 #define _NOT_PD 0x04
4946 #define _PD 0x04
4947 #define _NOT_TO 0x08
4948 #define _TO 0x08
4949 #define _NOT_RI 0x10
4950 #define _RI 0x10
4951 #define _NOT_CM 0x20
4952 #define _CM 0x20
4953 #define _IPEN 0x80
4955 //==============================================================================
4958 //==============================================================================
4959 // WDTCON Bits
4961 extern __at(0x0FD1) __sfr WDTCON;
4963 typedef union
4965 struct
4967 unsigned SWDTEN : 1;
4968 unsigned : 1;
4969 unsigned : 1;
4970 unsigned : 1;
4971 unsigned : 1;
4972 unsigned : 1;
4973 unsigned : 1;
4974 unsigned : 1;
4977 struct
4979 unsigned SWDTE : 1;
4980 unsigned : 1;
4981 unsigned : 1;
4982 unsigned : 1;
4983 unsigned : 1;
4984 unsigned : 1;
4985 unsigned : 1;
4986 unsigned : 1;
4988 } __WDTCONbits_t;
4990 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
4992 #define _SWDTEN 0x01
4993 #define _SWDTE 0x01
4995 //==============================================================================
4998 //==============================================================================
4999 // ECON1 Bits
5001 extern __at(0x0FD2) __sfr ECON1;
5003 typedef struct
5005 unsigned : 1;
5006 unsigned : 1;
5007 unsigned RXEN : 1;
5008 unsigned TXRTS : 1;
5009 unsigned CSUMEN : 1;
5010 unsigned DMAST : 1;
5011 unsigned RXRST : 1;
5012 unsigned TXRST : 1;
5013 } __ECON1bits_t;
5015 extern __at(0x0FD2) volatile __ECON1bits_t ECON1bits;
5017 #define _RXEN 0x04
5018 #define _TXRTS 0x08
5019 #define _CSUMEN 0x10
5020 #define _DMAST 0x20
5021 #define _RXRST 0x40
5022 #define _TXRST 0x80
5024 //==============================================================================
5027 //==============================================================================
5028 // OSCCON Bits
5030 extern __at(0x0FD3) __sfr OSCCON;
5032 typedef union
5034 struct
5036 unsigned SCS0 : 1;
5037 unsigned SCS1 : 1;
5038 unsigned : 1;
5039 unsigned OSTS : 1;
5040 unsigned : 1;
5041 unsigned : 1;
5042 unsigned : 1;
5043 unsigned IDLEN : 1;
5046 struct
5048 unsigned SCS : 2;
5049 unsigned : 6;
5051 } __OSCCONbits_t;
5053 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5055 #define _SCS0 0x01
5056 #define _SCS1 0x02
5057 #define _OSTS 0x08
5058 #define _IDLEN 0x80
5060 //==============================================================================
5063 //==============================================================================
5064 // T0CON Bits
5066 extern __at(0x0FD5) __sfr T0CON;
5068 typedef union
5070 struct
5072 unsigned T0PS0 : 1;
5073 unsigned T0PS1 : 1;
5074 unsigned T0PS2 : 1;
5075 unsigned PSA : 1;
5076 unsigned T0SE : 1;
5077 unsigned T0CS : 1;
5078 unsigned T08BIT : 1;
5079 unsigned TMR0ON : 1;
5082 struct
5084 unsigned T0PS : 3;
5085 unsigned : 5;
5087 } __T0CONbits_t;
5089 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5091 #define _T0PS0 0x01
5092 #define _T0PS1 0x02
5093 #define _T0PS2 0x04
5094 #define _PSA 0x08
5095 #define _T0SE 0x10
5096 #define _T0CS 0x20
5097 #define _T08BIT 0x40
5098 #define _TMR0ON 0x80
5100 //==============================================================================
5102 extern __at(0x0FD6) __sfr TMR0;
5103 extern __at(0x0FD6) __sfr TMR0L;
5104 extern __at(0x0FD7) __sfr TMR0H;
5106 //==============================================================================
5107 // STATUS Bits
5109 extern __at(0x0FD8) __sfr STATUS;
5111 typedef struct
5113 unsigned C : 1;
5114 unsigned DC : 1;
5115 unsigned Z : 1;
5116 unsigned OV : 1;
5117 unsigned N : 1;
5118 unsigned : 1;
5119 unsigned : 1;
5120 unsigned : 1;
5121 } __STATUSbits_t;
5123 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5125 #define _C 0x01
5126 #define _DC 0x02
5127 #define _Z 0x04
5128 #define _OV 0x08
5129 #define _N 0x10
5131 //==============================================================================
5133 extern __at(0x0FD9) __sfr FSR2L;
5134 extern __at(0x0FDA) __sfr FSR2H;
5135 extern __at(0x0FDB) __sfr PLUSW2;
5136 extern __at(0x0FDC) __sfr PREINC2;
5137 extern __at(0x0FDD) __sfr POSTDEC2;
5138 extern __at(0x0FDE) __sfr POSTINC2;
5139 extern __at(0x0FDF) __sfr INDF2;
5140 extern __at(0x0FE0) __sfr BSR;
5141 extern __at(0x0FE1) __sfr FSR1L;
5142 extern __at(0x0FE2) __sfr FSR1H;
5143 extern __at(0x0FE3) __sfr PLUSW1;
5144 extern __at(0x0FE4) __sfr PREINC1;
5145 extern __at(0x0FE5) __sfr POSTDEC1;
5146 extern __at(0x0FE6) __sfr POSTINC1;
5147 extern __at(0x0FE7) __sfr INDF1;
5148 extern __at(0x0FE8) __sfr WREG;
5149 extern __at(0x0FE9) __sfr FSR0L;
5150 extern __at(0x0FEA) __sfr FSR0H;
5151 extern __at(0x0FEB) __sfr PLUSW0;
5152 extern __at(0x0FEC) __sfr PREINC0;
5153 extern __at(0x0FED) __sfr POSTDEC0;
5154 extern __at(0x0FEE) __sfr POSTINC0;
5155 extern __at(0x0FEF) __sfr INDF0;
5157 //==============================================================================
5158 // INTCON3 Bits
5160 extern __at(0x0FF0) __sfr INTCON3;
5162 typedef union
5164 struct
5166 unsigned INT1IF : 1;
5167 unsigned INT2IF : 1;
5168 unsigned INT3IF : 1;
5169 unsigned INT1IE : 1;
5170 unsigned INT2IE : 1;
5171 unsigned INT3IE : 1;
5172 unsigned INT1IP : 1;
5173 unsigned INT2IP : 1;
5176 struct
5178 unsigned INT1F : 1;
5179 unsigned INT2F : 1;
5180 unsigned INT3F : 1;
5181 unsigned INT1E : 1;
5182 unsigned INT2E : 1;
5183 unsigned INT3E : 1;
5184 unsigned INT1P : 1;
5185 unsigned INT2P : 1;
5187 } __INTCON3bits_t;
5189 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5191 #define _INT1IF 0x01
5192 #define _INT1F 0x01
5193 #define _INT2IF 0x02
5194 #define _INT2F 0x02
5195 #define _INT3IF 0x04
5196 #define _INT3F 0x04
5197 #define _INT1IE 0x08
5198 #define _INT1E 0x08
5199 #define _INT2IE 0x10
5200 #define _INT2E 0x10
5201 #define _INT3IE 0x20
5202 #define _INT3E 0x20
5203 #define _INT1IP 0x40
5204 #define _INT1P 0x40
5205 #define _INT2IP 0x80
5206 #define _INT2P 0x80
5208 //==============================================================================
5211 //==============================================================================
5212 // INTCON2 Bits
5214 extern __at(0x0FF1) __sfr INTCON2;
5216 typedef union
5218 struct
5220 unsigned RBIP : 1;
5221 unsigned INT3IP : 1;
5222 unsigned TMR0IP : 1;
5223 unsigned INTEDG3 : 1;
5224 unsigned INTEDG2 : 1;
5225 unsigned INTEDG1 : 1;
5226 unsigned INTEDG0 : 1;
5227 unsigned NOT_RBPU : 1;
5230 struct
5232 unsigned : 1;
5233 unsigned : 1;
5234 unsigned T0IP : 1;
5235 unsigned : 1;
5236 unsigned : 1;
5237 unsigned : 1;
5238 unsigned : 1;
5239 unsigned RBPU : 1;
5241 } __INTCON2bits_t;
5243 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5245 #define _RBIP 0x01
5246 #define _INT3IP 0x02
5247 #define _TMR0IP 0x04
5248 #define _T0IP 0x04
5249 #define _INTEDG3 0x08
5250 #define _INTEDG2 0x10
5251 #define _INTEDG1 0x20
5252 #define _INTEDG0 0x40
5253 #define _NOT_RBPU 0x80
5254 #define _RBPU 0x80
5256 //==============================================================================
5259 //==============================================================================
5260 // INTCON Bits
5262 extern __at(0x0FF2) __sfr INTCON;
5264 typedef union
5266 struct
5268 unsigned RBIF : 1;
5269 unsigned INT0IF : 1;
5270 unsigned TMR0IF : 1;
5271 unsigned RBIE : 1;
5272 unsigned INT0IE : 1;
5273 unsigned TMR0IE : 1;
5274 unsigned PEIE_GIEL : 1;
5275 unsigned GIE_GIEH : 1;
5278 struct
5280 unsigned : 1;
5281 unsigned INT0F : 1;
5282 unsigned T0IF : 1;
5283 unsigned : 1;
5284 unsigned INT0E : 1;
5285 unsigned T0IE : 1;
5286 unsigned PEIE : 1;
5287 unsigned GIE : 1;
5290 struct
5292 unsigned : 1;
5293 unsigned : 1;
5294 unsigned : 1;
5295 unsigned : 1;
5296 unsigned : 1;
5297 unsigned : 1;
5298 unsigned GIEL : 1;
5299 unsigned GIEH : 1;
5301 } __INTCONbits_t;
5303 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
5305 #define _RBIF 0x01
5306 #define _INT0IF 0x02
5307 #define _INT0F 0x02
5308 #define _TMR0IF 0x04
5309 #define _T0IF 0x04
5310 #define _RBIE 0x08
5311 #define _INT0IE 0x10
5312 #define _INT0E 0x10
5313 #define _TMR0IE 0x20
5314 #define _T0IE 0x20
5315 #define _PEIE_GIEL 0x40
5316 #define _PEIE 0x40
5317 #define _GIEL 0x40
5318 #define _GIE_GIEH 0x80
5319 #define _GIE 0x80
5320 #define _GIEH 0x80
5322 //==============================================================================
5324 extern __at(0x0FF3) __sfr PROD;
5325 extern __at(0x0FF3) __sfr PRODL;
5326 extern __at(0x0FF4) __sfr PRODH;
5327 extern __at(0x0FF5) __sfr TABLAT;
5328 extern __at(0x0FF6) __sfr TBLPTR;
5329 extern __at(0x0FF6) __sfr TBLPTRL;
5330 extern __at(0x0FF7) __sfr TBLPTRH;
5331 extern __at(0x0FF8) __sfr TBLPTRU;
5332 extern __at(0x0FF9) __sfr PC;
5333 extern __at(0x0FF9) __sfr PCL;
5334 extern __at(0x0FFA) __sfr PCLATH;
5335 extern __at(0x0FFB) __sfr PCLATU;
5337 //==============================================================================
5338 // STKPTR Bits
5340 extern __at(0x0FFC) __sfr STKPTR;
5342 typedef union
5344 struct
5346 unsigned STKPTR0 : 1;
5347 unsigned STKPTR1 : 1;
5348 unsigned STKPTR2 : 1;
5349 unsigned STKPTR3 : 1;
5350 unsigned STKPTR4 : 1;
5351 unsigned : 1;
5352 unsigned STKUNF : 1;
5353 unsigned STKFUL : 1;
5356 struct
5358 unsigned SP0 : 1;
5359 unsigned SP1 : 1;
5360 unsigned SP2 : 1;
5361 unsigned SP3 : 1;
5362 unsigned SP4 : 1;
5363 unsigned : 1;
5364 unsigned : 1;
5365 unsigned STKOVF : 1;
5368 struct
5370 unsigned SP : 5;
5371 unsigned : 3;
5374 struct
5376 unsigned STKPTR : 5;
5377 unsigned : 3;
5379 } __STKPTRbits_t;
5381 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
5383 #define _STKPTR0 0x01
5384 #define _SP0 0x01
5385 #define _STKPTR1 0x02
5386 #define _SP1 0x02
5387 #define _STKPTR2 0x04
5388 #define _SP2 0x04
5389 #define _STKPTR3 0x08
5390 #define _SP3 0x08
5391 #define _STKPTR4 0x10
5392 #define _SP4 0x10
5393 #define _STKUNF 0x40
5394 #define _STKFUL 0x80
5395 #define _STKOVF 0x80
5397 //==============================================================================
5399 extern __at(0x0FFD) __sfr TOS;
5400 extern __at(0x0FFD) __sfr TOSL;
5401 extern __at(0x0FFE) __sfr TOSH;
5402 extern __at(0x0FFF) __sfr TOSU;
5404 //==============================================================================
5406 // Configuration Addresses
5408 //==============================================================================
5410 #define __CONFIG1L 0x017FF8
5411 #define __CONFIG1H 0x017FF9
5412 #define __CONFIG2L 0x017FFA
5413 #define __CONFIG2H 0x017FFB
5414 #define __CONFIG3L 0x017FFC
5415 #define __CONFIG3H 0x017FFD
5417 //==============================================================================
5419 #endif // #ifndef __PIC18F66J65_H__