struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f65k22.h
blob4ccb91a1bcb8221f1476a2294f4f92aba42dae96
1 /*
2 * This declarations of the PIC18F65K22 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:32 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 __PIC18F65K22_H__
26 #define __PIC18F65K22_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // PMD3 Bits
40 extern __at(0x0F16) __sfr PMD3;
42 typedef struct
44 unsigned : 1;
45 unsigned CCP4MD : 1;
46 unsigned CCP5MD : 1;
47 unsigned CCP6MD : 1;
48 unsigned CCP7MD : 1;
49 unsigned CCP8MD : 1;
50 unsigned : 1;
51 unsigned : 1;
52 } __PMD3bits_t;
54 extern __at(0x0F16) volatile __PMD3bits_t PMD3bits;
56 #define _CCP4MD 0x02
57 #define _CCP5MD 0x04
58 #define _CCP6MD 0x08
59 #define _CCP7MD 0x10
60 #define _CCP8MD 0x20
62 //==============================================================================
65 //==============================================================================
66 // PMD2 Bits
68 extern __at(0x0F17) __sfr PMD2;
70 typedef struct
72 unsigned CMP1MD : 1;
73 unsigned CMP2MD : 1;
74 unsigned CMP3MD : 1;
75 unsigned TMR5MD : 1;
76 unsigned TMR6MD : 1;
77 unsigned : 1;
78 unsigned TMR8MD : 1;
79 unsigned : 1;
80 } __PMD2bits_t;
82 extern __at(0x0F17) volatile __PMD2bits_t PMD2bits;
84 #define _CMP1MD 0x01
85 #define _CMP2MD 0x02
86 #define _CMP3MD 0x04
87 #define _TMR5MD 0x08
88 #define _TMR6MD 0x10
89 #define _TMR8MD 0x40
91 //==============================================================================
94 //==============================================================================
95 // PMD1 Bits
97 extern __at(0x0F18) __sfr PMD1;
99 typedef struct
101 unsigned : 1;
102 unsigned TMR1MD : 1;
103 unsigned TMR2MD : 1;
104 unsigned TMR3MD : 1;
105 unsigned TMR4MD : 1;
106 unsigned RTCCMD : 1;
107 unsigned CTMUMD : 1;
108 unsigned PSPMD : 1;
109 } __PMD1bits_t;
111 extern __at(0x0F18) volatile __PMD1bits_t PMD1bits;
113 #define _TMR1MD 0x02
114 #define _TMR2MD 0x04
115 #define _TMR3MD 0x08
116 #define _TMR4MD 0x10
117 #define _RTCCMD 0x20
118 #define _CTMUMD 0x40
119 #define _PSPMD 0x80
121 //==============================================================================
124 //==============================================================================
125 // PMD0 Bits
127 extern __at(0x0F19) __sfr PMD0;
129 typedef struct
131 unsigned ADCMD : 1;
132 unsigned SSP1MD : 1;
133 unsigned SSP2MD : 1;
134 unsigned UART1MD : 1;
135 unsigned UART2MD : 1;
136 unsigned CCP1MD : 1;
137 unsigned CCP2MD : 1;
138 unsigned CCP3MD : 1;
139 } __PMD0bits_t;
141 extern __at(0x0F19) volatile __PMD0bits_t PMD0bits;
143 #define _ADCMD 0x01
144 #define _SSP1MD 0x02
145 #define _SSP2MD 0x04
146 #define _UART1MD 0x08
147 #define _UART2MD 0x10
148 #define _CCP1MD 0x20
149 #define _CCP2MD 0x40
150 #define _CCP3MD 0x80
152 //==============================================================================
155 //==============================================================================
156 // PSTR3CON Bits
158 extern __at(0x0F1A) __sfr PSTR3CON;
160 typedef union
162 struct
164 unsigned STRA : 1;
165 unsigned STRB : 1;
166 unsigned STRC : 1;
167 unsigned STRD : 1;
168 unsigned STRSYNC : 1;
169 unsigned : 1;
170 unsigned CMPL0 : 1;
171 unsigned CMPL1 : 1;
174 struct
176 unsigned : 6;
177 unsigned CMPL : 2;
179 } __PSTR3CONbits_t;
181 extern __at(0x0F1A) volatile __PSTR3CONbits_t PSTR3CONbits;
183 #define _PSTR3CON_STRA 0x01
184 #define _PSTR3CON_STRB 0x02
185 #define _PSTR3CON_STRC 0x04
186 #define _PSTR3CON_STRD 0x08
187 #define _PSTR3CON_STRSYNC 0x10
188 #define _PSTR3CON_CMPL0 0x40
189 #define _PSTR3CON_CMPL1 0x80
191 //==============================================================================
194 //==============================================================================
195 // PSTR2CON Bits
197 extern __at(0x0F1B) __sfr PSTR2CON;
199 typedef union
201 struct
203 unsigned STRA : 1;
204 unsigned STRB : 1;
205 unsigned STRC : 1;
206 unsigned STRD : 1;
207 unsigned STRSYNC : 1;
208 unsigned : 1;
209 unsigned CMPL0 : 1;
210 unsigned CMPL1 : 1;
213 struct
215 unsigned : 6;
216 unsigned CMPL : 2;
218 } __PSTR2CONbits_t;
220 extern __at(0x0F1B) volatile __PSTR2CONbits_t PSTR2CONbits;
222 #define _PSTR2CON_STRA 0x01
223 #define _PSTR2CON_STRB 0x02
224 #define _PSTR2CON_STRC 0x04
225 #define _PSTR2CON_STRD 0x08
226 #define _PSTR2CON_STRSYNC 0x10
227 #define _PSTR2CON_CMPL0 0x40
228 #define _PSTR2CON_CMPL1 0x80
230 //==============================================================================
232 extern __at(0x0F1C) __sfr TXREG2;
233 extern __at(0x0F1D) __sfr RCREG2;
234 extern __at(0x0F1E) __sfr SPBRG2;
235 extern __at(0x0F1F) __sfr SPBRGH2;
237 //==============================================================================
238 // BAUDCON2 Bits
240 extern __at(0x0F20) __sfr BAUDCON2;
242 typedef struct
244 unsigned ABDEN : 1;
245 unsigned WUE : 1;
246 unsigned : 1;
247 unsigned BRG16 : 1;
248 unsigned TXCKP : 1;
249 unsigned RXDTP : 1;
250 unsigned RCIDL : 1;
251 unsigned ABDOVF : 1;
252 } __BAUDCON2bits_t;
254 extern __at(0x0F20) volatile __BAUDCON2bits_t BAUDCON2bits;
256 #define _BAUDCON2_ABDEN 0x01
257 #define _BAUDCON2_WUE 0x02
258 #define _BAUDCON2_BRG16 0x08
259 #define _BAUDCON2_TXCKP 0x10
260 #define _BAUDCON2_RXDTP 0x20
261 #define _BAUDCON2_RCIDL 0x40
262 #define _BAUDCON2_ABDOVF 0x80
264 //==============================================================================
267 //==============================================================================
268 // TXSTA2 Bits
270 extern __at(0x0F21) __sfr TXSTA2;
272 typedef union
274 struct
276 unsigned TX9D : 1;
277 unsigned TRMT : 1;
278 unsigned BRGH : 1;
279 unsigned SENDB : 1;
280 unsigned SYNC : 1;
281 unsigned TXEN : 1;
282 unsigned TX9 : 1;
283 unsigned CSRC : 1;
286 struct
288 unsigned TX9D2 : 1;
289 unsigned TRMT2 : 1;
290 unsigned BRGH2 : 1;
291 unsigned SENDB2 : 1;
292 unsigned SYNC2 : 1;
293 unsigned TXEN2 : 1;
294 unsigned TX92 : 1;
295 unsigned CSRC2 : 1;
297 } __TXSTA2bits_t;
299 extern __at(0x0F21) volatile __TXSTA2bits_t TXSTA2bits;
301 #define _TXSTA2_TX9D 0x01
302 #define _TXSTA2_TX9D2 0x01
303 #define _TXSTA2_TRMT 0x02
304 #define _TXSTA2_TRMT2 0x02
305 #define _TXSTA2_BRGH 0x04
306 #define _TXSTA2_BRGH2 0x04
307 #define _TXSTA2_SENDB 0x08
308 #define _TXSTA2_SENDB2 0x08
309 #define _TXSTA2_SYNC 0x10
310 #define _TXSTA2_SYNC2 0x10
311 #define _TXSTA2_TXEN 0x20
312 #define _TXSTA2_TXEN2 0x20
313 #define _TXSTA2_TX9 0x40
314 #define _TXSTA2_TX92 0x40
315 #define _TXSTA2_CSRC 0x80
316 #define _TXSTA2_CSRC2 0x80
318 //==============================================================================
321 //==============================================================================
322 // RCSTA2 Bits
324 extern __at(0x0F22) __sfr RCSTA2;
326 typedef union
328 struct
330 unsigned RX9D : 1;
331 unsigned OERR : 1;
332 unsigned FERR : 1;
333 unsigned ADDEN : 1;
334 unsigned CREN : 1;
335 unsigned SREN : 1;
336 unsigned RX9 : 1;
337 unsigned SPEN : 1;
340 struct
342 unsigned RX9D2 : 1;
343 unsigned OERR2 : 1;
344 unsigned FERR2 : 1;
345 unsigned ADDEN2 : 1;
346 unsigned CREN2 : 1;
347 unsigned SREN2 : 1;
348 unsigned RX92 : 1;
349 unsigned SPEN2 : 1;
351 } __RCSTA2bits_t;
353 extern __at(0x0F22) volatile __RCSTA2bits_t RCSTA2bits;
355 #define _RCSTA2_RX9D 0x01
356 #define _RCSTA2_RX9D2 0x01
357 #define _RCSTA2_OERR 0x02
358 #define _RCSTA2_OERR2 0x02
359 #define _RCSTA2_FERR 0x04
360 #define _RCSTA2_FERR2 0x04
361 #define _RCSTA2_ADDEN 0x08
362 #define _RCSTA2_ADDEN2 0x08
363 #define _RCSTA2_CREN 0x10
364 #define _RCSTA2_CREN2 0x10
365 #define _RCSTA2_SREN 0x20
366 #define _RCSTA2_SREN2 0x20
367 #define _RCSTA2_RX9 0x40
368 #define _RCSTA2_RX92 0x40
369 #define _RCSTA2_SPEN 0x80
370 #define _RCSTA2_SPEN2 0x80
372 //==============================================================================
375 //==============================================================================
376 // ANCON2 Bits
378 extern __at(0x0F23) __sfr ANCON2;
380 typedef struct
382 unsigned ANSEL16 : 1;
383 unsigned ANSEL17 : 1;
384 unsigned ANSEL18 : 1;
385 unsigned ANSEL19 : 1;
386 unsigned : 1;
387 unsigned : 1;
388 unsigned : 1;
389 unsigned : 1;
390 } __ANCON2bits_t;
392 extern __at(0x0F23) volatile __ANCON2bits_t ANCON2bits;
394 #define _ANSEL16 0x01
395 #define _ANSEL17 0x02
396 #define _ANSEL18 0x04
397 #define _ANSEL19 0x08
399 //==============================================================================
402 //==============================================================================
403 // ANCON1 Bits
405 extern __at(0x0F24) __sfr ANCON1;
407 typedef struct
409 unsigned ANSEL8 : 1;
410 unsigned ANSEL9 : 1;
411 unsigned ANSEL10 : 1;
412 unsigned ANSEL11 : 1;
413 unsigned : 1;
414 unsigned : 1;
415 unsigned : 1;
416 unsigned : 1;
417 } __ANCON1bits_t;
419 extern __at(0x0F24) volatile __ANCON1bits_t ANCON1bits;
421 #define _ANSEL8 0x01
422 #define _ANSEL9 0x02
423 #define _ANSEL10 0x04
424 #define _ANSEL11 0x08
426 //==============================================================================
429 //==============================================================================
430 // ANCON0 Bits
432 extern __at(0x0F25) __sfr ANCON0;
434 typedef struct
436 unsigned ANSEL0 : 1;
437 unsigned ANSEL1 : 1;
438 unsigned ANSEL2 : 1;
439 unsigned ANSEL3 : 1;
440 unsigned ANSEL4 : 1;
441 unsigned ANSEL5 : 1;
442 unsigned ANSEL6 : 1;
443 unsigned ANSEL7 : 1;
444 } __ANCON0bits_t;
446 extern __at(0x0F25) volatile __ANCON0bits_t ANCON0bits;
448 #define _ANSEL0 0x01
449 #define _ANSEL1 0x02
450 #define _ANSEL2 0x04
451 #define _ANSEL3 0x08
452 #define _ANSEL4 0x10
453 #define _ANSEL5 0x20
454 #define _ANSEL6 0x40
455 #define _ANSEL7 0x80
457 //==============================================================================
460 //==============================================================================
461 // ODCON3 Bits
463 extern __at(0x0F27) __sfr ODCON3;
465 typedef struct
467 unsigned CTMUDS : 1;
468 unsigned : 1;
469 unsigned : 1;
470 unsigned : 1;
471 unsigned : 1;
472 unsigned : 1;
473 unsigned U1OD : 1;
474 unsigned U2OD : 1;
475 } __ODCON3bits_t;
477 extern __at(0x0F27) volatile __ODCON3bits_t ODCON3bits;
479 #define _CTMUDS 0x01
480 #define _U1OD 0x40
481 #define _U2OD 0x80
483 //==============================================================================
486 //==============================================================================
487 // ODCON2 Bits
489 extern __at(0x0F28) __sfr ODCON2;
491 typedef struct
493 unsigned CCP3OD : 1;
494 unsigned CCP4OD : 1;
495 unsigned CCP5OD : 1;
496 unsigned CCP6OD : 1;
497 unsigned CCP7OD : 1;
498 unsigned CCP8OD : 1;
499 unsigned : 1;
500 unsigned : 1;
501 } __ODCON2bits_t;
503 extern __at(0x0F28) volatile __ODCON2bits_t ODCON2bits;
505 #define _CCP3OD 0x01
506 #define _CCP4OD 0x02
507 #define _CCP5OD 0x04
508 #define _CCP6OD 0x08
509 #define _CCP7OD 0x10
510 #define _CCP8OD 0x20
512 //==============================================================================
515 //==============================================================================
516 // ODCON1 Bits
518 extern __at(0x0F29) __sfr ODCON1;
520 typedef struct
522 unsigned SPI2OD : 1;
523 unsigned : 1;
524 unsigned : 1;
525 unsigned : 1;
526 unsigned : 1;
527 unsigned CCP1OD : 1;
528 unsigned CCP2OD : 1;
529 unsigned SPI1OD : 1;
530 } __ODCON1bits_t;
532 extern __at(0x0F29) volatile __ODCON1bits_t ODCON1bits;
534 #define _SPI2OD 0x01
535 #define _CCP1OD 0x20
536 #define _CCP2OD 0x40
537 #define _SPI1OD 0x80
539 //==============================================================================
542 //==============================================================================
543 // REFOCON Bits
545 extern __at(0x0F2A) __sfr REFOCON;
547 typedef union
549 struct
551 unsigned RODIV0 : 1;
552 unsigned RODIV1 : 1;
553 unsigned RODIV2 : 1;
554 unsigned RODIV3 : 1;
555 unsigned ROSEL : 1;
556 unsigned ROSSLP : 1;
557 unsigned : 1;
558 unsigned ROON : 1;
561 struct
563 unsigned RODIV : 4;
564 unsigned : 4;
566 } __REFOCONbits_t;
568 extern __at(0x0F2A) volatile __REFOCONbits_t REFOCONbits;
570 #define _RODIV0 0x01
571 #define _RODIV1 0x02
572 #define _RODIV2 0x04
573 #define _RODIV3 0x08
574 #define _ROSEL 0x10
575 #define _ROSSLP 0x20
576 #define _ROON 0x80
578 //==============================================================================
581 //==============================================================================
582 // CCPTMRS2 Bits
584 extern __at(0x0F2B) __sfr CCPTMRS2;
586 typedef union
588 struct
590 unsigned C8TSEL0 : 1;
591 unsigned C8TSEL1 : 1;
592 unsigned : 1;
593 unsigned : 1;
594 unsigned : 1;
595 unsigned : 1;
596 unsigned : 1;
597 unsigned : 1;
600 struct
602 unsigned C8TSEL : 2;
603 unsigned : 6;
605 } __CCPTMRS2bits_t;
607 extern __at(0x0F2B) volatile __CCPTMRS2bits_t CCPTMRS2bits;
609 #define _C8TSEL0 0x01
610 #define _C8TSEL1 0x02
612 //==============================================================================
615 //==============================================================================
616 // CCPTMRS1 Bits
618 extern __at(0x0F2C) __sfr CCPTMRS1;
620 typedef union
622 struct
624 unsigned C4TSEL0 : 1;
625 unsigned C4TSEL1 : 1;
626 unsigned C5TSEL0 : 1;
627 unsigned : 1;
628 unsigned C6TSEL0 : 1;
629 unsigned : 1;
630 unsigned C7TSEL0 : 1;
631 unsigned C7TSEL1 : 1;
634 struct
636 unsigned C4TSEL : 2;
637 unsigned : 6;
640 struct
642 unsigned : 6;
643 unsigned C7TSEL : 2;
645 } __CCPTMRS1bits_t;
647 extern __at(0x0F2C) volatile __CCPTMRS1bits_t CCPTMRS1bits;
649 #define _C4TSEL0 0x01
650 #define _C4TSEL1 0x02
651 #define _C5TSEL0 0x04
652 #define _C6TSEL0 0x10
653 #define _C7TSEL0 0x40
654 #define _C7TSEL1 0x80
656 //==============================================================================
659 //==============================================================================
660 // CCPTMRS0 Bits
662 extern __at(0x0F2D) __sfr CCPTMRS0;
664 typedef union
666 struct
668 unsigned C1TSEL0 : 1;
669 unsigned C1TSEL1 : 1;
670 unsigned C1TSEL2 : 1;
671 unsigned C2TSEL0 : 1;
672 unsigned C2TSEL1 : 1;
673 unsigned C2TSEL2 : 1;
674 unsigned C3TSEL0 : 1;
675 unsigned C3TSEL1 : 1;
678 struct
680 unsigned C1TSEL : 3;
681 unsigned : 5;
684 struct
686 unsigned : 3;
687 unsigned C2TSEL : 3;
688 unsigned : 2;
691 struct
693 unsigned : 6;
694 unsigned C3TSEL : 2;
696 } __CCPTMRS0bits_t;
698 extern __at(0x0F2D) volatile __CCPTMRS0bits_t CCPTMRS0bits;
700 #define _C1TSEL0 0x01
701 #define _C1TSEL1 0x02
702 #define _C1TSEL2 0x04
703 #define _C2TSEL0 0x08
704 #define _C2TSEL1 0x10
705 #define _C2TSEL2 0x20
706 #define _C3TSEL0 0x40
707 #define _C3TSEL1 0x80
709 //==============================================================================
712 //==============================================================================
713 // CM3CON Bits
715 extern __at(0x0F2E) __sfr CM3CON;
717 typedef union
719 struct
721 unsigned CCH0 : 1;
722 unsigned CCH1 : 1;
723 unsigned CREF : 1;
724 unsigned EVPOL0 : 1;
725 unsigned EVPOL1 : 1;
726 unsigned CPOL : 1;
727 unsigned COE : 1;
728 unsigned CON : 1;
731 struct
733 unsigned CCH : 2;
734 unsigned : 6;
737 struct
739 unsigned : 3;
740 unsigned EVPOL : 2;
741 unsigned : 3;
743 } __CM3CONbits_t;
745 extern __at(0x0F2E) volatile __CM3CONbits_t CM3CONbits;
747 #define _CM3CON_CCH0 0x01
748 #define _CM3CON_CCH1 0x02
749 #define _CM3CON_CREF 0x04
750 #define _CM3CON_EVPOL0 0x08
751 #define _CM3CON_EVPOL1 0x10
752 #define _CM3CON_CPOL 0x20
753 #define _CM3CON_COE 0x40
754 #define _CM3CON_CON 0x80
756 //==============================================================================
759 //==============================================================================
760 // CM3CON1 Bits
762 extern __at(0x0F2E) __sfr CM3CON1;
764 typedef union
766 struct
768 unsigned CCH0 : 1;
769 unsigned CCH1 : 1;
770 unsigned CREF : 1;
771 unsigned EVPOL0 : 1;
772 unsigned EVPOL1 : 1;
773 unsigned CPOL : 1;
774 unsigned COE : 1;
775 unsigned CON : 1;
778 struct
780 unsigned CCH : 2;
781 unsigned : 6;
784 struct
786 unsigned : 3;
787 unsigned EVPOL : 2;
788 unsigned : 3;
790 } __CM3CON1bits_t;
792 extern __at(0x0F2E) volatile __CM3CON1bits_t CM3CON1bits;
794 #define _CM3CON1_CCH0 0x01
795 #define _CM3CON1_CCH1 0x02
796 #define _CM3CON1_CREF 0x04
797 #define _CM3CON1_EVPOL0 0x08
798 #define _CM3CON1_EVPOL1 0x10
799 #define _CM3CON1_CPOL 0x20
800 #define _CM3CON1_COE 0x40
801 #define _CM3CON1_CON 0x80
803 //==============================================================================
806 //==============================================================================
807 // CM2CON Bits
809 extern __at(0x0F2F) __sfr CM2CON;
811 typedef union
813 struct
815 unsigned CCH0 : 1;
816 unsigned CCH1 : 1;
817 unsigned CREF : 1;
818 unsigned EVPOL0 : 1;
819 unsigned EVPOL1 : 1;
820 unsigned CPOL : 1;
821 unsigned COE : 1;
822 unsigned CON : 1;
825 struct
827 unsigned CCH : 2;
828 unsigned : 6;
831 struct
833 unsigned : 3;
834 unsigned EVPOL : 2;
835 unsigned : 3;
837 } __CM2CONbits_t;
839 extern __at(0x0F2F) volatile __CM2CONbits_t CM2CONbits;
841 #define _CM2CON_CCH0 0x01
842 #define _CM2CON_CCH1 0x02
843 #define _CM2CON_CREF 0x04
844 #define _CM2CON_EVPOL0 0x08
845 #define _CM2CON_EVPOL1 0x10
846 #define _CM2CON_CPOL 0x20
847 #define _CM2CON_COE 0x40
848 #define _CM2CON_CON 0x80
850 //==============================================================================
853 //==============================================================================
854 // CM2CON1 Bits
856 extern __at(0x0F2F) __sfr CM2CON1;
858 typedef union
860 struct
862 unsigned CCH0 : 1;
863 unsigned CCH1 : 1;
864 unsigned CREF : 1;
865 unsigned EVPOL0 : 1;
866 unsigned EVPOL1 : 1;
867 unsigned CPOL : 1;
868 unsigned COE : 1;
869 unsigned CON : 1;
872 struct
874 unsigned CCH : 2;
875 unsigned : 6;
878 struct
880 unsigned : 3;
881 unsigned EVPOL : 2;
882 unsigned : 3;
884 } __CM2CON1bits_t;
886 extern __at(0x0F2F) volatile __CM2CON1bits_t CM2CON1bits;
888 #define _CM2CON1_CCH0 0x01
889 #define _CM2CON1_CCH1 0x02
890 #define _CM2CON1_CREF 0x04
891 #define _CM2CON1_EVPOL0 0x08
892 #define _CM2CON1_EVPOL1 0x10
893 #define _CM2CON1_CPOL 0x20
894 #define _CM2CON1_COE 0x40
895 #define _CM2CON1_CON 0x80
897 //==============================================================================
900 //==============================================================================
901 // T8CON Bits
903 extern __at(0x0F36) __sfr T8CON;
905 typedef union
907 struct
909 unsigned T8CKPS0 : 1;
910 unsigned T8CKPS1 : 1;
911 unsigned TMR8ON : 1;
912 unsigned T8OUTPS0 : 1;
913 unsigned T8OUTPS1 : 1;
914 unsigned T8OUTPS2 : 1;
915 unsigned T8OUTPS3 : 1;
916 unsigned : 1;
919 struct
921 unsigned T8CKPS : 2;
922 unsigned : 6;
925 struct
927 unsigned : 3;
928 unsigned T8OUTPS : 4;
929 unsigned : 1;
931 } __T8CONbits_t;
933 extern __at(0x0F36) volatile __T8CONbits_t T8CONbits;
935 #define _T8CKPS0 0x01
936 #define _T8CKPS1 0x02
937 #define _TMR8ON 0x04
938 #define _T8OUTPS0 0x08
939 #define _T8OUTPS1 0x10
940 #define _T8OUTPS2 0x20
941 #define _T8OUTPS3 0x40
943 //==============================================================================
945 extern __at(0x0F37) __sfr PR8;
946 extern __at(0x0F38) __sfr TMR8;
948 //==============================================================================
949 // T6CON Bits
951 extern __at(0x0F39) __sfr T6CON;
953 typedef union
955 struct
957 unsigned T6CKPS0 : 1;
958 unsigned T6CKPS1 : 1;
959 unsigned TMR6ON : 1;
960 unsigned T6OUTPS0 : 1;
961 unsigned T6OUTPS1 : 1;
962 unsigned T6OUTPS2 : 1;
963 unsigned T6OUTPS3 : 1;
964 unsigned : 1;
967 struct
969 unsigned T6CKPS : 2;
970 unsigned : 6;
973 struct
975 unsigned : 3;
976 unsigned T6OUTPS : 4;
977 unsigned : 1;
979 } __T6CONbits_t;
981 extern __at(0x0F39) volatile __T6CONbits_t T6CONbits;
983 #define _T6CKPS0 0x01
984 #define _T6CKPS1 0x02
985 #define _TMR6ON 0x04
986 #define _T6OUTPS0 0x08
987 #define _T6OUTPS1 0x10
988 #define _T6OUTPS2 0x20
989 #define _T6OUTPS3 0x40
991 //==============================================================================
993 extern __at(0x0F3A) __sfr PR6;
994 extern __at(0x0F3B) __sfr TMR6;
996 //==============================================================================
997 // CCP8CON Bits
999 extern __at(0x0F46) __sfr CCP8CON;
1001 typedef union
1003 struct
1005 unsigned CCP8M0 : 1;
1006 unsigned CCP8M1 : 1;
1007 unsigned CCP8M2 : 1;
1008 unsigned CCP8M3 : 1;
1009 unsigned DC8B0 : 1;
1010 unsigned DC8B1 : 1;
1011 unsigned : 1;
1012 unsigned : 1;
1015 struct
1017 unsigned : 1;
1018 unsigned : 1;
1019 unsigned : 1;
1020 unsigned : 1;
1021 unsigned CCP8Y : 1;
1022 unsigned CCP8X : 1;
1023 unsigned : 1;
1024 unsigned : 1;
1027 struct
1029 unsigned CCP8M : 4;
1030 unsigned : 4;
1033 struct
1035 unsigned : 4;
1036 unsigned DC8B : 2;
1037 unsigned : 2;
1039 } __CCP8CONbits_t;
1041 extern __at(0x0F46) volatile __CCP8CONbits_t CCP8CONbits;
1043 #define _CCP8M0 0x01
1044 #define _CCP8M1 0x02
1045 #define _CCP8M2 0x04
1046 #define _CCP8M3 0x08
1047 #define _DC8B0 0x10
1048 #define _CCP8Y 0x10
1049 #define _DC8B1 0x20
1050 #define _CCP8X 0x20
1052 //==============================================================================
1054 extern __at(0x0F47) __sfr CCPR8;
1055 extern __at(0x0F47) __sfr CCPR8L;
1056 extern __at(0x0F48) __sfr CCPR8H;
1058 //==============================================================================
1059 // CCP3CON Bits
1061 extern __at(0x0F49) __sfr CCP3CON;
1063 typedef union
1065 struct
1067 unsigned CCP3M0 : 1;
1068 unsigned CCP3M1 : 1;
1069 unsigned CCP3M2 : 1;
1070 unsigned CCP3M3 : 1;
1071 unsigned DC3B0 : 1;
1072 unsigned DC3B1 : 1;
1073 unsigned P3M0 : 1;
1074 unsigned P3M1 : 1;
1077 struct
1079 unsigned CCP3M : 4;
1080 unsigned : 4;
1083 struct
1085 unsigned : 4;
1086 unsigned DC3B : 2;
1087 unsigned : 2;
1090 struct
1092 unsigned : 6;
1093 unsigned P3M : 2;
1095 } __CCP3CONbits_t;
1097 extern __at(0x0F49) volatile __CCP3CONbits_t CCP3CONbits;
1099 #define _CCP3M0 0x01
1100 #define _CCP3M1 0x02
1101 #define _CCP3M2 0x04
1102 #define _CCP3M3 0x08
1103 #define _DC3B0 0x10
1104 #define _DC3B1 0x20
1105 #define _P3M0 0x40
1106 #define _P3M1 0x80
1108 //==============================================================================
1110 extern __at(0x0F4A) __sfr CCPR3;
1111 extern __at(0x0F4A) __sfr CCPR3L;
1112 extern __at(0x0F4B) __sfr CCPR3H;
1114 //==============================================================================
1115 // ECCP3DEL Bits
1117 extern __at(0x0F4C) __sfr ECCP3DEL;
1119 typedef union
1121 struct
1123 unsigned P3DC0 : 1;
1124 unsigned P3DC1 : 1;
1125 unsigned P3DC2 : 1;
1126 unsigned P3DC3 : 1;
1127 unsigned P3DC4 : 1;
1128 unsigned P3DC5 : 1;
1129 unsigned P3DC6 : 1;
1130 unsigned P3RSEN : 1;
1133 struct
1135 unsigned P3DC : 7;
1136 unsigned : 1;
1138 } __ECCP3DELbits_t;
1140 extern __at(0x0F4C) volatile __ECCP3DELbits_t ECCP3DELbits;
1142 #define _P3DC0 0x01
1143 #define _P3DC1 0x02
1144 #define _P3DC2 0x04
1145 #define _P3DC3 0x08
1146 #define _P3DC4 0x10
1147 #define _P3DC5 0x20
1148 #define _P3DC6 0x40
1149 #define _P3RSEN 0x80
1151 //==============================================================================
1154 //==============================================================================
1155 // ECCP3AS Bits
1157 extern __at(0x0F4D) __sfr ECCP3AS;
1159 typedef union
1161 struct
1163 unsigned PSS3BD0 : 1;
1164 unsigned PSS3BD1 : 1;
1165 unsigned PSS3AC0 : 1;
1166 unsigned PSS3AC1 : 1;
1167 unsigned ECCP3AS0 : 1;
1168 unsigned ECCP3AS1 : 1;
1169 unsigned ECCP3AS2 : 1;
1170 unsigned ECCP3ASE : 1;
1173 struct
1175 unsigned PSS3BD : 2;
1176 unsigned : 6;
1179 struct
1181 unsigned : 2;
1182 unsigned PSS3AC : 2;
1183 unsigned : 4;
1186 struct
1188 unsigned : 4;
1189 unsigned ECCP3AS : 3;
1190 unsigned : 1;
1192 } __ECCP3ASbits_t;
1194 extern __at(0x0F4D) volatile __ECCP3ASbits_t ECCP3ASbits;
1196 #define _PSS3BD0 0x01
1197 #define _PSS3BD1 0x02
1198 #define _PSS3AC0 0x04
1199 #define _PSS3AC1 0x08
1200 #define _ECCP3AS0 0x10
1201 #define _ECCP3AS1 0x20
1202 #define _ECCP3AS2 0x40
1203 #define _ECCP3ASE 0x80
1205 //==============================================================================
1208 //==============================================================================
1209 // CCP2CON Bits
1211 extern __at(0x0F4E) __sfr CCP2CON;
1213 typedef union
1215 struct
1217 unsigned CCP2M0 : 1;
1218 unsigned CCP2M1 : 1;
1219 unsigned CCP2M2 : 1;
1220 unsigned CCP2M3 : 1;
1221 unsigned DC2B0 : 1;
1222 unsigned DC2B1 : 1;
1223 unsigned P2M0 : 1;
1224 unsigned P2M1 : 1;
1227 struct
1229 unsigned : 1;
1230 unsigned : 1;
1231 unsigned : 1;
1232 unsigned : 1;
1233 unsigned CCP2Y : 1;
1234 unsigned CCP2X : 1;
1235 unsigned : 1;
1236 unsigned : 1;
1239 struct
1241 unsigned CCP2M : 4;
1242 unsigned : 4;
1245 struct
1247 unsigned : 4;
1248 unsigned DC2B : 2;
1249 unsigned : 2;
1252 struct
1254 unsigned : 6;
1255 unsigned P2M : 2;
1257 } __CCP2CONbits_t;
1259 extern __at(0x0F4E) volatile __CCP2CONbits_t CCP2CONbits;
1261 #define _CCP2M0 0x01
1262 #define _CCP2M1 0x02
1263 #define _CCP2M2 0x04
1264 #define _CCP2M3 0x08
1265 #define _DC2B0 0x10
1266 #define _CCP2Y 0x10
1267 #define _DC2B1 0x20
1268 #define _CCP2X 0x20
1269 #define _P2M0 0x40
1270 #define _P2M1 0x80
1272 //==============================================================================
1275 //==============================================================================
1276 // ECCP2CON Bits
1278 extern __at(0x0F4E) __sfr ECCP2CON;
1280 typedef union
1282 struct
1284 unsigned CCP2M0 : 1;
1285 unsigned CCP2M1 : 1;
1286 unsigned CCP2M2 : 1;
1287 unsigned CCP2M3 : 1;
1288 unsigned DC2B0 : 1;
1289 unsigned DC2B1 : 1;
1290 unsigned P2M0 : 1;
1291 unsigned P2M1 : 1;
1294 struct
1296 unsigned : 1;
1297 unsigned : 1;
1298 unsigned : 1;
1299 unsigned : 1;
1300 unsigned CCP2Y : 1;
1301 unsigned CCP2X : 1;
1302 unsigned : 1;
1303 unsigned : 1;
1306 struct
1308 unsigned CCP2M : 4;
1309 unsigned : 4;
1312 struct
1314 unsigned : 4;
1315 unsigned DC2B : 2;
1316 unsigned : 2;
1319 struct
1321 unsigned : 6;
1322 unsigned P2M : 2;
1324 } __ECCP2CONbits_t;
1326 extern __at(0x0F4E) volatile __ECCP2CONbits_t ECCP2CONbits;
1328 #define _ECCP2CON_CCP2M0 0x01
1329 #define _ECCP2CON_CCP2M1 0x02
1330 #define _ECCP2CON_CCP2M2 0x04
1331 #define _ECCP2CON_CCP2M3 0x08
1332 #define _ECCP2CON_DC2B0 0x10
1333 #define _ECCP2CON_CCP2Y 0x10
1334 #define _ECCP2CON_DC2B1 0x20
1335 #define _ECCP2CON_CCP2X 0x20
1336 #define _ECCP2CON_P2M0 0x40
1337 #define _ECCP2CON_P2M1 0x80
1339 //==============================================================================
1341 extern __at(0x0F4F) __sfr CCPR2;
1342 extern __at(0x0F4F) __sfr CCPR2L;
1343 extern __at(0x0F50) __sfr CCPR2H;
1345 //==============================================================================
1346 // ECCP2DEL Bits
1348 extern __at(0x0F51) __sfr ECCP2DEL;
1350 typedef union
1352 struct
1354 unsigned P2DC0 : 1;
1355 unsigned P2DC1 : 1;
1356 unsigned P2DC2 : 1;
1357 unsigned P2DC3 : 1;
1358 unsigned P2DC4 : 1;
1359 unsigned P2DC5 : 1;
1360 unsigned P2DC6 : 1;
1361 unsigned P2RSEN : 1;
1364 struct
1366 unsigned P2DC : 7;
1367 unsigned : 1;
1369 } __ECCP2DELbits_t;
1371 extern __at(0x0F51) volatile __ECCP2DELbits_t ECCP2DELbits;
1373 #define _P2DC0 0x01
1374 #define _P2DC1 0x02
1375 #define _P2DC2 0x04
1376 #define _P2DC3 0x08
1377 #define _P2DC4 0x10
1378 #define _P2DC5 0x20
1379 #define _P2DC6 0x40
1380 #define _P2RSEN 0x80
1382 //==============================================================================
1385 //==============================================================================
1386 // PWM2CON Bits
1388 extern __at(0x0F51) __sfr PWM2CON;
1390 typedef union
1392 struct
1394 unsigned P2DC0 : 1;
1395 unsigned P2DC1 : 1;
1396 unsigned P2DC2 : 1;
1397 unsigned P2DC3 : 1;
1398 unsigned P2DC4 : 1;
1399 unsigned P2DC5 : 1;
1400 unsigned P2DC6 : 1;
1401 unsigned P2RSEN : 1;
1404 struct
1406 unsigned P2DC : 7;
1407 unsigned : 1;
1409 } __PWM2CONbits_t;
1411 extern __at(0x0F51) volatile __PWM2CONbits_t PWM2CONbits;
1413 #define _PWM2CON_P2DC0 0x01
1414 #define _PWM2CON_P2DC1 0x02
1415 #define _PWM2CON_P2DC2 0x04
1416 #define _PWM2CON_P2DC3 0x08
1417 #define _PWM2CON_P2DC4 0x10
1418 #define _PWM2CON_P2DC5 0x20
1419 #define _PWM2CON_P2DC6 0x40
1420 #define _PWM2CON_P2RSEN 0x80
1422 //==============================================================================
1425 //==============================================================================
1426 // ECCP2AS Bits
1428 extern __at(0x0F52) __sfr ECCP2AS;
1430 typedef union
1432 struct
1434 unsigned PSS2BD0 : 1;
1435 unsigned PSS2BD1 : 1;
1436 unsigned PSS2AC0 : 1;
1437 unsigned PSS2AC1 : 1;
1438 unsigned ECCP2AS0 : 1;
1439 unsigned ECCP2AS1 : 1;
1440 unsigned ECCP2AS2 : 1;
1441 unsigned ECCP2ASE : 1;
1444 struct
1446 unsigned PSS2BD : 2;
1447 unsigned : 6;
1450 struct
1452 unsigned : 2;
1453 unsigned PSS2AC : 2;
1454 unsigned : 4;
1457 struct
1459 unsigned : 4;
1460 unsigned ECCP2AS : 3;
1461 unsigned : 1;
1463 } __ECCP2ASbits_t;
1465 extern __at(0x0F52) volatile __ECCP2ASbits_t ECCP2ASbits;
1467 #define _PSS2BD0 0x01
1468 #define _PSS2BD1 0x02
1469 #define _PSS2AC0 0x04
1470 #define _PSS2AC1 0x08
1471 #define _ECCP2AS0 0x10
1472 #define _ECCP2AS1 0x20
1473 #define _ECCP2AS2 0x40
1474 #define _ECCP2ASE 0x80
1476 //==============================================================================
1479 //==============================================================================
1480 // PADCFG1 Bits
1482 extern __at(0x0F53) __sfr PADCFG1;
1484 typedef union
1486 struct
1488 unsigned : 1;
1489 unsigned RTSECSEL0 : 1;
1490 unsigned RTSECSEL1 : 1;
1491 unsigned : 1;
1492 unsigned : 1;
1493 unsigned : 1;
1494 unsigned REPU : 1;
1495 unsigned RDPU : 1;
1498 struct
1500 unsigned : 1;
1501 unsigned RTSECSEL : 2;
1502 unsigned : 5;
1504 } __PADCFG1bits_t;
1506 extern __at(0x0F53) volatile __PADCFG1bits_t PADCFG1bits;
1508 #define _RTSECSEL0 0x02
1509 #define _RTSECSEL1 0x04
1510 #define _REPU 0x40
1511 #define _RDPU 0x80
1513 //==============================================================================
1516 //==============================================================================
1517 // CM1CON Bits
1519 extern __at(0x0F54) __sfr CM1CON;
1521 typedef union
1523 struct
1525 unsigned CCH0 : 1;
1526 unsigned CCH1 : 1;
1527 unsigned CREF : 1;
1528 unsigned EVPOL0 : 1;
1529 unsigned EVPOL1 : 1;
1530 unsigned CPOL : 1;
1531 unsigned COE : 1;
1532 unsigned CON : 1;
1535 struct
1537 unsigned CCH : 2;
1538 unsigned : 6;
1541 struct
1543 unsigned : 3;
1544 unsigned EVPOL : 2;
1545 unsigned : 3;
1547 } __CM1CONbits_t;
1549 extern __at(0x0F54) volatile __CM1CONbits_t CM1CONbits;
1551 #define _CCH0 0x01
1552 #define _CCH1 0x02
1553 #define _CREF 0x04
1554 #define _EVPOL0 0x08
1555 #define _EVPOL1 0x10
1556 #define _CPOL 0x20
1557 #define _COE 0x40
1558 #define _CON 0x80
1560 //==============================================================================
1563 //==============================================================================
1564 // CM1CON1 Bits
1566 extern __at(0x0F54) __sfr CM1CON1;
1568 typedef union
1570 struct
1572 unsigned CCH0 : 1;
1573 unsigned CCH1 : 1;
1574 unsigned CREF : 1;
1575 unsigned EVPOL0 : 1;
1576 unsigned EVPOL1 : 1;
1577 unsigned CPOL : 1;
1578 unsigned COE : 1;
1579 unsigned CON : 1;
1582 struct
1584 unsigned CCH : 2;
1585 unsigned : 6;
1588 struct
1590 unsigned : 3;
1591 unsigned EVPOL : 2;
1592 unsigned : 3;
1594 } __CM1CON1bits_t;
1596 extern __at(0x0F54) volatile __CM1CON1bits_t CM1CON1bits;
1598 #define _CM1CON1_CCH0 0x01
1599 #define _CM1CON1_CCH1 0x02
1600 #define _CM1CON1_CREF 0x04
1601 #define _CM1CON1_EVPOL0 0x08
1602 #define _CM1CON1_EVPOL1 0x10
1603 #define _CM1CON1_CPOL 0x20
1604 #define _CM1CON1_COE 0x40
1605 #define _CM1CON1_CON 0x80
1607 //==============================================================================
1610 //==============================================================================
1611 // CTMUICON Bits
1613 extern __at(0x0F55) __sfr CTMUICON;
1615 typedef union
1617 struct
1619 unsigned IRNG0 : 1;
1620 unsigned IRNG1 : 1;
1621 unsigned ITRIM0 : 1;
1622 unsigned ITRIM1 : 1;
1623 unsigned ITRIM2 : 1;
1624 unsigned ITRIM3 : 1;
1625 unsigned ITRIM4 : 1;
1626 unsigned ITRIM5 : 1;
1629 struct
1631 unsigned IRNG : 2;
1632 unsigned : 6;
1635 struct
1637 unsigned : 2;
1638 unsigned ITRIM : 6;
1640 } __CTMUICONbits_t;
1642 extern __at(0x0F55) volatile __CTMUICONbits_t CTMUICONbits;
1644 #define _IRNG0 0x01
1645 #define _IRNG1 0x02
1646 #define _ITRIM0 0x04
1647 #define _ITRIM1 0x08
1648 #define _ITRIM2 0x10
1649 #define _ITRIM3 0x20
1650 #define _ITRIM4 0x40
1651 #define _ITRIM5 0x80
1653 //==============================================================================
1656 //==============================================================================
1657 // CTMUCONL Bits
1659 extern __at(0x0F56) __sfr CTMUCONL;
1661 typedef union
1663 struct
1665 unsigned EDG1STAT : 1;
1666 unsigned EDG2STAT : 1;
1667 unsigned EDG1SEL0 : 1;
1668 unsigned EDG1SEL1 : 1;
1669 unsigned EDG1POL : 1;
1670 unsigned EDG2SEL0 : 1;
1671 unsigned EDG2SEL1 : 1;
1672 unsigned EDG2POL : 1;
1675 struct
1677 unsigned : 2;
1678 unsigned EDG1SEL : 2;
1679 unsigned : 4;
1682 struct
1684 unsigned : 5;
1685 unsigned EDG2SEL : 2;
1686 unsigned : 1;
1688 } __CTMUCONLbits_t;
1690 extern __at(0x0F56) volatile __CTMUCONLbits_t CTMUCONLbits;
1692 #define _EDG1STAT 0x01
1693 #define _EDG2STAT 0x02
1694 #define _EDG1SEL0 0x04
1695 #define _EDG1SEL1 0x08
1696 #define _EDG1POL 0x10
1697 #define _EDG2SEL0 0x20
1698 #define _EDG2SEL1 0x40
1699 #define _EDG2POL 0x80
1701 //==============================================================================
1704 //==============================================================================
1705 // CTMUCONH Bits
1707 extern __at(0x0F57) __sfr CTMUCONH;
1709 typedef struct
1711 unsigned CTTRIG : 1;
1712 unsigned IDISSEN : 1;
1713 unsigned EDGSEQEN : 1;
1714 unsigned EDGEN : 1;
1715 unsigned TGEN : 1;
1716 unsigned CTMUSIDL : 1;
1717 unsigned : 1;
1718 unsigned CTMUEN : 1;
1719 } __CTMUCONHbits_t;
1721 extern __at(0x0F57) volatile __CTMUCONHbits_t CTMUCONHbits;
1723 #define _CTTRIG 0x01
1724 #define _IDISSEN 0x02
1725 #define _EDGSEQEN 0x04
1726 #define _EDGEN 0x08
1727 #define _TGEN 0x10
1728 #define _CTMUSIDL 0x20
1729 #define _CTMUEN 0x80
1731 //==============================================================================
1733 extern __at(0x0F58) __sfr ALRMVAL;
1734 extern __at(0x0F58) __sfr ALRMVALL;
1735 extern __at(0x0F59) __sfr ALRMVALH;
1737 //==============================================================================
1738 // ALRMRPT Bits
1740 extern __at(0x0F5A) __sfr ALRMRPT;
1742 typedef struct
1744 unsigned ARPT0 : 1;
1745 unsigned ARPT1 : 1;
1746 unsigned ARPT2 : 1;
1747 unsigned ARPT3 : 1;
1748 unsigned ARPT4 : 1;
1749 unsigned ARPT5 : 1;
1750 unsigned ARPT6 : 1;
1751 unsigned ARPT7 : 1;
1752 } __ALRMRPTbits_t;
1754 extern __at(0x0F5A) volatile __ALRMRPTbits_t ALRMRPTbits;
1756 #define _ARPT0 0x01
1757 #define _ARPT1 0x02
1758 #define _ARPT2 0x04
1759 #define _ARPT3 0x08
1760 #define _ARPT4 0x10
1761 #define _ARPT5 0x20
1762 #define _ARPT6 0x40
1763 #define _ARPT7 0x80
1765 //==============================================================================
1768 //==============================================================================
1769 // ALRMCFG Bits
1771 extern __at(0x0F5B) __sfr ALRMCFG;
1773 typedef union
1775 struct
1777 unsigned ALRMPTR0 : 1;
1778 unsigned ALRMPTR1 : 1;
1779 unsigned AMASK0 : 1;
1780 unsigned AMASK1 : 1;
1781 unsigned AMASK2 : 1;
1782 unsigned AMASK3 : 1;
1783 unsigned CHIME : 1;
1784 unsigned ALRMEN : 1;
1787 struct
1789 unsigned ALRMPTR : 2;
1790 unsigned : 6;
1793 struct
1795 unsigned : 2;
1796 unsigned AMASK : 4;
1797 unsigned : 2;
1799 } __ALRMCFGbits_t;
1801 extern __at(0x0F5B) volatile __ALRMCFGbits_t ALRMCFGbits;
1803 #define _ALRMPTR0 0x01
1804 #define _ALRMPTR1 0x02
1805 #define _AMASK0 0x04
1806 #define _AMASK1 0x08
1807 #define _AMASK2 0x10
1808 #define _AMASK3 0x20
1809 #define _CHIME 0x40
1810 #define _ALRMEN 0x80
1812 //==============================================================================
1814 extern __at(0x0F5C) __sfr RTCVAL;
1815 extern __at(0x0F5C) __sfr RTCVALL;
1816 extern __at(0x0F5D) __sfr RTCVALH;
1818 //==============================================================================
1819 // RTCCAL Bits
1821 extern __at(0x0F5E) __sfr RTCCAL;
1823 typedef struct
1825 unsigned CAL0 : 1;
1826 unsigned CAL1 : 1;
1827 unsigned CAL2 : 1;
1828 unsigned CAL3 : 1;
1829 unsigned CAL4 : 1;
1830 unsigned CAL5 : 1;
1831 unsigned CAL6 : 1;
1832 unsigned CAL7 : 1;
1833 } __RTCCALbits_t;
1835 extern __at(0x0F5E) volatile __RTCCALbits_t RTCCALbits;
1837 #define _CAL0 0x01
1838 #define _CAL1 0x02
1839 #define _CAL2 0x04
1840 #define _CAL3 0x08
1841 #define _CAL4 0x10
1842 #define _CAL5 0x20
1843 #define _CAL6 0x40
1844 #define _CAL7 0x80
1846 //==============================================================================
1849 //==============================================================================
1850 // RTCCFG Bits
1852 extern __at(0x0F5F) __sfr RTCCFG;
1854 typedef union
1856 struct
1858 unsigned RTCPTR0 : 1;
1859 unsigned RTCPTR1 : 1;
1860 unsigned RTCOE : 1;
1861 unsigned HALFSEC : 1;
1862 unsigned RTCSYNC : 1;
1863 unsigned RTCWREN : 1;
1864 unsigned : 1;
1865 unsigned RTCEN : 1;
1868 struct
1870 unsigned RTCPTR : 2;
1871 unsigned : 6;
1873 } __RTCCFGbits_t;
1875 extern __at(0x0F5F) volatile __RTCCFGbits_t RTCCFGbits;
1877 #define _RTCPTR0 0x01
1878 #define _RTCPTR1 0x02
1879 #define _RTCOE 0x04
1880 #define _HALFSEC 0x08
1881 #define _RTCSYNC 0x10
1882 #define _RTCWREN 0x20
1883 #define _RTCEN 0x80
1885 //==============================================================================
1888 //==============================================================================
1889 // PIE6 Bits
1891 extern __at(0x0F60) __sfr PIE6;
1893 typedef struct
1895 unsigned CMP1IE : 1;
1896 unsigned CMP2IE : 1;
1897 unsigned CMP3IE : 1;
1898 unsigned : 1;
1899 unsigned EEIE : 1;
1900 unsigned : 1;
1901 unsigned : 1;
1902 unsigned : 1;
1903 } __PIE6bits_t;
1905 extern __at(0x0F60) volatile __PIE6bits_t PIE6bits;
1907 #define _CMP1IE 0x01
1908 #define _CMP2IE 0x02
1909 #define _CMP3IE 0x04
1910 #define _EEIE 0x10
1912 //==============================================================================
1914 extern __at(0x0F61) __sfr EEDATA;
1915 extern __at(0x0F62) __sfr EEADR;
1916 extern __at(0x0F63) __sfr EEADRH;
1918 //==============================================================================
1919 // OSCCON2 Bits
1921 extern __at(0x0F64) __sfr OSCCON2;
1923 typedef struct
1925 unsigned MFIOSEL : 1;
1926 unsigned MFIOFS : 1;
1927 unsigned : 1;
1928 unsigned SOSCGO : 1;
1929 unsigned : 1;
1930 unsigned : 1;
1931 unsigned SOSCRUN : 1;
1932 unsigned : 1;
1933 } __OSCCON2bits_t;
1935 extern __at(0x0F64) volatile __OSCCON2bits_t OSCCON2bits;
1937 #define _MFIOSEL 0x01
1938 #define _MFIOFS 0x02
1939 #define _SOSCGO 0x08
1940 #define _SOSCRUN 0x40
1942 //==============================================================================
1945 //==============================================================================
1946 // BAUDCON Bits
1948 extern __at(0x0F65) __sfr BAUDCON;
1950 typedef struct
1952 unsigned ABDEN : 1;
1953 unsigned WUE : 1;
1954 unsigned : 1;
1955 unsigned BRG16 : 1;
1956 unsigned TXCKP : 1;
1957 unsigned RXDTP : 1;
1958 unsigned RCIDL : 1;
1959 unsigned ABDOVF : 1;
1960 } __BAUDCONbits_t;
1962 extern __at(0x0F65) volatile __BAUDCONbits_t BAUDCONbits;
1964 #define _ABDEN 0x01
1965 #define _WUE 0x02
1966 #define _BRG16 0x08
1967 #define _TXCKP 0x10
1968 #define _RXDTP 0x20
1969 #define _RCIDL 0x40
1970 #define _ABDOVF 0x80
1972 //==============================================================================
1975 //==============================================================================
1976 // BAUDCON1 Bits
1978 extern __at(0x0F65) __sfr BAUDCON1;
1980 typedef struct
1982 unsigned ABDEN : 1;
1983 unsigned WUE : 1;
1984 unsigned : 1;
1985 unsigned BRG16 : 1;
1986 unsigned TXCKP : 1;
1987 unsigned RXDTP : 1;
1988 unsigned RCIDL : 1;
1989 unsigned ABDOVF : 1;
1990 } __BAUDCON1bits_t;
1992 extern __at(0x0F65) volatile __BAUDCON1bits_t BAUDCON1bits;
1994 #define _BAUDCON1_ABDEN 0x01
1995 #define _BAUDCON1_WUE 0x02
1996 #define _BAUDCON1_BRG16 0x08
1997 #define _BAUDCON1_TXCKP 0x10
1998 #define _BAUDCON1_RXDTP 0x20
1999 #define _BAUDCON1_RCIDL 0x40
2000 #define _BAUDCON1_ABDOVF 0x80
2002 //==============================================================================
2005 //==============================================================================
2006 // BAUDCTL Bits
2008 extern __at(0x0F65) __sfr BAUDCTL;
2010 typedef struct
2012 unsigned ABDEN : 1;
2013 unsigned WUE : 1;
2014 unsigned : 1;
2015 unsigned BRG16 : 1;
2016 unsigned TXCKP : 1;
2017 unsigned RXDTP : 1;
2018 unsigned RCIDL : 1;
2019 unsigned ABDOVF : 1;
2020 } __BAUDCTLbits_t;
2022 extern __at(0x0F65) volatile __BAUDCTLbits_t BAUDCTLbits;
2024 #define _BAUDCTL_ABDEN 0x01
2025 #define _BAUDCTL_WUE 0x02
2026 #define _BAUDCTL_BRG16 0x08
2027 #define _BAUDCTL_TXCKP 0x10
2028 #define _BAUDCTL_RXDTP 0x20
2029 #define _BAUDCTL_RCIDL 0x40
2030 #define _BAUDCTL_ABDOVF 0x80
2032 //==============================================================================
2035 //==============================================================================
2036 // SSP2CON2 Bits
2038 extern __at(0x0F66) __sfr SSP2CON2;
2040 typedef union
2042 struct
2044 unsigned SEN : 1;
2045 unsigned RSEN : 1;
2046 unsigned PEN : 1;
2047 unsigned RCEN : 1;
2048 unsigned ACKEN : 1;
2049 unsigned ACKDT : 1;
2050 unsigned ACKSTAT : 1;
2051 unsigned GCEN : 1;
2054 struct
2056 unsigned : 1;
2057 unsigned ADMSK1 : 1;
2058 unsigned ADMSK2 : 1;
2059 unsigned ADMSK3 : 1;
2060 unsigned ADMSK4 : 1;
2061 unsigned ADMSK5 : 1;
2062 unsigned : 1;
2063 unsigned : 1;
2065 } __SSP2CON2bits_t;
2067 extern __at(0x0F66) volatile __SSP2CON2bits_t SSP2CON2bits;
2069 #define _SSP2CON2_SEN 0x01
2070 #define _SSP2CON2_RSEN 0x02
2071 #define _SSP2CON2_ADMSK1 0x02
2072 #define _SSP2CON2_PEN 0x04
2073 #define _SSP2CON2_ADMSK2 0x04
2074 #define _SSP2CON2_RCEN 0x08
2075 #define _SSP2CON2_ADMSK3 0x08
2076 #define _SSP2CON2_ACKEN 0x10
2077 #define _SSP2CON2_ADMSK4 0x10
2078 #define _SSP2CON2_ACKDT 0x20
2079 #define _SSP2CON2_ADMSK5 0x20
2080 #define _SSP2CON2_ACKSTAT 0x40
2081 #define _SSP2CON2_GCEN 0x80
2083 //==============================================================================
2086 //==============================================================================
2087 // SSP2CON1 Bits
2089 extern __at(0x0F67) __sfr SSP2CON1;
2091 typedef union
2093 struct
2095 unsigned SSPM0 : 1;
2096 unsigned SSPM1 : 1;
2097 unsigned SSPM2 : 1;
2098 unsigned SSPM3 : 1;
2099 unsigned CKP : 1;
2100 unsigned SSPEN : 1;
2101 unsigned SSPOV : 1;
2102 unsigned WCOL : 1;
2105 struct
2107 unsigned SSPM : 4;
2108 unsigned : 4;
2110 } __SSP2CON1bits_t;
2112 extern __at(0x0F67) volatile __SSP2CON1bits_t SSP2CON1bits;
2114 #define _SSP2CON1_SSPM0 0x01
2115 #define _SSP2CON1_SSPM1 0x02
2116 #define _SSP2CON1_SSPM2 0x04
2117 #define _SSP2CON1_SSPM3 0x08
2118 #define _SSP2CON1_CKP 0x10
2119 #define _SSP2CON1_SSPEN 0x20
2120 #define _SSP2CON1_SSPOV 0x40
2121 #define _SSP2CON1_WCOL 0x80
2123 //==============================================================================
2126 //==============================================================================
2127 // SSP2STAT Bits
2129 extern __at(0x0F68) __sfr SSP2STAT;
2131 typedef union
2133 struct
2135 unsigned BF : 1;
2136 unsigned UA : 1;
2137 unsigned R_NOT_W : 1;
2138 unsigned S : 1;
2139 unsigned P : 1;
2140 unsigned D_NOT_A : 1;
2141 unsigned CKE : 1;
2142 unsigned SMP : 1;
2145 struct
2147 unsigned : 1;
2148 unsigned : 1;
2149 unsigned R : 1;
2150 unsigned I2C_START : 1;
2151 unsigned I2C_STOP : 1;
2152 unsigned D : 1;
2153 unsigned : 1;
2154 unsigned : 1;
2157 struct
2159 unsigned : 1;
2160 unsigned : 1;
2161 unsigned R_W : 1;
2162 unsigned : 1;
2163 unsigned : 1;
2164 unsigned D_A : 1;
2165 unsigned : 1;
2166 unsigned : 1;
2169 struct
2171 unsigned : 1;
2172 unsigned : 1;
2173 unsigned NOT_W : 1;
2174 unsigned : 1;
2175 unsigned : 1;
2176 unsigned NOT_A : 1;
2177 unsigned : 1;
2178 unsigned : 1;
2181 struct
2183 unsigned : 1;
2184 unsigned : 1;
2185 unsigned NOT_WRITE : 1;
2186 unsigned : 1;
2187 unsigned : 1;
2188 unsigned NOT_ADDRESS : 1;
2189 unsigned : 1;
2190 unsigned : 1;
2193 struct
2195 unsigned : 1;
2196 unsigned : 1;
2197 unsigned READ_WRITE : 1;
2198 unsigned : 1;
2199 unsigned : 1;
2200 unsigned DATA_ADDRESS : 1;
2201 unsigned : 1;
2202 unsigned : 1;
2205 struct
2207 unsigned : 1;
2208 unsigned : 1;
2209 unsigned I2C_READ : 1;
2210 unsigned : 1;
2211 unsigned : 1;
2212 unsigned I2C_DAT : 1;
2213 unsigned : 1;
2214 unsigned : 1;
2216 } __SSP2STATbits_t;
2218 extern __at(0x0F68) volatile __SSP2STATbits_t SSP2STATbits;
2220 #define _SSP2STAT_BF 0x01
2221 #define _SSP2STAT_UA 0x02
2222 #define _SSP2STAT_R_NOT_W 0x04
2223 #define _SSP2STAT_R 0x04
2224 #define _SSP2STAT_R_W 0x04
2225 #define _SSP2STAT_NOT_W 0x04
2226 #define _SSP2STAT_NOT_WRITE 0x04
2227 #define _SSP2STAT_READ_WRITE 0x04
2228 #define _SSP2STAT_I2C_READ 0x04
2229 #define _SSP2STAT_S 0x08
2230 #define _SSP2STAT_I2C_START 0x08
2231 #define _SSP2STAT_P 0x10
2232 #define _SSP2STAT_I2C_STOP 0x10
2233 #define _SSP2STAT_D_NOT_A 0x20
2234 #define _SSP2STAT_D 0x20
2235 #define _SSP2STAT_D_A 0x20
2236 #define _SSP2STAT_NOT_A 0x20
2237 #define _SSP2STAT_NOT_ADDRESS 0x20
2238 #define _SSP2STAT_DATA_ADDRESS 0x20
2239 #define _SSP2STAT_I2C_DAT 0x20
2240 #define _SSP2STAT_CKE 0x40
2241 #define _SSP2STAT_SMP 0x80
2243 //==============================================================================
2245 extern __at(0x0F69) __sfr SSP2ADD;
2247 //==============================================================================
2248 // SSP2MSK Bits
2250 extern __at(0x0F69) __sfr SSP2MSK;
2252 typedef struct
2254 unsigned MSK0 : 1;
2255 unsigned MSK1 : 1;
2256 unsigned MSK2 : 1;
2257 unsigned MSK3 : 1;
2258 unsigned MSK4 : 1;
2259 unsigned MSK5 : 1;
2260 unsigned MSK6 : 1;
2261 unsigned MSK7 : 1;
2262 } __SSP2MSKbits_t;
2264 extern __at(0x0F69) volatile __SSP2MSKbits_t SSP2MSKbits;
2266 #define _SSP2MSK_MSK0 0x01
2267 #define _SSP2MSK_MSK1 0x02
2268 #define _SSP2MSK_MSK2 0x04
2269 #define _SSP2MSK_MSK3 0x08
2270 #define _SSP2MSK_MSK4 0x10
2271 #define _SSP2MSK_MSK5 0x20
2272 #define _SSP2MSK_MSK6 0x40
2273 #define _SSP2MSK_MSK7 0x80
2275 //==============================================================================
2277 extern __at(0x0F6A) __sfr SSP2BUF;
2279 //==============================================================================
2280 // T4CON Bits
2282 extern __at(0x0F6B) __sfr T4CON;
2284 typedef union
2286 struct
2288 unsigned T4CKPS0 : 1;
2289 unsigned T4CKPS1 : 1;
2290 unsigned TMR4ON : 1;
2291 unsigned T4OUTPS0 : 1;
2292 unsigned T4OUTPS1 : 1;
2293 unsigned T4OUTPS2 : 1;
2294 unsigned T4OUTPS3 : 1;
2295 unsigned : 1;
2298 struct
2300 unsigned T4CKPS : 2;
2301 unsigned : 6;
2304 struct
2306 unsigned : 3;
2307 unsigned T4OUTPS : 4;
2308 unsigned : 1;
2310 } __T4CONbits_t;
2312 extern __at(0x0F6B) volatile __T4CONbits_t T4CONbits;
2314 #define _T4CKPS0 0x01
2315 #define _T4CKPS1 0x02
2316 #define _TMR4ON 0x04
2317 #define _T4OUTPS0 0x08
2318 #define _T4OUTPS1 0x10
2319 #define _T4OUTPS2 0x20
2320 #define _T4OUTPS3 0x40
2322 //==============================================================================
2324 extern __at(0x0F6C) __sfr PR4;
2325 extern __at(0x0F6D) __sfr TMR4;
2327 //==============================================================================
2328 // CCP7CON Bits
2330 extern __at(0x0F6E) __sfr CCP7CON;
2332 typedef union
2334 struct
2336 unsigned CCP7M0 : 1;
2337 unsigned CCP7M1 : 1;
2338 unsigned CCP7M2 : 1;
2339 unsigned CCP7M3 : 1;
2340 unsigned DC7B0 : 1;
2341 unsigned DC7B1 : 1;
2342 unsigned : 1;
2343 unsigned : 1;
2346 struct
2348 unsigned : 1;
2349 unsigned : 1;
2350 unsigned : 1;
2351 unsigned : 1;
2352 unsigned CCP7Y : 1;
2353 unsigned CCP7X : 1;
2354 unsigned : 1;
2355 unsigned : 1;
2358 struct
2360 unsigned CCP7M : 4;
2361 unsigned : 4;
2364 struct
2366 unsigned : 4;
2367 unsigned DC7B : 2;
2368 unsigned : 2;
2370 } __CCP7CONbits_t;
2372 extern __at(0x0F6E) volatile __CCP7CONbits_t CCP7CONbits;
2374 #define _CCP7M0 0x01
2375 #define _CCP7M1 0x02
2376 #define _CCP7M2 0x04
2377 #define _CCP7M3 0x08
2378 #define _DC7B0 0x10
2379 #define _CCP7Y 0x10
2380 #define _DC7B1 0x20
2381 #define _CCP7X 0x20
2383 //==============================================================================
2385 extern __at(0x0F6F) __sfr CCPR7;
2386 extern __at(0x0F6F) __sfr CCPR7L;
2387 extern __at(0x0F70) __sfr CCPR7H;
2389 //==============================================================================
2390 // CCP6CON Bits
2392 extern __at(0x0F71) __sfr CCP6CON;
2394 typedef union
2396 struct
2398 unsigned CCP6M0 : 1;
2399 unsigned CCP6M1 : 1;
2400 unsigned CCP6M2 : 1;
2401 unsigned CCP6M3 : 1;
2402 unsigned DC6B0 : 1;
2403 unsigned DC6B1 : 1;
2404 unsigned : 1;
2405 unsigned : 1;
2408 struct
2410 unsigned : 1;
2411 unsigned : 1;
2412 unsigned : 1;
2413 unsigned : 1;
2414 unsigned CCP6Y : 1;
2415 unsigned CCP6X : 1;
2416 unsigned : 1;
2417 unsigned : 1;
2420 struct
2422 unsigned CCP6M : 4;
2423 unsigned : 4;
2426 struct
2428 unsigned : 4;
2429 unsigned DC6B : 2;
2430 unsigned : 2;
2432 } __CCP6CONbits_t;
2434 extern __at(0x0F71) volatile __CCP6CONbits_t CCP6CONbits;
2436 #define _CCP6M0 0x01
2437 #define _CCP6M1 0x02
2438 #define _CCP6M2 0x04
2439 #define _CCP6M3 0x08
2440 #define _DC6B0 0x10
2441 #define _CCP6Y 0x10
2442 #define _DC6B1 0x20
2443 #define _CCP6X 0x20
2445 //==============================================================================
2447 extern __at(0x0F72) __sfr CCPR6;
2448 extern __at(0x0F72) __sfr CCPR6L;
2449 extern __at(0x0F73) __sfr CCPR6H;
2451 //==============================================================================
2452 // CCP5CON Bits
2454 extern __at(0x0F74) __sfr CCP5CON;
2456 typedef union
2458 struct
2460 unsigned CCP5M0 : 1;
2461 unsigned CCP5M1 : 1;
2462 unsigned CCP5M2 : 1;
2463 unsigned CCP5M3 : 1;
2464 unsigned DC5B0 : 1;
2465 unsigned DC5B1 : 1;
2466 unsigned : 1;
2467 unsigned : 1;
2470 struct
2472 unsigned : 1;
2473 unsigned : 1;
2474 unsigned : 1;
2475 unsigned : 1;
2476 unsigned CCP5Y : 1;
2477 unsigned CCP5X : 1;
2478 unsigned : 1;
2479 unsigned : 1;
2482 struct
2484 unsigned CCP5M : 4;
2485 unsigned : 4;
2488 struct
2490 unsigned : 4;
2491 unsigned DC5B : 2;
2492 unsigned : 2;
2494 } __CCP5CONbits_t;
2496 extern __at(0x0F74) volatile __CCP5CONbits_t CCP5CONbits;
2498 #define _CCP5M0 0x01
2499 #define _CCP5M1 0x02
2500 #define _CCP5M2 0x04
2501 #define _CCP5M3 0x08
2502 #define _DC5B0 0x10
2503 #define _CCP5Y 0x10
2504 #define _DC5B1 0x20
2505 #define _CCP5X 0x20
2507 //==============================================================================
2509 extern __at(0x0F75) __sfr CCPR5;
2510 extern __at(0x0F75) __sfr CCPR5L;
2511 extern __at(0x0F76) __sfr CCPR5H;
2513 //==============================================================================
2514 // CCP4CON Bits
2516 extern __at(0x0F77) __sfr CCP4CON;
2518 typedef union
2520 struct
2522 unsigned CCP4M0 : 1;
2523 unsigned CCP4M1 : 1;
2524 unsigned CCP4M2 : 1;
2525 unsigned CCP4M3 : 1;
2526 unsigned DC4B0 : 1;
2527 unsigned DC4B1 : 1;
2528 unsigned : 1;
2529 unsigned : 1;
2532 struct
2534 unsigned : 1;
2535 unsigned : 1;
2536 unsigned : 1;
2537 unsigned : 1;
2538 unsigned CCP4Y : 1;
2539 unsigned CCP4X : 1;
2540 unsigned : 1;
2541 unsigned : 1;
2544 struct
2546 unsigned CCP4M : 4;
2547 unsigned : 4;
2550 struct
2552 unsigned : 4;
2553 unsigned DC4B : 2;
2554 unsigned : 2;
2556 } __CCP4CONbits_t;
2558 extern __at(0x0F77) volatile __CCP4CONbits_t CCP4CONbits;
2560 #define _CCP4M0 0x01
2561 #define _CCP4M1 0x02
2562 #define _CCP4M2 0x04
2563 #define _CCP4M3 0x08
2564 #define _DC4B0 0x10
2565 #define _CCP4Y 0x10
2566 #define _DC4B1 0x20
2567 #define _CCP4X 0x20
2569 //==============================================================================
2571 extern __at(0x0F78) __sfr CCPR4;
2572 extern __at(0x0F78) __sfr CCPR4L;
2573 extern __at(0x0F79) __sfr CCPR4H;
2575 //==============================================================================
2576 // T5GCON Bits
2578 extern __at(0x0F7A) __sfr T5GCON;
2580 typedef union
2582 struct
2584 unsigned T5GSS0 : 1;
2585 unsigned T5GSS1 : 1;
2586 unsigned T5GVAL : 1;
2587 unsigned T5GGO_NOT_T5DONE : 1;
2588 unsigned T5GSPM : 1;
2589 unsigned T5GTM : 1;
2590 unsigned T5GPOL : 1;
2591 unsigned TMR5GE : 1;
2594 struct
2596 unsigned : 1;
2597 unsigned : 1;
2598 unsigned : 1;
2599 unsigned T5GGO : 1;
2600 unsigned : 1;
2601 unsigned : 1;
2602 unsigned : 1;
2603 unsigned : 1;
2606 struct
2608 unsigned : 1;
2609 unsigned : 1;
2610 unsigned : 1;
2611 unsigned NOT_T5DONE : 1;
2612 unsigned : 1;
2613 unsigned : 1;
2614 unsigned : 1;
2615 unsigned : 1;
2618 struct
2620 unsigned T5GSS : 2;
2621 unsigned : 6;
2623 } __T5GCONbits_t;
2625 extern __at(0x0F7A) volatile __T5GCONbits_t T5GCONbits;
2627 #define _T5GSS0 0x01
2628 #define _T5GSS1 0x02
2629 #define _T5GVAL 0x04
2630 #define _T5GGO_NOT_T5DONE 0x08
2631 #define _T5GGO 0x08
2632 #define _NOT_T5DONE 0x08
2633 #define _T5GSPM 0x10
2634 #define _T5GTM 0x20
2635 #define _T5GPOL 0x40
2636 #define _TMR5GE 0x80
2638 //==============================================================================
2641 //==============================================================================
2642 // T5CON Bits
2644 extern __at(0x0F7B) __sfr T5CON;
2646 typedef union
2648 struct
2650 unsigned TMR5ON : 1;
2651 unsigned RD16 : 1;
2652 unsigned NOT_T5SYNC : 1;
2653 unsigned SOSCEN : 1;
2654 unsigned T5CKPS0 : 1;
2655 unsigned T5CKPS1 : 1;
2656 unsigned TMR5CS0 : 1;
2657 unsigned TMR5CS1 : 1;
2660 struct
2662 unsigned : 4;
2663 unsigned T5CKPS : 2;
2664 unsigned : 2;
2667 struct
2669 unsigned : 6;
2670 unsigned TMR5CS : 2;
2672 } __T5CONbits_t;
2674 extern __at(0x0F7B) volatile __T5CONbits_t T5CONbits;
2676 #define _T5CON_TMR5ON 0x01
2677 #define _T5CON_RD16 0x02
2678 #define _T5CON_NOT_T5SYNC 0x04
2679 #define _T5CON_SOSCEN 0x08
2680 #define _T5CON_T5CKPS0 0x10
2681 #define _T5CON_T5CKPS1 0x20
2682 #define _T5CON_TMR5CS0 0x40
2683 #define _T5CON_TMR5CS1 0x80
2685 //==============================================================================
2687 extern __at(0x0F7C) __sfr TMR5;
2688 extern __at(0x0F7C) __sfr TMR5L;
2689 extern __at(0x0F7D) __sfr TMR5H;
2690 extern __at(0x0F7E) __sfr EECON2;
2692 //==============================================================================
2693 // EECON1 Bits
2695 extern __at(0x0F7F) __sfr EECON1;
2697 typedef struct
2699 unsigned RD : 1;
2700 unsigned WR : 1;
2701 unsigned WREN : 1;
2702 unsigned WRERR : 1;
2703 unsigned FREE : 1;
2704 unsigned : 1;
2705 unsigned CFGS : 1;
2706 unsigned EEPGD : 1;
2707 } __EECON1bits_t;
2709 extern __at(0x0F7F) volatile __EECON1bits_t EECON1bits;
2711 #define _RD 0x01
2712 #define _WR 0x02
2713 #define _WREN 0x04
2714 #define _WRERR 0x08
2715 #define _FREE 0x10
2716 #define _CFGS 0x40
2717 #define _EEPGD 0x80
2719 //==============================================================================
2722 //==============================================================================
2723 // PORTA Bits
2725 extern __at(0x0F80) __sfr PORTA;
2727 typedef union
2729 struct
2731 unsigned RA0 : 1;
2732 unsigned RA1 : 1;
2733 unsigned RA2 : 1;
2734 unsigned RA3 : 1;
2735 unsigned RA4 : 1;
2736 unsigned RA5 : 1;
2737 unsigned RA6 : 1;
2738 unsigned RA7 : 1;
2741 struct
2743 unsigned AN0 : 1;
2744 unsigned AN1 : 1;
2745 unsigned AN2 : 1;
2746 unsigned AN3 : 1;
2747 unsigned T0CKI : 1;
2748 unsigned AN4 : 1;
2749 unsigned OSC2 : 1;
2750 unsigned OSC1 : 1;
2753 struct
2755 unsigned ULPWU : 1;
2756 unsigned : 1;
2757 unsigned VREF_MINUS : 1;
2758 unsigned VREF_PLUS : 1;
2759 unsigned : 1;
2760 unsigned T1CKI : 1;
2761 unsigned CLKO : 1;
2762 unsigned CLKI : 1;
2765 struct
2767 unsigned : 1;
2768 unsigned : 1;
2769 unsigned : 1;
2770 unsigned : 1;
2771 unsigned : 1;
2772 unsigned T3G : 1;
2773 unsigned : 1;
2774 unsigned : 1;
2777 struct
2779 unsigned : 1;
2780 unsigned : 1;
2781 unsigned : 1;
2782 unsigned : 1;
2783 unsigned : 1;
2784 unsigned HLVDIN : 1;
2785 unsigned : 1;
2786 unsigned : 1;
2788 } __PORTAbits_t;
2790 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
2792 #define _RA0 0x01
2793 #define _AN0 0x01
2794 #define _ULPWU 0x01
2795 #define _RA1 0x02
2796 #define _AN1 0x02
2797 #define _RA2 0x04
2798 #define _AN2 0x04
2799 #define _VREF_MINUS 0x04
2800 #define _RA3 0x08
2801 #define _AN3 0x08
2802 #define _VREF_PLUS 0x08
2803 #define _RA4 0x10
2804 #define _T0CKI 0x10
2805 #define _RA5 0x20
2806 #define _AN4 0x20
2807 #define _T1CKI 0x20
2808 #define _T3G 0x20
2809 #define _HLVDIN 0x20
2810 #define _RA6 0x40
2811 #define _OSC2 0x40
2812 #define _CLKO 0x40
2813 #define _RA7 0x80
2814 #define _OSC1 0x80
2815 #define _CLKI 0x80
2817 //==============================================================================
2820 //==============================================================================
2821 // PORTB Bits
2823 extern __at(0x0F81) __sfr PORTB;
2825 typedef union
2827 struct
2829 unsigned RB0 : 1;
2830 unsigned RB1 : 1;
2831 unsigned RB2 : 1;
2832 unsigned RB3 : 1;
2833 unsigned RB4 : 1;
2834 unsigned RB5 : 1;
2835 unsigned RB6 : 1;
2836 unsigned RB7 : 1;
2839 struct
2841 unsigned INT0 : 1;
2842 unsigned INT1 : 1;
2843 unsigned INT2 : 1;
2844 unsigned INT3 : 1;
2845 unsigned KBI0 : 1;
2846 unsigned KBI1 : 1;
2847 unsigned KBI2 : 1;
2848 unsigned KBI3 : 1;
2851 struct
2853 unsigned FLT0 : 1;
2854 unsigned : 1;
2855 unsigned CTED1 : 1;
2856 unsigned CTED2 : 1;
2857 unsigned : 1;
2858 unsigned T3CKI : 1;
2859 unsigned PGC : 1;
2860 unsigned PGD : 1;
2863 struct
2865 unsigned : 1;
2866 unsigned : 1;
2867 unsigned : 1;
2868 unsigned CCP2_P2A : 1;
2869 unsigned : 1;
2870 unsigned T1G : 1;
2871 unsigned : 1;
2872 unsigned : 1;
2875 struct
2877 unsigned : 1;
2878 unsigned : 1;
2879 unsigned : 1;
2880 unsigned : 1;
2881 unsigned : 1;
2882 unsigned PGM : 1;
2883 unsigned : 1;
2884 unsigned : 1;
2887 struct
2889 unsigned INT : 4;
2890 unsigned : 4;
2893 struct
2895 unsigned : 4;
2896 unsigned KBI : 4;
2898 } __PORTBbits_t;
2900 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
2902 #define _RB0 0x01
2903 #define _INT0 0x01
2904 #define _FLT0 0x01
2905 #define _RB1 0x02
2906 #define _INT1 0x02
2907 #define _RB2 0x04
2908 #define _INT2 0x04
2909 #define _CTED1 0x04
2910 #define _RB3 0x08
2911 #define _INT3 0x08
2912 #define _CTED2 0x08
2913 #define _CCP2_P2A 0x08
2914 #define _RB4 0x10
2915 #define _KBI0 0x10
2916 #define _RB5 0x20
2917 #define _KBI1 0x20
2918 #define _T3CKI 0x20
2919 #define _T1G 0x20
2920 #define _PGM 0x20
2921 #define _RB6 0x40
2922 #define _KBI2 0x40
2923 #define _PGC 0x40
2924 #define _RB7 0x80
2925 #define _KBI3 0x80
2926 #define _PGD 0x80
2928 //==============================================================================
2931 //==============================================================================
2932 // PORTC Bits
2934 extern __at(0x0F82) __sfr PORTC;
2936 typedef union
2938 struct
2940 unsigned RC0 : 1;
2941 unsigned RC1 : 1;
2942 unsigned RC2 : 1;
2943 unsigned RC3 : 1;
2944 unsigned RC4 : 1;
2945 unsigned RC5 : 1;
2946 unsigned RC6 : 1;
2947 unsigned RC7 : 1;
2950 struct
2952 unsigned SOSCO : 1;
2953 unsigned SOSCI : 1;
2954 unsigned CCP1 : 1;
2955 unsigned SCK1 : 1;
2956 unsigned SDI1 : 1;
2957 unsigned SDO1 : 1;
2958 unsigned TX1 : 1;
2959 unsigned RX1 : 1;
2962 struct
2964 unsigned SCKLI : 1;
2965 unsigned CCP2 : 1;
2966 unsigned P1A : 1;
2967 unsigned SCL1 : 1;
2968 unsigned SDA1 : 1;
2969 unsigned : 1;
2970 unsigned CK1 : 1;
2971 unsigned DT1 : 1;
2974 struct
2976 unsigned : 1;
2977 unsigned P2A : 1;
2978 unsigned : 1;
2979 unsigned : 1;
2980 unsigned : 1;
2981 unsigned : 1;
2982 unsigned : 1;
2983 unsigned : 1;
2985 } __PORTCbits_t;
2987 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
2989 #define _RC0 0x01
2990 #define _SOSCO 0x01
2991 #define _SCKLI 0x01
2992 #define _RC1 0x02
2993 #define _SOSCI 0x02
2994 #define _CCP2 0x02
2995 #define _P2A 0x02
2996 #define _RC2 0x04
2997 #define _CCP1 0x04
2998 #define _P1A 0x04
2999 #define _RC3 0x08
3000 #define _SCK1 0x08
3001 #define _SCL1 0x08
3002 #define _RC4 0x10
3003 #define _SDI1 0x10
3004 #define _SDA1 0x10
3005 #define _RC5 0x20
3006 #define _SDO1 0x20
3007 #define _RC6 0x40
3008 #define _TX1 0x40
3009 #define _CK1 0x40
3010 #define _RC7 0x80
3011 #define _RX1 0x80
3012 #define _DT1 0x80
3014 //==============================================================================
3017 //==============================================================================
3018 // PORTD Bits
3020 extern __at(0x0F83) __sfr PORTD;
3022 typedef union
3024 struct
3026 unsigned RD0 : 1;
3027 unsigned RD1 : 1;
3028 unsigned RD2 : 1;
3029 unsigned RD3 : 1;
3030 unsigned RD4 : 1;
3031 unsigned RD5 : 1;
3032 unsigned RD6 : 1;
3033 unsigned RD7 : 1;
3036 struct
3038 unsigned AD0 : 1;
3039 unsigned AD1 : 1;
3040 unsigned AD2 : 1;
3041 unsigned AD3 : 1;
3042 unsigned AD4 : 1;
3043 unsigned AD5 : 1;
3044 unsigned AD6 : 1;
3045 unsigned AD7 : 1;
3048 struct
3050 unsigned PSP0 : 1;
3051 unsigned PSP1 : 1;
3052 unsigned PSP2 : 1;
3053 unsigned PSP3 : 1;
3054 unsigned PSP4 : 1;
3055 unsigned PSP5 : 1;
3056 unsigned PSP6 : 1;
3057 unsigned PSP7 : 1;
3060 struct
3062 unsigned CTPLS : 1;
3063 unsigned T5CKI : 1;
3064 unsigned : 1;
3065 unsigned : 1;
3066 unsigned SDO2 : 1;
3067 unsigned SDI2 : 1;
3068 unsigned SCK2 : 1;
3069 unsigned NOT_SS2 : 1;
3072 struct
3074 unsigned : 1;
3075 unsigned T7G : 1;
3076 unsigned : 1;
3077 unsigned : 1;
3078 unsigned : 1;
3079 unsigned SDA2 : 1;
3080 unsigned SCL2 : 1;
3081 unsigned : 1;
3083 } __PORTDbits_t;
3085 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
3087 #define _RD0 0x01
3088 #define _AD0 0x01
3089 #define _PSP0 0x01
3090 #define _CTPLS 0x01
3091 #define _RD1 0x02
3092 #define _AD1 0x02
3093 #define _PSP1 0x02
3094 #define _T5CKI 0x02
3095 #define _T7G 0x02
3096 #define _RD2 0x04
3097 #define _AD2 0x04
3098 #define _PSP2 0x04
3099 #define _RD3 0x08
3100 #define _AD3 0x08
3101 #define _PSP3 0x08
3102 #define _RD4 0x10
3103 #define _AD4 0x10
3104 #define _PSP4 0x10
3105 #define _SDO2 0x10
3106 #define _RD5 0x20
3107 #define _AD5 0x20
3108 #define _PSP5 0x20
3109 #define _SDI2 0x20
3110 #define _SDA2 0x20
3111 #define _RD6 0x40
3112 #define _AD6 0x40
3113 #define _PSP6 0x40
3114 #define _SCK2 0x40
3115 #define _SCL2 0x40
3116 #define _RD7 0x80
3117 #define _AD7 0x80
3118 #define _PSP7 0x80
3119 #define _NOT_SS2 0x80
3121 //==============================================================================
3124 //==============================================================================
3125 // PORTE Bits
3127 extern __at(0x0F84) __sfr PORTE;
3129 typedef union
3131 struct
3133 unsigned RE0 : 1;
3134 unsigned RE1 : 1;
3135 unsigned RE2 : 1;
3136 unsigned RE3 : 1;
3137 unsigned RE4 : 1;
3138 unsigned RE5 : 1;
3139 unsigned RE6 : 1;
3140 unsigned RE7 : 1;
3143 struct
3145 unsigned AD8 : 1;
3146 unsigned AD9 : 1;
3147 unsigned AD10 : 1;
3148 unsigned AD11 : 1;
3149 unsigned AD12 : 1;
3150 unsigned AD13 : 1;
3151 unsigned AD14 : 1;
3152 unsigned AD15 : 1;
3155 struct
3157 unsigned P2D : 1;
3158 unsigned P2C : 1;
3159 unsigned P2B : 1;
3160 unsigned P3C : 1;
3161 unsigned P3B : 1;
3162 unsigned P1C : 1;
3163 unsigned P1B : 1;
3164 unsigned P2A : 1;
3167 struct
3169 unsigned NOT_RD : 1;
3170 unsigned NOT_WR : 1;
3171 unsigned CCP10 : 1;
3172 unsigned CCP9 : 1;
3173 unsigned CCP8 : 1;
3174 unsigned CCP7 : 1;
3175 unsigned CCP6 : 1;
3176 unsigned CCP2 : 1;
3179 struct
3181 unsigned : 1;
3182 unsigned : 1;
3183 unsigned NOT_CS : 1;
3184 unsigned REFO : 1;
3185 unsigned : 1;
3186 unsigned : 1;
3187 unsigned : 1;
3188 unsigned : 1;
3190 } __PORTEbits_t;
3192 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
3194 #define _PORTE_RE0 0x01
3195 #define _PORTE_AD8 0x01
3196 #define _PORTE_P2D 0x01
3197 #define _PORTE_NOT_RD 0x01
3198 #define _PORTE_RE1 0x02
3199 #define _PORTE_AD9 0x02
3200 #define _PORTE_P2C 0x02
3201 #define _PORTE_NOT_WR 0x02
3202 #define _PORTE_RE2 0x04
3203 #define _PORTE_AD10 0x04
3204 #define _PORTE_P2B 0x04
3205 #define _PORTE_CCP10 0x04
3206 #define _PORTE_NOT_CS 0x04
3207 #define _PORTE_RE3 0x08
3208 #define _PORTE_AD11 0x08
3209 #define _PORTE_P3C 0x08
3210 #define _PORTE_CCP9 0x08
3211 #define _PORTE_REFO 0x08
3212 #define _PORTE_RE4 0x10
3213 #define _PORTE_AD12 0x10
3214 #define _PORTE_P3B 0x10
3215 #define _PORTE_CCP8 0x10
3216 #define _PORTE_RE5 0x20
3217 #define _PORTE_AD13 0x20
3218 #define _PORTE_P1C 0x20
3219 #define _PORTE_CCP7 0x20
3220 #define _PORTE_RE6 0x40
3221 #define _PORTE_AD14 0x40
3222 #define _PORTE_P1B 0x40
3223 #define _PORTE_CCP6 0x40
3224 #define _PORTE_RE7 0x80
3225 #define _PORTE_AD15 0x80
3226 #define _PORTE_P2A 0x80
3227 #define _PORTE_CCP2 0x80
3229 //==============================================================================
3232 //==============================================================================
3233 // PORTF Bits
3235 extern __at(0x0F85) __sfr PORTF;
3237 typedef union
3239 struct
3241 unsigned : 1;
3242 unsigned RF1 : 1;
3243 unsigned RF2 : 1;
3244 unsigned RF3 : 1;
3245 unsigned RF4 : 1;
3246 unsigned RF5 : 1;
3247 unsigned RF6 : 1;
3248 unsigned RF7 : 1;
3251 struct
3253 unsigned : 1;
3254 unsigned AN6 : 1;
3255 unsigned AN7 : 1;
3256 unsigned AN8 : 1;
3257 unsigned AN9 : 1;
3258 unsigned AN10 : 1;
3259 unsigned AN11 : 1;
3260 unsigned AN5 : 1;
3263 struct
3265 unsigned : 1;
3266 unsigned C2OUT : 1;
3267 unsigned C1OUT : 1;
3268 unsigned C2INB : 1;
3269 unsigned C2INA : 1;
3270 unsigned C1INB : 1;
3271 unsigned C1INA : 1;
3272 unsigned SS1 : 1;
3275 struct
3277 unsigned : 1;
3278 unsigned CTDIN : 1;
3279 unsigned : 1;
3280 unsigned CTMUI : 1;
3281 unsigned : 1;
3282 unsigned CVREF : 1;
3283 unsigned : 1;
3284 unsigned : 1;
3286 } __PORTFbits_t;
3288 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
3290 #define _RF1 0x02
3291 #define _AN6 0x02
3292 #define _C2OUT 0x02
3293 #define _CTDIN 0x02
3294 #define _RF2 0x04
3295 #define _AN7 0x04
3296 #define _C1OUT 0x04
3297 #define _RF3 0x08
3298 #define _AN8 0x08
3299 #define _C2INB 0x08
3300 #define _CTMUI 0x08
3301 #define _RF4 0x10
3302 #define _AN9 0x10
3303 #define _C2INA 0x10
3304 #define _RF5 0x20
3305 #define _AN10 0x20
3306 #define _C1INB 0x20
3307 #define _CVREF 0x20
3308 #define _RF6 0x40
3309 #define _AN11 0x40
3310 #define _C1INA 0x40
3311 #define _RF7 0x80
3312 #define _AN5 0x80
3313 #define _SS1 0x80
3315 //==============================================================================
3318 //==============================================================================
3319 // PORTG Bits
3321 extern __at(0x0F86) __sfr PORTG;
3323 typedef union
3325 struct
3327 unsigned RG0 : 1;
3328 unsigned RG1 : 1;
3329 unsigned RG2 : 1;
3330 unsigned RG3 : 1;
3331 unsigned RG4 : 1;
3332 unsigned RG5 : 1;
3333 unsigned : 1;
3334 unsigned : 1;
3337 struct
3339 unsigned CCP3 : 1;
3340 unsigned C3OUT : 1;
3341 unsigned C3INA : 1;
3342 unsigned C3INB : 1;
3343 unsigned C3INC : 1;
3344 unsigned : 1;
3345 unsigned : 1;
3346 unsigned : 1;
3349 struct
3351 unsigned PA3 : 1;
3352 unsigned TX2 : 1;
3353 unsigned RX2 : 1;
3354 unsigned PD3 : 1;
3355 unsigned PD1 : 1;
3356 unsigned : 1;
3357 unsigned : 1;
3358 unsigned : 1;
3361 struct
3363 unsigned : 1;
3364 unsigned AN19 : 1;
3365 unsigned AN18 : 1;
3366 unsigned AN17 : 1;
3367 unsigned AN16 : 1;
3368 unsigned : 1;
3369 unsigned : 1;
3370 unsigned : 1;
3373 struct
3375 unsigned : 1;
3376 unsigned CK2 : 1;
3377 unsigned DT2 : 1;
3378 unsigned CCP4 : 1;
3379 unsigned CCP5 : 1;
3380 unsigned : 1;
3381 unsigned : 1;
3382 unsigned : 1;
3385 struct
3387 unsigned : 1;
3388 unsigned : 1;
3389 unsigned : 1;
3390 unsigned : 1;
3391 unsigned T7CKI : 1;
3392 unsigned : 1;
3393 unsigned : 1;
3394 unsigned : 1;
3397 struct
3399 unsigned : 1;
3400 unsigned : 1;
3401 unsigned : 1;
3402 unsigned : 1;
3403 unsigned T5G : 1;
3404 unsigned : 1;
3405 unsigned : 1;
3406 unsigned : 1;
3409 struct
3411 unsigned : 1;
3412 unsigned : 1;
3413 unsigned : 1;
3414 unsigned : 1;
3415 unsigned RTCC : 1;
3416 unsigned : 1;
3417 unsigned : 1;
3418 unsigned : 1;
3421 struct
3423 unsigned RG : 6;
3424 unsigned : 2;
3426 } __PORTGbits_t;
3428 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
3430 #define _RG0 0x01
3431 #define _CCP3 0x01
3432 #define _PA3 0x01
3433 #define _RG1 0x02
3434 #define _C3OUT 0x02
3435 #define _TX2 0x02
3436 #define _AN19 0x02
3437 #define _CK2 0x02
3438 #define _RG2 0x04
3439 #define _C3INA 0x04
3440 #define _RX2 0x04
3441 #define _AN18 0x04
3442 #define _DT2 0x04
3443 #define _RG3 0x08
3444 #define _C3INB 0x08
3445 #define _PD3 0x08
3446 #define _AN17 0x08
3447 #define _CCP4 0x08
3448 #define _RG4 0x10
3449 #define _C3INC 0x10
3450 #define _PD1 0x10
3451 #define _AN16 0x10
3452 #define _CCP5 0x10
3453 #define _T7CKI 0x10
3454 #define _T5G 0x10
3455 #define _RTCC 0x10
3456 #define _RG5 0x20
3458 //==============================================================================
3461 //==============================================================================
3462 // LATA Bits
3464 extern __at(0x0F89) __sfr LATA;
3466 typedef struct
3468 unsigned LATA0 : 1;
3469 unsigned LATA1 : 1;
3470 unsigned LATA2 : 1;
3471 unsigned LATA3 : 1;
3472 unsigned LATA4 : 1;
3473 unsigned LATA5 : 1;
3474 unsigned LATA6 : 1;
3475 unsigned LATA7 : 1;
3476 } __LATAbits_t;
3478 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
3480 #define _LATA0 0x01
3481 #define _LATA1 0x02
3482 #define _LATA2 0x04
3483 #define _LATA3 0x08
3484 #define _LATA4 0x10
3485 #define _LATA5 0x20
3486 #define _LATA6 0x40
3487 #define _LATA7 0x80
3489 //==============================================================================
3492 //==============================================================================
3493 // LATB Bits
3495 extern __at(0x0F8A) __sfr LATB;
3497 typedef struct
3499 unsigned LATB0 : 1;
3500 unsigned LATB1 : 1;
3501 unsigned LATB2 : 1;
3502 unsigned LATB3 : 1;
3503 unsigned LATB4 : 1;
3504 unsigned LATB5 : 1;
3505 unsigned LATB6 : 1;
3506 unsigned LATB7 : 1;
3507 } __LATBbits_t;
3509 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
3511 #define _LATB0 0x01
3512 #define _LATB1 0x02
3513 #define _LATB2 0x04
3514 #define _LATB3 0x08
3515 #define _LATB4 0x10
3516 #define _LATB5 0x20
3517 #define _LATB6 0x40
3518 #define _LATB7 0x80
3520 //==============================================================================
3523 //==============================================================================
3524 // LATC Bits
3526 extern __at(0x0F8B) __sfr LATC;
3528 typedef struct
3530 unsigned LATC0 : 1;
3531 unsigned LATC1 : 1;
3532 unsigned LATC2 : 1;
3533 unsigned LATC3 : 1;
3534 unsigned LATC4 : 1;
3535 unsigned LATC5 : 1;
3536 unsigned LATC6 : 1;
3537 unsigned LATC7 : 1;
3538 } __LATCbits_t;
3540 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
3542 #define _LATC0 0x01
3543 #define _LATC1 0x02
3544 #define _LATC2 0x04
3545 #define _LATC3 0x08
3546 #define _LATC4 0x10
3547 #define _LATC5 0x20
3548 #define _LATC6 0x40
3549 #define _LATC7 0x80
3551 //==============================================================================
3554 //==============================================================================
3555 // LATD Bits
3557 extern __at(0x0F8C) __sfr LATD;
3559 typedef struct
3561 unsigned LATD0 : 1;
3562 unsigned LATD1 : 1;
3563 unsigned LATD2 : 1;
3564 unsigned LATD3 : 1;
3565 unsigned LATD4 : 1;
3566 unsigned LATD5 : 1;
3567 unsigned LATD6 : 1;
3568 unsigned LATD7 : 1;
3569 } __LATDbits_t;
3571 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
3573 #define _LATD0 0x01
3574 #define _LATD1 0x02
3575 #define _LATD2 0x04
3576 #define _LATD3 0x08
3577 #define _LATD4 0x10
3578 #define _LATD5 0x20
3579 #define _LATD6 0x40
3580 #define _LATD7 0x80
3582 //==============================================================================
3585 //==============================================================================
3586 // LATE Bits
3588 extern __at(0x0F8D) __sfr LATE;
3590 typedef struct
3592 unsigned LATE0 : 1;
3593 unsigned LATE1 : 1;
3594 unsigned LATE2 : 1;
3595 unsigned LATE3 : 1;
3596 unsigned LATE4 : 1;
3597 unsigned LATE5 : 1;
3598 unsigned LATE6 : 1;
3599 unsigned LATE7 : 1;
3600 } __LATEbits_t;
3602 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
3604 #define _LATE0 0x01
3605 #define _LATE1 0x02
3606 #define _LATE2 0x04
3607 #define _LATE3 0x08
3608 #define _LATE4 0x10
3609 #define _LATE5 0x20
3610 #define _LATE6 0x40
3611 #define _LATE7 0x80
3613 //==============================================================================
3616 //==============================================================================
3617 // LATF Bits
3619 extern __at(0x0F8E) __sfr LATF;
3621 typedef struct
3623 unsigned : 1;
3624 unsigned LATF1 : 1;
3625 unsigned LATF2 : 1;
3626 unsigned LATF3 : 1;
3627 unsigned LATF4 : 1;
3628 unsigned LATF5 : 1;
3629 unsigned LATF6 : 1;
3630 unsigned LATF7 : 1;
3631 } __LATFbits_t;
3633 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
3635 #define _LATF1 0x02
3636 #define _LATF2 0x04
3637 #define _LATF3 0x08
3638 #define _LATF4 0x10
3639 #define _LATF5 0x20
3640 #define _LATF6 0x40
3641 #define _LATF7 0x80
3643 //==============================================================================
3646 //==============================================================================
3647 // LATG Bits
3649 extern __at(0x0F8F) __sfr LATG;
3651 typedef union
3653 struct
3655 unsigned LATG0 : 1;
3656 unsigned LATG1 : 1;
3657 unsigned LATG2 : 1;
3658 unsigned LATG3 : 1;
3659 unsigned LATG4 : 1;
3660 unsigned : 1;
3661 unsigned : 1;
3662 unsigned : 1;
3665 struct
3667 unsigned LATG : 5;
3668 unsigned : 3;
3670 } __LATGbits_t;
3672 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
3674 #define _LATG0 0x01
3675 #define _LATG1 0x02
3676 #define _LATG2 0x04
3677 #define _LATG3 0x08
3678 #define _LATG4 0x10
3680 //==============================================================================
3683 //==============================================================================
3684 // TRISA Bits
3686 extern __at(0x0F92) __sfr TRISA;
3688 typedef struct
3690 unsigned TRISA0 : 1;
3691 unsigned TRISA1 : 1;
3692 unsigned TRISA2 : 1;
3693 unsigned TRISA3 : 1;
3694 unsigned TRISA4 : 1;
3695 unsigned TRISA5 : 1;
3696 unsigned TRISA6 : 1;
3697 unsigned TRISA7 : 1;
3698 } __TRISAbits_t;
3700 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
3702 #define _TRISA0 0x01
3703 #define _TRISA1 0x02
3704 #define _TRISA2 0x04
3705 #define _TRISA3 0x08
3706 #define _TRISA4 0x10
3707 #define _TRISA5 0x20
3708 #define _TRISA6 0x40
3709 #define _TRISA7 0x80
3711 //==============================================================================
3714 //==============================================================================
3715 // TRISB Bits
3717 extern __at(0x0F93) __sfr TRISB;
3719 typedef struct
3721 unsigned TRISB0 : 1;
3722 unsigned TRISB1 : 1;
3723 unsigned TRISB2 : 1;
3724 unsigned TRISB3 : 1;
3725 unsigned TRISB4 : 1;
3726 unsigned TRISB5 : 1;
3727 unsigned TRISB6 : 1;
3728 unsigned TRISB7 : 1;
3729 } __TRISBbits_t;
3731 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
3733 #define _TRISB0 0x01
3734 #define _TRISB1 0x02
3735 #define _TRISB2 0x04
3736 #define _TRISB3 0x08
3737 #define _TRISB4 0x10
3738 #define _TRISB5 0x20
3739 #define _TRISB6 0x40
3740 #define _TRISB7 0x80
3742 //==============================================================================
3745 //==============================================================================
3746 // TRISC Bits
3748 extern __at(0x0F94) __sfr TRISC;
3750 typedef struct
3752 unsigned TRISC0 : 1;
3753 unsigned TRISC1 : 1;
3754 unsigned TRISC2 : 1;
3755 unsigned TRISC3 : 1;
3756 unsigned TRISC4 : 1;
3757 unsigned TRISC5 : 1;
3758 unsigned TRISC6 : 1;
3759 unsigned TRISC7 : 1;
3760 } __TRISCbits_t;
3762 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
3764 #define _TRISC0 0x01
3765 #define _TRISC1 0x02
3766 #define _TRISC2 0x04
3767 #define _TRISC3 0x08
3768 #define _TRISC4 0x10
3769 #define _TRISC5 0x20
3770 #define _TRISC6 0x40
3771 #define _TRISC7 0x80
3773 //==============================================================================
3776 //==============================================================================
3777 // TRISD Bits
3779 extern __at(0x0F95) __sfr TRISD;
3781 typedef struct
3783 unsigned TRISD0 : 1;
3784 unsigned TRISD1 : 1;
3785 unsigned TRISD2 : 1;
3786 unsigned TRISD3 : 1;
3787 unsigned TRISD4 : 1;
3788 unsigned TRISD5 : 1;
3789 unsigned TRISD6 : 1;
3790 unsigned TRISD7 : 1;
3791 } __TRISDbits_t;
3793 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
3795 #define _TRISD0 0x01
3796 #define _TRISD1 0x02
3797 #define _TRISD2 0x04
3798 #define _TRISD3 0x08
3799 #define _TRISD4 0x10
3800 #define _TRISD5 0x20
3801 #define _TRISD6 0x40
3802 #define _TRISD7 0x80
3804 //==============================================================================
3807 //==============================================================================
3808 // TRISE Bits
3810 extern __at(0x0F96) __sfr TRISE;
3812 typedef struct
3814 unsigned TRISE0 : 1;
3815 unsigned TRISE1 : 1;
3816 unsigned TRISE2 : 1;
3817 unsigned TRISE3 : 1;
3818 unsigned TRISE4 : 1;
3819 unsigned TRISE5 : 1;
3820 unsigned TRISE6 : 1;
3821 unsigned TRISE7 : 1;
3822 } __TRISEbits_t;
3824 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
3826 #define _TRISE0 0x01
3827 #define _TRISE1 0x02
3828 #define _TRISE2 0x04
3829 #define _TRISE3 0x08
3830 #define _TRISE4 0x10
3831 #define _TRISE5 0x20
3832 #define _TRISE6 0x40
3833 #define _TRISE7 0x80
3835 //==============================================================================
3838 //==============================================================================
3839 // TRISF Bits
3841 extern __at(0x0F97) __sfr TRISF;
3843 typedef struct
3845 unsigned : 1;
3846 unsigned TRISF1 : 1;
3847 unsigned TRISF2 : 1;
3848 unsigned TRISF3 : 1;
3849 unsigned TRISF4 : 1;
3850 unsigned TRISF5 : 1;
3851 unsigned TRISF6 : 1;
3852 unsigned TRISF7 : 1;
3853 } __TRISFbits_t;
3855 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
3857 #define _TRISF1 0x02
3858 #define _TRISF2 0x04
3859 #define _TRISF3 0x08
3860 #define _TRISF4 0x10
3861 #define _TRISF5 0x20
3862 #define _TRISF6 0x40
3863 #define _TRISF7 0x80
3865 //==============================================================================
3868 //==============================================================================
3869 // TRISG Bits
3871 extern __at(0x0F98) __sfr TRISG;
3873 typedef union
3875 struct
3877 unsigned TRISG0 : 1;
3878 unsigned TRISG1 : 1;
3879 unsigned TRISG2 : 1;
3880 unsigned TRISG3 : 1;
3881 unsigned TRISG4 : 1;
3882 unsigned : 1;
3883 unsigned : 1;
3884 unsigned : 1;
3887 struct
3889 unsigned TRISG : 5;
3890 unsigned : 3;
3892 } __TRISGbits_t;
3894 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
3896 #define _TRISG0 0x01
3897 #define _TRISG1 0x02
3898 #define _TRISG2 0x04
3899 #define _TRISG3 0x08
3900 #define _TRISG4 0x10
3902 //==============================================================================
3905 //==============================================================================
3906 // OSCTUNE Bits
3908 extern __at(0x0F9B) __sfr OSCTUNE;
3910 typedef union
3912 struct
3914 unsigned TUN0 : 1;
3915 unsigned TUN1 : 1;
3916 unsigned TUN2 : 1;
3917 unsigned TUN3 : 1;
3918 unsigned TUN4 : 1;
3919 unsigned TUN5 : 1;
3920 unsigned PLLEN : 1;
3921 unsigned INTSRC : 1;
3924 struct
3926 unsigned TUN : 6;
3927 unsigned : 2;
3929 } __OSCTUNEbits_t;
3931 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3933 #define _TUN0 0x01
3934 #define _TUN1 0x02
3935 #define _TUN2 0x04
3936 #define _TUN3 0x08
3937 #define _TUN4 0x10
3938 #define _TUN5 0x20
3939 #define _PLLEN 0x40
3940 #define _INTSRC 0x80
3942 //==============================================================================
3945 //==============================================================================
3946 // PSTR1CON Bits
3948 extern __at(0x0F9C) __sfr PSTR1CON;
3950 typedef union
3952 struct
3954 unsigned STRA : 1;
3955 unsigned STRB : 1;
3956 unsigned STRC : 1;
3957 unsigned STRD : 1;
3958 unsigned STRSYNC : 1;
3959 unsigned : 1;
3960 unsigned CMPL0 : 1;
3961 unsigned CMPL1 : 1;
3964 struct
3966 unsigned : 6;
3967 unsigned CMPL : 2;
3969 } __PSTR1CONbits_t;
3971 extern __at(0x0F9C) volatile __PSTR1CONbits_t PSTR1CONbits;
3973 #define _STRA 0x01
3974 #define _STRB 0x02
3975 #define _STRC 0x04
3976 #define _STRD 0x08
3977 #define _STRSYNC 0x10
3978 #define _CMPL0 0x40
3979 #define _CMPL1 0x80
3981 //==============================================================================
3984 //==============================================================================
3985 // PIE1 Bits
3987 extern __at(0x0F9D) __sfr PIE1;
3989 typedef union
3991 struct
3993 unsigned TMR1IE : 1;
3994 unsigned TMR2IE : 1;
3995 unsigned TMR1GIE : 1;
3996 unsigned SSP1IE : 1;
3997 unsigned TX1IE : 1;
3998 unsigned RC1IE : 1;
3999 unsigned ADIE : 1;
4000 unsigned PSPIE : 1;
4003 struct
4005 unsigned : 1;
4006 unsigned : 1;
4007 unsigned : 1;
4008 unsigned SSPIE : 1;
4009 unsigned TXIE : 1;
4010 unsigned RCIE : 1;
4011 unsigned : 1;
4012 unsigned : 1;
4014 } __PIE1bits_t;
4016 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
4018 #define _TMR1IE 0x01
4019 #define _TMR2IE 0x02
4020 #define _TMR1GIE 0x04
4021 #define _SSP1IE 0x08
4022 #define _SSPIE 0x08
4023 #define _TX1IE 0x10
4024 #define _TXIE 0x10
4025 #define _RC1IE 0x20
4026 #define _RCIE 0x20
4027 #define _ADIE 0x40
4028 #define _PSPIE 0x80
4030 //==============================================================================
4033 //==============================================================================
4034 // PIR1 Bits
4036 extern __at(0x0F9E) __sfr PIR1;
4038 typedef union
4040 struct
4042 unsigned TMR1IF : 1;
4043 unsigned TMR2IF : 1;
4044 unsigned TMR1GIF : 1;
4045 unsigned SSP1IF : 1;
4046 unsigned TX1IF : 1;
4047 unsigned RC1IF : 1;
4048 unsigned ADIF : 1;
4049 unsigned PSPIF : 1;
4052 struct
4054 unsigned : 1;
4055 unsigned : 1;
4056 unsigned : 1;
4057 unsigned SSPIF : 1;
4058 unsigned TXIF : 1;
4059 unsigned RCIF : 1;
4060 unsigned : 1;
4061 unsigned : 1;
4063 } __PIR1bits_t;
4065 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
4067 #define _TMR1IF 0x01
4068 #define _TMR2IF 0x02
4069 #define _TMR1GIF 0x04
4070 #define _SSP1IF 0x08
4071 #define _SSPIF 0x08
4072 #define _TX1IF 0x10
4073 #define _TXIF 0x10
4074 #define _RC1IF 0x20
4075 #define _RCIF 0x20
4076 #define _ADIF 0x40
4077 #define _PSPIF 0x80
4079 //==============================================================================
4082 //==============================================================================
4083 // IPR1 Bits
4085 extern __at(0x0F9F) __sfr IPR1;
4087 typedef union
4089 struct
4091 unsigned TMR1IP : 1;
4092 unsigned TMR2IP : 1;
4093 unsigned TMR1GIP : 1;
4094 unsigned SSP1IP : 1;
4095 unsigned TX1IP : 1;
4096 unsigned RC1IP : 1;
4097 unsigned ADIP : 1;
4098 unsigned PSPIP : 1;
4101 struct
4103 unsigned : 1;
4104 unsigned : 1;
4105 unsigned : 1;
4106 unsigned SSPIP : 1;
4107 unsigned TXIP : 1;
4108 unsigned RCIP : 1;
4109 unsigned : 1;
4110 unsigned : 1;
4112 } __IPR1bits_t;
4114 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
4116 #define _TMR1IP 0x01
4117 #define _TMR2IP 0x02
4118 #define _TMR1GIP 0x04
4119 #define _SSP1IP 0x08
4120 #define _SSPIP 0x08
4121 #define _TX1IP 0x10
4122 #define _TXIP 0x10
4123 #define _RC1IP 0x20
4124 #define _RCIP 0x20
4125 #define _ADIP 0x40
4126 #define _PSPIP 0x80
4128 //==============================================================================
4131 //==============================================================================
4132 // PIE2 Bits
4134 extern __at(0x0FA0) __sfr PIE2;
4136 typedef union
4138 struct
4140 unsigned TMR3GIE : 1;
4141 unsigned TMR3IE : 1;
4142 unsigned HLVDIE : 1;
4143 unsigned BCL1IE : 1;
4144 unsigned BCL2IE : 1;
4145 unsigned SSP2IE : 1;
4146 unsigned : 1;
4147 unsigned OSCFIE : 1;
4150 struct
4152 unsigned : 1;
4153 unsigned : 1;
4154 unsigned LVDIE : 1;
4155 unsigned BCLIE : 1;
4156 unsigned : 1;
4157 unsigned : 1;
4158 unsigned : 1;
4159 unsigned : 1;
4161 } __PIE2bits_t;
4163 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
4165 #define _TMR3GIE 0x01
4166 #define _TMR3IE 0x02
4167 #define _HLVDIE 0x04
4168 #define _LVDIE 0x04
4169 #define _BCL1IE 0x08
4170 #define _BCLIE 0x08
4171 #define _BCL2IE 0x10
4172 #define _SSP2IE 0x20
4173 #define _OSCFIE 0x80
4175 //==============================================================================
4178 //==============================================================================
4179 // PIR2 Bits
4181 extern __at(0x0FA1) __sfr PIR2;
4183 typedef union
4185 struct
4187 unsigned TMR3GIF : 1;
4188 unsigned TMR3IF : 1;
4189 unsigned HLVDIF : 1;
4190 unsigned BCL1IF : 1;
4191 unsigned BCL2IF : 1;
4192 unsigned SSP2IF : 1;
4193 unsigned : 1;
4194 unsigned OSCFIF : 1;
4197 struct
4199 unsigned : 1;
4200 unsigned : 1;
4201 unsigned LVDIF : 1;
4202 unsigned BCLIF : 1;
4203 unsigned : 1;
4204 unsigned : 1;
4205 unsigned : 1;
4206 unsigned : 1;
4208 } __PIR2bits_t;
4210 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
4212 #define _TMR3GIF 0x01
4213 #define _TMR3IF 0x02
4214 #define _HLVDIF 0x04
4215 #define _LVDIF 0x04
4216 #define _BCL1IF 0x08
4217 #define _BCLIF 0x08
4218 #define _BCL2IF 0x10
4219 #define _SSP2IF 0x20
4220 #define _OSCFIF 0x80
4222 //==============================================================================
4225 //==============================================================================
4226 // IPR2 Bits
4228 extern __at(0x0FA2) __sfr IPR2;
4230 typedef union
4232 struct
4234 unsigned TMR3GIP : 1;
4235 unsigned TMR3IP : 1;
4236 unsigned HLVDIP : 1;
4237 unsigned BCL1IP : 1;
4238 unsigned BCL2IP : 1;
4239 unsigned SSP2IP : 1;
4240 unsigned : 1;
4241 unsigned OSCFIP : 1;
4244 struct
4246 unsigned : 1;
4247 unsigned : 1;
4248 unsigned LVDIP : 1;
4249 unsigned BCLIP : 1;
4250 unsigned : 1;
4251 unsigned : 1;
4252 unsigned : 1;
4253 unsigned : 1;
4255 } __IPR2bits_t;
4257 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
4259 #define _TMR3GIP 0x01
4260 #define _TMR3IP 0x02
4261 #define _HLVDIP 0x04
4262 #define _LVDIP 0x04
4263 #define _BCL1IP 0x08
4264 #define _BCLIP 0x08
4265 #define _BCL2IP 0x10
4266 #define _SSP2IP 0x20
4267 #define _OSCFIP 0x80
4269 //==============================================================================
4272 //==============================================================================
4273 // PIE3 Bits
4275 extern __at(0x0FA3) __sfr PIE3;
4277 typedef struct
4279 unsigned RTCCIE : 1;
4280 unsigned CCP1IE : 1;
4281 unsigned CCP2IE : 1;
4282 unsigned CTMUIE : 1;
4283 unsigned TX2IE : 1;
4284 unsigned RC2IE : 1;
4285 unsigned : 1;
4286 unsigned TMR5GIE : 1;
4287 } __PIE3bits_t;
4289 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
4291 #define _RTCCIE 0x01
4292 #define _CCP1IE 0x02
4293 #define _CCP2IE 0x04
4294 #define _CTMUIE 0x08
4295 #define _TX2IE 0x10
4296 #define _RC2IE 0x20
4297 #define _TMR5GIE 0x80
4299 //==============================================================================
4302 //==============================================================================
4303 // PIR3 Bits
4305 extern __at(0x0FA4) __sfr PIR3;
4307 typedef struct
4309 unsigned RTCCIF : 1;
4310 unsigned CCP1IF : 1;
4311 unsigned CCP2IF : 1;
4312 unsigned CTMUIF : 1;
4313 unsigned TX2IF : 1;
4314 unsigned RC2IF : 1;
4315 unsigned : 1;
4316 unsigned TMR5GIF : 1;
4317 } __PIR3bits_t;
4319 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
4321 #define _RTCCIF 0x01
4322 #define _CCP1IF 0x02
4323 #define _CCP2IF 0x04
4324 #define _CTMUIF 0x08
4325 #define _TX2IF 0x10
4326 #define _RC2IF 0x20
4327 #define _TMR5GIF 0x80
4329 //==============================================================================
4332 //==============================================================================
4333 // IPR3 Bits
4335 extern __at(0x0FA5) __sfr IPR3;
4337 typedef struct
4339 unsigned RTCCIP : 1;
4340 unsigned CCP1IP : 1;
4341 unsigned CCP2IP : 1;
4342 unsigned CTMUIP : 1;
4343 unsigned TX2IP : 1;
4344 unsigned RC2IP : 1;
4345 unsigned : 1;
4346 unsigned TMR5GIP : 1;
4347 } __IPR3bits_t;
4349 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
4351 #define _RTCCIP 0x01
4352 #define _CCP1IP 0x02
4353 #define _CCP2IP 0x04
4354 #define _CTMUIP 0x08
4355 #define _TX2IP 0x10
4356 #define _RC2IP 0x20
4357 #define _TMR5GIP 0x80
4359 //==============================================================================
4362 //==============================================================================
4363 // PIR6 Bits
4365 extern __at(0x0FA6) __sfr PIR6;
4367 typedef struct
4369 unsigned CMP1IF : 1;
4370 unsigned CMP2IF : 1;
4371 unsigned CMP3IF : 1;
4372 unsigned : 1;
4373 unsigned EEIF : 1;
4374 unsigned : 1;
4375 unsigned : 1;
4376 unsigned : 1;
4377 } __PIR6bits_t;
4379 extern __at(0x0FA6) volatile __PIR6bits_t PIR6bits;
4381 #define _CMP1IF 0x01
4382 #define _CMP2IF 0x02
4383 #define _CMP3IF 0x04
4384 #define _EEIF 0x10
4386 //==============================================================================
4389 //==============================================================================
4390 // PSPCON Bits
4392 extern __at(0x0FA7) __sfr PSPCON;
4394 typedef struct
4396 unsigned : 1;
4397 unsigned : 1;
4398 unsigned : 1;
4399 unsigned : 1;
4400 unsigned PSPMODE : 1;
4401 unsigned IBOV : 1;
4402 unsigned OBF : 1;
4403 unsigned IBF : 1;
4404 } __PSPCONbits_t;
4406 extern __at(0x0FA7) volatile __PSPCONbits_t PSPCONbits;
4408 #define _PSPMODE 0x10
4409 #define _IBOV 0x20
4410 #define _OBF 0x40
4411 #define _IBF 0x80
4413 //==============================================================================
4416 //==============================================================================
4417 // HLVDCON Bits
4419 extern __at(0x0FA8) __sfr HLVDCON;
4421 typedef union
4423 struct
4425 unsigned HLVDL0 : 1;
4426 unsigned HLVDL1 : 1;
4427 unsigned HLVDL2 : 1;
4428 unsigned HLVDL3 : 1;
4429 unsigned HLVDEN : 1;
4430 unsigned IRVST : 1;
4431 unsigned BGVST : 1;
4432 unsigned VDIRMAG : 1;
4435 struct
4437 unsigned HLVDL : 4;
4438 unsigned : 4;
4440 } __HLVDCONbits_t;
4442 extern __at(0x0FA8) volatile __HLVDCONbits_t HLVDCONbits;
4444 #define _HLVDL0 0x01
4445 #define _HLVDL1 0x02
4446 #define _HLVDL2 0x04
4447 #define _HLVDL3 0x08
4448 #define _HLVDEN 0x10
4449 #define _IRVST 0x20
4450 #define _BGVST 0x40
4451 #define _VDIRMAG 0x80
4453 //==============================================================================
4456 //==============================================================================
4457 // IPR6 Bits
4459 extern __at(0x0FA9) __sfr IPR6;
4461 typedef struct
4463 unsigned CMP1IP : 1;
4464 unsigned CMP2IP : 1;
4465 unsigned CMP3IP : 1;
4466 unsigned : 1;
4467 unsigned EEIP : 1;
4468 unsigned : 1;
4469 unsigned : 1;
4470 unsigned : 1;
4471 } __IPR6bits_t;
4473 extern __at(0x0FA9) volatile __IPR6bits_t IPR6bits;
4475 #define _CMP1IP 0x01
4476 #define _CMP2IP 0x02
4477 #define _CMP3IP 0x04
4478 #define _EEIP 0x10
4480 //==============================================================================
4483 //==============================================================================
4484 // T1GCON Bits
4486 extern __at(0x0FAA) __sfr T1GCON;
4488 typedef union
4490 struct
4492 unsigned T1GSS0 : 1;
4493 unsigned T1GSS1 : 1;
4494 unsigned T1GVAL : 1;
4495 unsigned T1GGO_NOT_T1DONE : 1;
4496 unsigned T1GSPM : 1;
4497 unsigned T1GTM : 1;
4498 unsigned T1GPOL : 1;
4499 unsigned TMR1GE : 1;
4502 struct
4504 unsigned : 1;
4505 unsigned : 1;
4506 unsigned : 1;
4507 unsigned T1GGO : 1;
4508 unsigned : 1;
4509 unsigned : 1;
4510 unsigned : 1;
4511 unsigned : 1;
4514 struct
4516 unsigned : 1;
4517 unsigned : 1;
4518 unsigned : 1;
4519 unsigned NOT_T1DONE : 1;
4520 unsigned : 1;
4521 unsigned : 1;
4522 unsigned : 1;
4523 unsigned : 1;
4526 struct
4528 unsigned T1GSS : 2;
4529 unsigned : 6;
4531 } __T1GCONbits_t;
4533 extern __at(0x0FAA) volatile __T1GCONbits_t T1GCONbits;
4535 #define _T1GSS0 0x01
4536 #define _T1GSS1 0x02
4537 #define _T1GVAL 0x04
4538 #define _T1GGO_NOT_T1DONE 0x08
4539 #define _T1GGO 0x08
4540 #define _NOT_T1DONE 0x08
4541 #define _T1GSPM 0x10
4542 #define _T1GTM 0x20
4543 #define _T1GPOL 0x40
4544 #define _TMR1GE 0x80
4546 //==============================================================================
4549 //==============================================================================
4550 // RCSTA Bits
4552 extern __at(0x0FAB) __sfr RCSTA;
4554 typedef union
4556 struct
4558 unsigned RX9D : 1;
4559 unsigned OERR : 1;
4560 unsigned FERR : 1;
4561 unsigned ADDEN : 1;
4562 unsigned CREN : 1;
4563 unsigned SREN : 1;
4564 unsigned RX9 : 1;
4565 unsigned SPEN : 1;
4568 struct
4570 unsigned RCD8 : 1;
4571 unsigned OERR1 : 1;
4572 unsigned FERR1 : 1;
4573 unsigned ADEN : 1;
4574 unsigned CREN1 : 1;
4575 unsigned SREN1 : 1;
4576 unsigned RC9 : 1;
4577 unsigned SPEN1 : 1;
4580 struct
4582 unsigned RX9D1 : 1;
4583 unsigned : 1;
4584 unsigned : 1;
4585 unsigned ADDEN1 : 1;
4586 unsigned : 1;
4587 unsigned : 1;
4588 unsigned NOT_RC8 : 1;
4589 unsigned : 1;
4592 struct
4594 unsigned : 1;
4595 unsigned : 1;
4596 unsigned : 1;
4597 unsigned : 1;
4598 unsigned : 1;
4599 unsigned : 1;
4600 unsigned RC8_9 : 1;
4601 unsigned : 1;
4604 struct
4606 unsigned : 1;
4607 unsigned : 1;
4608 unsigned : 1;
4609 unsigned : 1;
4610 unsigned : 1;
4611 unsigned : 1;
4612 unsigned RX91 : 1;
4613 unsigned : 1;
4615 } __RCSTAbits_t;
4617 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
4619 #define _RX9D 0x01
4620 #define _RCD8 0x01
4621 #define _RX9D1 0x01
4622 #define _OERR 0x02
4623 #define _OERR1 0x02
4624 #define _FERR 0x04
4625 #define _FERR1 0x04
4626 #define _ADDEN 0x08
4627 #define _ADEN 0x08
4628 #define _ADDEN1 0x08
4629 #define _CREN 0x10
4630 #define _CREN1 0x10
4631 #define _SREN 0x20
4632 #define _SREN1 0x20
4633 #define _RX9 0x40
4634 #define _RC9 0x40
4635 #define _NOT_RC8 0x40
4636 #define _RC8_9 0x40
4637 #define _RX91 0x40
4638 #define _SPEN 0x80
4639 #define _SPEN1 0x80
4641 //==============================================================================
4644 //==============================================================================
4645 // RCSTA1 Bits
4647 extern __at(0x0FAB) __sfr RCSTA1;
4649 typedef union
4651 struct
4653 unsigned RX9D : 1;
4654 unsigned OERR : 1;
4655 unsigned FERR : 1;
4656 unsigned ADDEN : 1;
4657 unsigned CREN : 1;
4658 unsigned SREN : 1;
4659 unsigned RX9 : 1;
4660 unsigned SPEN : 1;
4663 struct
4665 unsigned RCD8 : 1;
4666 unsigned OERR1 : 1;
4667 unsigned FERR1 : 1;
4668 unsigned ADEN : 1;
4669 unsigned CREN1 : 1;
4670 unsigned SREN1 : 1;
4671 unsigned RC9 : 1;
4672 unsigned SPEN1 : 1;
4675 struct
4677 unsigned RX9D1 : 1;
4678 unsigned : 1;
4679 unsigned : 1;
4680 unsigned ADDEN1 : 1;
4681 unsigned : 1;
4682 unsigned : 1;
4683 unsigned NOT_RC8 : 1;
4684 unsigned : 1;
4687 struct
4689 unsigned : 1;
4690 unsigned : 1;
4691 unsigned : 1;
4692 unsigned : 1;
4693 unsigned : 1;
4694 unsigned : 1;
4695 unsigned RC8_9 : 1;
4696 unsigned : 1;
4699 struct
4701 unsigned : 1;
4702 unsigned : 1;
4703 unsigned : 1;
4704 unsigned : 1;
4705 unsigned : 1;
4706 unsigned : 1;
4707 unsigned RX91 : 1;
4708 unsigned : 1;
4710 } __RCSTA1bits_t;
4712 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
4714 #define _RCSTA1_RX9D 0x01
4715 #define _RCSTA1_RCD8 0x01
4716 #define _RCSTA1_RX9D1 0x01
4717 #define _RCSTA1_OERR 0x02
4718 #define _RCSTA1_OERR1 0x02
4719 #define _RCSTA1_FERR 0x04
4720 #define _RCSTA1_FERR1 0x04
4721 #define _RCSTA1_ADDEN 0x08
4722 #define _RCSTA1_ADEN 0x08
4723 #define _RCSTA1_ADDEN1 0x08
4724 #define _RCSTA1_CREN 0x10
4725 #define _RCSTA1_CREN1 0x10
4726 #define _RCSTA1_SREN 0x20
4727 #define _RCSTA1_SREN1 0x20
4728 #define _RCSTA1_RX9 0x40
4729 #define _RCSTA1_RC9 0x40
4730 #define _RCSTA1_NOT_RC8 0x40
4731 #define _RCSTA1_RC8_9 0x40
4732 #define _RCSTA1_RX91 0x40
4733 #define _RCSTA1_SPEN 0x80
4734 #define _RCSTA1_SPEN1 0x80
4736 //==============================================================================
4739 //==============================================================================
4740 // TXSTA Bits
4742 extern __at(0x0FAC) __sfr TXSTA;
4744 typedef union
4746 struct
4748 unsigned TX9D : 1;
4749 unsigned TRMT : 1;
4750 unsigned BRGH : 1;
4751 unsigned SENDB : 1;
4752 unsigned SYNC : 1;
4753 unsigned TXEN : 1;
4754 unsigned TX9 : 1;
4755 unsigned CSRC : 1;
4758 struct
4760 unsigned TXD8 : 1;
4761 unsigned TRMT1 : 1;
4762 unsigned BRGH1 : 1;
4763 unsigned SENDB1 : 1;
4764 unsigned SYNC1 : 1;
4765 unsigned TXEN1 : 1;
4766 unsigned TX8_9 : 1;
4767 unsigned CSRC1 : 1;
4770 struct
4772 unsigned TX9D1 : 1;
4773 unsigned : 1;
4774 unsigned : 1;
4775 unsigned : 1;
4776 unsigned : 1;
4777 unsigned : 1;
4778 unsigned NOT_TX8 : 1;
4779 unsigned : 1;
4782 struct
4784 unsigned : 1;
4785 unsigned : 1;
4786 unsigned : 1;
4787 unsigned : 1;
4788 unsigned : 1;
4789 unsigned : 1;
4790 unsigned TX91 : 1;
4791 unsigned : 1;
4793 } __TXSTAbits_t;
4795 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
4797 #define _TX9D 0x01
4798 #define _TXD8 0x01
4799 #define _TX9D1 0x01
4800 #define _TRMT 0x02
4801 #define _TRMT1 0x02
4802 #define _BRGH 0x04
4803 #define _BRGH1 0x04
4804 #define _SENDB 0x08
4805 #define _SENDB1 0x08
4806 #define _SYNC 0x10
4807 #define _SYNC1 0x10
4808 #define _TXEN 0x20
4809 #define _TXEN1 0x20
4810 #define _TX9 0x40
4811 #define _TX8_9 0x40
4812 #define _NOT_TX8 0x40
4813 #define _TX91 0x40
4814 #define _CSRC 0x80
4815 #define _CSRC1 0x80
4817 //==============================================================================
4820 //==============================================================================
4821 // TXSTA1 Bits
4823 extern __at(0x0FAC) __sfr TXSTA1;
4825 typedef union
4827 struct
4829 unsigned TX9D : 1;
4830 unsigned TRMT : 1;
4831 unsigned BRGH : 1;
4832 unsigned SENDB : 1;
4833 unsigned SYNC : 1;
4834 unsigned TXEN : 1;
4835 unsigned TX9 : 1;
4836 unsigned CSRC : 1;
4839 struct
4841 unsigned TXD8 : 1;
4842 unsigned TRMT1 : 1;
4843 unsigned BRGH1 : 1;
4844 unsigned SENDB1 : 1;
4845 unsigned SYNC1 : 1;
4846 unsigned TXEN1 : 1;
4847 unsigned TX8_9 : 1;
4848 unsigned CSRC1 : 1;
4851 struct
4853 unsigned TX9D1 : 1;
4854 unsigned : 1;
4855 unsigned : 1;
4856 unsigned : 1;
4857 unsigned : 1;
4858 unsigned : 1;
4859 unsigned NOT_TX8 : 1;
4860 unsigned : 1;
4863 struct
4865 unsigned : 1;
4866 unsigned : 1;
4867 unsigned : 1;
4868 unsigned : 1;
4869 unsigned : 1;
4870 unsigned : 1;
4871 unsigned TX91 : 1;
4872 unsigned : 1;
4874 } __TXSTA1bits_t;
4876 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
4878 #define _TXSTA1_TX9D 0x01
4879 #define _TXSTA1_TXD8 0x01
4880 #define _TXSTA1_TX9D1 0x01
4881 #define _TXSTA1_TRMT 0x02
4882 #define _TXSTA1_TRMT1 0x02
4883 #define _TXSTA1_BRGH 0x04
4884 #define _TXSTA1_BRGH1 0x04
4885 #define _TXSTA1_SENDB 0x08
4886 #define _TXSTA1_SENDB1 0x08
4887 #define _TXSTA1_SYNC 0x10
4888 #define _TXSTA1_SYNC1 0x10
4889 #define _TXSTA1_TXEN 0x20
4890 #define _TXSTA1_TXEN1 0x20
4891 #define _TXSTA1_TX9 0x40
4892 #define _TXSTA1_TX8_9 0x40
4893 #define _TXSTA1_NOT_TX8 0x40
4894 #define _TXSTA1_TX91 0x40
4895 #define _TXSTA1_CSRC 0x80
4896 #define _TXSTA1_CSRC1 0x80
4898 //==============================================================================
4900 extern __at(0x0FAD) __sfr TXREG;
4901 extern __at(0x0FAD) __sfr TXREG1;
4902 extern __at(0x0FAE) __sfr RCREG;
4903 extern __at(0x0FAE) __sfr RCREG1;
4904 extern __at(0x0FAF) __sfr SPBRG;
4905 extern __at(0x0FAF) __sfr SPBRG1;
4907 //==============================================================================
4908 // T3GCON Bits
4910 extern __at(0x0FB0) __sfr T3GCON;
4912 typedef union
4914 struct
4916 unsigned T3GSS0 : 1;
4917 unsigned T3GSS1 : 1;
4918 unsigned T3GVAL : 1;
4919 unsigned T3GGO_NOT_T3DONE : 1;
4920 unsigned T3GSPM : 1;
4921 unsigned T3GTM : 1;
4922 unsigned T3GPOL : 1;
4923 unsigned TMR3GE : 1;
4926 struct
4928 unsigned : 1;
4929 unsigned : 1;
4930 unsigned : 1;
4931 unsigned T3GGO : 1;
4932 unsigned : 1;
4933 unsigned : 1;
4934 unsigned : 1;
4935 unsigned : 1;
4938 struct
4940 unsigned : 1;
4941 unsigned : 1;
4942 unsigned : 1;
4943 unsigned NOT_T3DONE : 1;
4944 unsigned : 1;
4945 unsigned : 1;
4946 unsigned : 1;
4947 unsigned : 1;
4950 struct
4952 unsigned T3GSS : 2;
4953 unsigned : 6;
4955 } __T3GCONbits_t;
4957 extern __at(0x0FB0) volatile __T3GCONbits_t T3GCONbits;
4959 #define _T3GSS0 0x01
4960 #define _T3GSS1 0x02
4961 #define _T3GVAL 0x04
4962 #define _T3GGO_NOT_T3DONE 0x08
4963 #define _T3GGO 0x08
4964 #define _NOT_T3DONE 0x08
4965 #define _T3GSPM 0x10
4966 #define _T3GTM 0x20
4967 #define _T3GPOL 0x40
4968 #define _TMR3GE 0x80
4970 //==============================================================================
4973 //==============================================================================
4974 // T3CON Bits
4976 extern __at(0x0FB1) __sfr T3CON;
4978 typedef union
4980 struct
4982 unsigned TMR3ON : 1;
4983 unsigned RD16 : 1;
4984 unsigned NOT_T3SYNC : 1;
4985 unsigned SOSCEN : 1;
4986 unsigned T3CKPS0 : 1;
4987 unsigned T3CKPS1 : 1;
4988 unsigned TMR3CS0 : 1;
4989 unsigned TMR3CS1 : 1;
4992 struct
4994 unsigned : 4;
4995 unsigned T3CKPS : 2;
4996 unsigned : 2;
4999 struct
5001 unsigned : 6;
5002 unsigned TMR3CS : 2;
5004 } __T3CONbits_t;
5006 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
5008 #define _T3CON_TMR3ON 0x01
5009 #define _T3CON_RD16 0x02
5010 #define _T3CON_NOT_T3SYNC 0x04
5011 #define _T3CON_SOSCEN 0x08
5012 #define _T3CON_T3CKPS0 0x10
5013 #define _T3CON_T3CKPS1 0x20
5014 #define _T3CON_TMR3CS0 0x40
5015 #define _T3CON_TMR3CS1 0x80
5017 //==============================================================================
5019 extern __at(0x0FB2) __sfr TMR3;
5020 extern __at(0x0FB2) __sfr TMR3L;
5021 extern __at(0x0FB3) __sfr TMR3H;
5023 //==============================================================================
5024 // CMSTAT Bits
5026 extern __at(0x0FB4) __sfr CMSTAT;
5028 typedef struct
5030 unsigned : 1;
5031 unsigned : 1;
5032 unsigned : 1;
5033 unsigned : 1;
5034 unsigned : 1;
5035 unsigned CMP1OUT : 1;
5036 unsigned CMP2OUT : 1;
5037 unsigned CMP3OUT : 1;
5038 } __CMSTATbits_t;
5040 extern __at(0x0FB4) volatile __CMSTATbits_t CMSTATbits;
5042 #define _CMP1OUT 0x20
5043 #define _CMP2OUT 0x40
5044 #define _CMP3OUT 0x80
5046 //==============================================================================
5049 //==============================================================================
5050 // CMSTATUS Bits
5052 extern __at(0x0FB4) __sfr CMSTATUS;
5054 typedef struct
5056 unsigned : 1;
5057 unsigned : 1;
5058 unsigned : 1;
5059 unsigned : 1;
5060 unsigned : 1;
5061 unsigned CMP1OUT : 1;
5062 unsigned CMP2OUT : 1;
5063 unsigned CMP3OUT : 1;
5064 } __CMSTATUSbits_t;
5066 extern __at(0x0FB4) volatile __CMSTATUSbits_t CMSTATUSbits;
5068 #define _CMSTATUS_CMP1OUT 0x20
5069 #define _CMSTATUS_CMP2OUT 0x40
5070 #define _CMSTATUS_CMP3OUT 0x80
5072 //==============================================================================
5075 //==============================================================================
5076 // CVRCON Bits
5078 extern __at(0x0FB5) __sfr CVRCON;
5080 typedef union
5082 struct
5084 unsigned CVR0 : 1;
5085 unsigned CVR1 : 1;
5086 unsigned CVR2 : 1;
5087 unsigned CVR3 : 1;
5088 unsigned CVR4 : 1;
5089 unsigned CVRSS : 1;
5090 unsigned CVROE : 1;
5091 unsigned CVREN : 1;
5094 struct
5096 unsigned CVR : 5;
5097 unsigned : 3;
5099 } __CVRCONbits_t;
5101 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
5103 #define _CVR0 0x01
5104 #define _CVR1 0x02
5105 #define _CVR2 0x04
5106 #define _CVR3 0x08
5107 #define _CVR4 0x10
5108 #define _CVRSS 0x20
5109 #define _CVROE 0x40
5110 #define _CVREN 0x80
5112 //==============================================================================
5115 //==============================================================================
5116 // PIE4 Bits
5118 extern __at(0x0FB6) __sfr PIE4;
5120 typedef struct
5122 unsigned CCP3IE : 1;
5123 unsigned CCP4IE : 1;
5124 unsigned CCP5IE : 1;
5125 unsigned CCP6IE : 1;
5126 unsigned CCP7IE : 1;
5127 unsigned CCP8IE : 1;
5128 unsigned : 1;
5129 unsigned : 1;
5130 } __PIE4bits_t;
5132 extern __at(0x0FB6) volatile __PIE4bits_t PIE4bits;
5134 #define _CCP3IE 0x01
5135 #define _CCP4IE 0x02
5136 #define _CCP5IE 0x04
5137 #define _CCP6IE 0x08
5138 #define _CCP7IE 0x10
5139 #define _CCP8IE 0x20
5141 //==============================================================================
5144 //==============================================================================
5145 // PIR4 Bits
5147 extern __at(0x0FB7) __sfr PIR4;
5149 typedef struct
5151 unsigned CCP3IF : 1;
5152 unsigned CCP4IF : 1;
5153 unsigned CCP5IF : 1;
5154 unsigned CCP6IF : 1;
5155 unsigned CCP7IF : 1;
5156 unsigned CCP8IF : 1;
5157 unsigned : 1;
5158 unsigned : 1;
5159 } __PIR4bits_t;
5161 extern __at(0x0FB7) volatile __PIR4bits_t PIR4bits;
5163 #define _CCP3IF 0x01
5164 #define _CCP4IF 0x02
5165 #define _CCP5IF 0x04
5166 #define _CCP6IF 0x08
5167 #define _CCP7IF 0x10
5168 #define _CCP8IF 0x20
5170 //==============================================================================
5173 //==============================================================================
5174 // IPR4 Bits
5176 extern __at(0x0FB8) __sfr IPR4;
5178 typedef struct
5180 unsigned CCP3IP : 1;
5181 unsigned CCP4IP : 1;
5182 unsigned CCP5IP : 1;
5183 unsigned CCP6IP : 1;
5184 unsigned CCP7IP : 1;
5185 unsigned CCP8IP : 1;
5186 unsigned : 1;
5187 unsigned : 1;
5188 } __IPR4bits_t;
5190 extern __at(0x0FB8) volatile __IPR4bits_t IPR4bits;
5192 #define _CCP3IP 0x01
5193 #define _CCP4IP 0x02
5194 #define _CCP5IP 0x04
5195 #define _CCP6IP 0x08
5196 #define _CCP7IP 0x10
5197 #define _CCP8IP 0x20
5199 //==============================================================================
5202 //==============================================================================
5203 // PIE5 Bits
5205 extern __at(0x0FB9) __sfr PIE5;
5207 typedef struct
5209 unsigned TMR4IE : 1;
5210 unsigned TMR5IE : 1;
5211 unsigned TMR6IE : 1;
5212 unsigned : 1;
5213 unsigned TMR8IE : 1;
5214 unsigned : 1;
5215 unsigned : 1;
5216 unsigned : 1;
5217 } __PIE5bits_t;
5219 extern __at(0x0FB9) volatile __PIE5bits_t PIE5bits;
5221 #define _TMR4IE 0x01
5222 #define _TMR5IE 0x02
5223 #define _TMR6IE 0x04
5224 #define _TMR8IE 0x10
5226 //==============================================================================
5229 //==============================================================================
5230 // PIR5 Bits
5232 extern __at(0x0FBA) __sfr PIR5;
5234 typedef struct
5236 unsigned TMR4IF : 1;
5237 unsigned TMR5IF : 1;
5238 unsigned TMR6IF : 1;
5239 unsigned : 1;
5240 unsigned TMR8IF : 1;
5241 unsigned : 1;
5242 unsigned : 1;
5243 unsigned : 1;
5244 } __PIR5bits_t;
5246 extern __at(0x0FBA) volatile __PIR5bits_t PIR5bits;
5248 #define _TMR4IF 0x01
5249 #define _TMR5IF 0x02
5250 #define _TMR6IF 0x04
5251 #define _TMR8IF 0x10
5253 //==============================================================================
5256 //==============================================================================
5257 // CCP1CON Bits
5259 extern __at(0x0FBB) __sfr CCP1CON;
5261 typedef union
5263 struct
5265 unsigned CCP1M0 : 1;
5266 unsigned CCP1M1 : 1;
5267 unsigned CCP1M2 : 1;
5268 unsigned CCP1M3 : 1;
5269 unsigned DC1B0 : 1;
5270 unsigned DC1B1 : 1;
5271 unsigned P1M0 : 1;
5272 unsigned P1M1 : 1;
5275 struct
5277 unsigned : 1;
5278 unsigned : 1;
5279 unsigned : 1;
5280 unsigned : 1;
5281 unsigned CCP1Y : 1;
5282 unsigned CCP1X : 1;
5283 unsigned : 1;
5284 unsigned : 1;
5287 struct
5289 unsigned CCP1M : 4;
5290 unsigned : 4;
5293 struct
5295 unsigned : 4;
5296 unsigned DC1B : 2;
5297 unsigned : 2;
5300 struct
5302 unsigned : 6;
5303 unsigned P1M : 2;
5305 } __CCP1CONbits_t;
5307 extern __at(0x0FBB) volatile __CCP1CONbits_t CCP1CONbits;
5309 #define _CCP1M0 0x01
5310 #define _CCP1M1 0x02
5311 #define _CCP1M2 0x04
5312 #define _CCP1M3 0x08
5313 #define _DC1B0 0x10
5314 #define _CCP1Y 0x10
5315 #define _DC1B1 0x20
5316 #define _CCP1X 0x20
5317 #define _P1M0 0x40
5318 #define _P1M1 0x80
5320 //==============================================================================
5323 //==============================================================================
5324 // ECCP1CON Bits
5326 extern __at(0x0FBB) __sfr ECCP1CON;
5328 typedef union
5330 struct
5332 unsigned CCP1M0 : 1;
5333 unsigned CCP1M1 : 1;
5334 unsigned CCP1M2 : 1;
5335 unsigned CCP1M3 : 1;
5336 unsigned DC1B0 : 1;
5337 unsigned DC1B1 : 1;
5338 unsigned P1M0 : 1;
5339 unsigned P1M1 : 1;
5342 struct
5344 unsigned : 1;
5345 unsigned : 1;
5346 unsigned : 1;
5347 unsigned : 1;
5348 unsigned CCP1Y : 1;
5349 unsigned CCP1X : 1;
5350 unsigned : 1;
5351 unsigned : 1;
5354 struct
5356 unsigned CCP1M : 4;
5357 unsigned : 4;
5360 struct
5362 unsigned : 4;
5363 unsigned DC1B : 2;
5364 unsigned : 2;
5367 struct
5369 unsigned : 6;
5370 unsigned P1M : 2;
5372 } __ECCP1CONbits_t;
5374 extern __at(0x0FBB) volatile __ECCP1CONbits_t ECCP1CONbits;
5376 #define _ECCP1CON_CCP1M0 0x01
5377 #define _ECCP1CON_CCP1M1 0x02
5378 #define _ECCP1CON_CCP1M2 0x04
5379 #define _ECCP1CON_CCP1M3 0x08
5380 #define _ECCP1CON_DC1B0 0x10
5381 #define _ECCP1CON_CCP1Y 0x10
5382 #define _ECCP1CON_DC1B1 0x20
5383 #define _ECCP1CON_CCP1X 0x20
5384 #define _ECCP1CON_P1M0 0x40
5385 #define _ECCP1CON_P1M1 0x80
5387 //==============================================================================
5389 extern __at(0x0FBC) __sfr CCPR1;
5390 extern __at(0x0FBC) __sfr CCPR1L;
5391 extern __at(0x0FBD) __sfr CCPR1H;
5393 //==============================================================================
5394 // ECCP1DEL Bits
5396 extern __at(0x0FBE) __sfr ECCP1DEL;
5398 typedef union
5400 struct
5402 unsigned P1DC0 : 1;
5403 unsigned P1DC1 : 1;
5404 unsigned P1DC2 : 1;
5405 unsigned P1DC3 : 1;
5406 unsigned P1DC4 : 1;
5407 unsigned P1DC5 : 1;
5408 unsigned P1DC6 : 1;
5409 unsigned P1RSEN : 1;
5412 struct
5414 unsigned P1DC : 7;
5415 unsigned : 1;
5417 } __ECCP1DELbits_t;
5419 extern __at(0x0FBE) volatile __ECCP1DELbits_t ECCP1DELbits;
5421 #define _P1DC0 0x01
5422 #define _P1DC1 0x02
5423 #define _P1DC2 0x04
5424 #define _P1DC3 0x08
5425 #define _P1DC4 0x10
5426 #define _P1DC5 0x20
5427 #define _P1DC6 0x40
5428 #define _P1RSEN 0x80
5430 //==============================================================================
5433 //==============================================================================
5434 // PWM1CON Bits
5436 extern __at(0x0FBE) __sfr PWM1CON;
5438 typedef union
5440 struct
5442 unsigned P1DC0 : 1;
5443 unsigned P1DC1 : 1;
5444 unsigned P1DC2 : 1;
5445 unsigned P1DC3 : 1;
5446 unsigned P1DC4 : 1;
5447 unsigned P1DC5 : 1;
5448 unsigned P1DC6 : 1;
5449 unsigned P1RSEN : 1;
5452 struct
5454 unsigned P1DC : 7;
5455 unsigned : 1;
5457 } __PWM1CONbits_t;
5459 extern __at(0x0FBE) volatile __PWM1CONbits_t PWM1CONbits;
5461 #define _PWM1CON_P1DC0 0x01
5462 #define _PWM1CON_P1DC1 0x02
5463 #define _PWM1CON_P1DC2 0x04
5464 #define _PWM1CON_P1DC3 0x08
5465 #define _PWM1CON_P1DC4 0x10
5466 #define _PWM1CON_P1DC5 0x20
5467 #define _PWM1CON_P1DC6 0x40
5468 #define _PWM1CON_P1RSEN 0x80
5470 //==============================================================================
5473 //==============================================================================
5474 // ECCP1AS Bits
5476 extern __at(0x0FBF) __sfr ECCP1AS;
5478 typedef union
5480 struct
5482 unsigned PSS1BD0 : 1;
5483 unsigned PSS1BD1 : 1;
5484 unsigned PSS1AC0 : 1;
5485 unsigned PSS1AC1 : 1;
5486 unsigned ECCP1AS0 : 1;
5487 unsigned ECCP1AS1 : 1;
5488 unsigned ECCP1AS2 : 1;
5489 unsigned ECCP1ASE : 1;
5492 struct
5494 unsigned PSS1BD : 2;
5495 unsigned : 6;
5498 struct
5500 unsigned : 2;
5501 unsigned PSS1AC : 2;
5502 unsigned : 4;
5505 struct
5507 unsigned : 4;
5508 unsigned ECCP1AS : 3;
5509 unsigned : 1;
5511 } __ECCP1ASbits_t;
5513 extern __at(0x0FBF) volatile __ECCP1ASbits_t ECCP1ASbits;
5515 #define _PSS1BD0 0x01
5516 #define _PSS1BD1 0x02
5517 #define _PSS1AC0 0x04
5518 #define _PSS1AC1 0x08
5519 #define _ECCP1AS0 0x10
5520 #define _ECCP1AS1 0x20
5521 #define _ECCP1AS2 0x40
5522 #define _ECCP1ASE 0x80
5524 //==============================================================================
5527 //==============================================================================
5528 // ADCON2 Bits
5530 extern __at(0x0FC0) __sfr ADCON2;
5532 typedef union
5534 struct
5536 unsigned ADCS0 : 1;
5537 unsigned ADCS1 : 1;
5538 unsigned ADCS2 : 1;
5539 unsigned ACQT0 : 1;
5540 unsigned ACQT1 : 1;
5541 unsigned ACQT2 : 1;
5542 unsigned : 1;
5543 unsigned ADFM : 1;
5546 struct
5548 unsigned ADCS : 3;
5549 unsigned : 5;
5552 struct
5554 unsigned : 3;
5555 unsigned ACQT : 3;
5556 unsigned : 2;
5558 } __ADCON2bits_t;
5560 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
5562 #define _ADCS0 0x01
5563 #define _ADCS1 0x02
5564 #define _ADCS2 0x04
5565 #define _ACQT0 0x08
5566 #define _ACQT1 0x10
5567 #define _ACQT2 0x20
5568 #define _ADFM 0x80
5570 //==============================================================================
5573 //==============================================================================
5574 // ADCON1 Bits
5576 extern __at(0x0FC1) __sfr ADCON1;
5578 typedef union
5580 struct
5582 unsigned CHSN0 : 1;
5583 unsigned CHSN1 : 1;
5584 unsigned CHSN2 : 1;
5585 unsigned VNCFG : 1;
5586 unsigned VCFG0 : 1;
5587 unsigned VCFG1 : 1;
5588 unsigned TRIGSEL0 : 1;
5589 unsigned TRIGSEL1 : 1;
5592 struct
5594 unsigned CHSN : 3;
5595 unsigned : 5;
5598 struct
5600 unsigned : 4;
5601 unsigned VCFG : 2;
5602 unsigned : 2;
5605 struct
5607 unsigned : 6;
5608 unsigned TRIGSEL : 2;
5610 } __ADCON1bits_t;
5612 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5614 #define _CHSN0 0x01
5615 #define _CHSN1 0x02
5616 #define _CHSN2 0x04
5617 #define _VNCFG 0x08
5618 #define _VCFG0 0x10
5619 #define _VCFG1 0x20
5620 #define _TRIGSEL0 0x40
5621 #define _TRIGSEL1 0x80
5623 //==============================================================================
5626 //==============================================================================
5627 // ADCON0 Bits
5629 extern __at(0x0FC2) __sfr ADCON0;
5631 typedef union
5633 struct
5635 unsigned ADON : 1;
5636 unsigned GO_NOT_DONE : 1;
5637 unsigned CHS0 : 1;
5638 unsigned CHS1 : 1;
5639 unsigned CHS2 : 1;
5640 unsigned CHS3 : 1;
5641 unsigned CHS4 : 1;
5642 unsigned : 1;
5645 struct
5647 unsigned : 1;
5648 unsigned DONE : 1;
5649 unsigned : 1;
5650 unsigned : 1;
5651 unsigned : 1;
5652 unsigned : 1;
5653 unsigned : 1;
5654 unsigned : 1;
5657 struct
5659 unsigned : 1;
5660 unsigned GO : 1;
5661 unsigned : 1;
5662 unsigned : 1;
5663 unsigned : 1;
5664 unsigned : 1;
5665 unsigned : 1;
5666 unsigned : 1;
5669 struct
5671 unsigned : 1;
5672 unsigned NOT_DONE : 1;
5673 unsigned : 1;
5674 unsigned : 1;
5675 unsigned : 1;
5676 unsigned : 1;
5677 unsigned : 1;
5678 unsigned : 1;
5681 struct
5683 unsigned : 2;
5684 unsigned CHS : 5;
5685 unsigned : 1;
5687 } __ADCON0bits_t;
5689 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
5691 #define _ADON 0x01
5692 #define _GO_NOT_DONE 0x02
5693 #define _DONE 0x02
5694 #define _GO 0x02
5695 #define _NOT_DONE 0x02
5696 #define _CHS0 0x04
5697 #define _CHS1 0x08
5698 #define _CHS2 0x10
5699 #define _CHS3 0x20
5700 #define _CHS4 0x40
5702 //==============================================================================
5704 extern __at(0x0FC3) __sfr ADRES;
5705 extern __at(0x0FC3) __sfr ADRESL;
5706 extern __at(0x0FC4) __sfr ADRESH;
5708 //==============================================================================
5709 // SSP1CON2 Bits
5711 extern __at(0x0FC5) __sfr SSP1CON2;
5713 typedef union
5715 struct
5717 unsigned SEN : 1;
5718 unsigned RSEN : 1;
5719 unsigned PEN : 1;
5720 unsigned RCEN : 1;
5721 unsigned ACKEN : 1;
5722 unsigned ACKDT : 1;
5723 unsigned ACKSTAT : 1;
5724 unsigned GCEN : 1;
5727 struct
5729 unsigned : 1;
5730 unsigned ADMSK1 : 1;
5731 unsigned ADMSK2 : 1;
5732 unsigned ADMSK3 : 1;
5733 unsigned ADMSK4 : 1;
5734 unsigned ADMSK5 : 1;
5735 unsigned : 1;
5736 unsigned : 1;
5738 } __SSP1CON2bits_t;
5740 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
5742 #define _SEN 0x01
5743 #define _RSEN 0x02
5744 #define _ADMSK1 0x02
5745 #define _PEN 0x04
5746 #define _ADMSK2 0x04
5747 #define _RCEN 0x08
5748 #define _ADMSK3 0x08
5749 #define _ACKEN 0x10
5750 #define _ADMSK4 0x10
5751 #define _ACKDT 0x20
5752 #define _ADMSK5 0x20
5753 #define _ACKSTAT 0x40
5754 #define _GCEN 0x80
5756 //==============================================================================
5759 //==============================================================================
5760 // SSPCON2 Bits
5762 extern __at(0x0FC5) __sfr SSPCON2;
5764 typedef union
5766 struct
5768 unsigned SEN : 1;
5769 unsigned RSEN : 1;
5770 unsigned PEN : 1;
5771 unsigned RCEN : 1;
5772 unsigned ACKEN : 1;
5773 unsigned ACKDT : 1;
5774 unsigned ACKSTAT : 1;
5775 unsigned GCEN : 1;
5778 struct
5780 unsigned : 1;
5781 unsigned ADMSK1 : 1;
5782 unsigned ADMSK2 : 1;
5783 unsigned ADMSK3 : 1;
5784 unsigned ADMSK4 : 1;
5785 unsigned ADMSK5 : 1;
5786 unsigned : 1;
5787 unsigned : 1;
5789 } __SSPCON2bits_t;
5791 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5793 #define _SSPCON2_SEN 0x01
5794 #define _SSPCON2_RSEN 0x02
5795 #define _SSPCON2_ADMSK1 0x02
5796 #define _SSPCON2_PEN 0x04
5797 #define _SSPCON2_ADMSK2 0x04
5798 #define _SSPCON2_RCEN 0x08
5799 #define _SSPCON2_ADMSK3 0x08
5800 #define _SSPCON2_ACKEN 0x10
5801 #define _SSPCON2_ADMSK4 0x10
5802 #define _SSPCON2_ACKDT 0x20
5803 #define _SSPCON2_ADMSK5 0x20
5804 #define _SSPCON2_ACKSTAT 0x40
5805 #define _SSPCON2_GCEN 0x80
5807 //==============================================================================
5810 //==============================================================================
5811 // SSP1CON1 Bits
5813 extern __at(0x0FC6) __sfr SSP1CON1;
5815 typedef union
5817 struct
5819 unsigned SSPM0 : 1;
5820 unsigned SSPM1 : 1;
5821 unsigned SSPM2 : 1;
5822 unsigned SSPM3 : 1;
5823 unsigned CKP : 1;
5824 unsigned SSPEN : 1;
5825 unsigned SSPOV : 1;
5826 unsigned WCOL : 1;
5829 struct
5831 unsigned SSPM : 4;
5832 unsigned : 4;
5834 } __SSP1CON1bits_t;
5836 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
5838 #define _SSPM0 0x01
5839 #define _SSPM1 0x02
5840 #define _SSPM2 0x04
5841 #define _SSPM3 0x08
5842 #define _CKP 0x10
5843 #define _SSPEN 0x20
5844 #define _SSPOV 0x40
5845 #define _WCOL 0x80
5847 //==============================================================================
5850 //==============================================================================
5851 // SSPCON1 Bits
5853 extern __at(0x0FC6) __sfr SSPCON1;
5855 typedef union
5857 struct
5859 unsigned SSPM0 : 1;
5860 unsigned SSPM1 : 1;
5861 unsigned SSPM2 : 1;
5862 unsigned SSPM3 : 1;
5863 unsigned CKP : 1;
5864 unsigned SSPEN : 1;
5865 unsigned SSPOV : 1;
5866 unsigned WCOL : 1;
5869 struct
5871 unsigned SSPM : 4;
5872 unsigned : 4;
5874 } __SSPCON1bits_t;
5876 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
5878 #define _SSPCON1_SSPM0 0x01
5879 #define _SSPCON1_SSPM1 0x02
5880 #define _SSPCON1_SSPM2 0x04
5881 #define _SSPCON1_SSPM3 0x08
5882 #define _SSPCON1_CKP 0x10
5883 #define _SSPCON1_SSPEN 0x20
5884 #define _SSPCON1_SSPOV 0x40
5885 #define _SSPCON1_WCOL 0x80
5887 //==============================================================================
5890 //==============================================================================
5891 // SSP1STAT Bits
5893 extern __at(0x0FC7) __sfr SSP1STAT;
5895 typedef union
5897 struct
5899 unsigned BF : 1;
5900 unsigned UA : 1;
5901 unsigned R_NOT_W : 1;
5902 unsigned S : 1;
5903 unsigned P : 1;
5904 unsigned D_NOT_A : 1;
5905 unsigned CKE : 1;
5906 unsigned SMP : 1;
5909 struct
5911 unsigned : 1;
5912 unsigned : 1;
5913 unsigned R : 1;
5914 unsigned I2C_START : 1;
5915 unsigned I2C_STOP : 1;
5916 unsigned D : 1;
5917 unsigned : 1;
5918 unsigned : 1;
5921 struct
5923 unsigned : 1;
5924 unsigned : 1;
5925 unsigned R_W : 1;
5926 unsigned : 1;
5927 unsigned : 1;
5928 unsigned D_A : 1;
5929 unsigned : 1;
5930 unsigned : 1;
5933 struct
5935 unsigned : 1;
5936 unsigned : 1;
5937 unsigned NOT_W : 1;
5938 unsigned : 1;
5939 unsigned : 1;
5940 unsigned NOT_A : 1;
5941 unsigned : 1;
5942 unsigned : 1;
5945 struct
5947 unsigned : 1;
5948 unsigned : 1;
5949 unsigned NOT_WRITE : 1;
5950 unsigned : 1;
5951 unsigned : 1;
5952 unsigned NOT_ADDRESS : 1;
5953 unsigned : 1;
5954 unsigned : 1;
5957 struct
5959 unsigned : 1;
5960 unsigned : 1;
5961 unsigned READ_WRITE : 1;
5962 unsigned : 1;
5963 unsigned : 1;
5964 unsigned DATA_ADDRESS : 1;
5965 unsigned : 1;
5966 unsigned : 1;
5969 struct
5971 unsigned : 1;
5972 unsigned : 1;
5973 unsigned I2C_READ : 1;
5974 unsigned : 1;
5975 unsigned : 1;
5976 unsigned I2C_DAT : 1;
5977 unsigned : 1;
5978 unsigned : 1;
5980 } __SSP1STATbits_t;
5982 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
5984 #define _BF 0x01
5985 #define _UA 0x02
5986 #define _R_NOT_W 0x04
5987 #define _R 0x04
5988 #define _R_W 0x04
5989 #define _NOT_W 0x04
5990 #define _NOT_WRITE 0x04
5991 #define _READ_WRITE 0x04
5992 #define _I2C_READ 0x04
5993 #define _S 0x08
5994 #define _I2C_START 0x08
5995 #define _P 0x10
5996 #define _I2C_STOP 0x10
5997 #define _D_NOT_A 0x20
5998 #define _D 0x20
5999 #define _D_A 0x20
6000 #define _NOT_A 0x20
6001 #define _NOT_ADDRESS 0x20
6002 #define _DATA_ADDRESS 0x20
6003 #define _I2C_DAT 0x20
6004 #define _CKE 0x40
6005 #define _SMP 0x80
6007 //==============================================================================
6010 //==============================================================================
6011 // SSPSTAT Bits
6013 extern __at(0x0FC7) __sfr SSPSTAT;
6015 typedef union
6017 struct
6019 unsigned BF : 1;
6020 unsigned UA : 1;
6021 unsigned R_NOT_W : 1;
6022 unsigned S : 1;
6023 unsigned P : 1;
6024 unsigned D_NOT_A : 1;
6025 unsigned CKE : 1;
6026 unsigned SMP : 1;
6029 struct
6031 unsigned : 1;
6032 unsigned : 1;
6033 unsigned R : 1;
6034 unsigned I2C_START : 1;
6035 unsigned I2C_STOP : 1;
6036 unsigned D : 1;
6037 unsigned : 1;
6038 unsigned : 1;
6041 struct
6043 unsigned : 1;
6044 unsigned : 1;
6045 unsigned R_W : 1;
6046 unsigned : 1;
6047 unsigned : 1;
6048 unsigned D_A : 1;
6049 unsigned : 1;
6050 unsigned : 1;
6053 struct
6055 unsigned : 1;
6056 unsigned : 1;
6057 unsigned NOT_W : 1;
6058 unsigned : 1;
6059 unsigned : 1;
6060 unsigned NOT_A : 1;
6061 unsigned : 1;
6062 unsigned : 1;
6065 struct
6067 unsigned : 1;
6068 unsigned : 1;
6069 unsigned NOT_WRITE : 1;
6070 unsigned : 1;
6071 unsigned : 1;
6072 unsigned NOT_ADDRESS : 1;
6073 unsigned : 1;
6074 unsigned : 1;
6077 struct
6079 unsigned : 1;
6080 unsigned : 1;
6081 unsigned READ_WRITE : 1;
6082 unsigned : 1;
6083 unsigned : 1;
6084 unsigned DATA_ADDRESS : 1;
6085 unsigned : 1;
6086 unsigned : 1;
6089 struct
6091 unsigned : 1;
6092 unsigned : 1;
6093 unsigned I2C_READ : 1;
6094 unsigned : 1;
6095 unsigned : 1;
6096 unsigned I2C_DAT : 1;
6097 unsigned : 1;
6098 unsigned : 1;
6100 } __SSPSTATbits_t;
6102 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
6104 #define _SSPSTAT_BF 0x01
6105 #define _SSPSTAT_UA 0x02
6106 #define _SSPSTAT_R_NOT_W 0x04
6107 #define _SSPSTAT_R 0x04
6108 #define _SSPSTAT_R_W 0x04
6109 #define _SSPSTAT_NOT_W 0x04
6110 #define _SSPSTAT_NOT_WRITE 0x04
6111 #define _SSPSTAT_READ_WRITE 0x04
6112 #define _SSPSTAT_I2C_READ 0x04
6113 #define _SSPSTAT_S 0x08
6114 #define _SSPSTAT_I2C_START 0x08
6115 #define _SSPSTAT_P 0x10
6116 #define _SSPSTAT_I2C_STOP 0x10
6117 #define _SSPSTAT_D_NOT_A 0x20
6118 #define _SSPSTAT_D 0x20
6119 #define _SSPSTAT_D_A 0x20
6120 #define _SSPSTAT_NOT_A 0x20
6121 #define _SSPSTAT_NOT_ADDRESS 0x20
6122 #define _SSPSTAT_DATA_ADDRESS 0x20
6123 #define _SSPSTAT_I2C_DAT 0x20
6124 #define _SSPSTAT_CKE 0x40
6125 #define _SSPSTAT_SMP 0x80
6127 //==============================================================================
6129 extern __at(0x0FC8) __sfr SSP1ADD;
6131 //==============================================================================
6132 // SSP1MSK Bits
6134 extern __at(0x0FC8) __sfr SSP1MSK;
6136 typedef struct
6138 unsigned MSK0 : 1;
6139 unsigned MSK1 : 1;
6140 unsigned MSK2 : 1;
6141 unsigned MSK3 : 1;
6142 unsigned MSK4 : 1;
6143 unsigned MSK5 : 1;
6144 unsigned MSK6 : 1;
6145 unsigned MSK7 : 1;
6146 } __SSP1MSKbits_t;
6148 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
6150 #define _MSK0 0x01
6151 #define _MSK1 0x02
6152 #define _MSK2 0x04
6153 #define _MSK3 0x08
6154 #define _MSK4 0x10
6155 #define _MSK5 0x20
6156 #define _MSK6 0x40
6157 #define _MSK7 0x80
6159 //==============================================================================
6161 extern __at(0x0FC8) __sfr SSPADD;
6162 extern __at(0x0FC9) __sfr SSP1BUF;
6163 extern __at(0x0FC9) __sfr SSPBUF;
6165 //==============================================================================
6166 // T2CON Bits
6168 extern __at(0x0FCA) __sfr T2CON;
6170 typedef union
6172 struct
6174 unsigned T2CKPS0 : 1;
6175 unsigned T2CKPS1 : 1;
6176 unsigned TMR2ON : 1;
6177 unsigned T2OUTPS0 : 1;
6178 unsigned T2OUTPS1 : 1;
6179 unsigned T2OUTPS2 : 1;
6180 unsigned T2OUTPS3 : 1;
6181 unsigned : 1;
6184 struct
6186 unsigned T2CKPS : 2;
6187 unsigned : 6;
6190 struct
6192 unsigned : 3;
6193 unsigned T2OUTPS : 4;
6194 unsigned : 1;
6196 } __T2CONbits_t;
6198 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
6200 #define _T2CKPS0 0x01
6201 #define _T2CKPS1 0x02
6202 #define _TMR2ON 0x04
6203 #define _T2OUTPS0 0x08
6204 #define _T2OUTPS1 0x10
6205 #define _T2OUTPS2 0x20
6206 #define _T2OUTPS3 0x40
6208 //==============================================================================
6210 extern __at(0x0FCB) __sfr PR2;
6211 extern __at(0x0FCC) __sfr TMR2;
6213 //==============================================================================
6214 // T1CON Bits
6216 extern __at(0x0FCD) __sfr T1CON;
6218 typedef union
6220 struct
6222 unsigned TMR1ON : 1;
6223 unsigned RD16 : 1;
6224 unsigned NOT_T1SYNC : 1;
6225 unsigned SOSCEN : 1;
6226 unsigned T1CKPS0 : 1;
6227 unsigned T1CKPS1 : 1;
6228 unsigned TMR1CS0 : 1;
6229 unsigned TMR1CS1 : 1;
6232 struct
6234 unsigned : 4;
6235 unsigned T1CKPS : 2;
6236 unsigned : 2;
6239 struct
6241 unsigned : 6;
6242 unsigned TMR1CS : 2;
6244 } __T1CONbits_t;
6246 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6248 #define _TMR1ON 0x01
6249 #define _RD16 0x02
6250 #define _NOT_T1SYNC 0x04
6251 #define _SOSCEN 0x08
6252 #define _T1CKPS0 0x10
6253 #define _T1CKPS1 0x20
6254 #define _TMR1CS0 0x40
6255 #define _TMR1CS1 0x80
6257 //==============================================================================
6259 extern __at(0x0FCE) __sfr TMR1;
6260 extern __at(0x0FCE) __sfr TMR1L;
6261 extern __at(0x0FCF) __sfr TMR1H;
6263 //==============================================================================
6264 // RCON Bits
6266 extern __at(0x0FD0) __sfr RCON;
6268 typedef union
6270 struct
6272 unsigned NOT_BOR : 1;
6273 unsigned NOT_POR : 1;
6274 unsigned NOT_PD : 1;
6275 unsigned NOT_TO : 1;
6276 unsigned NOT_RI : 1;
6277 unsigned NOT_CM : 1;
6278 unsigned SBOREN : 1;
6279 unsigned IPEN : 1;
6282 struct
6284 unsigned BOR : 1;
6285 unsigned POR : 1;
6286 unsigned PD : 1;
6287 unsigned TO : 1;
6288 unsigned RI : 1;
6289 unsigned CM : 1;
6290 unsigned : 1;
6291 unsigned : 1;
6293 } __RCONbits_t;
6295 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6297 #define _NOT_BOR 0x01
6298 #define _BOR 0x01
6299 #define _NOT_POR 0x02
6300 #define _POR 0x02
6301 #define _NOT_PD 0x04
6302 #define _PD 0x04
6303 #define _NOT_TO 0x08
6304 #define _TO 0x08
6305 #define _NOT_RI 0x10
6306 #define _RI 0x10
6307 #define _NOT_CM 0x20
6308 #define _CM 0x20
6309 #define _SBOREN 0x40
6310 #define _IPEN 0x80
6312 //==============================================================================
6315 //==============================================================================
6316 // WDTCON Bits
6318 extern __at(0x0FD1) __sfr WDTCON;
6320 typedef union
6322 struct
6324 unsigned SWDTEN : 1;
6325 unsigned ULPSINK : 1;
6326 unsigned ULPEN : 1;
6327 unsigned : 1;
6328 unsigned SRETEN : 1;
6329 unsigned ULPLVL : 1;
6330 unsigned : 1;
6331 unsigned REGSLP : 1;
6334 struct
6336 unsigned SWDTE : 1;
6337 unsigned : 1;
6338 unsigned : 1;
6339 unsigned : 1;
6340 unsigned : 1;
6341 unsigned : 1;
6342 unsigned : 1;
6343 unsigned : 1;
6345 } __WDTCONbits_t;
6347 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
6349 #define _SWDTEN 0x01
6350 #define _SWDTE 0x01
6351 #define _ULPSINK 0x02
6352 #define _ULPEN 0x04
6353 #define _SRETEN 0x10
6354 #define _ULPLVL 0x20
6355 #define _REGSLP 0x80
6357 //==============================================================================
6360 //==============================================================================
6361 // IPR5 Bits
6363 extern __at(0x0FD2) __sfr IPR5;
6365 typedef union
6367 struct
6369 unsigned TMR4IP : 1;
6370 unsigned TMR5IP : 1;
6371 unsigned TMR6IP : 1;
6372 unsigned EVPOL0 : 1;
6373 unsigned TMR8IP : 1;
6374 unsigned : 1;
6375 unsigned : 1;
6376 unsigned : 1;
6379 struct
6381 unsigned CCH0 : 1;
6382 unsigned CCH1 : 1;
6383 unsigned : 1;
6384 unsigned : 1;
6385 unsigned EVPOL1 : 1;
6386 unsigned : 1;
6387 unsigned : 1;
6388 unsigned : 1;
6391 struct
6393 unsigned CCH : 2;
6394 unsigned : 6;
6397 struct
6399 unsigned : 3;
6400 unsigned EVPOL : 2;
6401 unsigned : 3;
6403 } __IPR5bits_t;
6405 extern __at(0x0FD2) volatile __IPR5bits_t IPR5bits;
6407 #define _IPR5_TMR4IP 0x01
6408 #define _IPR5_CCH0 0x01
6409 #define _IPR5_TMR5IP 0x02
6410 #define _IPR5_CCH1 0x02
6411 #define _IPR5_TMR6IP 0x04
6412 #define _IPR5_EVPOL0 0x08
6413 #define _IPR5_TMR8IP 0x10
6414 #define _IPR5_EVPOL1 0x10
6416 //==============================================================================
6419 //==============================================================================
6420 // OSCCON Bits
6422 extern __at(0x0FD3) __sfr OSCCON;
6424 typedef union
6426 struct
6428 unsigned SCS0 : 1;
6429 unsigned SCS1 : 1;
6430 unsigned HFIOFS : 1;
6431 unsigned OSTS : 1;
6432 unsigned IRCF0 : 1;
6433 unsigned IRCF1 : 1;
6434 unsigned IRCF2 : 1;
6435 unsigned IDLEN : 1;
6438 struct
6440 unsigned SCS : 2;
6441 unsigned : 6;
6444 struct
6446 unsigned : 4;
6447 unsigned IRCF : 3;
6448 unsigned : 1;
6450 } __OSCCONbits_t;
6452 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
6454 #define _SCS0 0x01
6455 #define _SCS1 0x02
6456 #define _HFIOFS 0x04
6457 #define _OSTS 0x08
6458 #define _IRCF0 0x10
6459 #define _IRCF1 0x20
6460 #define _IRCF2 0x40
6461 #define _IDLEN 0x80
6463 //==============================================================================
6465 extern __at(0x0FD4) __sfr SPBRGH1;
6467 //==============================================================================
6468 // T0CON Bits
6470 extern __at(0x0FD5) __sfr T0CON;
6472 typedef union
6474 struct
6476 unsigned T0PS0 : 1;
6477 unsigned T0PS1 : 1;
6478 unsigned T0PS2 : 1;
6479 unsigned PSA : 1;
6480 unsigned T0SE : 1;
6481 unsigned T0CS : 1;
6482 unsigned T08BIT : 1;
6483 unsigned TMR0ON : 1;
6486 struct
6488 unsigned T0PS : 3;
6489 unsigned : 5;
6491 } __T0CONbits_t;
6493 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
6495 #define _T0PS0 0x01
6496 #define _T0PS1 0x02
6497 #define _T0PS2 0x04
6498 #define _PSA 0x08
6499 #define _T0SE 0x10
6500 #define _T0CS 0x20
6501 #define _T08BIT 0x40
6502 #define _TMR0ON 0x80
6504 //==============================================================================
6506 extern __at(0x0FD6) __sfr TMR0;
6507 extern __at(0x0FD6) __sfr TMR0L;
6508 extern __at(0x0FD7) __sfr TMR0H;
6510 //==============================================================================
6511 // STATUS Bits
6513 extern __at(0x0FD8) __sfr STATUS;
6515 typedef struct
6517 unsigned C : 1;
6518 unsigned DC : 1;
6519 unsigned Z : 1;
6520 unsigned OV : 1;
6521 unsigned N : 1;
6522 unsigned : 1;
6523 unsigned : 1;
6524 unsigned : 1;
6525 } __STATUSbits_t;
6527 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
6529 #define _C 0x01
6530 #define _DC 0x02
6531 #define _Z 0x04
6532 #define _OV 0x08
6533 #define _N 0x10
6535 //==============================================================================
6537 extern __at(0x0FD9) __sfr FSR2L;
6538 extern __at(0x0FDA) __sfr FSR2H;
6539 extern __at(0x0FDB) __sfr PLUSW2;
6540 extern __at(0x0FDC) __sfr PREINC2;
6541 extern __at(0x0FDD) __sfr POSTDEC2;
6542 extern __at(0x0FDE) __sfr POSTINC2;
6543 extern __at(0x0FDF) __sfr INDF2;
6544 extern __at(0x0FE0) __sfr BSR;
6545 extern __at(0x0FE1) __sfr FSR1L;
6546 extern __at(0x0FE2) __sfr FSR1H;
6547 extern __at(0x0FE3) __sfr PLUSW1;
6548 extern __at(0x0FE4) __sfr PREINC1;
6549 extern __at(0x0FE5) __sfr POSTDEC1;
6550 extern __at(0x0FE6) __sfr POSTINC1;
6551 extern __at(0x0FE7) __sfr INDF1;
6552 extern __at(0x0FE8) __sfr WREG;
6553 extern __at(0x0FE9) __sfr FSR0L;
6554 extern __at(0x0FEA) __sfr FSR0H;
6555 extern __at(0x0FEB) __sfr PLUSW0;
6556 extern __at(0x0FEC) __sfr PREINC0;
6557 extern __at(0x0FED) __sfr POSTDEC0;
6558 extern __at(0x0FEE) __sfr POSTINC0;
6559 extern __at(0x0FEF) __sfr INDF0;
6561 //==============================================================================
6562 // INTCON3 Bits
6564 extern __at(0x0FF0) __sfr INTCON3;
6566 typedef union
6568 struct
6570 unsigned INT1IF : 1;
6571 unsigned INT2IF : 1;
6572 unsigned INT3IF : 1;
6573 unsigned INT1IE : 1;
6574 unsigned INT2IE : 1;
6575 unsigned INT3IE : 1;
6576 unsigned INT1IP : 1;
6577 unsigned INT2IP : 1;
6580 struct
6582 unsigned INT1F : 1;
6583 unsigned INT2F : 1;
6584 unsigned INT3F : 1;
6585 unsigned INT1E : 1;
6586 unsigned INT2E : 1;
6587 unsigned INT3E : 1;
6588 unsigned INT1P : 1;
6589 unsigned INT2P : 1;
6591 } __INTCON3bits_t;
6593 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6595 #define _INT1IF 0x01
6596 #define _INT1F 0x01
6597 #define _INT2IF 0x02
6598 #define _INT2F 0x02
6599 #define _INT3IF 0x04
6600 #define _INT3F 0x04
6601 #define _INT1IE 0x08
6602 #define _INT1E 0x08
6603 #define _INT2IE 0x10
6604 #define _INT2E 0x10
6605 #define _INT3IE 0x20
6606 #define _INT3E 0x20
6607 #define _INT1IP 0x40
6608 #define _INT1P 0x40
6609 #define _INT2IP 0x80
6610 #define _INT2P 0x80
6612 //==============================================================================
6615 //==============================================================================
6616 // INTCON2 Bits
6618 extern __at(0x0FF1) __sfr INTCON2;
6620 typedef union
6622 struct
6624 unsigned RBIP : 1;
6625 unsigned INT3IP : 1;
6626 unsigned TMR0IP : 1;
6627 unsigned INTEDG3 : 1;
6628 unsigned INTEDG2 : 1;
6629 unsigned INTEDG1 : 1;
6630 unsigned INTEDG0 : 1;
6631 unsigned NOT_RBPU : 1;
6634 struct
6636 unsigned : 1;
6637 unsigned INT3P : 1;
6638 unsigned T0IP : 1;
6639 unsigned : 1;
6640 unsigned : 1;
6641 unsigned : 1;
6642 unsigned : 1;
6643 unsigned RBPU : 1;
6645 } __INTCON2bits_t;
6647 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6649 #define _RBIP 0x01
6650 #define _INT3IP 0x02
6651 #define _INT3P 0x02
6652 #define _TMR0IP 0x04
6653 #define _T0IP 0x04
6654 #define _INTEDG3 0x08
6655 #define _INTEDG2 0x10
6656 #define _INTEDG1 0x20
6657 #define _INTEDG0 0x40
6658 #define _NOT_RBPU 0x80
6659 #define _RBPU 0x80
6661 //==============================================================================
6664 //==============================================================================
6665 // INTCON Bits
6667 extern __at(0x0FF2) __sfr INTCON;
6669 typedef union
6671 struct
6673 unsigned RBIF : 1;
6674 unsigned INT0IF : 1;
6675 unsigned TMR0IF : 1;
6676 unsigned RBIE : 1;
6677 unsigned INT0IE : 1;
6678 unsigned TMR0IE : 1;
6679 unsigned PEIE_GIEL : 1;
6680 unsigned GIE_GIEH : 1;
6683 struct
6685 unsigned : 1;
6686 unsigned INT0F : 1;
6687 unsigned T0IF : 1;
6688 unsigned : 1;
6689 unsigned INT0E : 1;
6690 unsigned T0IE : 1;
6691 unsigned PEIE : 1;
6692 unsigned GIE : 1;
6695 struct
6697 unsigned : 1;
6698 unsigned : 1;
6699 unsigned : 1;
6700 unsigned : 1;
6701 unsigned : 1;
6702 unsigned : 1;
6703 unsigned GIEL : 1;
6704 unsigned GIEH : 1;
6706 } __INTCONbits_t;
6708 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6710 #define _RBIF 0x01
6711 #define _INT0IF 0x02
6712 #define _INT0F 0x02
6713 #define _TMR0IF 0x04
6714 #define _T0IF 0x04
6715 #define _RBIE 0x08
6716 #define _INT0IE 0x10
6717 #define _INT0E 0x10
6718 #define _TMR0IE 0x20
6719 #define _T0IE 0x20
6720 #define _PEIE_GIEL 0x40
6721 #define _PEIE 0x40
6722 #define _GIEL 0x40
6723 #define _GIE_GIEH 0x80
6724 #define _GIE 0x80
6725 #define _GIEH 0x80
6727 //==============================================================================
6729 extern __at(0x0FF3) __sfr PROD;
6730 extern __at(0x0FF3) __sfr PRODL;
6731 extern __at(0x0FF4) __sfr PRODH;
6732 extern __at(0x0FF5) __sfr TABLAT;
6733 extern __at(0x0FF6) __sfr TBLPTR;
6734 extern __at(0x0FF6) __sfr TBLPTRL;
6735 extern __at(0x0FF7) __sfr TBLPTRH;
6736 extern __at(0x0FF8) __sfr TBLPTRU;
6737 extern __at(0x0FF9) __sfr PC;
6738 extern __at(0x0FF9) __sfr PCL;
6739 extern __at(0x0FFA) __sfr PCLATH;
6740 extern __at(0x0FFB) __sfr PCLATU;
6742 //==============================================================================
6743 // STKPTR Bits
6745 extern __at(0x0FFC) __sfr STKPTR;
6747 typedef union
6749 struct
6751 unsigned SP0 : 1;
6752 unsigned SP1 : 1;
6753 unsigned SP2 : 1;
6754 unsigned SP3 : 1;
6755 unsigned SP4 : 1;
6756 unsigned : 1;
6757 unsigned STKUNF : 1;
6758 unsigned STKFUL : 1;
6761 struct
6763 unsigned : 1;
6764 unsigned : 1;
6765 unsigned : 1;
6766 unsigned : 1;
6767 unsigned : 1;
6768 unsigned : 1;
6769 unsigned : 1;
6770 unsigned STKOVF : 1;
6773 struct
6775 unsigned SP : 5;
6776 unsigned : 3;
6778 } __STKPTRbits_t;
6780 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6782 #define _SP0 0x01
6783 #define _SP1 0x02
6784 #define _SP2 0x04
6785 #define _SP3 0x08
6786 #define _SP4 0x10
6787 #define _STKUNF 0x40
6788 #define _STKFUL 0x80
6789 #define _STKOVF 0x80
6791 //==============================================================================
6793 extern __at(0x0FFD) __sfr TOS;
6794 extern __at(0x0FFD) __sfr TOSL;
6795 extern __at(0x0FFE) __sfr TOSH;
6796 extern __at(0x0FFF) __sfr TOSU;
6798 //==============================================================================
6800 // Configuration Bits
6802 //==============================================================================
6804 #define __CONFIG1L 0x300000
6805 #define __CONFIG1H 0x300001
6806 #define __CONFIG2L 0x300002
6807 #define __CONFIG2H 0x300003
6808 #define __CONFIG3L 0x300004
6809 #define __CONFIG3H 0x300005
6810 #define __CONFIG4L 0x300006
6811 #define __CONFIG5L 0x300008
6812 #define __CONFIG5H 0x300009
6813 #define __CONFIG6L 0x30000A
6814 #define __CONFIG6H 0x30000B
6815 #define __CONFIG7L 0x30000C
6816 #define __CONFIG7H 0x30000D
6818 //----------------------------- CONFIG1L Options -------------------------------
6820 #define _RETEN_OFF_1L 0xFE // Disabled - Controlled by SRETEN bit.
6821 #define _RETEN_ON_1L 0xFF // Enabled.
6822 #define _INTOSCSEL_LOW_1L 0xFB // LF-INTOSC in Low-power mode during Sleep.
6823 #define _INTOSCSEL_HIGH_1L 0xFF // LF-INTOSC in High-power mode during Sleep.
6824 #define _SOSCSEL_LOW_1L 0xEF // Low Power SOSC circuit selected.
6825 #define _SOSCSEL_DIG_1L 0xF7 // Digital (SCLKI) mode.
6826 #define _SOSCSEL_HIGH_1L 0xFF // High Power SOSC circuit selected.
6827 #define _XINST_OFF_1L 0xBF // Disabled.
6828 #define _XINST_ON_1L 0xFF // Enabled.
6830 //----------------------------- CONFIG1H Options -------------------------------
6832 #define _FOSC_LP_1H 0xF0 // LP oscillator.
6833 #define _FOSC_XT_1H 0xF1 // XT oscillator.
6834 #define _FOSC_HS2_1H 0xF2 // HS oscillator (High power, 16 MHz - 25 MHz).
6835 #define _FOSC_HS1_1H 0xF3 // HS oscillator (Medium power, 4 MHz - 16 MHz).
6836 #define _FOSC_EC3IO_1H 0xF4 // EC oscillator, CLKOUT function on OSC2 (High power, 16 MHz - 64 MHz).
6837 #define _FOSC_EC3_1H 0xF5 // EC oscillator (High power, 16 MHz - 64 MHz).
6838 #define _FOSC_RC_1H 0xF6 // External RC oscillator, CLKOUT function on OSC2.
6839 #define _FOSC_RCIO_1H 0xF7 // External RC oscillator.
6840 #define _FOSC_INTIO2_1H 0xF8 // Internal RC oscillator.
6841 #define _FOSC_INTIO1_1H 0xF9 // Internal RC oscillator, CLKOUT function on OSC2.
6842 #define _FOSC_EC2IO_1H 0xFA // EC oscillator, CLKOUT function on OSC2 (Medium power, 160 kHz - 16 MHz).
6843 #define _FOSC_EC2_1H 0xFB // EC oscillator (Medium power, 160 kHz - 16 MHz).
6844 #define _FOSC_EC1IO_1H 0xFC // EC oscillator, CLKOUT function on OSC2 (Low power, DC - 160 kHz).
6845 #define _FOSC_EC1_1H 0xFD // EC oscillator (Low power, DC - 160 kHz).
6846 #define _PLLCFG_OFF_1H 0xEF // Disabled.
6847 #define _PLLCFG_ON_1H 0xFF // Enabled.
6848 #define _FCMEN_OFF_1H 0xBF // Disabled.
6849 #define _FCMEN_ON_1H 0xFF // Enabled.
6850 #define _IESO_OFF_1H 0x7F // Disabled.
6851 #define _IESO_ON_1H 0xFF // Enabled.
6853 //----------------------------- CONFIG2L Options -------------------------------
6855 #define _PWRTEN_ON_2L 0xFE // Enabled.
6856 #define _PWRTEN_OFF_2L 0xFF // Disabled.
6857 #define _BOREN_OFF_2L 0xF9 // Disabled in hardware, SBOREN disabled.
6858 #define _BOREN_ON_2L 0xFB // Controlled with SBOREN bit.
6859 #define _BOREN_NOSLP_2L 0xFD // Enabled while active, disabled in SLEEP, SBOREN disabled.
6860 #define _BOREN_SBORDIS_2L 0xFF // Enabled in hardware, SBOREN disabled.
6861 #define _BORV_0_2L 0xE7 // 3.0V.
6862 #define _BORV_1_2L 0xEF // 2.7V.
6863 #define _BORV_2_2L 0xF7 // 2.0V.
6864 #define _BORV_3_2L 0xFF // 1.8V.
6865 #define _BORPWR_LOW_2L 0x9F // BORMV set to low power level.
6866 #define _BORPWR_MEDIUM_2L 0xBF // BORMV set to medium power level.
6867 #define _BORPWR_HIGH_2L 0xDF // BORMV set to high power level.
6868 #define _BORPWR_ZPBORMV_2L 0xFF // ZPBORMV instead of BORMV is selected.
6870 //----------------------------- CONFIG2H Options -------------------------------
6872 #define _WDTEN_OFF_2H 0xFC // WDT disabled in hardware; SWDTEN bit disabled.
6873 #define _WDTEN_NOSLP_2H 0xFD // WDT enabled only while device is active and disabled in Sleep mode; SWDTEN bit disabled.
6874 #define _WDTEN_ON_2H 0xFE // WDT controlled by SWDTEN bit setting.
6875 #define _WDTEN_SWDTDIS_2H 0xFF // WDT enabled in hardware; SWDTEN bit disabled.
6876 #define _WDTPS_1_2H 0x83 // 1:1.
6877 #define _WDTPS_2_2H 0x87 // 1:2.
6878 #define _WDTPS_4_2H 0x8B // 1:4.
6879 #define _WDTPS_8_2H 0x8F // 1:8.
6880 #define _WDTPS_16_2H 0x93 // 1:16.
6881 #define _WDTPS_32_2H 0x97 // 1:32.
6882 #define _WDTPS_64_2H 0x9B // 1:64.
6883 #define _WDTPS_128_2H 0x9F // 1:128.
6884 #define _WDTPS_256_2H 0xA3 // 1:256.
6885 #define _WDTPS_512_2H 0xA7 // 1:512.
6886 #define _WDTPS_1024_2H 0xAB // 1:1024.
6887 #define _WDTPS_2048_2H 0xAF // 1:2048.
6888 #define _WDTPS_4096_2H 0xB3 // 1:4096.
6889 #define _WDTPS_8192_2H 0xB7 // 1:8192.
6890 #define _WDTPS_16384_2H 0xBB // 1:16384.
6891 #define _WDTPS_32768_2H 0xBF // 1:32768.
6892 #define _WDTPS_65536_2H 0xC3 // 1:65536.
6893 #define _WDTPS_131072_2H 0xC7 // 1:131072.
6894 #define _WDTPS_262144_2H 0xCB // 1:262144.
6895 #define _WDTPS_524288_2H 0xCF // 1:524288.
6896 #define _WDTPS_1048576_2H 0xFF // 1:1048576.
6898 //----------------------------- CONFIG3L Options -------------------------------
6900 #define _RTCOSC_INTOSCREF_3L 0xFE // RTCC uses INTRC.
6901 #define _RTCOSC_SOSCREF_3L 0xFF // RTCC uses SOSC.
6903 //----------------------------- CONFIG3H Options -------------------------------
6905 #define _CCP2MX_PORTBE_3H 0xFE // RE7-Microcontroller Mode/RB3-All other modes.
6906 #define _CCP2MX_PORTC_3H 0xFF // RC1.
6907 #define _MSSPMSK_MSK5_3H 0xF7 // 5 bit address masking mode.
6908 #define _MSSPMSK_MSK7_3H 0xFF // 7 Bit address masking mode.
6909 #define _MCLRE_OFF_3H 0x7F // MCLR Disabled, RG5 Enabled.
6910 #define _MCLRE_ON_3H 0xFF // MCLR Enabled, RG5 Disabled.
6912 //----------------------------- CONFIG4L Options -------------------------------
6914 #define _STVREN_OFF_4L 0xFE // Disabled.
6915 #define _STVREN_ON_4L 0xFF // Enabled.
6916 #define _BBSIZ_BB1K_4L 0xEF // 1K word Boot Block size.
6917 #define _BBSIZ_BB2K_4L 0xFF // 2K word Boot Block size.
6918 #define _DEBUG_ON_4L 0x7F // Enabled.
6919 #define _DEBUG_OFF_4L 0xFF // Disabled.
6921 //----------------------------- CONFIG5L Options -------------------------------
6923 #define _CP0_ON_5L 0xFE // Enabled.
6924 #define _CP0_OFF_5L 0xFF // Disabled.
6925 #define _CP1_ON_5L 0xFD // Enabled.
6926 #define _CP1_OFF_5L 0xFF // Disabled.
6927 #define _CP2_ON_5L 0xFB // Enabled.
6928 #define _CP2_OFF_5L 0xFF // Disabled.
6929 #define _CP3_ON_5L 0xF7 // Enabled.
6930 #define _CP3_OFF_5L 0xFF // Disabled.
6932 //----------------------------- CONFIG5H Options -------------------------------
6934 #define _CPB_ON_5H 0xBF // Enabled.
6935 #define _CPB_OFF_5H 0xFF // Disabled.
6936 #define _CPD_ON_5H 0x7F // Enabled.
6937 #define _CPD_OFF_5H 0xFF // Disabled.
6939 //----------------------------- CONFIG6L Options -------------------------------
6941 #define _WRT0_ON_6L 0xFE // Enabled.
6942 #define _WRT0_OFF_6L 0xFF // Disabled.
6943 #define _WRT1_ON_6L 0xFD // Enabled.
6944 #define _WRT1_OFF_6L 0xFF // Disabled.
6945 #define _WRT2_ON_6L 0xFB // Enabled.
6946 #define _WRT2_OFF_6L 0xFF // Disabled.
6947 #define _WRT3_ON_6L 0xF7 // Enabled.
6948 #define _WRT3_OFF_6L 0xFF // Disabled.
6950 //----------------------------- CONFIG6H Options -------------------------------
6952 #define _WRTC_ON_6H 0xDF // Enabled.
6953 #define _WRTC_OFF_6H 0xFF // Disabled.
6954 #define _WRTB_ON_6H 0xBF // Enabled.
6955 #define _WRTB_OFF_6H 0xFF // Disabled.
6956 #define _WRTD_ON_6H 0x7F // Enabled.
6957 #define _WRTD_OFF_6H 0xFF // Disabled.
6959 //----------------------------- CONFIG7L Options -------------------------------
6961 #define _EBRT0_ON_7L 0xFE // Enabled.
6962 #define _EBRT0_OFF_7L 0xFF // Disabled.
6963 #define _EBRT1_ON_7L 0xFD // Enabled.
6964 #define _EBRT1_OFF_7L 0xFF // Disabled.
6965 #define _EBRT2_ON_7L 0xFB // Enabled.
6966 #define _EBRT2_OFF_7L 0xFF // Disabled.
6967 #define _EBRT3_ON_7L 0xF7 // Enabled.
6968 #define _EBRT3_OFF_7L 0xFF // Disabled.
6970 //----------------------------- CONFIG7H Options -------------------------------
6972 #define _EBRTB_ON_7H 0xBF // Enabled.
6973 #define _EBRTB_OFF_7H 0xFF // Disabled.
6975 //==============================================================================
6977 #define __DEVID1 0x3FFFFE
6978 #define __DEVID2 0x3FFFFF
6980 #define __IDLOC0 0x200000
6981 #define __IDLOC1 0x200001
6982 #define __IDLOC2 0x200002
6983 #define __IDLOC3 0x200003
6984 #define __IDLOC4 0x200004
6985 #define __IDLOC5 0x200005
6986 #define __IDLOC6 0x200006
6987 #define __IDLOC7 0x200007
6989 #endif // #ifndef __PIC18F65K22_H__