struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f8527.h
blob8a213e1bf1c003bec3bb65e5cef16016d5f1281a
1 /*
2 * This declarations of the PIC18F8527 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:51 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 __PIC18F8527_H__
26 #define __PIC18F8527_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // SSP2CON2 Bits
40 extern __at(0x0F62) __sfr SSP2CON2;
42 typedef union
44 struct
46 unsigned SEN : 1;
47 unsigned RSEN : 1;
48 unsigned PEN : 1;
49 unsigned RCEN : 1;
50 unsigned ACKEN : 1;
51 unsigned ACKDT : 1;
52 unsigned ACKSTAT : 1;
53 unsigned GCEN : 1;
56 struct
58 unsigned SEN2 : 1;
59 unsigned RSEN2 : 1;
60 unsigned PEN2 : 1;
61 unsigned RCEN2 : 1;
62 unsigned ACKEN2 : 1;
63 unsigned ACKDT2 : 1;
64 unsigned ACKSTAT2 : 1;
65 unsigned GCEN2 : 1;
67 } __SSP2CON2bits_t;
69 extern __at(0x0F62) volatile __SSP2CON2bits_t SSP2CON2bits;
71 #define _SSP2CON2_SEN 0x01
72 #define _SSP2CON2_SEN2 0x01
73 #define _SSP2CON2_RSEN 0x02
74 #define _SSP2CON2_RSEN2 0x02
75 #define _SSP2CON2_PEN 0x04
76 #define _SSP2CON2_PEN2 0x04
77 #define _SSP2CON2_RCEN 0x08
78 #define _SSP2CON2_RCEN2 0x08
79 #define _SSP2CON2_ACKEN 0x10
80 #define _SSP2CON2_ACKEN2 0x10
81 #define _SSP2CON2_ACKDT 0x20
82 #define _SSP2CON2_ACKDT2 0x20
83 #define _SSP2CON2_ACKSTAT 0x40
84 #define _SSP2CON2_ACKSTAT2 0x40
85 #define _SSP2CON2_GCEN 0x80
86 #define _SSP2CON2_GCEN2 0x80
88 //==============================================================================
91 //==============================================================================
92 // SSP2CON1 Bits
94 extern __at(0x0F63) __sfr SSP2CON1;
96 typedef union
98 struct
100 unsigned SSPM0 : 1;
101 unsigned SSPM1 : 1;
102 unsigned SSPM2 : 1;
103 unsigned SSPM3 : 1;
104 unsigned CKP : 1;
105 unsigned SSPEN : 1;
106 unsigned SSPOV : 1;
107 unsigned WCOL : 1;
110 struct
112 unsigned SSPM02 : 1;
113 unsigned SSPM12 : 1;
114 unsigned SSPM22 : 1;
115 unsigned SSPM32 : 1;
116 unsigned CKP2 : 1;
117 unsigned SSPEN2 : 1;
118 unsigned SSPOV2 : 1;
119 unsigned WCOL2 : 1;
121 } __SSP2CON1bits_t;
123 extern __at(0x0F63) volatile __SSP2CON1bits_t SSP2CON1bits;
125 #define _SSP2CON1_SSPM0 0x01
126 #define _SSP2CON1_SSPM02 0x01
127 #define _SSP2CON1_SSPM1 0x02
128 #define _SSP2CON1_SSPM12 0x02
129 #define _SSP2CON1_SSPM2 0x04
130 #define _SSP2CON1_SSPM22 0x04
131 #define _SSP2CON1_SSPM3 0x08
132 #define _SSP2CON1_SSPM32 0x08
133 #define _SSP2CON1_CKP 0x10
134 #define _SSP2CON1_CKP2 0x10
135 #define _SSP2CON1_SSPEN 0x20
136 #define _SSP2CON1_SSPEN2 0x20
137 #define _SSP2CON1_SSPOV 0x40
138 #define _SSP2CON1_SSPOV2 0x40
139 #define _SSP2CON1_WCOL 0x80
140 #define _SSP2CON1_WCOL2 0x80
142 //==============================================================================
145 //==============================================================================
146 // SSP2STAT Bits
148 extern __at(0x0F64) __sfr SSP2STAT;
150 typedef union
152 struct
154 unsigned BF : 1;
155 unsigned UA : 1;
156 unsigned R_NOT_W : 1;
157 unsigned S : 1;
158 unsigned P : 1;
159 unsigned D_NOT_A : 1;
160 unsigned CKE : 1;
161 unsigned SMP : 1;
164 struct
166 unsigned BF2 : 1;
167 unsigned UA2 : 1;
168 unsigned R_W : 1;
169 unsigned I2C_START : 1;
170 unsigned I2C_STOP : 1;
171 unsigned D_A : 1;
172 unsigned CKE2 : 1;
173 unsigned SMP2 : 1;
176 struct
178 unsigned : 1;
179 unsigned : 1;
180 unsigned I2C_READ : 1;
181 unsigned START2 : 1;
182 unsigned STOP2 : 1;
183 unsigned I2C_DAT : 1;
184 unsigned : 1;
185 unsigned : 1;
188 struct
190 unsigned : 1;
191 unsigned : 1;
192 unsigned NOT_W : 1;
193 unsigned : 1;
194 unsigned : 1;
195 unsigned NOT_A : 1;
196 unsigned : 1;
197 unsigned : 1;
200 struct
202 unsigned : 1;
203 unsigned : 1;
204 unsigned NOT_WRITE : 1;
205 unsigned : 1;
206 unsigned : 1;
207 unsigned NOT_ADDRESS : 1;
208 unsigned : 1;
209 unsigned : 1;
212 struct
214 unsigned : 1;
215 unsigned : 1;
216 unsigned READ_WRITE : 1;
217 unsigned : 1;
218 unsigned : 1;
219 unsigned DATA_ADDRESS : 1;
220 unsigned : 1;
221 unsigned : 1;
224 struct
226 unsigned : 1;
227 unsigned : 1;
228 unsigned R : 1;
229 unsigned : 1;
230 unsigned : 1;
231 unsigned D : 1;
232 unsigned : 1;
233 unsigned : 1;
236 struct
238 unsigned : 1;
239 unsigned : 1;
240 unsigned RW2 : 1;
241 unsigned : 1;
242 unsigned : 1;
243 unsigned DA2 : 1;
244 unsigned : 1;
245 unsigned : 1;
247 } __SSP2STATbits_t;
249 extern __at(0x0F64) volatile __SSP2STATbits_t SSP2STATbits;
251 #define _SSP2STAT_BF 0x01
252 #define _SSP2STAT_BF2 0x01
253 #define _SSP2STAT_UA 0x02
254 #define _SSP2STAT_UA2 0x02
255 #define _SSP2STAT_R_NOT_W 0x04
256 #define _SSP2STAT_R_W 0x04
257 #define _SSP2STAT_I2C_READ 0x04
258 #define _SSP2STAT_NOT_W 0x04
259 #define _SSP2STAT_NOT_WRITE 0x04
260 #define _SSP2STAT_READ_WRITE 0x04
261 #define _SSP2STAT_R 0x04
262 #define _SSP2STAT_RW2 0x04
263 #define _SSP2STAT_S 0x08
264 #define _SSP2STAT_I2C_START 0x08
265 #define _SSP2STAT_START2 0x08
266 #define _SSP2STAT_P 0x10
267 #define _SSP2STAT_I2C_STOP 0x10
268 #define _SSP2STAT_STOP2 0x10
269 #define _SSP2STAT_D_NOT_A 0x20
270 #define _SSP2STAT_D_A 0x20
271 #define _SSP2STAT_I2C_DAT 0x20
272 #define _SSP2STAT_NOT_A 0x20
273 #define _SSP2STAT_NOT_ADDRESS 0x20
274 #define _SSP2STAT_DATA_ADDRESS 0x20
275 #define _SSP2STAT_D 0x20
276 #define _SSP2STAT_DA2 0x20
277 #define _SSP2STAT_CKE 0x40
278 #define _SSP2STAT_CKE2 0x40
279 #define _SSP2STAT_SMP 0x80
280 #define _SSP2STAT_SMP2 0x80
282 //==============================================================================
284 extern __at(0x0F65) __sfr SSP2ADD;
285 extern __at(0x0F66) __sfr SSP2BUF;
287 //==============================================================================
288 // ECCP2DEL Bits
290 extern __at(0x0F67) __sfr ECCP2DEL;
292 typedef union
294 struct
296 unsigned P2DC0 : 1;
297 unsigned P2DC1 : 1;
298 unsigned P2DC2 : 1;
299 unsigned P2DC3 : 1;
300 unsigned P2DC4 : 1;
301 unsigned P2DC5 : 1;
302 unsigned P2DC6 : 1;
303 unsigned P2RSEN : 1;
306 struct
308 unsigned PDC0 : 1;
309 unsigned PDC1 : 1;
310 unsigned PDC2 : 1;
311 unsigned PDC3 : 1;
312 unsigned PDC4 : 1;
313 unsigned PDC5 : 1;
314 unsigned PDC6 : 1;
315 unsigned PRSEN : 1;
318 struct
320 unsigned PDC : 7;
321 unsigned : 1;
324 struct
326 unsigned P2DC : 7;
327 unsigned : 1;
329 } __ECCP2DELbits_t;
331 extern __at(0x0F67) volatile __ECCP2DELbits_t ECCP2DELbits;
333 #define _ECCP2DEL_P2DC0 0x01
334 #define _ECCP2DEL_PDC0 0x01
335 #define _ECCP2DEL_P2DC1 0x02
336 #define _ECCP2DEL_PDC1 0x02
337 #define _ECCP2DEL_P2DC2 0x04
338 #define _ECCP2DEL_PDC2 0x04
339 #define _ECCP2DEL_P2DC3 0x08
340 #define _ECCP2DEL_PDC3 0x08
341 #define _ECCP2DEL_P2DC4 0x10
342 #define _ECCP2DEL_PDC4 0x10
343 #define _ECCP2DEL_P2DC5 0x20
344 #define _ECCP2DEL_PDC5 0x20
345 #define _ECCP2DEL_P2DC6 0x40
346 #define _ECCP2DEL_PDC6 0x40
347 #define _ECCP2DEL_P2RSEN 0x80
348 #define _ECCP2DEL_PRSEN 0x80
350 //==============================================================================
353 //==============================================================================
354 // ECCP2AS Bits
356 extern __at(0x0F68) __sfr ECCP2AS;
358 typedef union
360 struct
362 unsigned PSS2BD0 : 1;
363 unsigned PSS2BD1 : 1;
364 unsigned PSS2AC0 : 1;
365 unsigned PSS2AC1 : 1;
366 unsigned ECCP2AS0 : 1;
367 unsigned ECCP2AS1 : 1;
368 unsigned ECCP2AS2 : 1;
369 unsigned ECCP2ASE : 1;
372 struct
374 unsigned PSSBD0 : 1;
375 unsigned PSSBD1 : 1;
376 unsigned PSSAC0 : 1;
377 unsigned PSSAC1 : 1;
378 unsigned ECCPAS0 : 1;
379 unsigned ECCPAS1 : 1;
380 unsigned ECCPAS2 : 1;
381 unsigned ECCPASE : 1;
384 struct
386 unsigned PSS2BD : 2;
387 unsigned : 6;
390 struct
392 unsigned PSSBD : 2;
393 unsigned : 6;
396 struct
398 unsigned : 2;
399 unsigned PSSAC : 2;
400 unsigned : 4;
403 struct
405 unsigned : 2;
406 unsigned PSS2AC : 2;
407 unsigned : 4;
410 struct
412 unsigned : 4;
413 unsigned ECCP2AS : 3;
414 unsigned : 1;
417 struct
419 unsigned : 4;
420 unsigned ECCPAS : 3;
421 unsigned : 1;
423 } __ECCP2ASbits_t;
425 extern __at(0x0F68) volatile __ECCP2ASbits_t ECCP2ASbits;
427 #define _ECCP2AS_PSS2BD0 0x01
428 #define _ECCP2AS_PSSBD0 0x01
429 #define _ECCP2AS_PSS2BD1 0x02
430 #define _ECCP2AS_PSSBD1 0x02
431 #define _ECCP2AS_PSS2AC0 0x04
432 #define _ECCP2AS_PSSAC0 0x04
433 #define _ECCP2AS_PSS2AC1 0x08
434 #define _ECCP2AS_PSSAC1 0x08
435 #define _ECCP2AS_ECCP2AS0 0x10
436 #define _ECCP2AS_ECCPAS0 0x10
437 #define _ECCP2AS_ECCP2AS1 0x20
438 #define _ECCP2AS_ECCPAS1 0x20
439 #define _ECCP2AS_ECCP2AS2 0x40
440 #define _ECCP2AS_ECCPAS2 0x40
441 #define _ECCP2AS_ECCP2ASE 0x80
442 #define _ECCP2AS_ECCPASE 0x80
444 //==============================================================================
447 //==============================================================================
448 // ECCP3DEL Bits
450 extern __at(0x0F69) __sfr ECCP3DEL;
452 typedef union
454 struct
456 unsigned P3DC0 : 1;
457 unsigned P3DC1 : 1;
458 unsigned P3DC2 : 1;
459 unsigned P3DC3 : 1;
460 unsigned P3DC4 : 1;
461 unsigned P3DC5 : 1;
462 unsigned P3DC6 : 1;
463 unsigned P3RSEN : 1;
466 struct
468 unsigned PDC0 : 1;
469 unsigned PDC1 : 1;
470 unsigned PDC2 : 1;
471 unsigned PDC3 : 1;
472 unsigned PDC4 : 1;
473 unsigned PDC5 : 1;
474 unsigned PDC6 : 1;
475 unsigned PRSEN : 1;
478 struct
480 unsigned PDC : 7;
481 unsigned : 1;
484 struct
486 unsigned P3DC : 7;
487 unsigned : 1;
489 } __ECCP3DELbits_t;
491 extern __at(0x0F69) volatile __ECCP3DELbits_t ECCP3DELbits;
493 #define _ECCP3DEL_P3DC0 0x01
494 #define _ECCP3DEL_PDC0 0x01
495 #define _ECCP3DEL_P3DC1 0x02
496 #define _ECCP3DEL_PDC1 0x02
497 #define _ECCP3DEL_P3DC2 0x04
498 #define _ECCP3DEL_PDC2 0x04
499 #define _ECCP3DEL_P3DC3 0x08
500 #define _ECCP3DEL_PDC3 0x08
501 #define _ECCP3DEL_P3DC4 0x10
502 #define _ECCP3DEL_PDC4 0x10
503 #define _ECCP3DEL_P3DC5 0x20
504 #define _ECCP3DEL_PDC5 0x20
505 #define _ECCP3DEL_P3DC6 0x40
506 #define _ECCP3DEL_PDC6 0x40
507 #define _ECCP3DEL_P3RSEN 0x80
508 #define _ECCP3DEL_PRSEN 0x80
510 //==============================================================================
513 //==============================================================================
514 // ECCP3AS Bits
516 extern __at(0x0F6A) __sfr ECCP3AS;
518 typedef union
520 struct
522 unsigned PSS3BD0 : 1;
523 unsigned PSS3BD1 : 1;
524 unsigned PSS3AC0 : 1;
525 unsigned PSS3AC1 : 1;
526 unsigned ECCP3AS0 : 1;
527 unsigned ECCP3AS1 : 1;
528 unsigned ECCP3AS2 : 1;
529 unsigned ECCP3ASE : 1;
532 struct
534 unsigned PSSBD0 : 1;
535 unsigned PSSBD1 : 1;
536 unsigned PSSAC0 : 1;
537 unsigned PSSAC1 : 1;
538 unsigned ECCPAS0 : 1;
539 unsigned ECCPAS1 : 1;
540 unsigned ECCPAS2 : 1;
541 unsigned ECCPASE : 1;
544 struct
546 unsigned PSSBD : 2;
547 unsigned : 6;
550 struct
552 unsigned PSS3BD : 2;
553 unsigned : 6;
556 struct
558 unsigned : 2;
559 unsigned PSS3AC : 2;
560 unsigned : 4;
563 struct
565 unsigned : 2;
566 unsigned PSSAC : 2;
567 unsigned : 4;
570 struct
572 unsigned : 4;
573 unsigned ECCPAS : 3;
574 unsigned : 1;
577 struct
579 unsigned : 4;
580 unsigned ECCP3AS : 3;
581 unsigned : 1;
583 } __ECCP3ASbits_t;
585 extern __at(0x0F6A) volatile __ECCP3ASbits_t ECCP3ASbits;
587 #define _ECCP3AS_PSS3BD0 0x01
588 #define _ECCP3AS_PSSBD0 0x01
589 #define _ECCP3AS_PSS3BD1 0x02
590 #define _ECCP3AS_PSSBD1 0x02
591 #define _ECCP3AS_PSS3AC0 0x04
592 #define _ECCP3AS_PSSAC0 0x04
593 #define _ECCP3AS_PSS3AC1 0x08
594 #define _ECCP3AS_PSSAC1 0x08
595 #define _ECCP3AS_ECCP3AS0 0x10
596 #define _ECCP3AS_ECCPAS0 0x10
597 #define _ECCP3AS_ECCP3AS1 0x20
598 #define _ECCP3AS_ECCPAS1 0x20
599 #define _ECCP3AS_ECCP3AS2 0x40
600 #define _ECCP3AS_ECCPAS2 0x40
601 #define _ECCP3AS_ECCP3ASE 0x80
602 #define _ECCP3AS_ECCPASE 0x80
604 //==============================================================================
607 //==============================================================================
608 // RCSTA2 Bits
610 extern __at(0x0F6B) __sfr RCSTA2;
612 typedef union
614 struct
616 unsigned RX9D : 1;
617 unsigned OERR : 1;
618 unsigned FERR : 1;
619 unsigned ADDEN : 1;
620 unsigned CREN : 1;
621 unsigned SREN : 1;
622 unsigned RX9 : 1;
623 unsigned SPEN : 1;
626 struct
628 unsigned RCD8 : 1;
629 unsigned OERR2 : 1;
630 unsigned FERR2 : 1;
631 unsigned ADDEN2 : 1;
632 unsigned CREN2 : 1;
633 unsigned SREN2 : 1;
634 unsigned RC9 : 1;
635 unsigned SPEN2 : 1;
638 struct
640 unsigned RX9D2 : 1;
641 unsigned : 1;
642 unsigned : 1;
643 unsigned : 1;
644 unsigned : 1;
645 unsigned : 1;
646 unsigned NOT_RC8 : 1;
647 unsigned : 1;
650 struct
652 unsigned : 1;
653 unsigned : 1;
654 unsigned : 1;
655 unsigned : 1;
656 unsigned : 1;
657 unsigned : 1;
658 unsigned RC8_9 : 1;
659 unsigned : 1;
662 struct
664 unsigned : 1;
665 unsigned : 1;
666 unsigned : 1;
667 unsigned : 1;
668 unsigned : 1;
669 unsigned : 1;
670 unsigned RX92 : 1;
671 unsigned : 1;
673 } __RCSTA2bits_t;
675 extern __at(0x0F6B) volatile __RCSTA2bits_t RCSTA2bits;
677 #define _RCSTA2_RX9D 0x01
678 #define _RCSTA2_RCD8 0x01
679 #define _RCSTA2_RX9D2 0x01
680 #define _RCSTA2_OERR 0x02
681 #define _RCSTA2_OERR2 0x02
682 #define _RCSTA2_FERR 0x04
683 #define _RCSTA2_FERR2 0x04
684 #define _RCSTA2_ADDEN 0x08
685 #define _RCSTA2_ADDEN2 0x08
686 #define _RCSTA2_CREN 0x10
687 #define _RCSTA2_CREN2 0x10
688 #define _RCSTA2_SREN 0x20
689 #define _RCSTA2_SREN2 0x20
690 #define _RCSTA2_RX9 0x40
691 #define _RCSTA2_RC9 0x40
692 #define _RCSTA2_NOT_RC8 0x40
693 #define _RCSTA2_RC8_9 0x40
694 #define _RCSTA2_RX92 0x40
695 #define _RCSTA2_SPEN 0x80
696 #define _RCSTA2_SPEN2 0x80
698 //==============================================================================
701 //==============================================================================
702 // TXSTA2 Bits
704 extern __at(0x0F6C) __sfr TXSTA2;
706 typedef union
708 struct
710 unsigned TX9D : 1;
711 unsigned TRMT : 1;
712 unsigned BRGH : 1;
713 unsigned SENDB : 1;
714 unsigned SYNC : 1;
715 unsigned TXEN : 1;
716 unsigned TX9 : 1;
717 unsigned CSRC : 1;
720 struct
722 unsigned TXD8 : 1;
723 unsigned TRMT2 : 1;
724 unsigned BRGH2 : 1;
725 unsigned SENDB2 : 1;
726 unsigned SYNC2 : 1;
727 unsigned TXEN2 : 1;
728 unsigned TX8_9 : 1;
729 unsigned CSRC2 : 1;
732 struct
734 unsigned TX9D2 : 1;
735 unsigned : 1;
736 unsigned : 1;
737 unsigned : 1;
738 unsigned : 1;
739 unsigned : 1;
740 unsigned NOT_TX8 : 1;
741 unsigned : 1;
744 struct
746 unsigned : 1;
747 unsigned : 1;
748 unsigned : 1;
749 unsigned : 1;
750 unsigned : 1;
751 unsigned : 1;
752 unsigned TX92 : 1;
753 unsigned : 1;
755 } __TXSTA2bits_t;
757 extern __at(0x0F6C) volatile __TXSTA2bits_t TXSTA2bits;
759 #define _TXSTA2_TX9D 0x01
760 #define _TXSTA2_TXD8 0x01
761 #define _TXSTA2_TX9D2 0x01
762 #define _TXSTA2_TRMT 0x02
763 #define _TXSTA2_TRMT2 0x02
764 #define _TXSTA2_BRGH 0x04
765 #define _TXSTA2_BRGH2 0x04
766 #define _TXSTA2_SENDB 0x08
767 #define _TXSTA2_SENDB2 0x08
768 #define _TXSTA2_SYNC 0x10
769 #define _TXSTA2_SYNC2 0x10
770 #define _TXSTA2_TXEN 0x20
771 #define _TXSTA2_TXEN2 0x20
772 #define _TXSTA2_TX9 0x40
773 #define _TXSTA2_TX8_9 0x40
774 #define _TXSTA2_NOT_TX8 0x40
775 #define _TXSTA2_TX92 0x40
776 #define _TXSTA2_CSRC 0x80
777 #define _TXSTA2_CSRC2 0x80
779 //==============================================================================
781 extern __at(0x0F6D) __sfr TXREG2;
782 extern __at(0x0F6E) __sfr RCREG2;
783 extern __at(0x0F6F) __sfr SPBRG2;
785 //==============================================================================
786 // CCP5CON Bits
788 extern __at(0x0F70) __sfr CCP5CON;
790 typedef union
792 struct
794 unsigned CCP5M0 : 1;
795 unsigned CCP5M1 : 1;
796 unsigned CCP5M2 : 1;
797 unsigned CCP5M3 : 1;
798 unsigned DCCP5Y : 1;
799 unsigned DCCP5X : 1;
800 unsigned : 1;
801 unsigned : 1;
804 struct
806 unsigned : 1;
807 unsigned : 1;
808 unsigned : 1;
809 unsigned : 1;
810 unsigned DC5B0 : 1;
811 unsigned DC5B1 : 1;
812 unsigned : 1;
813 unsigned : 1;
816 struct
818 unsigned CCP5M : 4;
819 unsigned : 4;
822 struct
824 unsigned : 4;
825 unsigned DC5B : 2;
826 unsigned : 2;
828 } __CCP5CONbits_t;
830 extern __at(0x0F70) volatile __CCP5CONbits_t CCP5CONbits;
832 #define _CCP5M0 0x01
833 #define _CCP5M1 0x02
834 #define _CCP5M2 0x04
835 #define _CCP5M3 0x08
836 #define _DCCP5Y 0x10
837 #define _DC5B0 0x10
838 #define _DCCP5X 0x20
839 #define _DC5B1 0x20
841 //==============================================================================
843 extern __at(0x0F71) __sfr CCPR5;
844 extern __at(0x0F71) __sfr CCPR5L;
845 extern __at(0x0F72) __sfr CCPR5H;
847 //==============================================================================
848 // CCP4CON Bits
850 extern __at(0x0F73) __sfr CCP4CON;
852 typedef union
854 struct
856 unsigned CCP4M0 : 1;
857 unsigned CCP4M1 : 1;
858 unsigned CCP4M2 : 1;
859 unsigned CCP4M3 : 1;
860 unsigned DCCP4Y : 1;
861 unsigned DCCP4X : 1;
862 unsigned : 1;
863 unsigned : 1;
866 struct
868 unsigned : 1;
869 unsigned : 1;
870 unsigned : 1;
871 unsigned : 1;
872 unsigned DC4B0 : 1;
873 unsigned DC4B1 : 1;
874 unsigned : 1;
875 unsigned : 1;
878 struct
880 unsigned CCP4M : 4;
881 unsigned : 4;
884 struct
886 unsigned : 4;
887 unsigned DC4B : 2;
888 unsigned : 2;
890 } __CCP4CONbits_t;
892 extern __at(0x0F73) volatile __CCP4CONbits_t CCP4CONbits;
894 #define _CCP4M0 0x01
895 #define _CCP4M1 0x02
896 #define _CCP4M2 0x04
897 #define _CCP4M3 0x08
898 #define _DCCP4Y 0x10
899 #define _DC4B0 0x10
900 #define _DCCP4X 0x20
901 #define _DC4B1 0x20
903 //==============================================================================
905 extern __at(0x0F74) __sfr CCPR4;
906 extern __at(0x0F74) __sfr CCPR4L;
907 extern __at(0x0F75) __sfr CCPR4H;
909 //==============================================================================
910 // T4CON Bits
912 extern __at(0x0F76) __sfr T4CON;
914 typedef union
916 struct
918 unsigned T4CKPS0 : 1;
919 unsigned T4CKPS1 : 1;
920 unsigned TMR4ON : 1;
921 unsigned T4OUTPS0 : 1;
922 unsigned T4OUTPS1 : 1;
923 unsigned T4OUTPS2 : 1;
924 unsigned T4OUTPS3 : 1;
925 unsigned : 1;
928 struct
930 unsigned T4CKPS : 2;
931 unsigned : 6;
934 struct
936 unsigned : 3;
937 unsigned T4OUTPS : 4;
938 unsigned : 1;
940 } __T4CONbits_t;
942 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
944 #define _T4CKPS0 0x01
945 #define _T4CKPS1 0x02
946 #define _TMR4ON 0x04
947 #define _T4OUTPS0 0x08
948 #define _T4OUTPS1 0x10
949 #define _T4OUTPS2 0x20
950 #define _T4OUTPS3 0x40
952 //==============================================================================
954 extern __at(0x0F77) __sfr PR4;
955 extern __at(0x0F78) __sfr TMR4;
957 //==============================================================================
958 // ECCP1DEL Bits
960 extern __at(0x0F79) __sfr ECCP1DEL;
962 typedef union
964 struct
966 unsigned P1DC0 : 1;
967 unsigned P1DC1 : 1;
968 unsigned P1DC2 : 1;
969 unsigned P1DC3 : 1;
970 unsigned P1DC4 : 1;
971 unsigned P1DC5 : 1;
972 unsigned P1DC6 : 1;
973 unsigned P1RSEN : 1;
976 struct
978 unsigned PDC0 : 1;
979 unsigned PDC1 : 1;
980 unsigned PDC2 : 1;
981 unsigned PDC3 : 1;
982 unsigned PDC4 : 1;
983 unsigned PDC5 : 1;
984 unsigned PDC6 : 1;
985 unsigned PRSEN : 1;
988 struct
990 unsigned PDC : 7;
991 unsigned : 1;
994 struct
996 unsigned P1DC : 7;
997 unsigned : 1;
999 } __ECCP1DELbits_t;
1001 extern __at(0x0F79) volatile __ECCP1DELbits_t ECCP1DELbits;
1003 #define _P1DC0 0x01
1004 #define _PDC0 0x01
1005 #define _P1DC1 0x02
1006 #define _PDC1 0x02
1007 #define _P1DC2 0x04
1008 #define _PDC2 0x04
1009 #define _P1DC3 0x08
1010 #define _PDC3 0x08
1011 #define _P1DC4 0x10
1012 #define _PDC4 0x10
1013 #define _P1DC5 0x20
1014 #define _PDC5 0x20
1015 #define _P1DC6 0x40
1016 #define _PDC6 0x40
1017 #define _P1RSEN 0x80
1018 #define _PRSEN 0x80
1020 //==============================================================================
1023 //==============================================================================
1024 // BAUDCON2 Bits
1026 extern __at(0x0F7C) __sfr BAUDCON2;
1028 typedef union
1030 struct
1032 unsigned ABDEN : 1;
1033 unsigned WUE : 1;
1034 unsigned : 1;
1035 unsigned BRG16 : 1;
1036 unsigned SCKP : 1;
1037 unsigned : 1;
1038 unsigned RCIDL : 1;
1039 unsigned ABDOVF : 1;
1042 struct
1044 unsigned ABDEN2 : 1;
1045 unsigned WUE2 : 1;
1046 unsigned : 1;
1047 unsigned BRG162 : 1;
1048 unsigned SCKP2 : 1;
1049 unsigned : 1;
1050 unsigned RCMT : 1;
1051 unsigned ABDOVF2 : 1;
1054 struct
1056 unsigned : 1;
1057 unsigned : 1;
1058 unsigned : 1;
1059 unsigned : 1;
1060 unsigned : 1;
1061 unsigned : 1;
1062 unsigned RCIDL2 : 1;
1063 unsigned : 1;
1065 } __BAUDCON2bits_t;
1067 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
1069 #define _BAUDCON2_ABDEN 0x01
1070 #define _BAUDCON2_ABDEN2 0x01
1071 #define _BAUDCON2_WUE 0x02
1072 #define _BAUDCON2_WUE2 0x02
1073 #define _BAUDCON2_BRG16 0x08
1074 #define _BAUDCON2_BRG162 0x08
1075 #define _BAUDCON2_SCKP 0x10
1076 #define _BAUDCON2_SCKP2 0x10
1077 #define _BAUDCON2_RCIDL 0x40
1078 #define _BAUDCON2_RCMT 0x40
1079 #define _BAUDCON2_RCIDL2 0x40
1080 #define _BAUDCON2_ABDOVF 0x80
1081 #define _BAUDCON2_ABDOVF2 0x80
1083 //==============================================================================
1085 extern __at(0x0F7D) __sfr SPBRGH2;
1087 //==============================================================================
1088 // BAUDCON Bits
1090 extern __at(0x0F7E) __sfr BAUDCON;
1092 typedef union
1094 struct
1096 unsigned ABDEN : 1;
1097 unsigned WUE : 1;
1098 unsigned : 1;
1099 unsigned BRG16 : 1;
1100 unsigned SCKP : 1;
1101 unsigned : 1;
1102 unsigned RCIDL : 1;
1103 unsigned ABDOVF : 1;
1106 struct
1108 unsigned ABDEN1 : 1;
1109 unsigned WUE1 : 1;
1110 unsigned : 1;
1111 unsigned BRG161 : 1;
1112 unsigned SCKP1 : 1;
1113 unsigned : 1;
1114 unsigned RCMT : 1;
1115 unsigned ABDOVF1 : 1;
1118 struct
1120 unsigned : 1;
1121 unsigned : 1;
1122 unsigned : 1;
1123 unsigned : 1;
1124 unsigned : 1;
1125 unsigned : 1;
1126 unsigned RCIDL1 : 1;
1127 unsigned : 1;
1129 } __BAUDCONbits_t;
1131 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
1133 #define _ABDEN 0x01
1134 #define _ABDEN1 0x01
1135 #define _WUE 0x02
1136 #define _WUE1 0x02
1137 #define _BRG16 0x08
1138 #define _BRG161 0x08
1139 #define _SCKP 0x10
1140 #define _SCKP1 0x10
1141 #define _RCIDL 0x40
1142 #define _RCMT 0x40
1143 #define _RCIDL1 0x40
1144 #define _ABDOVF 0x80
1145 #define _ABDOVF1 0x80
1147 //==============================================================================
1150 //==============================================================================
1151 // BAUDCON1 Bits
1153 extern __at(0x0F7E) __sfr BAUDCON1;
1155 typedef union
1157 struct
1159 unsigned ABDEN : 1;
1160 unsigned WUE : 1;
1161 unsigned : 1;
1162 unsigned BRG16 : 1;
1163 unsigned SCKP : 1;
1164 unsigned : 1;
1165 unsigned RCIDL : 1;
1166 unsigned ABDOVF : 1;
1169 struct
1171 unsigned ABDEN1 : 1;
1172 unsigned WUE1 : 1;
1173 unsigned : 1;
1174 unsigned BRG161 : 1;
1175 unsigned SCKP1 : 1;
1176 unsigned : 1;
1177 unsigned RCMT : 1;
1178 unsigned ABDOVF1 : 1;
1181 struct
1183 unsigned : 1;
1184 unsigned : 1;
1185 unsigned : 1;
1186 unsigned : 1;
1187 unsigned : 1;
1188 unsigned : 1;
1189 unsigned RCIDL1 : 1;
1190 unsigned : 1;
1192 } __BAUDCON1bits_t;
1194 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1196 #define _BAUDCON1_ABDEN 0x01
1197 #define _BAUDCON1_ABDEN1 0x01
1198 #define _BAUDCON1_WUE 0x02
1199 #define _BAUDCON1_WUE1 0x02
1200 #define _BAUDCON1_BRG16 0x08
1201 #define _BAUDCON1_BRG161 0x08
1202 #define _BAUDCON1_SCKP 0x10
1203 #define _BAUDCON1_SCKP1 0x10
1204 #define _BAUDCON1_RCIDL 0x40
1205 #define _BAUDCON1_RCMT 0x40
1206 #define _BAUDCON1_RCIDL1 0x40
1207 #define _BAUDCON1_ABDOVF 0x80
1208 #define _BAUDCON1_ABDOVF1 0x80
1210 //==============================================================================
1212 extern __at(0x0F7F) __sfr SPBRGH;
1213 extern __at(0x0F7F) __sfr SPBRGH1;
1215 //==============================================================================
1216 // PORTA Bits
1218 extern __at(0x0F80) __sfr PORTA;
1220 typedef union
1222 struct
1224 unsigned RA0 : 1;
1225 unsigned RA1 : 1;
1226 unsigned RA2 : 1;
1227 unsigned RA3 : 1;
1228 unsigned RA4 : 1;
1229 unsigned RA5 : 1;
1230 unsigned RA6 : 1;
1231 unsigned RA7 : 1;
1234 struct
1236 unsigned AN0 : 1;
1237 unsigned AN1 : 1;
1238 unsigned VREFM : 1;
1239 unsigned VREFP : 1;
1240 unsigned T0CKI : 1;
1241 unsigned LVDIN : 1;
1242 unsigned : 1;
1243 unsigned : 1;
1246 struct
1248 unsigned : 1;
1249 unsigned : 1;
1250 unsigned AN2 : 1;
1251 unsigned AN3 : 1;
1252 unsigned : 1;
1253 unsigned AN4 : 1;
1254 unsigned : 1;
1255 unsigned : 1;
1258 struct
1260 unsigned : 1;
1261 unsigned : 1;
1262 unsigned : 1;
1263 unsigned : 1;
1264 unsigned : 1;
1265 unsigned HLVDIN : 1;
1266 unsigned : 1;
1267 unsigned : 1;
1269 } __PORTAbits_t;
1271 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1273 #define _PORTA_RA0 0x01
1274 #define _PORTA_AN0 0x01
1275 #define _PORTA_RA1 0x02
1276 #define _PORTA_AN1 0x02
1277 #define _PORTA_RA2 0x04
1278 #define _PORTA_VREFM 0x04
1279 #define _PORTA_AN2 0x04
1280 #define _PORTA_RA3 0x08
1281 #define _PORTA_VREFP 0x08
1282 #define _PORTA_AN3 0x08
1283 #define _PORTA_RA4 0x10
1284 #define _PORTA_T0CKI 0x10
1285 #define _PORTA_RA5 0x20
1286 #define _PORTA_LVDIN 0x20
1287 #define _PORTA_AN4 0x20
1288 #define _PORTA_HLVDIN 0x20
1289 #define _PORTA_RA6 0x40
1290 #define _PORTA_RA7 0x80
1292 //==============================================================================
1295 //==============================================================================
1296 // PORTB Bits
1298 extern __at(0x0F81) __sfr PORTB;
1300 typedef union
1302 struct
1304 unsigned RB0 : 1;
1305 unsigned RB1 : 1;
1306 unsigned RB2 : 1;
1307 unsigned RB3 : 1;
1308 unsigned RB4 : 1;
1309 unsigned RB5 : 1;
1310 unsigned RB6 : 1;
1311 unsigned RB7 : 1;
1314 struct
1316 unsigned INT0 : 1;
1317 unsigned INT1 : 1;
1318 unsigned INT2 : 1;
1319 unsigned INT3 : 1;
1320 unsigned KBI0 : 1;
1321 unsigned KBI1 : 1;
1322 unsigned KBI2 : 1;
1323 unsigned KBI3 : 1;
1326 struct
1328 unsigned FLT0 : 1;
1329 unsigned : 1;
1330 unsigned : 1;
1331 unsigned ECCP2 : 1;
1332 unsigned : 1;
1333 unsigned : 1;
1334 unsigned : 1;
1335 unsigned : 1;
1338 struct
1340 unsigned : 1;
1341 unsigned : 1;
1342 unsigned : 1;
1343 unsigned CCP2 : 1;
1344 unsigned : 1;
1345 unsigned : 1;
1346 unsigned : 1;
1347 unsigned : 1;
1350 struct
1352 unsigned : 1;
1353 unsigned : 1;
1354 unsigned : 1;
1355 unsigned P2A : 1;
1356 unsigned : 1;
1357 unsigned : 1;
1358 unsigned : 1;
1359 unsigned : 1;
1362 struct
1364 unsigned INT : 4;
1365 unsigned : 4;
1368 struct
1370 unsigned : 4;
1371 unsigned KBI : 4;
1373 } __PORTBbits_t;
1375 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1377 #define _PORTB_RB0 0x01
1378 #define _PORTB_INT0 0x01
1379 #define _PORTB_FLT0 0x01
1380 #define _PORTB_RB1 0x02
1381 #define _PORTB_INT1 0x02
1382 #define _PORTB_RB2 0x04
1383 #define _PORTB_INT2 0x04
1384 #define _PORTB_RB3 0x08
1385 #define _PORTB_INT3 0x08
1386 #define _PORTB_ECCP2 0x08
1387 #define _PORTB_CCP2 0x08
1388 #define _PORTB_P2A 0x08
1389 #define _PORTB_RB4 0x10
1390 #define _PORTB_KBI0 0x10
1391 #define _PORTB_RB5 0x20
1392 #define _PORTB_KBI1 0x20
1393 #define _PORTB_RB6 0x40
1394 #define _PORTB_KBI2 0x40
1395 #define _PORTB_RB7 0x80
1396 #define _PORTB_KBI3 0x80
1398 //==============================================================================
1401 //==============================================================================
1402 // PORTC Bits
1404 extern __at(0x0F82) __sfr PORTC;
1406 typedef union
1408 struct
1410 unsigned RC0 : 1;
1411 unsigned RC1 : 1;
1412 unsigned RC2 : 1;
1413 unsigned RC3 : 1;
1414 unsigned RC4 : 1;
1415 unsigned RC5 : 1;
1416 unsigned RC6 : 1;
1417 unsigned RC7 : 1;
1420 struct
1422 unsigned T1OSO : 1;
1423 unsigned T1OSI : 1;
1424 unsigned ECCP1 : 1;
1425 unsigned SCK : 1;
1426 unsigned SDI : 1;
1427 unsigned SDO : 1;
1428 unsigned TX : 1;
1429 unsigned RX : 1;
1432 struct
1434 unsigned T13CKI : 1;
1435 unsigned ECCP2 : 1;
1436 unsigned CCP1 : 1;
1437 unsigned SCL : 1;
1438 unsigned SDA : 1;
1439 unsigned SDO1 : 1;
1440 unsigned CK : 1;
1441 unsigned DT1 : 1;
1444 struct
1446 unsigned : 1;
1447 unsigned CCP2 : 1;
1448 unsigned P1A : 1;
1449 unsigned SCL1 : 1;
1450 unsigned SDA1 : 1;
1451 unsigned : 1;
1452 unsigned CK1 : 1;
1453 unsigned RX1 : 1;
1456 struct
1458 unsigned : 1;
1459 unsigned P2A : 1;
1460 unsigned : 1;
1461 unsigned SCK1 : 1;
1462 unsigned SDI1 : 1;
1463 unsigned : 1;
1464 unsigned TX1 : 1;
1465 unsigned : 1;
1467 } __PORTCbits_t;
1469 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1471 #define _PORTC_RC0 0x01
1472 #define _PORTC_T1OSO 0x01
1473 #define _PORTC_T13CKI 0x01
1474 #define _PORTC_RC1 0x02
1475 #define _PORTC_T1OSI 0x02
1476 #define _PORTC_ECCP2 0x02
1477 #define _PORTC_CCP2 0x02
1478 #define _PORTC_P2A 0x02
1479 #define _PORTC_RC2 0x04
1480 #define _PORTC_ECCP1 0x04
1481 #define _PORTC_CCP1 0x04
1482 #define _PORTC_P1A 0x04
1483 #define _PORTC_RC3 0x08
1484 #define _PORTC_SCK 0x08
1485 #define _PORTC_SCL 0x08
1486 #define _PORTC_SCL1 0x08
1487 #define _PORTC_SCK1 0x08
1488 #define _PORTC_RC4 0x10
1489 #define _PORTC_SDI 0x10
1490 #define _PORTC_SDA 0x10
1491 #define _PORTC_SDA1 0x10
1492 #define _PORTC_SDI1 0x10
1493 #define _PORTC_RC5 0x20
1494 #define _PORTC_SDO 0x20
1495 #define _PORTC_SDO1 0x20
1496 #define _PORTC_RC6 0x40
1497 #define _PORTC_TX 0x40
1498 #define _PORTC_CK 0x40
1499 #define _PORTC_CK1 0x40
1500 #define _PORTC_TX1 0x40
1501 #define _PORTC_RC7 0x80
1502 #define _PORTC_RX 0x80
1503 #define _PORTC_DT1 0x80
1504 #define _PORTC_RX1 0x80
1506 //==============================================================================
1509 //==============================================================================
1510 // PORTD Bits
1512 extern __at(0x0F83) __sfr PORTD;
1514 typedef union
1516 struct
1518 unsigned RD0 : 1;
1519 unsigned RD1 : 1;
1520 unsigned RD2 : 1;
1521 unsigned RD3 : 1;
1522 unsigned RD4 : 1;
1523 unsigned RD5 : 1;
1524 unsigned RD6 : 1;
1525 unsigned RD7 : 1;
1528 struct
1530 unsigned PSP0 : 1;
1531 unsigned PSP1 : 1;
1532 unsigned PSP2 : 1;
1533 unsigned PSP3 : 1;
1534 unsigned PSP4 : 1;
1535 unsigned PSP5 : 1;
1536 unsigned PSP6 : 1;
1537 unsigned PSP7 : 1;
1540 struct
1542 unsigned AD0 : 1;
1543 unsigned AD1 : 1;
1544 unsigned AD2 : 1;
1545 unsigned AD3 : 1;
1546 unsigned AD4 : 1;
1547 unsigned AD5 : 1;
1548 unsigned AD6 : 1;
1549 unsigned AD7 : 1;
1552 struct
1554 unsigned : 1;
1555 unsigned : 1;
1556 unsigned : 1;
1557 unsigned : 1;
1558 unsigned SDO2 : 1;
1559 unsigned SDA2 : 1;
1560 unsigned SCL2 : 1;
1561 unsigned SS2 : 1;
1564 struct
1566 unsigned : 1;
1567 unsigned : 1;
1568 unsigned : 1;
1569 unsigned : 1;
1570 unsigned : 1;
1571 unsigned SDI2 : 1;
1572 unsigned SCK2 : 1;
1573 unsigned NOT_SS2 : 1;
1575 } __PORTDbits_t;
1577 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1579 #define _PORTD_RD0 0x01
1580 #define _PORTD_PSP0 0x01
1581 #define _PORTD_AD0 0x01
1582 #define _PORTD_RD1 0x02
1583 #define _PORTD_PSP1 0x02
1584 #define _PORTD_AD1 0x02
1585 #define _PORTD_RD2 0x04
1586 #define _PORTD_PSP2 0x04
1587 #define _PORTD_AD2 0x04
1588 #define _PORTD_RD3 0x08
1589 #define _PORTD_PSP3 0x08
1590 #define _PORTD_AD3 0x08
1591 #define _PORTD_RD4 0x10
1592 #define _PORTD_PSP4 0x10
1593 #define _PORTD_AD4 0x10
1594 #define _PORTD_SDO2 0x10
1595 #define _PORTD_RD5 0x20
1596 #define _PORTD_PSP5 0x20
1597 #define _PORTD_AD5 0x20
1598 #define _PORTD_SDA2 0x20
1599 #define _PORTD_SDI2 0x20
1600 #define _PORTD_RD6 0x40
1601 #define _PORTD_PSP6 0x40
1602 #define _PORTD_AD6 0x40
1603 #define _PORTD_SCL2 0x40
1604 #define _PORTD_SCK2 0x40
1605 #define _PORTD_RD7 0x80
1606 #define _PORTD_PSP7 0x80
1607 #define _PORTD_AD7 0x80
1608 #define _PORTD_SS2 0x80
1609 #define _PORTD_NOT_SS2 0x80
1611 //==============================================================================
1614 //==============================================================================
1615 // PORTE Bits
1617 extern __at(0x0F84) __sfr PORTE;
1619 typedef union
1621 struct
1623 unsigned RE0 : 1;
1624 unsigned RE1 : 1;
1625 unsigned RE2 : 1;
1626 unsigned RE3 : 1;
1627 unsigned RE4 : 1;
1628 unsigned RE5 : 1;
1629 unsigned RE6 : 1;
1630 unsigned RE7 : 1;
1633 struct
1635 unsigned RD : 1;
1636 unsigned WR : 1;
1637 unsigned CS : 1;
1638 unsigned AD11 : 1;
1639 unsigned AD12 : 1;
1640 unsigned AD13 : 1;
1641 unsigned AD14 : 1;
1642 unsigned ECCP2 : 1;
1645 struct
1647 unsigned NOT_RD : 1;
1648 unsigned NOT_WR : 1;
1649 unsigned NOT_CS : 1;
1650 unsigned P3C : 1;
1651 unsigned P3B : 1;
1652 unsigned P1C : 1;
1653 unsigned P1B : 1;
1654 unsigned CCP2 : 1;
1657 struct
1659 unsigned AD8 : 1;
1660 unsigned AD9 : 1;
1661 unsigned AD10 : 1;
1662 unsigned : 1;
1663 unsigned : 1;
1664 unsigned : 1;
1665 unsigned : 1;
1666 unsigned AD15 : 1;
1669 struct
1671 unsigned P2D : 1;
1672 unsigned P2C : 1;
1673 unsigned P2B : 1;
1674 unsigned : 1;
1675 unsigned : 1;
1676 unsigned : 1;
1677 unsigned : 1;
1678 unsigned P2A : 1;
1680 } __PORTEbits_t;
1682 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1684 #define _PORTE_RE0 0x01
1685 #define _PORTE_RD 0x01
1686 #define _PORTE_NOT_RD 0x01
1687 #define _PORTE_AD8 0x01
1688 #define _PORTE_P2D 0x01
1689 #define _PORTE_RE1 0x02
1690 #define _PORTE_WR 0x02
1691 #define _PORTE_NOT_WR 0x02
1692 #define _PORTE_AD9 0x02
1693 #define _PORTE_P2C 0x02
1694 #define _PORTE_RE2 0x04
1695 #define _PORTE_CS 0x04
1696 #define _PORTE_NOT_CS 0x04
1697 #define _PORTE_AD10 0x04
1698 #define _PORTE_P2B 0x04
1699 #define _PORTE_RE3 0x08
1700 #define _PORTE_AD11 0x08
1701 #define _PORTE_P3C 0x08
1702 #define _PORTE_RE4 0x10
1703 #define _PORTE_AD12 0x10
1704 #define _PORTE_P3B 0x10
1705 #define _PORTE_RE5 0x20
1706 #define _PORTE_AD13 0x20
1707 #define _PORTE_P1C 0x20
1708 #define _PORTE_RE6 0x40
1709 #define _PORTE_AD14 0x40
1710 #define _PORTE_P1B 0x40
1711 #define _PORTE_RE7 0x80
1712 #define _PORTE_ECCP2 0x80
1713 #define _PORTE_CCP2 0x80
1714 #define _PORTE_AD15 0x80
1715 #define _PORTE_P2A 0x80
1717 //==============================================================================
1720 //==============================================================================
1721 // PORTF Bits
1723 extern __at(0x0F85) __sfr PORTF;
1725 typedef union
1727 struct
1729 unsigned RF0 : 1;
1730 unsigned RF1 : 1;
1731 unsigned RF2 : 1;
1732 unsigned RF3 : 1;
1733 unsigned RF4 : 1;
1734 unsigned RF5 : 1;
1735 unsigned RF6 : 1;
1736 unsigned RF7 : 1;
1739 struct
1741 unsigned AN5 : 1;
1742 unsigned AN6 : 1;
1743 unsigned AN7 : 1;
1744 unsigned AN8 : 1;
1745 unsigned AN9 : 1;
1746 unsigned AN10 : 1;
1747 unsigned AN11 : 1;
1748 unsigned SS1 : 1;
1751 struct
1753 unsigned : 1;
1754 unsigned C2OUT : 1;
1755 unsigned C1OUT : 1;
1756 unsigned : 1;
1757 unsigned : 1;
1758 unsigned CVREF : 1;
1759 unsigned : 1;
1760 unsigned NOT_SS1 : 1;
1762 } __PORTFbits_t;
1764 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
1766 #define _PORTF_RF0 0x01
1767 #define _PORTF_AN5 0x01
1768 #define _PORTF_RF1 0x02
1769 #define _PORTF_AN6 0x02
1770 #define _PORTF_C2OUT 0x02
1771 #define _PORTF_RF2 0x04
1772 #define _PORTF_AN7 0x04
1773 #define _PORTF_C1OUT 0x04
1774 #define _PORTF_RF3 0x08
1775 #define _PORTF_AN8 0x08
1776 #define _PORTF_RF4 0x10
1777 #define _PORTF_AN9 0x10
1778 #define _PORTF_RF5 0x20
1779 #define _PORTF_AN10 0x20
1780 #define _PORTF_CVREF 0x20
1781 #define _PORTF_RF6 0x40
1782 #define _PORTF_AN11 0x40
1783 #define _PORTF_RF7 0x80
1784 #define _PORTF_SS1 0x80
1785 #define _PORTF_NOT_SS1 0x80
1787 //==============================================================================
1790 //==============================================================================
1791 // PORTG Bits
1793 extern __at(0x0F86) __sfr PORTG;
1795 typedef union
1797 struct
1799 unsigned RG0 : 1;
1800 unsigned RG1 : 1;
1801 unsigned RG2 : 1;
1802 unsigned RG3 : 1;
1803 unsigned RG4 : 1;
1804 unsigned RG5 : 1;
1805 unsigned : 1;
1806 unsigned : 1;
1809 struct
1811 unsigned ECCP3 : 1;
1812 unsigned TX2 : 1;
1813 unsigned RX2 : 1;
1814 unsigned CCP4 : 1;
1815 unsigned CCP5 : 1;
1816 unsigned MCLR : 1;
1817 unsigned : 1;
1818 unsigned : 1;
1821 struct
1823 unsigned P3A : 1;
1824 unsigned CK2 : 1;
1825 unsigned DT2 : 1;
1826 unsigned P3D : 1;
1827 unsigned P1D : 1;
1828 unsigned NOT_MCLR : 1;
1829 unsigned : 1;
1830 unsigned : 1;
1833 struct
1835 unsigned CCP3 : 1;
1836 unsigned : 1;
1837 unsigned : 1;
1838 unsigned : 1;
1839 unsigned : 1;
1840 unsigned : 1;
1841 unsigned : 1;
1842 unsigned : 1;
1845 struct
1847 unsigned RG : 6;
1848 unsigned : 2;
1850 } __PORTGbits_t;
1852 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
1854 #define _PORTG_RG0 0x01
1855 #define _PORTG_ECCP3 0x01
1856 #define _PORTG_P3A 0x01
1857 #define _PORTG_CCP3 0x01
1858 #define _PORTG_RG1 0x02
1859 #define _PORTG_TX2 0x02
1860 #define _PORTG_CK2 0x02
1861 #define _PORTG_RG2 0x04
1862 #define _PORTG_RX2 0x04
1863 #define _PORTG_DT2 0x04
1864 #define _PORTG_RG3 0x08
1865 #define _PORTG_CCP4 0x08
1866 #define _PORTG_P3D 0x08
1867 #define _PORTG_RG4 0x10
1868 #define _PORTG_CCP5 0x10
1869 #define _PORTG_P1D 0x10
1870 #define _PORTG_RG5 0x20
1871 #define _PORTG_MCLR 0x20
1872 #define _PORTG_NOT_MCLR 0x20
1874 //==============================================================================
1877 //==============================================================================
1878 // PORTH Bits
1880 extern __at(0x0F87) __sfr PORTH;
1882 typedef union
1884 struct
1886 unsigned RH0 : 1;
1887 unsigned RH1 : 1;
1888 unsigned RH2 : 1;
1889 unsigned RH3 : 1;
1890 unsigned RH4 : 1;
1891 unsigned RH5 : 1;
1892 unsigned RH6 : 1;
1893 unsigned RH7 : 1;
1896 struct
1898 unsigned A16 : 1;
1899 unsigned A17 : 1;
1900 unsigned A18 : 1;
1901 unsigned A19 : 1;
1902 unsigned AN12 : 1;
1903 unsigned AN13 : 1;
1904 unsigned AN14 : 1;
1905 unsigned AN15 : 1;
1908 struct
1910 unsigned : 1;
1911 unsigned : 1;
1912 unsigned : 1;
1913 unsigned : 1;
1914 unsigned P3C : 1;
1915 unsigned P3B : 1;
1916 unsigned P1C : 1;
1917 unsigned P1B : 1;
1919 } __PORTHbits_t;
1921 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
1923 #define _PORTH_RH0 0x01
1924 #define _PORTH_A16 0x01
1925 #define _PORTH_RH1 0x02
1926 #define _PORTH_A17 0x02
1927 #define _PORTH_RH2 0x04
1928 #define _PORTH_A18 0x04
1929 #define _PORTH_RH3 0x08
1930 #define _PORTH_A19 0x08
1931 #define _PORTH_RH4 0x10
1932 #define _PORTH_AN12 0x10
1933 #define _PORTH_P3C 0x10
1934 #define _PORTH_RH5 0x20
1935 #define _PORTH_AN13 0x20
1936 #define _PORTH_P3B 0x20
1937 #define _PORTH_RH6 0x40
1938 #define _PORTH_AN14 0x40
1939 #define _PORTH_P1C 0x40
1940 #define _PORTH_RH7 0x80
1941 #define _PORTH_AN15 0x80
1942 #define _PORTH_P1B 0x80
1944 //==============================================================================
1947 //==============================================================================
1948 // PORTJ Bits
1950 extern __at(0x0F88) __sfr PORTJ;
1952 typedef union
1954 struct
1956 unsigned RJ0 : 1;
1957 unsigned RJ1 : 1;
1958 unsigned RJ2 : 1;
1959 unsigned RJ3 : 1;
1960 unsigned RJ4 : 1;
1961 unsigned RJ5 : 1;
1962 unsigned RJ6 : 1;
1963 unsigned RJ7 : 1;
1966 struct
1968 unsigned ALE : 1;
1969 unsigned OE : 1;
1970 unsigned WRL : 1;
1971 unsigned WRH : 1;
1972 unsigned BA0 : 1;
1973 unsigned CE : 1;
1974 unsigned LB : 1;
1975 unsigned UB : 1;
1978 struct
1980 unsigned : 1;
1981 unsigned NOT_OE : 1;
1982 unsigned NOT_WRL : 1;
1983 unsigned NOT_WRH : 1;
1984 unsigned : 1;
1985 unsigned NOT_CE : 1;
1986 unsigned NOT_LB : 1;
1987 unsigned NOT_UB : 1;
1989 } __PORTJbits_t;
1991 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
1993 #define _PORTJ_RJ0 0x01
1994 #define _PORTJ_ALE 0x01
1995 #define _PORTJ_RJ1 0x02
1996 #define _PORTJ_OE 0x02
1997 #define _PORTJ_NOT_OE 0x02
1998 #define _PORTJ_RJ2 0x04
1999 #define _PORTJ_WRL 0x04
2000 #define _PORTJ_NOT_WRL 0x04
2001 #define _PORTJ_RJ3 0x08
2002 #define _PORTJ_WRH 0x08
2003 #define _PORTJ_NOT_WRH 0x08
2004 #define _PORTJ_RJ4 0x10
2005 #define _PORTJ_BA0 0x10
2006 #define _PORTJ_RJ5 0x20
2007 #define _PORTJ_CE 0x20
2008 #define _PORTJ_NOT_CE 0x20
2009 #define _PORTJ_RJ6 0x40
2010 #define _PORTJ_LB 0x40
2011 #define _PORTJ_NOT_LB 0x40
2012 #define _PORTJ_RJ7 0x80
2013 #define _PORTJ_UB 0x80
2014 #define _PORTJ_NOT_UB 0x80
2016 //==============================================================================
2019 //==============================================================================
2020 // LATA Bits
2022 extern __at(0x0F89) __sfr LATA;
2024 typedef struct
2026 unsigned LATA0 : 1;
2027 unsigned LATA1 : 1;
2028 unsigned LATA2 : 1;
2029 unsigned LATA3 : 1;
2030 unsigned LATA4 : 1;
2031 unsigned LATA5 : 1;
2032 unsigned LATA6 : 1;
2033 unsigned LATA7 : 1;
2034 } __LATAbits_t;
2036 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2038 #define _LATA0 0x01
2039 #define _LATA1 0x02
2040 #define _LATA2 0x04
2041 #define _LATA3 0x08
2042 #define _LATA4 0x10
2043 #define _LATA5 0x20
2044 #define _LATA6 0x40
2045 #define _LATA7 0x80
2047 //==============================================================================
2050 //==============================================================================
2051 // LATB Bits
2053 extern __at(0x0F8A) __sfr LATB;
2055 typedef struct
2057 unsigned LATB0 : 1;
2058 unsigned LATB1 : 1;
2059 unsigned LATB2 : 1;
2060 unsigned LATB3 : 1;
2061 unsigned LATB4 : 1;
2062 unsigned LATB5 : 1;
2063 unsigned LATB6 : 1;
2064 unsigned LATB7 : 1;
2065 } __LATBbits_t;
2067 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2069 #define _LATB0 0x01
2070 #define _LATB1 0x02
2071 #define _LATB2 0x04
2072 #define _LATB3 0x08
2073 #define _LATB4 0x10
2074 #define _LATB5 0x20
2075 #define _LATB6 0x40
2076 #define _LATB7 0x80
2078 //==============================================================================
2081 //==============================================================================
2082 // LATC Bits
2084 extern __at(0x0F8B) __sfr LATC;
2086 typedef struct
2088 unsigned LATC0 : 1;
2089 unsigned LATC1 : 1;
2090 unsigned LATC2 : 1;
2091 unsigned LATC3 : 1;
2092 unsigned LATC4 : 1;
2093 unsigned LATC5 : 1;
2094 unsigned LATC6 : 1;
2095 unsigned LATC7 : 1;
2096 } __LATCbits_t;
2098 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2100 #define _LATC0 0x01
2101 #define _LATC1 0x02
2102 #define _LATC2 0x04
2103 #define _LATC3 0x08
2104 #define _LATC4 0x10
2105 #define _LATC5 0x20
2106 #define _LATC6 0x40
2107 #define _LATC7 0x80
2109 //==============================================================================
2112 //==============================================================================
2113 // LATD Bits
2115 extern __at(0x0F8C) __sfr LATD;
2117 typedef struct
2119 unsigned LATD0 : 1;
2120 unsigned LATD1 : 1;
2121 unsigned LATD2 : 1;
2122 unsigned LATD3 : 1;
2123 unsigned LATD4 : 1;
2124 unsigned LATD5 : 1;
2125 unsigned LATD6 : 1;
2126 unsigned LATD7 : 1;
2127 } __LATDbits_t;
2129 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
2131 #define _LATD0 0x01
2132 #define _LATD1 0x02
2133 #define _LATD2 0x04
2134 #define _LATD3 0x08
2135 #define _LATD4 0x10
2136 #define _LATD5 0x20
2137 #define _LATD6 0x40
2138 #define _LATD7 0x80
2140 //==============================================================================
2143 //==============================================================================
2144 // LATE Bits
2146 extern __at(0x0F8D) __sfr LATE;
2148 typedef struct
2150 unsigned LATE0 : 1;
2151 unsigned LATE1 : 1;
2152 unsigned LATE2 : 1;
2153 unsigned LATE3 : 1;
2154 unsigned LATE4 : 1;
2155 unsigned LATE5 : 1;
2156 unsigned LATE6 : 1;
2157 unsigned LATE7 : 1;
2158 } __LATEbits_t;
2160 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
2162 #define _LATE0 0x01
2163 #define _LATE1 0x02
2164 #define _LATE2 0x04
2165 #define _LATE3 0x08
2166 #define _LATE4 0x10
2167 #define _LATE5 0x20
2168 #define _LATE6 0x40
2169 #define _LATE7 0x80
2171 //==============================================================================
2174 //==============================================================================
2175 // LATF Bits
2177 extern __at(0x0F8E) __sfr LATF;
2179 typedef struct
2181 unsigned LATF0 : 1;
2182 unsigned LATF1 : 1;
2183 unsigned LATF2 : 1;
2184 unsigned LATF3 : 1;
2185 unsigned LATF4 : 1;
2186 unsigned LATF5 : 1;
2187 unsigned LATF6 : 1;
2188 unsigned LATF7 : 1;
2189 } __LATFbits_t;
2191 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
2193 #define _LATF0 0x01
2194 #define _LATF1 0x02
2195 #define _LATF2 0x04
2196 #define _LATF3 0x08
2197 #define _LATF4 0x10
2198 #define _LATF5 0x20
2199 #define _LATF6 0x40
2200 #define _LATF7 0x80
2202 //==============================================================================
2205 //==============================================================================
2206 // LATG Bits
2208 extern __at(0x0F8F) __sfr LATG;
2210 typedef union
2212 struct
2214 unsigned LATG0 : 1;
2215 unsigned LATG1 : 1;
2216 unsigned LATG2 : 1;
2217 unsigned LATG3 : 1;
2218 unsigned LATG4 : 1;
2219 unsigned LATG5 : 1;
2220 unsigned : 1;
2221 unsigned : 1;
2224 struct
2226 unsigned LATG : 6;
2227 unsigned : 2;
2229 } __LATGbits_t;
2231 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
2233 #define _LATG0 0x01
2234 #define _LATG1 0x02
2235 #define _LATG2 0x04
2236 #define _LATG3 0x08
2237 #define _LATG4 0x10
2238 #define _LATG5 0x20
2240 //==============================================================================
2243 //==============================================================================
2244 // LATH Bits
2246 extern __at(0x0F90) __sfr LATH;
2248 typedef struct
2250 unsigned LATH0 : 1;
2251 unsigned LATH1 : 1;
2252 unsigned LATH2 : 1;
2253 unsigned LATH3 : 1;
2254 unsigned LATH4 : 1;
2255 unsigned LATH5 : 1;
2256 unsigned LATH6 : 1;
2257 unsigned LATH7 : 1;
2258 } __LATHbits_t;
2260 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
2262 #define _LATH0 0x01
2263 #define _LATH1 0x02
2264 #define _LATH2 0x04
2265 #define _LATH3 0x08
2266 #define _LATH4 0x10
2267 #define _LATH5 0x20
2268 #define _LATH6 0x40
2269 #define _LATH7 0x80
2271 //==============================================================================
2274 //==============================================================================
2275 // LATJ Bits
2277 extern __at(0x0F91) __sfr LATJ;
2279 typedef struct
2281 unsigned LATJ0 : 1;
2282 unsigned LATJ1 : 1;
2283 unsigned LATJ2 : 1;
2284 unsigned LATJ3 : 1;
2285 unsigned LATJ4 : 1;
2286 unsigned LATJ5 : 1;
2287 unsigned LATJ6 : 1;
2288 unsigned LATJ7 : 1;
2289 } __LATJbits_t;
2291 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
2293 #define _LATJ0 0x01
2294 #define _LATJ1 0x02
2295 #define _LATJ2 0x04
2296 #define _LATJ3 0x08
2297 #define _LATJ4 0x10
2298 #define _LATJ5 0x20
2299 #define _LATJ6 0x40
2300 #define _LATJ7 0x80
2302 //==============================================================================
2305 //==============================================================================
2306 // DDRA Bits
2308 extern __at(0x0F92) __sfr DDRA;
2310 typedef union
2312 struct
2314 unsigned TRISA0 : 1;
2315 unsigned TRISA1 : 1;
2316 unsigned TRISA2 : 1;
2317 unsigned TRISA3 : 1;
2318 unsigned TRISA4 : 1;
2319 unsigned TRISA5 : 1;
2320 unsigned TRISA6 : 1;
2321 unsigned TRISA7 : 1;
2324 struct
2326 unsigned RA0 : 1;
2327 unsigned RA1 : 1;
2328 unsigned RA2 : 1;
2329 unsigned RA3 : 1;
2330 unsigned RA4 : 1;
2331 unsigned RA5 : 1;
2332 unsigned RA6 : 1;
2333 unsigned RA7 : 1;
2335 } __DDRAbits_t;
2337 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2339 #define _TRISA0 0x01
2340 #define _RA0 0x01
2341 #define _TRISA1 0x02
2342 #define _RA1 0x02
2343 #define _TRISA2 0x04
2344 #define _RA2 0x04
2345 #define _TRISA3 0x08
2346 #define _RA3 0x08
2347 #define _TRISA4 0x10
2348 #define _RA4 0x10
2349 #define _TRISA5 0x20
2350 #define _RA5 0x20
2351 #define _TRISA6 0x40
2352 #define _RA6 0x40
2353 #define _TRISA7 0x80
2354 #define _RA7 0x80
2356 //==============================================================================
2359 //==============================================================================
2360 // TRISA Bits
2362 extern __at(0x0F92) __sfr TRISA;
2364 typedef union
2366 struct
2368 unsigned TRISA0 : 1;
2369 unsigned TRISA1 : 1;
2370 unsigned TRISA2 : 1;
2371 unsigned TRISA3 : 1;
2372 unsigned TRISA4 : 1;
2373 unsigned TRISA5 : 1;
2374 unsigned TRISA6 : 1;
2375 unsigned TRISA7 : 1;
2378 struct
2380 unsigned RA0 : 1;
2381 unsigned RA1 : 1;
2382 unsigned RA2 : 1;
2383 unsigned RA3 : 1;
2384 unsigned RA4 : 1;
2385 unsigned RA5 : 1;
2386 unsigned RA6 : 1;
2387 unsigned RA7 : 1;
2389 } __TRISAbits_t;
2391 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2393 #define _TRISA_TRISA0 0x01
2394 #define _TRISA_RA0 0x01
2395 #define _TRISA_TRISA1 0x02
2396 #define _TRISA_RA1 0x02
2397 #define _TRISA_TRISA2 0x04
2398 #define _TRISA_RA2 0x04
2399 #define _TRISA_TRISA3 0x08
2400 #define _TRISA_RA3 0x08
2401 #define _TRISA_TRISA4 0x10
2402 #define _TRISA_RA4 0x10
2403 #define _TRISA_TRISA5 0x20
2404 #define _TRISA_RA5 0x20
2405 #define _TRISA_TRISA6 0x40
2406 #define _TRISA_RA6 0x40
2407 #define _TRISA_TRISA7 0x80
2408 #define _TRISA_RA7 0x80
2410 //==============================================================================
2413 //==============================================================================
2414 // DDRB Bits
2416 extern __at(0x0F93) __sfr DDRB;
2418 typedef union
2420 struct
2422 unsigned TRISB0 : 1;
2423 unsigned TRISB1 : 1;
2424 unsigned TRISB2 : 1;
2425 unsigned TRISB3 : 1;
2426 unsigned TRISB4 : 1;
2427 unsigned TRISB5 : 1;
2428 unsigned TRISB6 : 1;
2429 unsigned TRISB7 : 1;
2432 struct
2434 unsigned RB0 : 1;
2435 unsigned RB1 : 1;
2436 unsigned RB2 : 1;
2437 unsigned RB3 : 1;
2438 unsigned RB4 : 1;
2439 unsigned RB5 : 1;
2440 unsigned RB6 : 1;
2441 unsigned RB7 : 1;
2443 } __DDRBbits_t;
2445 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2447 #define _TRISB0 0x01
2448 #define _RB0 0x01
2449 #define _TRISB1 0x02
2450 #define _RB1 0x02
2451 #define _TRISB2 0x04
2452 #define _RB2 0x04
2453 #define _TRISB3 0x08
2454 #define _RB3 0x08
2455 #define _TRISB4 0x10
2456 #define _RB4 0x10
2457 #define _TRISB5 0x20
2458 #define _RB5 0x20
2459 #define _TRISB6 0x40
2460 #define _RB6 0x40
2461 #define _TRISB7 0x80
2462 #define _RB7 0x80
2464 //==============================================================================
2467 //==============================================================================
2468 // TRISB Bits
2470 extern __at(0x0F93) __sfr TRISB;
2472 typedef union
2474 struct
2476 unsigned TRISB0 : 1;
2477 unsigned TRISB1 : 1;
2478 unsigned TRISB2 : 1;
2479 unsigned TRISB3 : 1;
2480 unsigned TRISB4 : 1;
2481 unsigned TRISB5 : 1;
2482 unsigned TRISB6 : 1;
2483 unsigned TRISB7 : 1;
2486 struct
2488 unsigned RB0 : 1;
2489 unsigned RB1 : 1;
2490 unsigned RB2 : 1;
2491 unsigned RB3 : 1;
2492 unsigned RB4 : 1;
2493 unsigned RB5 : 1;
2494 unsigned RB6 : 1;
2495 unsigned RB7 : 1;
2497 } __TRISBbits_t;
2499 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2501 #define _TRISB_TRISB0 0x01
2502 #define _TRISB_RB0 0x01
2503 #define _TRISB_TRISB1 0x02
2504 #define _TRISB_RB1 0x02
2505 #define _TRISB_TRISB2 0x04
2506 #define _TRISB_RB2 0x04
2507 #define _TRISB_TRISB3 0x08
2508 #define _TRISB_RB3 0x08
2509 #define _TRISB_TRISB4 0x10
2510 #define _TRISB_RB4 0x10
2511 #define _TRISB_TRISB5 0x20
2512 #define _TRISB_RB5 0x20
2513 #define _TRISB_TRISB6 0x40
2514 #define _TRISB_RB6 0x40
2515 #define _TRISB_TRISB7 0x80
2516 #define _TRISB_RB7 0x80
2518 //==============================================================================
2521 //==============================================================================
2522 // DDRC Bits
2524 extern __at(0x0F94) __sfr DDRC;
2526 typedef union
2528 struct
2530 unsigned TRISC0 : 1;
2531 unsigned TRISC1 : 1;
2532 unsigned TRISC2 : 1;
2533 unsigned TRISC3 : 1;
2534 unsigned TRISC4 : 1;
2535 unsigned TRISC5 : 1;
2536 unsigned TRISC6 : 1;
2537 unsigned TRISC7 : 1;
2540 struct
2542 unsigned RC0 : 1;
2543 unsigned RC1 : 1;
2544 unsigned RC2 : 1;
2545 unsigned RC3 : 1;
2546 unsigned RC4 : 1;
2547 unsigned RC5 : 1;
2548 unsigned RC6 : 1;
2549 unsigned RC7 : 1;
2551 } __DDRCbits_t;
2553 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2555 #define _TRISC0 0x01
2556 #define _RC0 0x01
2557 #define _TRISC1 0x02
2558 #define _RC1 0x02
2559 #define _TRISC2 0x04
2560 #define _RC2 0x04
2561 #define _TRISC3 0x08
2562 #define _RC3 0x08
2563 #define _TRISC4 0x10
2564 #define _RC4 0x10
2565 #define _TRISC5 0x20
2566 #define _RC5 0x20
2567 #define _TRISC6 0x40
2568 #define _RC6 0x40
2569 #define _TRISC7 0x80
2570 #define _RC7 0x80
2572 //==============================================================================
2575 //==============================================================================
2576 // TRISC Bits
2578 extern __at(0x0F94) __sfr TRISC;
2580 typedef union
2582 struct
2584 unsigned TRISC0 : 1;
2585 unsigned TRISC1 : 1;
2586 unsigned TRISC2 : 1;
2587 unsigned TRISC3 : 1;
2588 unsigned TRISC4 : 1;
2589 unsigned TRISC5 : 1;
2590 unsigned TRISC6 : 1;
2591 unsigned TRISC7 : 1;
2594 struct
2596 unsigned RC0 : 1;
2597 unsigned RC1 : 1;
2598 unsigned RC2 : 1;
2599 unsigned RC3 : 1;
2600 unsigned RC4 : 1;
2601 unsigned RC5 : 1;
2602 unsigned RC6 : 1;
2603 unsigned RC7 : 1;
2605 } __TRISCbits_t;
2607 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2609 #define _TRISC_TRISC0 0x01
2610 #define _TRISC_RC0 0x01
2611 #define _TRISC_TRISC1 0x02
2612 #define _TRISC_RC1 0x02
2613 #define _TRISC_TRISC2 0x04
2614 #define _TRISC_RC2 0x04
2615 #define _TRISC_TRISC3 0x08
2616 #define _TRISC_RC3 0x08
2617 #define _TRISC_TRISC4 0x10
2618 #define _TRISC_RC4 0x10
2619 #define _TRISC_TRISC5 0x20
2620 #define _TRISC_RC5 0x20
2621 #define _TRISC_TRISC6 0x40
2622 #define _TRISC_RC6 0x40
2623 #define _TRISC_TRISC7 0x80
2624 #define _TRISC_RC7 0x80
2626 //==============================================================================
2629 //==============================================================================
2630 // DDRD Bits
2632 extern __at(0x0F95) __sfr DDRD;
2634 typedef union
2636 struct
2638 unsigned TRISD0 : 1;
2639 unsigned TRISD1 : 1;
2640 unsigned TRISD2 : 1;
2641 unsigned TRISD3 : 1;
2642 unsigned TRISD4 : 1;
2643 unsigned TRISD5 : 1;
2644 unsigned TRISD6 : 1;
2645 unsigned TRISD7 : 1;
2648 struct
2650 unsigned RD0 : 1;
2651 unsigned RD1 : 1;
2652 unsigned RD2 : 1;
2653 unsigned RD3 : 1;
2654 unsigned RD4 : 1;
2655 unsigned RD5 : 1;
2656 unsigned RD6 : 1;
2657 unsigned RD7 : 1;
2659 } __DDRDbits_t;
2661 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
2663 #define _TRISD0 0x01
2664 #define _RD0 0x01
2665 #define _TRISD1 0x02
2666 #define _RD1 0x02
2667 #define _TRISD2 0x04
2668 #define _RD2 0x04
2669 #define _TRISD3 0x08
2670 #define _RD3 0x08
2671 #define _TRISD4 0x10
2672 #define _RD4 0x10
2673 #define _TRISD5 0x20
2674 #define _RD5 0x20
2675 #define _TRISD6 0x40
2676 #define _RD6 0x40
2677 #define _TRISD7 0x80
2678 #define _RD7 0x80
2680 //==============================================================================
2683 //==============================================================================
2684 // TRISD Bits
2686 extern __at(0x0F95) __sfr TRISD;
2688 typedef union
2690 struct
2692 unsigned TRISD0 : 1;
2693 unsigned TRISD1 : 1;
2694 unsigned TRISD2 : 1;
2695 unsigned TRISD3 : 1;
2696 unsigned TRISD4 : 1;
2697 unsigned TRISD5 : 1;
2698 unsigned TRISD6 : 1;
2699 unsigned TRISD7 : 1;
2702 struct
2704 unsigned RD0 : 1;
2705 unsigned RD1 : 1;
2706 unsigned RD2 : 1;
2707 unsigned RD3 : 1;
2708 unsigned RD4 : 1;
2709 unsigned RD5 : 1;
2710 unsigned RD6 : 1;
2711 unsigned RD7 : 1;
2713 } __TRISDbits_t;
2715 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2717 #define _TRISD_TRISD0 0x01
2718 #define _TRISD_RD0 0x01
2719 #define _TRISD_TRISD1 0x02
2720 #define _TRISD_RD1 0x02
2721 #define _TRISD_TRISD2 0x04
2722 #define _TRISD_RD2 0x04
2723 #define _TRISD_TRISD3 0x08
2724 #define _TRISD_RD3 0x08
2725 #define _TRISD_TRISD4 0x10
2726 #define _TRISD_RD4 0x10
2727 #define _TRISD_TRISD5 0x20
2728 #define _TRISD_RD5 0x20
2729 #define _TRISD_TRISD6 0x40
2730 #define _TRISD_RD6 0x40
2731 #define _TRISD_TRISD7 0x80
2732 #define _TRISD_RD7 0x80
2734 //==============================================================================
2737 //==============================================================================
2738 // DDRE Bits
2740 extern __at(0x0F96) __sfr DDRE;
2742 typedef union
2744 struct
2746 unsigned TRISE0 : 1;
2747 unsigned TRISE1 : 1;
2748 unsigned TRISE2 : 1;
2749 unsigned TRISE3 : 1;
2750 unsigned TRISE4 : 1;
2751 unsigned TRISE5 : 1;
2752 unsigned TRISE6 : 1;
2753 unsigned TRISE7 : 1;
2756 struct
2758 unsigned RE0 : 1;
2759 unsigned RE1 : 1;
2760 unsigned RE2 : 1;
2761 unsigned RE3 : 1;
2762 unsigned RE4 : 1;
2763 unsigned RE5 : 1;
2764 unsigned RE6 : 1;
2765 unsigned RE7 : 1;
2767 } __DDREbits_t;
2769 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
2771 #define _TRISE0 0x01
2772 #define _RE0 0x01
2773 #define _TRISE1 0x02
2774 #define _RE1 0x02
2775 #define _TRISE2 0x04
2776 #define _RE2 0x04
2777 #define _TRISE3 0x08
2778 #define _RE3 0x08
2779 #define _TRISE4 0x10
2780 #define _RE4 0x10
2781 #define _TRISE5 0x20
2782 #define _RE5 0x20
2783 #define _TRISE6 0x40
2784 #define _RE6 0x40
2785 #define _TRISE7 0x80
2786 #define _RE7 0x80
2788 //==============================================================================
2791 //==============================================================================
2792 // TRISE Bits
2794 extern __at(0x0F96) __sfr TRISE;
2796 typedef union
2798 struct
2800 unsigned TRISE0 : 1;
2801 unsigned TRISE1 : 1;
2802 unsigned TRISE2 : 1;
2803 unsigned TRISE3 : 1;
2804 unsigned TRISE4 : 1;
2805 unsigned TRISE5 : 1;
2806 unsigned TRISE6 : 1;
2807 unsigned TRISE7 : 1;
2810 struct
2812 unsigned RE0 : 1;
2813 unsigned RE1 : 1;
2814 unsigned RE2 : 1;
2815 unsigned RE3 : 1;
2816 unsigned RE4 : 1;
2817 unsigned RE5 : 1;
2818 unsigned RE6 : 1;
2819 unsigned RE7 : 1;
2821 } __TRISEbits_t;
2823 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
2825 #define _TRISE_TRISE0 0x01
2826 #define _TRISE_RE0 0x01
2827 #define _TRISE_TRISE1 0x02
2828 #define _TRISE_RE1 0x02
2829 #define _TRISE_TRISE2 0x04
2830 #define _TRISE_RE2 0x04
2831 #define _TRISE_TRISE3 0x08
2832 #define _TRISE_RE3 0x08
2833 #define _TRISE_TRISE4 0x10
2834 #define _TRISE_RE4 0x10
2835 #define _TRISE_TRISE5 0x20
2836 #define _TRISE_RE5 0x20
2837 #define _TRISE_TRISE6 0x40
2838 #define _TRISE_RE6 0x40
2839 #define _TRISE_TRISE7 0x80
2840 #define _TRISE_RE7 0x80
2842 //==============================================================================
2845 //==============================================================================
2846 // DDRF Bits
2848 extern __at(0x0F97) __sfr DDRF;
2850 typedef union
2852 struct
2854 unsigned TRISF0 : 1;
2855 unsigned TRISF1 : 1;
2856 unsigned TRISF2 : 1;
2857 unsigned TRISF3 : 1;
2858 unsigned TRISF4 : 1;
2859 unsigned TRISF5 : 1;
2860 unsigned TRISF6 : 1;
2861 unsigned TRISF7 : 1;
2864 struct
2866 unsigned RF0 : 1;
2867 unsigned RF1 : 1;
2868 unsigned RF2 : 1;
2869 unsigned RF3 : 1;
2870 unsigned RF4 : 1;
2871 unsigned RF5 : 1;
2872 unsigned RF6 : 1;
2873 unsigned RF7 : 1;
2875 } __DDRFbits_t;
2877 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
2879 #define _TRISF0 0x01
2880 #define _RF0 0x01
2881 #define _TRISF1 0x02
2882 #define _RF1 0x02
2883 #define _TRISF2 0x04
2884 #define _RF2 0x04
2885 #define _TRISF3 0x08
2886 #define _RF3 0x08
2887 #define _TRISF4 0x10
2888 #define _RF4 0x10
2889 #define _TRISF5 0x20
2890 #define _RF5 0x20
2891 #define _TRISF6 0x40
2892 #define _RF6 0x40
2893 #define _TRISF7 0x80
2894 #define _RF7 0x80
2896 //==============================================================================
2899 //==============================================================================
2900 // TRISF Bits
2902 extern __at(0x0F97) __sfr TRISF;
2904 typedef union
2906 struct
2908 unsigned TRISF0 : 1;
2909 unsigned TRISF1 : 1;
2910 unsigned TRISF2 : 1;
2911 unsigned TRISF3 : 1;
2912 unsigned TRISF4 : 1;
2913 unsigned TRISF5 : 1;
2914 unsigned TRISF6 : 1;
2915 unsigned TRISF7 : 1;
2918 struct
2920 unsigned RF0 : 1;
2921 unsigned RF1 : 1;
2922 unsigned RF2 : 1;
2923 unsigned RF3 : 1;
2924 unsigned RF4 : 1;
2925 unsigned RF5 : 1;
2926 unsigned RF6 : 1;
2927 unsigned RF7 : 1;
2929 } __TRISFbits_t;
2931 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
2933 #define _TRISF_TRISF0 0x01
2934 #define _TRISF_RF0 0x01
2935 #define _TRISF_TRISF1 0x02
2936 #define _TRISF_RF1 0x02
2937 #define _TRISF_TRISF2 0x04
2938 #define _TRISF_RF2 0x04
2939 #define _TRISF_TRISF3 0x08
2940 #define _TRISF_RF3 0x08
2941 #define _TRISF_TRISF4 0x10
2942 #define _TRISF_RF4 0x10
2943 #define _TRISF_TRISF5 0x20
2944 #define _TRISF_RF5 0x20
2945 #define _TRISF_TRISF6 0x40
2946 #define _TRISF_RF6 0x40
2947 #define _TRISF_TRISF7 0x80
2948 #define _TRISF_RF7 0x80
2950 //==============================================================================
2953 //==============================================================================
2954 // DDRG Bits
2956 extern __at(0x0F98) __sfr DDRG;
2958 typedef union
2960 struct
2962 unsigned TRISG0 : 1;
2963 unsigned TRISG1 : 1;
2964 unsigned TRISG2 : 1;
2965 unsigned TRISG3 : 1;
2966 unsigned TRISG4 : 1;
2967 unsigned : 1;
2968 unsigned : 1;
2969 unsigned : 1;
2972 struct
2974 unsigned RG0 : 1;
2975 unsigned RG1 : 1;
2976 unsigned RG2 : 1;
2977 unsigned RG3 : 1;
2978 unsigned RG4 : 1;
2979 unsigned : 1;
2980 unsigned : 1;
2981 unsigned : 1;
2984 struct
2986 unsigned TRISG : 5;
2987 unsigned : 3;
2990 struct
2992 unsigned RG : 5;
2993 unsigned : 3;
2995 } __DDRGbits_t;
2997 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
2999 #define _TRISG0 0x01
3000 #define _RG0 0x01
3001 #define _TRISG1 0x02
3002 #define _RG1 0x02
3003 #define _TRISG2 0x04
3004 #define _RG2 0x04
3005 #define _TRISG3 0x08
3006 #define _RG3 0x08
3007 #define _TRISG4 0x10
3008 #define _RG4 0x10
3010 //==============================================================================
3013 //==============================================================================
3014 // TRISG Bits
3016 extern __at(0x0F98) __sfr TRISG;
3018 typedef union
3020 struct
3022 unsigned TRISG0 : 1;
3023 unsigned TRISG1 : 1;
3024 unsigned TRISG2 : 1;
3025 unsigned TRISG3 : 1;
3026 unsigned TRISG4 : 1;
3027 unsigned : 1;
3028 unsigned : 1;
3029 unsigned : 1;
3032 struct
3034 unsigned RG0 : 1;
3035 unsigned RG1 : 1;
3036 unsigned RG2 : 1;
3037 unsigned RG3 : 1;
3038 unsigned RG4 : 1;
3039 unsigned : 1;
3040 unsigned : 1;
3041 unsigned : 1;
3044 struct
3046 unsigned RG : 5;
3047 unsigned : 3;
3050 struct
3052 unsigned TRISG : 5;
3053 unsigned : 3;
3055 } __TRISGbits_t;
3057 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
3059 #define _TRISG_TRISG0 0x01
3060 #define _TRISG_RG0 0x01
3061 #define _TRISG_TRISG1 0x02
3062 #define _TRISG_RG1 0x02
3063 #define _TRISG_TRISG2 0x04
3064 #define _TRISG_RG2 0x04
3065 #define _TRISG_TRISG3 0x08
3066 #define _TRISG_RG3 0x08
3067 #define _TRISG_TRISG4 0x10
3068 #define _TRISG_RG4 0x10
3070 //==============================================================================
3073 //==============================================================================
3074 // DDRH Bits
3076 extern __at(0x0F99) __sfr DDRH;
3078 typedef union
3080 struct
3082 unsigned TRISH0 : 1;
3083 unsigned TRISH1 : 1;
3084 unsigned TRISH2 : 1;
3085 unsigned TRISH3 : 1;
3086 unsigned TRISH4 : 1;
3087 unsigned TRISH5 : 1;
3088 unsigned TRISH6 : 1;
3089 unsigned TRISH7 : 1;
3092 struct
3094 unsigned RH0 : 1;
3095 unsigned RH1 : 1;
3096 unsigned RH2 : 1;
3097 unsigned RH3 : 1;
3098 unsigned RH4 : 1;
3099 unsigned RH5 : 1;
3100 unsigned RH6 : 1;
3101 unsigned RH7 : 1;
3103 } __DDRHbits_t;
3105 extern __at(0x0F99) volatile __DDRHbits_t DDRHbits;
3107 #define _TRISH0 0x01
3108 #define _RH0 0x01
3109 #define _TRISH1 0x02
3110 #define _RH1 0x02
3111 #define _TRISH2 0x04
3112 #define _RH2 0x04
3113 #define _TRISH3 0x08
3114 #define _RH3 0x08
3115 #define _TRISH4 0x10
3116 #define _RH4 0x10
3117 #define _TRISH5 0x20
3118 #define _RH5 0x20
3119 #define _TRISH6 0x40
3120 #define _RH6 0x40
3121 #define _TRISH7 0x80
3122 #define _RH7 0x80
3124 //==============================================================================
3127 //==============================================================================
3128 // TRISH Bits
3130 extern __at(0x0F99) __sfr TRISH;
3132 typedef union
3134 struct
3136 unsigned TRISH0 : 1;
3137 unsigned TRISH1 : 1;
3138 unsigned TRISH2 : 1;
3139 unsigned TRISH3 : 1;
3140 unsigned TRISH4 : 1;
3141 unsigned TRISH5 : 1;
3142 unsigned TRISH6 : 1;
3143 unsigned TRISH7 : 1;
3146 struct
3148 unsigned RH0 : 1;
3149 unsigned RH1 : 1;
3150 unsigned RH2 : 1;
3151 unsigned RH3 : 1;
3152 unsigned RH4 : 1;
3153 unsigned RH5 : 1;
3154 unsigned RH6 : 1;
3155 unsigned RH7 : 1;
3157 } __TRISHbits_t;
3159 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
3161 #define _TRISH_TRISH0 0x01
3162 #define _TRISH_RH0 0x01
3163 #define _TRISH_TRISH1 0x02
3164 #define _TRISH_RH1 0x02
3165 #define _TRISH_TRISH2 0x04
3166 #define _TRISH_RH2 0x04
3167 #define _TRISH_TRISH3 0x08
3168 #define _TRISH_RH3 0x08
3169 #define _TRISH_TRISH4 0x10
3170 #define _TRISH_RH4 0x10
3171 #define _TRISH_TRISH5 0x20
3172 #define _TRISH_RH5 0x20
3173 #define _TRISH_TRISH6 0x40
3174 #define _TRISH_RH6 0x40
3175 #define _TRISH_TRISH7 0x80
3176 #define _TRISH_RH7 0x80
3178 //==============================================================================
3181 //==============================================================================
3182 // DDRJ Bits
3184 extern __at(0x0F9A) __sfr DDRJ;
3186 typedef union
3188 struct
3190 unsigned TRISJ0 : 1;
3191 unsigned TRISJ1 : 1;
3192 unsigned TRISJ2 : 1;
3193 unsigned TRISJ3 : 1;
3194 unsigned TRISJ4 : 1;
3195 unsigned TRISJ5 : 1;
3196 unsigned TRISJ6 : 1;
3197 unsigned TRISJ7 : 1;
3200 struct
3202 unsigned RJ0 : 1;
3203 unsigned RJ1 : 1;
3204 unsigned RJ2 : 1;
3205 unsigned RJ3 : 1;
3206 unsigned RJ4 : 1;
3207 unsigned RJ5 : 1;
3208 unsigned RJ6 : 1;
3209 unsigned RJ7 : 1;
3211 } __DDRJbits_t;
3213 extern __at(0x0F9A) volatile __DDRJbits_t DDRJbits;
3215 #define _TRISJ0 0x01
3216 #define _RJ0 0x01
3217 #define _TRISJ1 0x02
3218 #define _RJ1 0x02
3219 #define _TRISJ2 0x04
3220 #define _RJ2 0x04
3221 #define _TRISJ3 0x08
3222 #define _RJ3 0x08
3223 #define _TRISJ4 0x10
3224 #define _RJ4 0x10
3225 #define _TRISJ5 0x20
3226 #define _RJ5 0x20
3227 #define _TRISJ6 0x40
3228 #define _RJ6 0x40
3229 #define _TRISJ7 0x80
3230 #define _RJ7 0x80
3232 //==============================================================================
3235 //==============================================================================
3236 // TRISJ Bits
3238 extern __at(0x0F9A) __sfr TRISJ;
3240 typedef union
3242 struct
3244 unsigned TRISJ0 : 1;
3245 unsigned TRISJ1 : 1;
3246 unsigned TRISJ2 : 1;
3247 unsigned TRISJ3 : 1;
3248 unsigned TRISJ4 : 1;
3249 unsigned TRISJ5 : 1;
3250 unsigned TRISJ6 : 1;
3251 unsigned TRISJ7 : 1;
3254 struct
3256 unsigned RJ0 : 1;
3257 unsigned RJ1 : 1;
3258 unsigned RJ2 : 1;
3259 unsigned RJ3 : 1;
3260 unsigned RJ4 : 1;
3261 unsigned RJ5 : 1;
3262 unsigned RJ6 : 1;
3263 unsigned RJ7 : 1;
3265 } __TRISJbits_t;
3267 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
3269 #define _TRISJ_TRISJ0 0x01
3270 #define _TRISJ_RJ0 0x01
3271 #define _TRISJ_TRISJ1 0x02
3272 #define _TRISJ_RJ1 0x02
3273 #define _TRISJ_TRISJ2 0x04
3274 #define _TRISJ_RJ2 0x04
3275 #define _TRISJ_TRISJ3 0x08
3276 #define _TRISJ_RJ3 0x08
3277 #define _TRISJ_TRISJ4 0x10
3278 #define _TRISJ_RJ4 0x10
3279 #define _TRISJ_TRISJ5 0x20
3280 #define _TRISJ_RJ5 0x20
3281 #define _TRISJ_TRISJ6 0x40
3282 #define _TRISJ_RJ6 0x40
3283 #define _TRISJ_TRISJ7 0x80
3284 #define _TRISJ_RJ7 0x80
3286 //==============================================================================
3289 //==============================================================================
3290 // OSCTUNE Bits
3292 extern __at(0x0F9B) __sfr OSCTUNE;
3294 typedef union
3296 struct
3298 unsigned TUN0 : 1;
3299 unsigned TUN1 : 1;
3300 unsigned TUN2 : 1;
3301 unsigned TUN3 : 1;
3302 unsigned TUN4 : 1;
3303 unsigned : 1;
3304 unsigned PLLEN : 1;
3305 unsigned INTSRC : 1;
3308 struct
3310 unsigned TUN : 5;
3311 unsigned : 3;
3313 } __OSCTUNEbits_t;
3315 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3317 #define _TUN0 0x01
3318 #define _TUN1 0x02
3319 #define _TUN2 0x04
3320 #define _TUN3 0x08
3321 #define _TUN4 0x10
3322 #define _PLLEN 0x40
3323 #define _INTSRC 0x80
3325 //==============================================================================
3328 //==============================================================================
3329 // MEMCON Bits
3331 extern __at(0x0F9C) __sfr MEMCON;
3333 typedef union
3335 struct
3337 unsigned WM0 : 1;
3338 unsigned WM1 : 1;
3339 unsigned : 1;
3340 unsigned : 1;
3341 unsigned WAIT0 : 1;
3342 unsigned WAIT1 : 1;
3343 unsigned : 1;
3344 unsigned EBDIS : 1;
3347 struct
3349 unsigned WM : 2;
3350 unsigned : 6;
3353 struct
3355 unsigned : 4;
3356 unsigned WAIT : 2;
3357 unsigned : 2;
3359 } __MEMCONbits_t;
3361 extern __at(0x0F9C) volatile __MEMCONbits_t MEMCONbits;
3363 #define _WM0 0x01
3364 #define _WM1 0x02
3365 #define _WAIT0 0x10
3366 #define _WAIT1 0x20
3367 #define _EBDIS 0x80
3369 //==============================================================================
3372 //==============================================================================
3373 // PIE1 Bits
3375 extern __at(0x0F9D) __sfr PIE1;
3377 typedef union
3379 struct
3381 unsigned TMR1IE : 1;
3382 unsigned TMR2IE : 1;
3383 unsigned CCP1IE : 1;
3384 unsigned SSP1IE : 1;
3385 unsigned TX1IE : 1;
3386 unsigned RC1IE : 1;
3387 unsigned ADIE : 1;
3388 unsigned PSPIE : 1;
3391 struct
3393 unsigned : 1;
3394 unsigned : 1;
3395 unsigned : 1;
3396 unsigned SSPIE : 1;
3397 unsigned TXIE : 1;
3398 unsigned RCIE : 1;
3399 unsigned : 1;
3400 unsigned : 1;
3402 } __PIE1bits_t;
3404 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3406 #define _TMR1IE 0x01
3407 #define _TMR2IE 0x02
3408 #define _CCP1IE 0x04
3409 #define _SSP1IE 0x08
3410 #define _SSPIE 0x08
3411 #define _TX1IE 0x10
3412 #define _TXIE 0x10
3413 #define _RC1IE 0x20
3414 #define _RCIE 0x20
3415 #define _ADIE 0x40
3416 #define _PSPIE 0x80
3418 //==============================================================================
3421 //==============================================================================
3422 // PIR1 Bits
3424 extern __at(0x0F9E) __sfr PIR1;
3426 typedef union
3428 struct
3430 unsigned TMR1IF : 1;
3431 unsigned TMR2IF : 1;
3432 unsigned CCP1IF : 1;
3433 unsigned SSP1IF : 1;
3434 unsigned TX1IF : 1;
3435 unsigned RC1IF : 1;
3436 unsigned ADIF : 1;
3437 unsigned PSPIF : 1;
3440 struct
3442 unsigned : 1;
3443 unsigned : 1;
3444 unsigned : 1;
3445 unsigned SSPIF : 1;
3446 unsigned TXIF : 1;
3447 unsigned RCIF : 1;
3448 unsigned : 1;
3449 unsigned : 1;
3451 } __PIR1bits_t;
3453 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
3455 #define _TMR1IF 0x01
3456 #define _TMR2IF 0x02
3457 #define _CCP1IF 0x04
3458 #define _SSP1IF 0x08
3459 #define _SSPIF 0x08
3460 #define _TX1IF 0x10
3461 #define _TXIF 0x10
3462 #define _RC1IF 0x20
3463 #define _RCIF 0x20
3464 #define _ADIF 0x40
3465 #define _PSPIF 0x80
3467 //==============================================================================
3470 //==============================================================================
3471 // IPR1 Bits
3473 extern __at(0x0F9F) __sfr IPR1;
3475 typedef union
3477 struct
3479 unsigned TMR1IP : 1;
3480 unsigned TMR2IP : 1;
3481 unsigned CCP1IP : 1;
3482 unsigned SSP1IP : 1;
3483 unsigned TX1IP : 1;
3484 unsigned RC1IP : 1;
3485 unsigned ADIP : 1;
3486 unsigned PSPIP : 1;
3489 struct
3491 unsigned : 1;
3492 unsigned : 1;
3493 unsigned : 1;
3494 unsigned SSPIP : 1;
3495 unsigned TXIP : 1;
3496 unsigned RCIP : 1;
3497 unsigned : 1;
3498 unsigned : 1;
3500 } __IPR1bits_t;
3502 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
3504 #define _TMR1IP 0x01
3505 #define _TMR2IP 0x02
3506 #define _CCP1IP 0x04
3507 #define _SSP1IP 0x08
3508 #define _SSPIP 0x08
3509 #define _TX1IP 0x10
3510 #define _TXIP 0x10
3511 #define _RC1IP 0x20
3512 #define _RCIP 0x20
3513 #define _ADIP 0x40
3514 #define _PSPIP 0x80
3516 //==============================================================================
3519 //==============================================================================
3520 // PIE2 Bits
3522 extern __at(0x0FA0) __sfr PIE2;
3524 typedef union
3526 struct
3528 unsigned CCP2IE : 1;
3529 unsigned TMR3IE : 1;
3530 unsigned HLVDIE : 1;
3531 unsigned BCL1IE : 1;
3532 unsigned EEIE : 1;
3533 unsigned : 1;
3534 unsigned CMIE : 1;
3535 unsigned OSCFIE : 1;
3538 struct
3540 unsigned : 1;
3541 unsigned : 1;
3542 unsigned LVDIE : 1;
3543 unsigned BCLIE : 1;
3544 unsigned : 1;
3545 unsigned : 1;
3546 unsigned : 1;
3547 unsigned : 1;
3549 } __PIE2bits_t;
3551 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3553 #define _CCP2IE 0x01
3554 #define _TMR3IE 0x02
3555 #define _HLVDIE 0x04
3556 #define _LVDIE 0x04
3557 #define _BCL1IE 0x08
3558 #define _BCLIE 0x08
3559 #define _EEIE 0x10
3560 #define _CMIE 0x40
3561 #define _OSCFIE 0x80
3563 //==============================================================================
3566 //==============================================================================
3567 // PIR2 Bits
3569 extern __at(0x0FA1) __sfr PIR2;
3571 typedef union
3573 struct
3575 unsigned CCP2IF : 1;
3576 unsigned TMR3IF : 1;
3577 unsigned HLVDIF : 1;
3578 unsigned BCL1IF : 1;
3579 unsigned EEIF : 1;
3580 unsigned : 1;
3581 unsigned CMIF : 1;
3582 unsigned OSCFIF : 1;
3585 struct
3587 unsigned : 1;
3588 unsigned : 1;
3589 unsigned LVDIF : 1;
3590 unsigned BCLIF : 1;
3591 unsigned : 1;
3592 unsigned : 1;
3593 unsigned : 1;
3594 unsigned : 1;
3596 } __PIR2bits_t;
3598 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3600 #define _CCP2IF 0x01
3601 #define _TMR3IF 0x02
3602 #define _HLVDIF 0x04
3603 #define _LVDIF 0x04
3604 #define _BCL1IF 0x08
3605 #define _BCLIF 0x08
3606 #define _EEIF 0x10
3607 #define _CMIF 0x40
3608 #define _OSCFIF 0x80
3610 //==============================================================================
3613 //==============================================================================
3614 // IPR2 Bits
3616 extern __at(0x0FA2) __sfr IPR2;
3618 typedef union
3620 struct
3622 unsigned CCP2IP : 1;
3623 unsigned TMR3IP : 1;
3624 unsigned HLVDIP : 1;
3625 unsigned BCL1IP : 1;
3626 unsigned EEIP : 1;
3627 unsigned : 1;
3628 unsigned CMIP : 1;
3629 unsigned OSCFIP : 1;
3632 struct
3634 unsigned : 1;
3635 unsigned : 1;
3636 unsigned LVDIP : 1;
3637 unsigned BCLIP : 1;
3638 unsigned : 1;
3639 unsigned : 1;
3640 unsigned : 1;
3641 unsigned : 1;
3643 } __IPR2bits_t;
3645 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3647 #define _CCP2IP 0x01
3648 #define _TMR3IP 0x02
3649 #define _HLVDIP 0x04
3650 #define _LVDIP 0x04
3651 #define _BCL1IP 0x08
3652 #define _BCLIP 0x08
3653 #define _EEIP 0x10
3654 #define _CMIP 0x40
3655 #define _OSCFIP 0x80
3657 //==============================================================================
3660 //==============================================================================
3661 // PIE3 Bits
3663 extern __at(0x0FA3) __sfr PIE3;
3665 typedef struct
3667 unsigned CCP3IE : 1;
3668 unsigned CCP4IE : 1;
3669 unsigned CCP5IE : 1;
3670 unsigned TMR4IE : 1;
3671 unsigned TX2IE : 1;
3672 unsigned RC2IE : 1;
3673 unsigned BCL2IE : 1;
3674 unsigned SSP2IE : 1;
3675 } __PIE3bits_t;
3677 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3679 #define _CCP3IE 0x01
3680 #define _CCP4IE 0x02
3681 #define _CCP5IE 0x04
3682 #define _TMR4IE 0x08
3683 #define _TX2IE 0x10
3684 #define _RC2IE 0x20
3685 #define _BCL2IE 0x40
3686 #define _SSP2IE 0x80
3688 //==============================================================================
3691 //==============================================================================
3692 // PIR3 Bits
3694 extern __at(0x0FA4) __sfr PIR3;
3696 typedef struct
3698 unsigned CCP3IF : 1;
3699 unsigned CCP4IF : 1;
3700 unsigned CCP5IF : 1;
3701 unsigned TMR4IF : 1;
3702 unsigned TX2IF : 1;
3703 unsigned RC2IF : 1;
3704 unsigned BCL2IF : 1;
3705 unsigned SSP2IF : 1;
3706 } __PIR3bits_t;
3708 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3710 #define _CCP3IF 0x01
3711 #define _CCP4IF 0x02
3712 #define _CCP5IF 0x04
3713 #define _TMR4IF 0x08
3714 #define _TX2IF 0x10
3715 #define _RC2IF 0x20
3716 #define _BCL2IF 0x40
3717 #define _SSP2IF 0x80
3719 //==============================================================================
3722 //==============================================================================
3723 // IPR3 Bits
3725 extern __at(0x0FA5) __sfr IPR3;
3727 typedef struct
3729 unsigned CCP3IP : 1;
3730 unsigned CCP4IP : 1;
3731 unsigned CCP5IP : 1;
3732 unsigned TMR4IP : 1;
3733 unsigned TX2IP : 1;
3734 unsigned RC2IP : 1;
3735 unsigned BCL2IP : 1;
3736 unsigned SSP2IP : 1;
3737 } __IPR3bits_t;
3739 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3741 #define _CCP3IP 0x01
3742 #define _CCP4IP 0x02
3743 #define _CCP5IP 0x04
3744 #define _TMR4IP 0x08
3745 #define _TX2IP 0x10
3746 #define _RC2IP 0x20
3747 #define _BCL2IP 0x40
3748 #define _SSP2IP 0x80
3750 //==============================================================================
3753 //==============================================================================
3754 // EECON1 Bits
3756 extern __at(0x0FA6) __sfr EECON1;
3758 typedef struct
3760 unsigned RD : 1;
3761 unsigned WR : 1;
3762 unsigned WREN : 1;
3763 unsigned WRERR : 1;
3764 unsigned FREE : 1;
3765 unsigned : 1;
3766 unsigned CFGS : 1;
3767 unsigned EEPGD : 1;
3768 } __EECON1bits_t;
3770 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3772 #define _RD 0x01
3773 #define _WR 0x02
3774 #define _WREN 0x04
3775 #define _WRERR 0x08
3776 #define _FREE 0x10
3777 #define _CFGS 0x40
3778 #define _EEPGD 0x80
3780 //==============================================================================
3782 extern __at(0x0FA7) __sfr EECON2;
3783 extern __at(0x0FA8) __sfr EEDATA;
3784 extern __at(0x0FA9) __sfr EEADR;
3785 extern __at(0x0FAA) __sfr EEADRH;
3787 //==============================================================================
3788 // RCSTA Bits
3790 extern __at(0x0FAB) __sfr RCSTA;
3792 typedef union
3794 struct
3796 unsigned RX9D : 1;
3797 unsigned OERR : 1;
3798 unsigned FERR : 1;
3799 unsigned ADDEN : 1;
3800 unsigned CREN : 1;
3801 unsigned SREN : 1;
3802 unsigned RX9 : 1;
3803 unsigned SPEN : 1;
3806 struct
3808 unsigned RCD8 : 1;
3809 unsigned OERR1 : 1;
3810 unsigned FERR1 : 1;
3811 unsigned ADDEN1 : 1;
3812 unsigned CREN1 : 1;
3813 unsigned SREN1 : 1;
3814 unsigned RC9 : 1;
3815 unsigned SPEN1 : 1;
3818 struct
3820 unsigned RX9D1 : 1;
3821 unsigned : 1;
3822 unsigned : 1;
3823 unsigned : 1;
3824 unsigned : 1;
3825 unsigned : 1;
3826 unsigned NOT_RC8 : 1;
3827 unsigned : 1;
3830 struct
3832 unsigned : 1;
3833 unsigned : 1;
3834 unsigned : 1;
3835 unsigned : 1;
3836 unsigned : 1;
3837 unsigned : 1;
3838 unsigned RC8_9 : 1;
3839 unsigned : 1;
3842 struct
3844 unsigned : 1;
3845 unsigned : 1;
3846 unsigned : 1;
3847 unsigned : 1;
3848 unsigned : 1;
3849 unsigned : 1;
3850 unsigned RX91 : 1;
3851 unsigned : 1;
3853 } __RCSTAbits_t;
3855 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
3857 #define _RX9D 0x01
3858 #define _RCD8 0x01
3859 #define _RX9D1 0x01
3860 #define _OERR 0x02
3861 #define _OERR1 0x02
3862 #define _FERR 0x04
3863 #define _FERR1 0x04
3864 #define _ADDEN 0x08
3865 #define _ADDEN1 0x08
3866 #define _CREN 0x10
3867 #define _CREN1 0x10
3868 #define _SREN 0x20
3869 #define _SREN1 0x20
3870 #define _RX9 0x40
3871 #define _RC9 0x40
3872 #define _NOT_RC8 0x40
3873 #define _RC8_9 0x40
3874 #define _RX91 0x40
3875 #define _SPEN 0x80
3876 #define _SPEN1 0x80
3878 //==============================================================================
3881 //==============================================================================
3882 // RCSTA1 Bits
3884 extern __at(0x0FAB) __sfr RCSTA1;
3886 typedef union
3888 struct
3890 unsigned RX9D : 1;
3891 unsigned OERR : 1;
3892 unsigned FERR : 1;
3893 unsigned ADDEN : 1;
3894 unsigned CREN : 1;
3895 unsigned SREN : 1;
3896 unsigned RX9 : 1;
3897 unsigned SPEN : 1;
3900 struct
3902 unsigned RCD8 : 1;
3903 unsigned OERR1 : 1;
3904 unsigned FERR1 : 1;
3905 unsigned ADDEN1 : 1;
3906 unsigned CREN1 : 1;
3907 unsigned SREN1 : 1;
3908 unsigned RC9 : 1;
3909 unsigned SPEN1 : 1;
3912 struct
3914 unsigned RX9D1 : 1;
3915 unsigned : 1;
3916 unsigned : 1;
3917 unsigned : 1;
3918 unsigned : 1;
3919 unsigned : 1;
3920 unsigned NOT_RC8 : 1;
3921 unsigned : 1;
3924 struct
3926 unsigned : 1;
3927 unsigned : 1;
3928 unsigned : 1;
3929 unsigned : 1;
3930 unsigned : 1;
3931 unsigned : 1;
3932 unsigned RC8_9 : 1;
3933 unsigned : 1;
3936 struct
3938 unsigned : 1;
3939 unsigned : 1;
3940 unsigned : 1;
3941 unsigned : 1;
3942 unsigned : 1;
3943 unsigned : 1;
3944 unsigned RX91 : 1;
3945 unsigned : 1;
3947 } __RCSTA1bits_t;
3949 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
3951 #define _RCSTA1_RX9D 0x01
3952 #define _RCSTA1_RCD8 0x01
3953 #define _RCSTA1_RX9D1 0x01
3954 #define _RCSTA1_OERR 0x02
3955 #define _RCSTA1_OERR1 0x02
3956 #define _RCSTA1_FERR 0x04
3957 #define _RCSTA1_FERR1 0x04
3958 #define _RCSTA1_ADDEN 0x08
3959 #define _RCSTA1_ADDEN1 0x08
3960 #define _RCSTA1_CREN 0x10
3961 #define _RCSTA1_CREN1 0x10
3962 #define _RCSTA1_SREN 0x20
3963 #define _RCSTA1_SREN1 0x20
3964 #define _RCSTA1_RX9 0x40
3965 #define _RCSTA1_RC9 0x40
3966 #define _RCSTA1_NOT_RC8 0x40
3967 #define _RCSTA1_RC8_9 0x40
3968 #define _RCSTA1_RX91 0x40
3969 #define _RCSTA1_SPEN 0x80
3970 #define _RCSTA1_SPEN1 0x80
3972 //==============================================================================
3975 //==============================================================================
3976 // TXSTA Bits
3978 extern __at(0x0FAC) __sfr TXSTA;
3980 typedef union
3982 struct
3984 unsigned TX9D : 1;
3985 unsigned TRMT : 1;
3986 unsigned BRGH : 1;
3987 unsigned SENDB : 1;
3988 unsigned SYNC : 1;
3989 unsigned TXEN : 1;
3990 unsigned TX9 : 1;
3991 unsigned CSRC : 1;
3994 struct
3996 unsigned TXD8 : 1;
3997 unsigned TRMT1 : 1;
3998 unsigned BRGH1 : 1;
3999 unsigned SENDB1 : 1;
4000 unsigned SYNC1 : 1;
4001 unsigned TXEN1 : 1;
4002 unsigned TX8_9 : 1;
4003 unsigned CSRC1 : 1;
4006 struct
4008 unsigned TX9D1 : 1;
4009 unsigned : 1;
4010 unsigned : 1;
4011 unsigned : 1;
4012 unsigned : 1;
4013 unsigned : 1;
4014 unsigned NOT_TX8 : 1;
4015 unsigned : 1;
4018 struct
4020 unsigned : 1;
4021 unsigned : 1;
4022 unsigned : 1;
4023 unsigned : 1;
4024 unsigned : 1;
4025 unsigned : 1;
4026 unsigned TX91 : 1;
4027 unsigned : 1;
4029 } __TXSTAbits_t;
4031 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
4033 #define _TX9D 0x01
4034 #define _TXD8 0x01
4035 #define _TX9D1 0x01
4036 #define _TRMT 0x02
4037 #define _TRMT1 0x02
4038 #define _BRGH 0x04
4039 #define _BRGH1 0x04
4040 #define _SENDB 0x08
4041 #define _SENDB1 0x08
4042 #define _SYNC 0x10
4043 #define _SYNC1 0x10
4044 #define _TXEN 0x20
4045 #define _TXEN1 0x20
4046 #define _TX9 0x40
4047 #define _TX8_9 0x40
4048 #define _NOT_TX8 0x40
4049 #define _TX91 0x40
4050 #define _CSRC 0x80
4051 #define _CSRC1 0x80
4053 //==============================================================================
4056 //==============================================================================
4057 // TXSTA1 Bits
4059 extern __at(0x0FAC) __sfr TXSTA1;
4061 typedef union
4063 struct
4065 unsigned TX9D : 1;
4066 unsigned TRMT : 1;
4067 unsigned BRGH : 1;
4068 unsigned SENDB : 1;
4069 unsigned SYNC : 1;
4070 unsigned TXEN : 1;
4071 unsigned TX9 : 1;
4072 unsigned CSRC : 1;
4075 struct
4077 unsigned TXD8 : 1;
4078 unsigned TRMT1 : 1;
4079 unsigned BRGH1 : 1;
4080 unsigned SENDB1 : 1;
4081 unsigned SYNC1 : 1;
4082 unsigned TXEN1 : 1;
4083 unsigned TX8_9 : 1;
4084 unsigned CSRC1 : 1;
4087 struct
4089 unsigned TX9D1 : 1;
4090 unsigned : 1;
4091 unsigned : 1;
4092 unsigned : 1;
4093 unsigned : 1;
4094 unsigned : 1;
4095 unsigned NOT_TX8 : 1;
4096 unsigned : 1;
4099 struct
4101 unsigned : 1;
4102 unsigned : 1;
4103 unsigned : 1;
4104 unsigned : 1;
4105 unsigned : 1;
4106 unsigned : 1;
4107 unsigned TX91 : 1;
4108 unsigned : 1;
4110 } __TXSTA1bits_t;
4112 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
4114 #define _TXSTA1_TX9D 0x01
4115 #define _TXSTA1_TXD8 0x01
4116 #define _TXSTA1_TX9D1 0x01
4117 #define _TXSTA1_TRMT 0x02
4118 #define _TXSTA1_TRMT1 0x02
4119 #define _TXSTA1_BRGH 0x04
4120 #define _TXSTA1_BRGH1 0x04
4121 #define _TXSTA1_SENDB 0x08
4122 #define _TXSTA1_SENDB1 0x08
4123 #define _TXSTA1_SYNC 0x10
4124 #define _TXSTA1_SYNC1 0x10
4125 #define _TXSTA1_TXEN 0x20
4126 #define _TXSTA1_TXEN1 0x20
4127 #define _TXSTA1_TX9 0x40
4128 #define _TXSTA1_TX8_9 0x40
4129 #define _TXSTA1_NOT_TX8 0x40
4130 #define _TXSTA1_TX91 0x40
4131 #define _TXSTA1_CSRC 0x80
4132 #define _TXSTA1_CSRC1 0x80
4134 //==============================================================================
4136 extern __at(0x0FAD) __sfr TXREG;
4137 extern __at(0x0FAD) __sfr TXREG1;
4138 extern __at(0x0FAE) __sfr RCREG;
4139 extern __at(0x0FAE) __sfr RCREG1;
4140 extern __at(0x0FAF) __sfr SPBRG;
4141 extern __at(0x0FAF) __sfr SPBRG1;
4143 //==============================================================================
4144 // PSPCON Bits
4146 extern __at(0x0FB0) __sfr PSPCON;
4148 typedef struct
4150 unsigned : 1;
4151 unsigned : 1;
4152 unsigned : 1;
4153 unsigned : 1;
4154 unsigned PSPMODE : 1;
4155 unsigned IBOV : 1;
4156 unsigned OBF : 1;
4157 unsigned IBF : 1;
4158 } __PSPCONbits_t;
4160 extern __at(0x0FB0) volatile __PSPCONbits_t PSPCONbits;
4162 #define _PSPMODE 0x10
4163 #define _IBOV 0x20
4164 #define _OBF 0x40
4165 #define _IBF 0x80
4167 //==============================================================================
4170 //==============================================================================
4171 // T3CON Bits
4173 extern __at(0x0FB1) __sfr T3CON;
4175 typedef union
4177 struct
4179 unsigned TMR3ON : 1;
4180 unsigned TMR3CS : 1;
4181 unsigned NOT_T3SYNC : 1;
4182 unsigned T3CCP1 : 1;
4183 unsigned T3CKPS0 : 1;
4184 unsigned T3CKPS1 : 1;
4185 unsigned T3CCP2 : 1;
4186 unsigned RD16 : 1;
4189 struct
4191 unsigned : 1;
4192 unsigned : 1;
4193 unsigned T3SYNC : 1;
4194 unsigned : 1;
4195 unsigned : 1;
4196 unsigned : 1;
4197 unsigned : 1;
4198 unsigned : 1;
4201 struct
4203 unsigned : 1;
4204 unsigned : 1;
4205 unsigned T3INSYNC : 1;
4206 unsigned : 1;
4207 unsigned : 1;
4208 unsigned : 1;
4209 unsigned : 1;
4210 unsigned : 1;
4213 struct
4215 unsigned : 4;
4216 unsigned T3CKPS : 2;
4217 unsigned : 2;
4219 } __T3CONbits_t;
4221 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
4223 #define _T3CON_TMR3ON 0x01
4224 #define _T3CON_TMR3CS 0x02
4225 #define _T3CON_NOT_T3SYNC 0x04
4226 #define _T3CON_T3SYNC 0x04
4227 #define _T3CON_T3INSYNC 0x04
4228 #define _T3CON_T3CCP1 0x08
4229 #define _T3CON_T3CKPS0 0x10
4230 #define _T3CON_T3CKPS1 0x20
4231 #define _T3CON_T3CCP2 0x40
4232 #define _T3CON_RD16 0x80
4234 //==============================================================================
4236 extern __at(0x0FB2) __sfr TMR3;
4237 extern __at(0x0FB2) __sfr TMR3L;
4238 extern __at(0x0FB3) __sfr TMR3H;
4240 //==============================================================================
4241 // CMCON Bits
4243 extern __at(0x0FB4) __sfr CMCON;
4245 typedef union
4247 struct
4249 unsigned CM0 : 1;
4250 unsigned CM1 : 1;
4251 unsigned CM2 : 1;
4252 unsigned CIS : 1;
4253 unsigned C1INV : 1;
4254 unsigned C2INV : 1;
4255 unsigned C1OUT : 1;
4256 unsigned C2OUT : 1;
4259 struct
4261 unsigned CM : 3;
4262 unsigned : 5;
4264 } __CMCONbits_t;
4266 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
4268 #define _CM0 0x01
4269 #define _CM1 0x02
4270 #define _CM2 0x04
4271 #define _CIS 0x08
4272 #define _C1INV 0x10
4273 #define _C2INV 0x20
4274 #define _C1OUT 0x40
4275 #define _C2OUT 0x80
4277 //==============================================================================
4280 //==============================================================================
4281 // CVRCON Bits
4283 extern __at(0x0FB5) __sfr CVRCON;
4285 typedef union
4287 struct
4289 unsigned CVR0 : 1;
4290 unsigned CVR1 : 1;
4291 unsigned CVR2 : 1;
4292 unsigned CVR3 : 1;
4293 unsigned CVRSS : 1;
4294 unsigned CVRR : 1;
4295 unsigned CVROE : 1;
4296 unsigned CVREN : 1;
4299 struct
4301 unsigned CVR : 4;
4302 unsigned : 4;
4304 } __CVRCONbits_t;
4306 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
4308 #define _CVR0 0x01
4309 #define _CVR1 0x02
4310 #define _CVR2 0x04
4311 #define _CVR3 0x08
4312 #define _CVRSS 0x10
4313 #define _CVRR 0x20
4314 #define _CVROE 0x40
4315 #define _CVREN 0x80
4317 //==============================================================================
4320 //==============================================================================
4321 // ECCP1AS Bits
4323 extern __at(0x0FB6) __sfr ECCP1AS;
4325 typedef union
4327 struct
4329 unsigned PSS1BD0 : 1;
4330 unsigned PSS1BD1 : 1;
4331 unsigned PSS1AC0 : 1;
4332 unsigned PSS1AC1 : 1;
4333 unsigned ECCP1AS0 : 1;
4334 unsigned ECCP1AS1 : 1;
4335 unsigned ECCP1AS2 : 1;
4336 unsigned ECCP1ASE : 1;
4339 struct
4341 unsigned PSSBD0 : 1;
4342 unsigned PSSBD1 : 1;
4343 unsigned PSSAC0 : 1;
4344 unsigned PSSAC1 : 1;
4345 unsigned ECCPAS0 : 1;
4346 unsigned ECCPAS1 : 1;
4347 unsigned ECCPAS2 : 1;
4348 unsigned ECCPASE : 1;
4351 struct
4353 unsigned PSS1BD : 2;
4354 unsigned : 6;
4357 struct
4359 unsigned PSSBD : 2;
4360 unsigned : 6;
4363 struct
4365 unsigned : 2;
4366 unsigned PSSAC : 2;
4367 unsigned : 4;
4370 struct
4372 unsigned : 2;
4373 unsigned PSS1AC : 2;
4374 unsigned : 4;
4377 struct
4379 unsigned : 4;
4380 unsigned ECCP1AS : 3;
4381 unsigned : 1;
4384 struct
4386 unsigned : 4;
4387 unsigned ECCPAS : 3;
4388 unsigned : 1;
4390 } __ECCP1ASbits_t;
4392 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
4394 #define _PSS1BD0 0x01
4395 #define _PSSBD0 0x01
4396 #define _PSS1BD1 0x02
4397 #define _PSSBD1 0x02
4398 #define _PSS1AC0 0x04
4399 #define _PSSAC0 0x04
4400 #define _PSS1AC1 0x08
4401 #define _PSSAC1 0x08
4402 #define _ECCP1AS0 0x10
4403 #define _ECCPAS0 0x10
4404 #define _ECCP1AS1 0x20
4405 #define _ECCPAS1 0x20
4406 #define _ECCP1AS2 0x40
4407 #define _ECCPAS2 0x40
4408 #define _ECCP1ASE 0x80
4409 #define _ECCPASE 0x80
4411 //==============================================================================
4414 //==============================================================================
4415 // CCP3CON Bits
4417 extern __at(0x0FB7) __sfr CCP3CON;
4419 typedef union
4421 struct
4423 unsigned CCP3M0 : 1;
4424 unsigned CCP3M1 : 1;
4425 unsigned CCP3M2 : 1;
4426 unsigned CCP3M3 : 1;
4427 unsigned DC3B0 : 1;
4428 unsigned DC3B1 : 1;
4429 unsigned P3M0 : 1;
4430 unsigned P3M1 : 1;
4433 struct
4435 unsigned : 1;
4436 unsigned : 1;
4437 unsigned : 1;
4438 unsigned : 1;
4439 unsigned CCP3Y : 1;
4440 unsigned CCP3X : 1;
4441 unsigned : 1;
4442 unsigned : 1;
4445 struct
4447 unsigned CCP3M : 4;
4448 unsigned : 4;
4451 struct
4453 unsigned : 4;
4454 unsigned DC3B : 2;
4455 unsigned : 2;
4458 struct
4460 unsigned : 6;
4461 unsigned P3M : 2;
4463 } __CCP3CONbits_t;
4465 extern __at(0x0FB7) volatile __CCP3CONbits_t CCP3CONbits;
4467 #define _CCP3M0 0x01
4468 #define _CCP3M1 0x02
4469 #define _CCP3M2 0x04
4470 #define _CCP3M3 0x08
4471 #define _DC3B0 0x10
4472 #define _CCP3Y 0x10
4473 #define _DC3B1 0x20
4474 #define _CCP3X 0x20
4475 #define _P3M0 0x40
4476 #define _P3M1 0x80
4478 //==============================================================================
4481 //==============================================================================
4482 // ECCP3CON Bits
4484 extern __at(0x0FB7) __sfr ECCP3CON;
4486 typedef union
4488 struct
4490 unsigned CCP3M0 : 1;
4491 unsigned CCP3M1 : 1;
4492 unsigned CCP3M2 : 1;
4493 unsigned CCP3M3 : 1;
4494 unsigned DC3B0 : 1;
4495 unsigned DC3B1 : 1;
4496 unsigned P3M0 : 1;
4497 unsigned P3M1 : 1;
4500 struct
4502 unsigned : 1;
4503 unsigned : 1;
4504 unsigned : 1;
4505 unsigned : 1;
4506 unsigned CCP3Y : 1;
4507 unsigned CCP3X : 1;
4508 unsigned : 1;
4509 unsigned : 1;
4512 struct
4514 unsigned CCP3M : 4;
4515 unsigned : 4;
4518 struct
4520 unsigned : 4;
4521 unsigned DC3B : 2;
4522 unsigned : 2;
4525 struct
4527 unsigned : 6;
4528 unsigned P3M : 2;
4530 } __ECCP3CONbits_t;
4532 extern __at(0x0FB7) volatile __ECCP3CONbits_t ECCP3CONbits;
4534 #define _ECCP3CON_CCP3M0 0x01
4535 #define _ECCP3CON_CCP3M1 0x02
4536 #define _ECCP3CON_CCP3M2 0x04
4537 #define _ECCP3CON_CCP3M3 0x08
4538 #define _ECCP3CON_DC3B0 0x10
4539 #define _ECCP3CON_CCP3Y 0x10
4540 #define _ECCP3CON_DC3B1 0x20
4541 #define _ECCP3CON_CCP3X 0x20
4542 #define _ECCP3CON_P3M0 0x40
4543 #define _ECCP3CON_P3M1 0x80
4545 //==============================================================================
4547 extern __at(0x0FB8) __sfr CCPR3;
4548 extern __at(0x0FB8) __sfr CCPR3L;
4549 extern __at(0x0FB9) __sfr CCPR3H;
4551 //==============================================================================
4552 // CCP2CON Bits
4554 extern __at(0x0FBA) __sfr CCP2CON;
4556 typedef union
4558 struct
4560 unsigned CCP2M0 : 1;
4561 unsigned CCP2M1 : 1;
4562 unsigned CCP2M2 : 1;
4563 unsigned CCP2M3 : 1;
4564 unsigned DC2B0 : 1;
4565 unsigned DC2B1 : 1;
4566 unsigned P2M0 : 1;
4567 unsigned P2M1 : 1;
4570 struct
4572 unsigned : 1;
4573 unsigned : 1;
4574 unsigned : 1;
4575 unsigned : 1;
4576 unsigned CCP2Y : 1;
4577 unsigned CCP2X : 1;
4578 unsigned : 1;
4579 unsigned : 1;
4582 struct
4584 unsigned CCP2M : 4;
4585 unsigned : 4;
4588 struct
4590 unsigned : 4;
4591 unsigned DC2B : 2;
4592 unsigned : 2;
4595 struct
4597 unsigned : 6;
4598 unsigned P2M : 2;
4600 } __CCP2CONbits_t;
4602 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
4604 #define _CCP2M0 0x01
4605 #define _CCP2M1 0x02
4606 #define _CCP2M2 0x04
4607 #define _CCP2M3 0x08
4608 #define _DC2B0 0x10
4609 #define _CCP2Y 0x10
4610 #define _DC2B1 0x20
4611 #define _CCP2X 0x20
4612 #define _P2M0 0x40
4613 #define _P2M1 0x80
4615 //==============================================================================
4618 //==============================================================================
4619 // ECCP2CON Bits
4621 extern __at(0x0FBA) __sfr ECCP2CON;
4623 typedef union
4625 struct
4627 unsigned CCP2M0 : 1;
4628 unsigned CCP2M1 : 1;
4629 unsigned CCP2M2 : 1;
4630 unsigned CCP2M3 : 1;
4631 unsigned DC2B0 : 1;
4632 unsigned DC2B1 : 1;
4633 unsigned P2M0 : 1;
4634 unsigned P2M1 : 1;
4637 struct
4639 unsigned : 1;
4640 unsigned : 1;
4641 unsigned : 1;
4642 unsigned : 1;
4643 unsigned CCP2Y : 1;
4644 unsigned CCP2X : 1;
4645 unsigned : 1;
4646 unsigned : 1;
4649 struct
4651 unsigned CCP2M : 4;
4652 unsigned : 4;
4655 struct
4657 unsigned : 4;
4658 unsigned DC2B : 2;
4659 unsigned : 2;
4662 struct
4664 unsigned : 6;
4665 unsigned P2M : 2;
4667 } __ECCP2CONbits_t;
4669 extern __at(0x0FBA) volatile __ECCP2CONbits_t ECCP2CONbits;
4671 #define _ECCP2CON_CCP2M0 0x01
4672 #define _ECCP2CON_CCP2M1 0x02
4673 #define _ECCP2CON_CCP2M2 0x04
4674 #define _ECCP2CON_CCP2M3 0x08
4675 #define _ECCP2CON_DC2B0 0x10
4676 #define _ECCP2CON_CCP2Y 0x10
4677 #define _ECCP2CON_DC2B1 0x20
4678 #define _ECCP2CON_CCP2X 0x20
4679 #define _ECCP2CON_P2M0 0x40
4680 #define _ECCP2CON_P2M1 0x80
4682 //==============================================================================
4684 extern __at(0x0FBB) __sfr CCPR2;
4685 extern __at(0x0FBB) __sfr CCPR2L;
4686 extern __at(0x0FBC) __sfr CCPR2H;
4688 //==============================================================================
4689 // CCP1CON Bits
4691 extern __at(0x0FBD) __sfr CCP1CON;
4693 typedef union
4695 struct
4697 unsigned CCP1M0 : 1;
4698 unsigned CCP1M1 : 1;
4699 unsigned CCP1M2 : 1;
4700 unsigned CCP1M3 : 1;
4701 unsigned DC1B0 : 1;
4702 unsigned DC1B1 : 1;
4703 unsigned P1M0 : 1;
4704 unsigned P1M1 : 1;
4707 struct
4709 unsigned : 1;
4710 unsigned : 1;
4711 unsigned : 1;
4712 unsigned : 1;
4713 unsigned CCP1Y : 1;
4714 unsigned CCP1X : 1;
4715 unsigned : 1;
4716 unsigned : 1;
4719 struct
4721 unsigned CCP1M : 4;
4722 unsigned : 4;
4725 struct
4727 unsigned : 4;
4728 unsigned DC1B : 2;
4729 unsigned : 2;
4732 struct
4734 unsigned : 6;
4735 unsigned P1M : 2;
4737 } __CCP1CONbits_t;
4739 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
4741 #define _CCP1M0 0x01
4742 #define _CCP1M1 0x02
4743 #define _CCP1M2 0x04
4744 #define _CCP1M3 0x08
4745 #define _DC1B0 0x10
4746 #define _CCP1Y 0x10
4747 #define _DC1B1 0x20
4748 #define _CCP1X 0x20
4749 #define _P1M0 0x40
4750 #define _P1M1 0x80
4752 //==============================================================================
4755 //==============================================================================
4756 // ECCP1CON Bits
4758 extern __at(0x0FBD) __sfr ECCP1CON;
4760 typedef union
4762 struct
4764 unsigned CCP1M0 : 1;
4765 unsigned CCP1M1 : 1;
4766 unsigned CCP1M2 : 1;
4767 unsigned CCP1M3 : 1;
4768 unsigned DC1B0 : 1;
4769 unsigned DC1B1 : 1;
4770 unsigned P1M0 : 1;
4771 unsigned P1M1 : 1;
4774 struct
4776 unsigned : 1;
4777 unsigned : 1;
4778 unsigned : 1;
4779 unsigned : 1;
4780 unsigned CCP1Y : 1;
4781 unsigned CCP1X : 1;
4782 unsigned : 1;
4783 unsigned : 1;
4786 struct
4788 unsigned CCP1M : 4;
4789 unsigned : 4;
4792 struct
4794 unsigned : 4;
4795 unsigned DC1B : 2;
4796 unsigned : 2;
4799 struct
4801 unsigned : 6;
4802 unsigned P1M : 2;
4804 } __ECCP1CONbits_t;
4806 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits;
4808 #define _ECCP1CON_CCP1M0 0x01
4809 #define _ECCP1CON_CCP1M1 0x02
4810 #define _ECCP1CON_CCP1M2 0x04
4811 #define _ECCP1CON_CCP1M3 0x08
4812 #define _ECCP1CON_DC1B0 0x10
4813 #define _ECCP1CON_CCP1Y 0x10
4814 #define _ECCP1CON_DC1B1 0x20
4815 #define _ECCP1CON_CCP1X 0x20
4816 #define _ECCP1CON_P1M0 0x40
4817 #define _ECCP1CON_P1M1 0x80
4819 //==============================================================================
4821 extern __at(0x0FBE) __sfr CCPR1;
4822 extern __at(0x0FBE) __sfr CCPR1L;
4823 extern __at(0x0FBF) __sfr CCPR1H;
4825 //==============================================================================
4826 // ADCON2 Bits
4828 extern __at(0x0FC0) __sfr ADCON2;
4830 typedef union
4832 struct
4834 unsigned ADCS0 : 1;
4835 unsigned ADCS1 : 1;
4836 unsigned ADCS2 : 1;
4837 unsigned ACQT0 : 1;
4838 unsigned ACQT1 : 1;
4839 unsigned ACQT2 : 1;
4840 unsigned : 1;
4841 unsigned ADFM : 1;
4844 struct
4846 unsigned ADCS : 3;
4847 unsigned : 5;
4850 struct
4852 unsigned : 3;
4853 unsigned ACQT : 3;
4854 unsigned : 2;
4856 } __ADCON2bits_t;
4858 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4860 #define _ADCS0 0x01
4861 #define _ADCS1 0x02
4862 #define _ADCS2 0x04
4863 #define _ACQT0 0x08
4864 #define _ACQT1 0x10
4865 #define _ACQT2 0x20
4866 #define _ADFM 0x80
4868 //==============================================================================
4871 //==============================================================================
4872 // ADCON1 Bits
4874 extern __at(0x0FC1) __sfr ADCON1;
4876 typedef union
4878 struct
4880 unsigned PCFG0 : 1;
4881 unsigned PCFG1 : 1;
4882 unsigned PCFG2 : 1;
4883 unsigned PCFG3 : 1;
4884 unsigned VCFG0 : 1;
4885 unsigned VCFG1 : 1;
4886 unsigned : 1;
4887 unsigned : 1;
4890 struct
4892 unsigned PCFG : 4;
4893 unsigned : 4;
4896 struct
4898 unsigned : 4;
4899 unsigned VCFG : 2;
4900 unsigned : 2;
4902 } __ADCON1bits_t;
4904 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4906 #define _PCFG0 0x01
4907 #define _PCFG1 0x02
4908 #define _PCFG2 0x04
4909 #define _PCFG3 0x08
4910 #define _VCFG0 0x10
4911 #define _VCFG1 0x20
4913 //==============================================================================
4916 //==============================================================================
4917 // ADCON0 Bits
4919 extern __at(0x0FC2) __sfr ADCON0;
4921 typedef union
4923 struct
4925 unsigned ADON : 1;
4926 unsigned GO_NOT_DONE : 1;
4927 unsigned CHS0 : 1;
4928 unsigned CHS1 : 1;
4929 unsigned CHS2 : 1;
4930 unsigned CHS3 : 1;
4931 unsigned : 1;
4932 unsigned : 1;
4935 struct
4937 unsigned : 1;
4938 unsigned DONE : 1;
4939 unsigned : 1;
4940 unsigned : 1;
4941 unsigned : 1;
4942 unsigned : 1;
4943 unsigned : 1;
4944 unsigned : 1;
4947 struct
4949 unsigned : 1;
4950 unsigned GO_DONE : 1;
4951 unsigned : 1;
4952 unsigned : 1;
4953 unsigned : 1;
4954 unsigned : 1;
4955 unsigned : 1;
4956 unsigned : 1;
4959 struct
4961 unsigned : 1;
4962 unsigned GO : 1;
4963 unsigned : 1;
4964 unsigned : 1;
4965 unsigned : 1;
4966 unsigned : 1;
4967 unsigned : 1;
4968 unsigned : 1;
4971 struct
4973 unsigned : 1;
4974 unsigned NOT_DONE : 1;
4975 unsigned : 1;
4976 unsigned : 1;
4977 unsigned : 1;
4978 unsigned : 1;
4979 unsigned : 1;
4980 unsigned : 1;
4983 struct
4985 unsigned : 2;
4986 unsigned CHS : 4;
4987 unsigned : 2;
4989 } __ADCON0bits_t;
4991 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4993 #define _ADON 0x01
4994 #define _GO_NOT_DONE 0x02
4995 #define _DONE 0x02
4996 #define _GO_DONE 0x02
4997 #define _GO 0x02
4998 #define _NOT_DONE 0x02
4999 #define _CHS0 0x04
5000 #define _CHS1 0x08
5001 #define _CHS2 0x10
5002 #define _CHS3 0x20
5004 //==============================================================================
5006 extern __at(0x0FC3) __sfr ADRES;
5007 extern __at(0x0FC3) __sfr ADRESL;
5008 extern __at(0x0FC4) __sfr ADRESH;
5010 //==============================================================================
5011 // SSP1CON2 Bits
5013 extern __at(0x0FC5) __sfr SSP1CON2;
5015 typedef struct
5017 unsigned SEN : 1;
5018 unsigned RSEN : 1;
5019 unsigned PEN : 1;
5020 unsigned RCEN : 1;
5021 unsigned ACKEN : 1;
5022 unsigned ACKDT : 1;
5023 unsigned ACKSTAT : 1;
5024 unsigned GCEN : 1;
5025 } __SSP1CON2bits_t;
5027 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
5029 #define _SEN 0x01
5030 #define _RSEN 0x02
5031 #define _PEN 0x04
5032 #define _RCEN 0x08
5033 #define _ACKEN 0x10
5034 #define _ACKDT 0x20
5035 #define _ACKSTAT 0x40
5036 #define _GCEN 0x80
5038 //==============================================================================
5041 //==============================================================================
5042 // SSPCON2 Bits
5044 extern __at(0x0FC5) __sfr SSPCON2;
5046 typedef struct
5048 unsigned SEN : 1;
5049 unsigned RSEN : 1;
5050 unsigned PEN : 1;
5051 unsigned RCEN : 1;
5052 unsigned ACKEN : 1;
5053 unsigned ACKDT : 1;
5054 unsigned ACKSTAT : 1;
5055 unsigned GCEN : 1;
5056 } __SSPCON2bits_t;
5058 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5060 #define _SSPCON2_SEN 0x01
5061 #define _SSPCON2_RSEN 0x02
5062 #define _SSPCON2_PEN 0x04
5063 #define _SSPCON2_RCEN 0x08
5064 #define _SSPCON2_ACKEN 0x10
5065 #define _SSPCON2_ACKDT 0x20
5066 #define _SSPCON2_ACKSTAT 0x40
5067 #define _SSPCON2_GCEN 0x80
5069 //==============================================================================
5072 //==============================================================================
5073 // SSP1CON1 Bits
5075 extern __at(0x0FC6) __sfr SSP1CON1;
5077 typedef union
5079 struct
5081 unsigned SSPM0 : 1;
5082 unsigned SSPM1 : 1;
5083 unsigned SSPM2 : 1;
5084 unsigned SSPM3 : 1;
5085 unsigned CKP : 1;
5086 unsigned SSPEN : 1;
5087 unsigned SSPOV : 1;
5088 unsigned WCOL : 1;
5091 struct
5093 unsigned SSPM : 4;
5094 unsigned : 4;
5096 } __SSP1CON1bits_t;
5098 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
5100 #define _SSPM0 0x01
5101 #define _SSPM1 0x02
5102 #define _SSPM2 0x04
5103 #define _SSPM3 0x08
5104 #define _CKP 0x10
5105 #define _SSPEN 0x20
5106 #define _SSPOV 0x40
5107 #define _WCOL 0x80
5109 //==============================================================================
5112 //==============================================================================
5113 // SSPCON1 Bits
5115 extern __at(0x0FC6) __sfr SSPCON1;
5117 typedef union
5119 struct
5121 unsigned SSPM0 : 1;
5122 unsigned SSPM1 : 1;
5123 unsigned SSPM2 : 1;
5124 unsigned SSPM3 : 1;
5125 unsigned CKP : 1;
5126 unsigned SSPEN : 1;
5127 unsigned SSPOV : 1;
5128 unsigned WCOL : 1;
5131 struct
5133 unsigned SSPM : 4;
5134 unsigned : 4;
5136 } __SSPCON1bits_t;
5138 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
5140 #define _SSPCON1_SSPM0 0x01
5141 #define _SSPCON1_SSPM1 0x02
5142 #define _SSPCON1_SSPM2 0x04
5143 #define _SSPCON1_SSPM3 0x08
5144 #define _SSPCON1_CKP 0x10
5145 #define _SSPCON1_SSPEN 0x20
5146 #define _SSPCON1_SSPOV 0x40
5147 #define _SSPCON1_WCOL 0x80
5149 //==============================================================================
5152 //==============================================================================
5153 // SSP1STAT Bits
5155 extern __at(0x0FC7) __sfr SSP1STAT;
5157 typedef union
5159 struct
5161 unsigned BF : 1;
5162 unsigned UA : 1;
5163 unsigned R_NOT_W : 1;
5164 unsigned S : 1;
5165 unsigned P : 1;
5166 unsigned D_NOT_A : 1;
5167 unsigned CKE : 1;
5168 unsigned SMP : 1;
5171 struct
5173 unsigned : 1;
5174 unsigned : 1;
5175 unsigned R_W : 1;
5176 unsigned I2C_START : 1;
5177 unsigned I2C_STOP : 1;
5178 unsigned D_A : 1;
5179 unsigned : 1;
5180 unsigned : 1;
5183 struct
5185 unsigned : 1;
5186 unsigned : 1;
5187 unsigned I2C_READ : 1;
5188 unsigned : 1;
5189 unsigned : 1;
5190 unsigned I2C_DAT : 1;
5191 unsigned : 1;
5192 unsigned : 1;
5195 struct
5197 unsigned : 1;
5198 unsigned : 1;
5199 unsigned NOT_W : 1;
5200 unsigned : 1;
5201 unsigned : 1;
5202 unsigned NOT_A : 1;
5203 unsigned : 1;
5204 unsigned : 1;
5207 struct
5209 unsigned : 1;
5210 unsigned : 1;
5211 unsigned NOT_WRITE : 1;
5212 unsigned : 1;
5213 unsigned : 1;
5214 unsigned NOT_ADDRESS : 1;
5215 unsigned : 1;
5216 unsigned : 1;
5219 struct
5221 unsigned : 1;
5222 unsigned : 1;
5223 unsigned READ_WRITE : 1;
5224 unsigned : 1;
5225 unsigned : 1;
5226 unsigned DATA_ADDRESS : 1;
5227 unsigned : 1;
5228 unsigned : 1;
5231 struct
5233 unsigned : 1;
5234 unsigned : 1;
5235 unsigned R : 1;
5236 unsigned : 1;
5237 unsigned : 1;
5238 unsigned D : 1;
5239 unsigned : 1;
5240 unsigned : 1;
5242 } __SSP1STATbits_t;
5244 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
5246 #define _BF 0x01
5247 #define _UA 0x02
5248 #define _R_NOT_W 0x04
5249 #define _R_W 0x04
5250 #define _I2C_READ 0x04
5251 #define _NOT_W 0x04
5252 #define _NOT_WRITE 0x04
5253 #define _READ_WRITE 0x04
5254 #define _R 0x04
5255 #define _S 0x08
5256 #define _I2C_START 0x08
5257 #define _P 0x10
5258 #define _I2C_STOP 0x10
5259 #define _D_NOT_A 0x20
5260 #define _D_A 0x20
5261 #define _I2C_DAT 0x20
5262 #define _NOT_A 0x20
5263 #define _NOT_ADDRESS 0x20
5264 #define _DATA_ADDRESS 0x20
5265 #define _D 0x20
5266 #define _CKE 0x40
5267 #define _SMP 0x80
5269 //==============================================================================
5272 //==============================================================================
5273 // SSPSTAT Bits
5275 extern __at(0x0FC7) __sfr SSPSTAT;
5277 typedef union
5279 struct
5281 unsigned BF : 1;
5282 unsigned UA : 1;
5283 unsigned R_NOT_W : 1;
5284 unsigned S : 1;
5285 unsigned P : 1;
5286 unsigned D_NOT_A : 1;
5287 unsigned CKE : 1;
5288 unsigned SMP : 1;
5291 struct
5293 unsigned : 1;
5294 unsigned : 1;
5295 unsigned R_W : 1;
5296 unsigned I2C_START : 1;
5297 unsigned I2C_STOP : 1;
5298 unsigned D_A : 1;
5299 unsigned : 1;
5300 unsigned : 1;
5303 struct
5305 unsigned : 1;
5306 unsigned : 1;
5307 unsigned I2C_READ : 1;
5308 unsigned : 1;
5309 unsigned : 1;
5310 unsigned I2C_DAT : 1;
5311 unsigned : 1;
5312 unsigned : 1;
5315 struct
5317 unsigned : 1;
5318 unsigned : 1;
5319 unsigned NOT_W : 1;
5320 unsigned : 1;
5321 unsigned : 1;
5322 unsigned NOT_A : 1;
5323 unsigned : 1;
5324 unsigned : 1;
5327 struct
5329 unsigned : 1;
5330 unsigned : 1;
5331 unsigned NOT_WRITE : 1;
5332 unsigned : 1;
5333 unsigned : 1;
5334 unsigned NOT_ADDRESS : 1;
5335 unsigned : 1;
5336 unsigned : 1;
5339 struct
5341 unsigned : 1;
5342 unsigned : 1;
5343 unsigned READ_WRITE : 1;
5344 unsigned : 1;
5345 unsigned : 1;
5346 unsigned DATA_ADDRESS : 1;
5347 unsigned : 1;
5348 unsigned : 1;
5351 struct
5353 unsigned : 1;
5354 unsigned : 1;
5355 unsigned R : 1;
5356 unsigned : 1;
5357 unsigned : 1;
5358 unsigned D : 1;
5359 unsigned : 1;
5360 unsigned : 1;
5362 } __SSPSTATbits_t;
5364 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5366 #define _SSPSTAT_BF 0x01
5367 #define _SSPSTAT_UA 0x02
5368 #define _SSPSTAT_R_NOT_W 0x04
5369 #define _SSPSTAT_R_W 0x04
5370 #define _SSPSTAT_I2C_READ 0x04
5371 #define _SSPSTAT_NOT_W 0x04
5372 #define _SSPSTAT_NOT_WRITE 0x04
5373 #define _SSPSTAT_READ_WRITE 0x04
5374 #define _SSPSTAT_R 0x04
5375 #define _SSPSTAT_S 0x08
5376 #define _SSPSTAT_I2C_START 0x08
5377 #define _SSPSTAT_P 0x10
5378 #define _SSPSTAT_I2C_STOP 0x10
5379 #define _SSPSTAT_D_NOT_A 0x20
5380 #define _SSPSTAT_D_A 0x20
5381 #define _SSPSTAT_I2C_DAT 0x20
5382 #define _SSPSTAT_NOT_A 0x20
5383 #define _SSPSTAT_NOT_ADDRESS 0x20
5384 #define _SSPSTAT_DATA_ADDRESS 0x20
5385 #define _SSPSTAT_D 0x20
5386 #define _SSPSTAT_CKE 0x40
5387 #define _SSPSTAT_SMP 0x80
5389 //==============================================================================
5391 extern __at(0x0FC8) __sfr SSP1ADD;
5392 extern __at(0x0FC8) __sfr SSPADD;
5393 extern __at(0x0FC9) __sfr SSP1BUF;
5394 extern __at(0x0FC9) __sfr SSPBUF;
5396 //==============================================================================
5397 // T2CON Bits
5399 extern __at(0x0FCA) __sfr T2CON;
5401 typedef union
5403 struct
5405 unsigned T2CKPS0 : 1;
5406 unsigned T2CKPS1 : 1;
5407 unsigned TMR2ON : 1;
5408 unsigned T2OUTPS0 : 1;
5409 unsigned T2OUTPS1 : 1;
5410 unsigned T2OUTPS2 : 1;
5411 unsigned T2OUTPS3 : 1;
5412 unsigned : 1;
5415 struct
5417 unsigned T2CKPS : 2;
5418 unsigned : 6;
5421 struct
5423 unsigned : 3;
5424 unsigned T2OUTPS : 4;
5425 unsigned : 1;
5427 } __T2CONbits_t;
5429 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5431 #define _T2CKPS0 0x01
5432 #define _T2CKPS1 0x02
5433 #define _TMR2ON 0x04
5434 #define _T2OUTPS0 0x08
5435 #define _T2OUTPS1 0x10
5436 #define _T2OUTPS2 0x20
5437 #define _T2OUTPS3 0x40
5439 //==============================================================================
5441 extern __at(0x0FCB) __sfr PR2;
5442 extern __at(0x0FCC) __sfr TMR2;
5444 //==============================================================================
5445 // T1CON Bits
5447 extern __at(0x0FCD) __sfr T1CON;
5449 typedef union
5451 struct
5453 unsigned TMR1ON : 1;
5454 unsigned TMR1CS : 1;
5455 unsigned NOT_T1SYNC : 1;
5456 unsigned T1OSCEN : 1;
5457 unsigned T1CKPS0 : 1;
5458 unsigned T1CKPS1 : 1;
5459 unsigned T1RUN : 1;
5460 unsigned RD16 : 1;
5463 struct
5465 unsigned : 1;
5466 unsigned : 1;
5467 unsigned T1SYNC : 1;
5468 unsigned : 1;
5469 unsigned : 1;
5470 unsigned : 1;
5471 unsigned : 1;
5472 unsigned : 1;
5475 struct
5477 unsigned : 1;
5478 unsigned : 1;
5479 unsigned T1INSYNC : 1;
5480 unsigned : 1;
5481 unsigned : 1;
5482 unsigned : 1;
5483 unsigned : 1;
5484 unsigned : 1;
5487 struct
5489 unsigned : 4;
5490 unsigned T1CKPS : 2;
5491 unsigned : 2;
5493 } __T1CONbits_t;
5495 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5497 #define _TMR1ON 0x01
5498 #define _TMR1CS 0x02
5499 #define _NOT_T1SYNC 0x04
5500 #define _T1SYNC 0x04
5501 #define _T1INSYNC 0x04
5502 #define _T1OSCEN 0x08
5503 #define _T1CKPS0 0x10
5504 #define _T1CKPS1 0x20
5505 #define _T1RUN 0x40
5506 #define _RD16 0x80
5508 //==============================================================================
5510 extern __at(0x0FCE) __sfr TMR1;
5511 extern __at(0x0FCE) __sfr TMR1L;
5512 extern __at(0x0FCF) __sfr TMR1H;
5514 //==============================================================================
5515 // RCON Bits
5517 extern __at(0x0FD0) __sfr RCON;
5519 typedef union
5521 struct
5523 unsigned NOT_BOR : 1;
5524 unsigned NOT_POR : 1;
5525 unsigned NOT_PD : 1;
5526 unsigned NOT_TO : 1;
5527 unsigned NOT_RI : 1;
5528 unsigned : 1;
5529 unsigned SBOREN : 1;
5530 unsigned IPEN : 1;
5533 struct
5535 unsigned BOR : 1;
5536 unsigned POR : 1;
5537 unsigned PD : 1;
5538 unsigned TO : 1;
5539 unsigned RI : 1;
5540 unsigned : 1;
5541 unsigned : 1;
5542 unsigned : 1;
5544 } __RCONbits_t;
5546 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5548 #define _NOT_BOR 0x01
5549 #define _BOR 0x01
5550 #define _NOT_POR 0x02
5551 #define _POR 0x02
5552 #define _NOT_PD 0x04
5553 #define _PD 0x04
5554 #define _NOT_TO 0x08
5555 #define _TO 0x08
5556 #define _NOT_RI 0x10
5557 #define _RI 0x10
5558 #define _SBOREN 0x40
5559 #define _IPEN 0x80
5561 //==============================================================================
5564 //==============================================================================
5565 // WDTCON Bits
5567 extern __at(0x0FD1) __sfr WDTCON;
5569 typedef union
5571 struct
5573 unsigned SWDTEN : 1;
5574 unsigned : 1;
5575 unsigned : 1;
5576 unsigned : 1;
5577 unsigned : 1;
5578 unsigned : 1;
5579 unsigned : 1;
5580 unsigned : 1;
5583 struct
5585 unsigned SWDTE : 1;
5586 unsigned : 1;
5587 unsigned : 1;
5588 unsigned : 1;
5589 unsigned : 1;
5590 unsigned : 1;
5591 unsigned : 1;
5592 unsigned : 1;
5594 } __WDTCONbits_t;
5596 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5598 #define _SWDTEN 0x01
5599 #define _SWDTE 0x01
5601 //==============================================================================
5604 //==============================================================================
5605 // HLVDCON Bits
5607 extern __at(0x0FD2) __sfr HLVDCON;
5609 typedef union
5611 struct
5613 unsigned HLVDL0 : 1;
5614 unsigned HLVDL1 : 1;
5615 unsigned HLVDL2 : 1;
5616 unsigned HLVDL3 : 1;
5617 unsigned HLVDEN : 1;
5618 unsigned IRVST : 1;
5619 unsigned : 1;
5620 unsigned VDIRMAG : 1;
5623 struct
5625 unsigned LVV0 : 1;
5626 unsigned LVV1 : 1;
5627 unsigned LVV2 : 1;
5628 unsigned LVV3 : 1;
5629 unsigned LVDEN : 1;
5630 unsigned IVRST : 1;
5631 unsigned : 1;
5632 unsigned : 1;
5635 struct
5637 unsigned LVDL0 : 1;
5638 unsigned LVDL1 : 1;
5639 unsigned LVDL2 : 1;
5640 unsigned LVDL3 : 1;
5641 unsigned : 1;
5642 unsigned BGST : 1;
5643 unsigned : 1;
5644 unsigned : 1;
5647 struct
5649 unsigned LVV : 4;
5650 unsigned : 4;
5653 struct
5655 unsigned LVDL : 4;
5656 unsigned : 4;
5659 struct
5661 unsigned HLVDL : 4;
5662 unsigned : 4;
5664 } __HLVDCONbits_t;
5666 extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
5668 #define _HLVDL0 0x01
5669 #define _LVV0 0x01
5670 #define _LVDL0 0x01
5671 #define _HLVDL1 0x02
5672 #define _LVV1 0x02
5673 #define _LVDL1 0x02
5674 #define _HLVDL2 0x04
5675 #define _LVV2 0x04
5676 #define _LVDL2 0x04
5677 #define _HLVDL3 0x08
5678 #define _LVV3 0x08
5679 #define _LVDL3 0x08
5680 #define _HLVDEN 0x10
5681 #define _LVDEN 0x10
5682 #define _IRVST 0x20
5683 #define _IVRST 0x20
5684 #define _BGST 0x20
5685 #define _VDIRMAG 0x80
5687 //==============================================================================
5690 //==============================================================================
5691 // LVDCON Bits
5693 extern __at(0x0FD2) __sfr LVDCON;
5695 typedef union
5697 struct
5699 unsigned HLVDL0 : 1;
5700 unsigned HLVDL1 : 1;
5701 unsigned HLVDL2 : 1;
5702 unsigned HLVDL3 : 1;
5703 unsigned HLVDEN : 1;
5704 unsigned IRVST : 1;
5705 unsigned : 1;
5706 unsigned VDIRMAG : 1;
5709 struct
5711 unsigned LVV0 : 1;
5712 unsigned LVV1 : 1;
5713 unsigned LVV2 : 1;
5714 unsigned LVV3 : 1;
5715 unsigned LVDEN : 1;
5716 unsigned IVRST : 1;
5717 unsigned : 1;
5718 unsigned : 1;
5721 struct
5723 unsigned LVDL0 : 1;
5724 unsigned LVDL1 : 1;
5725 unsigned LVDL2 : 1;
5726 unsigned LVDL3 : 1;
5727 unsigned : 1;
5728 unsigned BGST : 1;
5729 unsigned : 1;
5730 unsigned : 1;
5733 struct
5735 unsigned LVV : 4;
5736 unsigned : 4;
5739 struct
5741 unsigned LVDL : 4;
5742 unsigned : 4;
5745 struct
5747 unsigned HLVDL : 4;
5748 unsigned : 4;
5750 } __LVDCONbits_t;
5752 extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
5754 #define _LVDCON_HLVDL0 0x01
5755 #define _LVDCON_LVV0 0x01
5756 #define _LVDCON_LVDL0 0x01
5757 #define _LVDCON_HLVDL1 0x02
5758 #define _LVDCON_LVV1 0x02
5759 #define _LVDCON_LVDL1 0x02
5760 #define _LVDCON_HLVDL2 0x04
5761 #define _LVDCON_LVV2 0x04
5762 #define _LVDCON_LVDL2 0x04
5763 #define _LVDCON_HLVDL3 0x08
5764 #define _LVDCON_LVV3 0x08
5765 #define _LVDCON_LVDL3 0x08
5766 #define _LVDCON_HLVDEN 0x10
5767 #define _LVDCON_LVDEN 0x10
5768 #define _LVDCON_IRVST 0x20
5769 #define _LVDCON_IVRST 0x20
5770 #define _LVDCON_BGST 0x20
5771 #define _LVDCON_VDIRMAG 0x80
5773 //==============================================================================
5776 //==============================================================================
5777 // OSCCON Bits
5779 extern __at(0x0FD3) __sfr OSCCON;
5781 typedef union
5783 struct
5785 unsigned SCS0 : 1;
5786 unsigned SCS1 : 1;
5787 unsigned IOFS : 1;
5788 unsigned OSTS : 1;
5789 unsigned IRCF0 : 1;
5790 unsigned IRCF1 : 1;
5791 unsigned IRCF2 : 1;
5792 unsigned IDLEN : 1;
5795 struct
5797 unsigned : 1;
5798 unsigned : 1;
5799 unsigned FLTS : 1;
5800 unsigned : 1;
5801 unsigned : 1;
5802 unsigned : 1;
5803 unsigned : 1;
5804 unsigned : 1;
5807 struct
5809 unsigned SCS : 2;
5810 unsigned : 6;
5813 struct
5815 unsigned : 4;
5816 unsigned IRCF : 3;
5817 unsigned : 1;
5819 } __OSCCONbits_t;
5821 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5823 #define _SCS0 0x01
5824 #define _SCS1 0x02
5825 #define _IOFS 0x04
5826 #define _FLTS 0x04
5827 #define _OSTS 0x08
5828 #define _IRCF0 0x10
5829 #define _IRCF1 0x20
5830 #define _IRCF2 0x40
5831 #define _IDLEN 0x80
5833 //==============================================================================
5836 //==============================================================================
5837 // T0CON Bits
5839 extern __at(0x0FD5) __sfr T0CON;
5841 typedef union
5843 struct
5845 unsigned T0PS0 : 1;
5846 unsigned T0PS1 : 1;
5847 unsigned T0PS2 : 1;
5848 unsigned PSA : 1;
5849 unsigned T0SE : 1;
5850 unsigned T0CS : 1;
5851 unsigned T08BIT : 1;
5852 unsigned TMR0ON : 1;
5855 struct
5857 unsigned : 1;
5858 unsigned : 1;
5859 unsigned : 1;
5860 unsigned T0PS3 : 1;
5861 unsigned : 1;
5862 unsigned : 1;
5863 unsigned : 1;
5864 unsigned : 1;
5867 struct
5869 unsigned T0PS : 4;
5870 unsigned : 4;
5872 } __T0CONbits_t;
5874 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5876 #define _T0PS0 0x01
5877 #define _T0PS1 0x02
5878 #define _T0PS2 0x04
5879 #define _PSA 0x08
5880 #define _T0PS3 0x08
5881 #define _T0SE 0x10
5882 #define _T0CS 0x20
5883 #define _T08BIT 0x40
5884 #define _TMR0ON 0x80
5886 //==============================================================================
5888 extern __at(0x0FD6) __sfr TMR0;
5889 extern __at(0x0FD6) __sfr TMR0L;
5890 extern __at(0x0FD7) __sfr TMR0H;
5892 //==============================================================================
5893 // STATUS Bits
5895 extern __at(0x0FD8) __sfr STATUS;
5897 typedef struct
5899 unsigned C : 1;
5900 unsigned DC : 1;
5901 unsigned Z : 1;
5902 unsigned OV : 1;
5903 unsigned N : 1;
5904 unsigned : 1;
5905 unsigned : 1;
5906 unsigned : 1;
5907 } __STATUSbits_t;
5909 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5911 #define _C 0x01
5912 #define _DC 0x02
5913 #define _Z 0x04
5914 #define _OV 0x08
5915 #define _N 0x10
5917 //==============================================================================
5919 extern __at(0x0FD9) __sfr FSR2L;
5920 extern __at(0x0FDA) __sfr FSR2H;
5921 extern __at(0x0FDB) __sfr PLUSW2;
5922 extern __at(0x0FDC) __sfr PREINC2;
5923 extern __at(0x0FDD) __sfr POSTDEC2;
5924 extern __at(0x0FDE) __sfr POSTINC2;
5925 extern __at(0x0FDF) __sfr INDF2;
5926 extern __at(0x0FE0) __sfr BSR;
5927 extern __at(0x0FE1) __sfr FSR1L;
5928 extern __at(0x0FE2) __sfr FSR1H;
5929 extern __at(0x0FE3) __sfr PLUSW1;
5930 extern __at(0x0FE4) __sfr PREINC1;
5931 extern __at(0x0FE5) __sfr POSTDEC1;
5932 extern __at(0x0FE6) __sfr POSTINC1;
5933 extern __at(0x0FE7) __sfr INDF1;
5934 extern __at(0x0FE8) __sfr WREG;
5935 extern __at(0x0FE9) __sfr FSR0L;
5936 extern __at(0x0FEA) __sfr FSR0H;
5937 extern __at(0x0FEB) __sfr PLUSW0;
5938 extern __at(0x0FEC) __sfr PREINC0;
5939 extern __at(0x0FED) __sfr POSTDEC0;
5940 extern __at(0x0FEE) __sfr POSTINC0;
5941 extern __at(0x0FEF) __sfr INDF0;
5943 //==============================================================================
5944 // INTCON3 Bits
5946 extern __at(0x0FF0) __sfr INTCON3;
5948 typedef union
5950 struct
5952 unsigned INT1IF : 1;
5953 unsigned INT2IF : 1;
5954 unsigned INT3IF : 1;
5955 unsigned INT1IE : 1;
5956 unsigned INT2IE : 1;
5957 unsigned INT3IE : 1;
5958 unsigned INT1IP : 1;
5959 unsigned INT2IP : 1;
5962 struct
5964 unsigned INT1F : 1;
5965 unsigned INT2F : 1;
5966 unsigned INT3F : 1;
5967 unsigned INT1E : 1;
5968 unsigned INT2E : 1;
5969 unsigned INT3E : 1;
5970 unsigned INT1P : 1;
5971 unsigned INT2P : 1;
5973 } __INTCON3bits_t;
5975 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5977 #define _INT1IF 0x01
5978 #define _INT1F 0x01
5979 #define _INT2IF 0x02
5980 #define _INT2F 0x02
5981 #define _INT3IF 0x04
5982 #define _INT3F 0x04
5983 #define _INT1IE 0x08
5984 #define _INT1E 0x08
5985 #define _INT2IE 0x10
5986 #define _INT2E 0x10
5987 #define _INT3IE 0x20
5988 #define _INT3E 0x20
5989 #define _INT1IP 0x40
5990 #define _INT1P 0x40
5991 #define _INT2IP 0x80
5992 #define _INT2P 0x80
5994 //==============================================================================
5997 //==============================================================================
5998 // INTCON2 Bits
6000 extern __at(0x0FF1) __sfr INTCON2;
6002 typedef union
6004 struct
6006 unsigned RBIP : 1;
6007 unsigned INT3IP : 1;
6008 unsigned TMR0IP : 1;
6009 unsigned INTEDG3 : 1;
6010 unsigned INTEDG2 : 1;
6011 unsigned INTEDG1 : 1;
6012 unsigned INTEDG0 : 1;
6013 unsigned NOT_RBPU : 1;
6016 struct
6018 unsigned : 1;
6019 unsigned INT3P : 1;
6020 unsigned T0IP : 1;
6021 unsigned : 1;
6022 unsigned : 1;
6023 unsigned : 1;
6024 unsigned : 1;
6025 unsigned RBPU : 1;
6027 } __INTCON2bits_t;
6029 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6031 #define _RBIP 0x01
6032 #define _INT3IP 0x02
6033 #define _INT3P 0x02
6034 #define _TMR0IP 0x04
6035 #define _T0IP 0x04
6036 #define _INTEDG3 0x08
6037 #define _INTEDG2 0x10
6038 #define _INTEDG1 0x20
6039 #define _INTEDG0 0x40
6040 #define _NOT_RBPU 0x80
6041 #define _RBPU 0x80
6043 //==============================================================================
6046 //==============================================================================
6047 // INTCON Bits
6049 extern __at(0x0FF2) __sfr INTCON;
6051 typedef union
6053 struct
6055 unsigned RBIF : 1;
6056 unsigned INT0IF : 1;
6057 unsigned TMR0IF : 1;
6058 unsigned RBIE : 1;
6059 unsigned INT0IE : 1;
6060 unsigned TMR0IE : 1;
6061 unsigned PEIE_GIEL : 1;
6062 unsigned GIE_GIEH : 1;
6065 struct
6067 unsigned : 1;
6068 unsigned INT0F : 1;
6069 unsigned T0IF : 1;
6070 unsigned : 1;
6071 unsigned INT0E : 1;
6072 unsigned T0IE : 1;
6073 unsigned PEIE : 1;
6074 unsigned GIE : 1;
6077 struct
6079 unsigned : 1;
6080 unsigned : 1;
6081 unsigned : 1;
6082 unsigned : 1;
6083 unsigned : 1;
6084 unsigned : 1;
6085 unsigned GIEL : 1;
6086 unsigned GIEH : 1;
6088 } __INTCONbits_t;
6090 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6092 #define _RBIF 0x01
6093 #define _INT0IF 0x02
6094 #define _INT0F 0x02
6095 #define _TMR0IF 0x04
6096 #define _T0IF 0x04
6097 #define _RBIE 0x08
6098 #define _INT0IE 0x10
6099 #define _INT0E 0x10
6100 #define _TMR0IE 0x20
6101 #define _T0IE 0x20
6102 #define _PEIE_GIEL 0x40
6103 #define _PEIE 0x40
6104 #define _GIEL 0x40
6105 #define _GIE_GIEH 0x80
6106 #define _GIE 0x80
6107 #define _GIEH 0x80
6109 //==============================================================================
6111 extern __at(0x0FF3) __sfr PROD;
6112 extern __at(0x0FF3) __sfr PRODL;
6113 extern __at(0x0FF4) __sfr PRODH;
6114 extern __at(0x0FF5) __sfr TABLAT;
6115 extern __at(0x0FF6) __sfr TBLPTR;
6116 extern __at(0x0FF6) __sfr TBLPTRL;
6117 extern __at(0x0FF7) __sfr TBLPTRH;
6118 extern __at(0x0FF8) __sfr TBLPTRU;
6119 extern __at(0x0FF9) __sfr PC;
6120 extern __at(0x0FF9) __sfr PCL;
6121 extern __at(0x0FFA) __sfr PCLATH;
6122 extern __at(0x0FFB) __sfr PCLATU;
6124 //==============================================================================
6125 // STKPTR Bits
6127 extern __at(0x0FFC) __sfr STKPTR;
6129 typedef union
6131 struct
6133 unsigned STKPTR0 : 1;
6134 unsigned STKPTR1 : 1;
6135 unsigned STKPTR2 : 1;
6136 unsigned STKPTR3 : 1;
6137 unsigned STKPTR4 : 1;
6138 unsigned : 1;
6139 unsigned STKUNF : 1;
6140 unsigned STKFUL : 1;
6143 struct
6145 unsigned SP0 : 1;
6146 unsigned SP1 : 1;
6147 unsigned SP2 : 1;
6148 unsigned SP3 : 1;
6149 unsigned SP4 : 1;
6150 unsigned : 1;
6151 unsigned : 1;
6152 unsigned STKOVF : 1;
6155 struct
6157 unsigned STKPTR : 5;
6158 unsigned : 3;
6161 struct
6163 unsigned SP : 5;
6164 unsigned : 3;
6166 } __STKPTRbits_t;
6168 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6170 #define _STKPTR0 0x01
6171 #define _SP0 0x01
6172 #define _STKPTR1 0x02
6173 #define _SP1 0x02
6174 #define _STKPTR2 0x04
6175 #define _SP2 0x04
6176 #define _STKPTR3 0x08
6177 #define _SP3 0x08
6178 #define _STKPTR4 0x10
6179 #define _SP4 0x10
6180 #define _STKUNF 0x40
6181 #define _STKFUL 0x80
6182 #define _STKOVF 0x80
6184 //==============================================================================
6186 extern __at(0x0FFD) __sfr TOS;
6187 extern __at(0x0FFD) __sfr TOSL;
6188 extern __at(0x0FFE) __sfr TOSH;
6189 extern __at(0x0FFF) __sfr TOSU;
6191 //==============================================================================
6193 // Configuration Bits
6195 //==============================================================================
6197 #define __CONFIG1H 0x300001
6198 #define __CONFIG2L 0x300002
6199 #define __CONFIG2H 0x300003
6200 #define __CONFIG3L 0x300004
6201 #define __CONFIG3H 0x300005
6202 #define __CONFIG4L 0x300006
6203 #define __CONFIG5L 0x300008
6204 #define __CONFIG5H 0x300009
6205 #define __CONFIG6L 0x30000A
6206 #define __CONFIG6H 0x30000B
6207 #define __CONFIG7L 0x30000C
6208 #define __CONFIG7H 0x30000D
6210 //----------------------------- CONFIG1H Options -------------------------------
6212 #define _OSC_LP_1H 0xF0 // LP oscillator.
6213 #define _OSC_XT_1H 0xF1 // XT oscillator.
6214 #define _OSC_HS_1H 0xF2 // HS oscillator.
6215 #define _OSC_RC_1H 0xF3 // External RC oscillator, CLKO function on RA6.
6216 #define _OSC_EC_1H 0xF4 // EC oscillator, CLKO function on RA6.
6217 #define _OSC_ECIO6_1H 0xF5 // EC oscillator, port function on RA6.
6218 #define _OSC_HSPLL_1H 0xF6 // HS oscillator, PLL enabled (Clock Frequency = 4 x FOSC1).
6219 #define _OSC_RCIO6_1H 0xF7 // External RC oscillator, port function on RA6.
6220 #define _OSC_INTIO67_1H 0xF8 // Internal oscillator block, port function on RA6 and RA7.
6221 #define _OSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKO function on RA6, port function on RA7.
6222 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
6223 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
6224 #define _IESO_OFF_1H 0x7F // Two-Speed Start-up disabled.
6225 #define _IESO_ON_1H 0xFF // Two-Speed Start-up enabled.
6227 //----------------------------- CONFIG2L Options -------------------------------
6229 #define _PWRT_ON_2L 0xFE // PWRT enabled.
6230 #define _PWRT_OFF_2L 0xFF // PWRT disabled.
6231 #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
6232 #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
6233 #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
6234 #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
6235 #define _BORV_0_2L 0xE7 // Maximum setting.
6236 #define _BORV_1_2L 0xEF
6237 #define _BORV_2_2L 0xF7
6238 #define _BORV_3_2L 0xFF // Minimum setting.
6240 //----------------------------- CONFIG2H Options -------------------------------
6242 #define _WDT_OFF_2H 0xFE // WDT disabled (control is placed on the SWDTEN bit).
6243 #define _WDT_ON_2H 0xFF // WDT enabled.
6244 #define _WDTPS_1_2H 0xE1 // 1:1.
6245 #define _WDTPS_2_2H 0xE3 // 1:2.
6246 #define _WDTPS_4_2H 0xE5 // 1:4.
6247 #define _WDTPS_8_2H 0xE7 // 1:8.
6248 #define _WDTPS_16_2H 0xE9 // 1:16.
6249 #define _WDTPS_32_2H 0xEB // 1:32.
6250 #define _WDTPS_64_2H 0xED // 1:64.
6251 #define _WDTPS_128_2H 0xEF // 1:128.
6252 #define _WDTPS_256_2H 0xF1 // 1:256.
6253 #define _WDTPS_512_2H 0xF3 // 1:512.
6254 #define _WDTPS_1024_2H 0xF5 // 1:1024.
6255 #define _WDTPS_2048_2H 0xF7 // 1:2048.
6256 #define _WDTPS_4096_2H 0xF9 // 1:4096.
6257 #define _WDTPS_8192_2H 0xFB // 1:8192.
6258 #define _WDTPS_16384_2H 0xFD // 1:16384.
6259 #define _WDTPS_32768_2H 0xFF // 1:32768.
6261 //----------------------------- CONFIG3L Options -------------------------------
6263 #define _MODE_EM_3L 0xFC // Extended Microcontroller mode.
6264 #define _MODE_MPB_3L 0xFD // Microprocessor with Boot Block mode.
6265 #define _MODE_MP_3L 0xFE // Microprocessor mode.
6266 #define _MODE_MC_3L 0xFF // Microcontroller mode.
6267 #define _ADDRBW_ADDR8BIT_3L 0xCF // 8-bit Address Bus.
6268 #define _ADDRBW_ADDR12BIT_3L 0xDF // 12-bit Address Bus.
6269 #define _ADDRBW_ADDR16BIT_3L 0xEF // 16-bit Address Bus.
6270 #define _ADDRBW_ADDR20BIT_3L 0xFF // 20-bit Address Bus.
6271 #define _DATABW_DATA8BIT_3L 0xBF // 8-bit External Bus mode.
6272 #define _DATABW_DATA16BIT_3L 0xFF // 16-bit External Bus mode.
6273 #define _WAIT_ON_3L 0x7F // Wait selections for table reads and table writes are determined by the WAIT1:WAIT0 bits.
6274 #define _WAIT_OFF_3L 0xFF // Wait selections are unavailable for table reads and table writes.
6276 //----------------------------- CONFIG3H Options -------------------------------
6278 #define _CCP2MX_PORTBE_3H 0xFE // ECCP2 is multiplexed with RB3 in Extended Microcontroller, Microprocessor or Microprocessor with Boot Block mode. Or with RE7 in Microcontroller mode.
6279 #define _CCP2MX_PORTC_3H 0xFF // ECCP2 input/output is multiplexed with RC1.
6280 #define _ECCPMX_PORTH_3H 0xFD // ECCP1/3 (P1B/P1C/P3B/P3C) are multiplexed onto RH7, RH6, RH5 and RH4 respectively.
6281 #define _ECCPMX_PORTE_3H 0xFF // ECCP1/3 (P1B/P1C/P3B/P3C) are multiplexed onto RE6, RE5, RE4 and RE3 respectively.
6282 #define _LPT1OSC_OFF_3H 0xFB // Timer1 configured for higher power operation.
6283 #define _LPT1OSC_ON_3H 0xFF // Timer1 configured for low-power operation.
6284 #define _MCLRE_OFF_3H 0x7F // RG5 input pin enabled; MCLR disabled.
6285 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RG5 input pin disabled.
6287 //----------------------------- CONFIG4L Options -------------------------------
6289 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
6290 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
6291 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
6292 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled.
6293 #define _BBSIZ_BB2K_4L 0xCF // 1K word (2 Kbytes) Boot Block size.
6294 #define _BBSIZ_BB4K_4L 0xDF // 2K words (4 Kbytes) Boot Block size.
6295 #define _BBSIZ_BB8K_4L 0xEF // 4K words (8 Kbytes) Boot Block size.
6296 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
6297 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
6298 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
6299 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
6301 //----------------------------- CONFIG5L Options -------------------------------
6303 #define _CP0_ON_5L 0xFE // Block 0 (000800, 001000 or 002000-003FFFh) code-protected.
6304 #define _CP0_OFF_5L 0xFF // Block 0 (000800, 001000 or 002000-003FFFh) not code-protected.
6305 #define _CP1_ON_5L 0xFD // Block 1 (004000-007FFFh) code-protected.
6306 #define _CP1_OFF_5L 0xFF // Block 1 (004000-007FFFh) not code-protected.
6307 #define _CP2_ON_5L 0xFB // Block 2 (008000-00BFFFh) code-protected.
6308 #define _CP2_OFF_5L 0xFF // Block 2 (008000-00BFFFh) not code-protected.
6310 //----------------------------- CONFIG5H Options -------------------------------
6312 #define _CPB_ON_5H 0xBF // Boot Block (000000-0007FFh) code-protected.
6313 #define _CPB_OFF_5H 0xFF // Boot Block (000000-0007FFh) not code-protected.
6314 #define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
6315 #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
6317 //----------------------------- CONFIG6L Options -------------------------------
6319 #define _WRT0_ON_6L 0xFE // Block 0 (000800, 001000 or 002000-003FFFh) write-protected.
6320 #define _WRT0_OFF_6L 0xFF // Block 0 (000800, 001000 or 002000-003FFFh) not write-protected.
6321 #define _WRT1_ON_6L 0xFD // Block 1 (004000-007FFFh) write-protected.
6322 #define _WRT1_OFF_6L 0xFF // Block 1 (004000-007FFFh) not write-protected.
6323 #define _WRT2_ON_6L 0xFB // Block 2 (008000-00BFFFh) write-protected.
6324 #define _WRT2_OFF_6L 0xFF // Block 2 (008000-00BFFFh) not write-protected.
6326 //----------------------------- CONFIG6H Options -------------------------------
6328 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) write-protected.
6329 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) not write-protected.
6330 #define _WRTB_ON_6H 0xBF // Boot Block (000000-007FFF, 000FFF or 001FFFh) write-protected.
6331 #define _WRTB_OFF_6H 0xFF // Boot Block (000000-007FFF, 000FFF or 001FFFh) not write-protected.
6332 #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
6333 #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
6335 //----------------------------- CONFIG7L Options -------------------------------
6337 #define _EBTR0_ON_7L 0xFE // Block 0 (000800, 001000 or 002000-003FFFh) protected from table reads executed in other blocks.
6338 #define _EBTR0_OFF_7L 0xFF // Block 0 (000800, 001000 or 002000-003FFFh) not protected from table reads executed in other blocks.
6339 #define _EBTR1_ON_7L 0xFD // Block 1 (004000-007FFFh) protected from table reads executed in other blocks.
6340 #define _EBTR1_OFF_7L 0xFF // Block 1 (004000-007FFFh) not protected from table reads executed in other blocks.
6341 #define _EBTR2_ON_7L 0xFB // Block 2 (008000-00BFFFh) protected from table reads executed in other blocks.
6342 #define _EBTR2_OFF_7L 0xFF // Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks.
6344 //----------------------------- CONFIG7H Options -------------------------------
6346 #define _EBTRB_ON_7H 0xBF // Boot Block (000000-007FFF, 000FFF or 001FFFh) protected from table reads executed in other blocks.
6347 #define _EBTRB_OFF_7H 0xFF // Boot Block (000000-007FFF, 000FFF or 001FFFh) not protected from table reads executed in other blocks.
6349 //==============================================================================
6351 #define __DEVID1 0x3FFFFE
6352 #define __DEVID2 0x3FFFFF
6354 #define __IDLOC0 0x200000
6355 #define __IDLOC1 0x200001
6356 #define __IDLOC2 0x200002
6357 #define __IDLOC3 0x200003
6358 #define __IDLOC4 0x200004
6359 #define __IDLOC5 0x200005
6360 #define __IDLOC6 0x200006
6361 #define __IDLOC7 0x200007
6363 #endif // #ifndef __PIC18F8527_H__