struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f67k22.h
blob7202fb992ed185a5f47f35bb8f421b2d966bb07b
1 /*
2 * This declarations of the PIC18F67K22 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:35 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 __PIC18F67K22_H__
26 #define __PIC18F67K22_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // PMD3 Bits
40 extern __at(0x0F16) __sfr PMD3;
42 typedef struct
44 unsigned TMR12MD : 1;
45 unsigned CCP4MD : 1;
46 unsigned CCP5MD : 1;
47 unsigned CCP6MD : 1;
48 unsigned CCP7MD : 1;
49 unsigned CCP8MD : 1;
50 unsigned CCP9MD : 1;
51 unsigned CCP10MD : 1;
52 } __PMD3bits_t;
54 extern __at(0x0F16) volatile __PMD3bits_t PMD3bits;
56 #define _TMR12MD 0x01
57 #define _CCP4MD 0x02
58 #define _CCP5MD 0x04
59 #define _CCP6MD 0x08
60 #define _CCP7MD 0x10
61 #define _CCP8MD 0x20
62 #define _CCP9MD 0x40
63 #define _CCP10MD 0x80
65 //==============================================================================
68 //==============================================================================
69 // PMD2 Bits
71 extern __at(0x0F17) __sfr PMD2;
73 typedef struct
75 unsigned CMP1MD : 1;
76 unsigned CMP2MD : 1;
77 unsigned CMP3MD : 1;
78 unsigned TMR5MD : 1;
79 unsigned TMR6MD : 1;
80 unsigned TMR7MD : 1;
81 unsigned TMR8MD : 1;
82 unsigned TMR10MD : 1;
83 } __PMD2bits_t;
85 extern __at(0x0F17) volatile __PMD2bits_t PMD2bits;
87 #define _CMP1MD 0x01
88 #define _CMP2MD 0x02
89 #define _CMP3MD 0x04
90 #define _TMR5MD 0x08
91 #define _TMR6MD 0x10
92 #define _TMR7MD 0x20
93 #define _TMR8MD 0x40
94 #define _TMR10MD 0x80
96 //==============================================================================
99 //==============================================================================
100 // PMD1 Bits
102 extern __at(0x0F18) __sfr PMD1;
104 typedef struct
106 unsigned : 1;
107 unsigned TMR1MD : 1;
108 unsigned TMR2MD : 1;
109 unsigned TMR3MD : 1;
110 unsigned TMR4MD : 1;
111 unsigned RTCCMD : 1;
112 unsigned CTMUMD : 1;
113 unsigned PSPMD : 1;
114 } __PMD1bits_t;
116 extern __at(0x0F18) volatile __PMD1bits_t PMD1bits;
118 #define _TMR1MD 0x02
119 #define _TMR2MD 0x04
120 #define _TMR3MD 0x08
121 #define _TMR4MD 0x10
122 #define _RTCCMD 0x20
123 #define _CTMUMD 0x40
124 #define _PSPMD 0x80
126 //==============================================================================
129 //==============================================================================
130 // PMD0 Bits
132 extern __at(0x0F19) __sfr PMD0;
134 typedef struct
136 unsigned ADCMD : 1;
137 unsigned SSP1MD : 1;
138 unsigned SSP2MD : 1;
139 unsigned UART1MD : 1;
140 unsigned UART2MD : 1;
141 unsigned CCP1MD : 1;
142 unsigned CCP2MD : 1;
143 unsigned CCP3MD : 1;
144 } __PMD0bits_t;
146 extern __at(0x0F19) volatile __PMD0bits_t PMD0bits;
148 #define _ADCMD 0x01
149 #define _SSP1MD 0x02
150 #define _SSP2MD 0x04
151 #define _UART1MD 0x08
152 #define _UART2MD 0x10
153 #define _CCP1MD 0x20
154 #define _CCP2MD 0x40
155 #define _CCP3MD 0x80
157 //==============================================================================
160 //==============================================================================
161 // PSTR3CON Bits
163 extern __at(0x0F1A) __sfr PSTR3CON;
165 typedef union
167 struct
169 unsigned STRA : 1;
170 unsigned STRB : 1;
171 unsigned STRC : 1;
172 unsigned STRD : 1;
173 unsigned STRSYNC : 1;
174 unsigned : 1;
175 unsigned CMPL0 : 1;
176 unsigned CMPL1 : 1;
179 struct
181 unsigned : 6;
182 unsigned CMPL : 2;
184 } __PSTR3CONbits_t;
186 extern __at(0x0F1A) volatile __PSTR3CONbits_t PSTR3CONbits;
188 #define _PSTR3CON_STRA 0x01
189 #define _PSTR3CON_STRB 0x02
190 #define _PSTR3CON_STRC 0x04
191 #define _PSTR3CON_STRD 0x08
192 #define _PSTR3CON_STRSYNC 0x10
193 #define _PSTR3CON_CMPL0 0x40
194 #define _PSTR3CON_CMPL1 0x80
196 //==============================================================================
199 //==============================================================================
200 // PSTR2CON Bits
202 extern __at(0x0F1B) __sfr PSTR2CON;
204 typedef union
206 struct
208 unsigned STRA : 1;
209 unsigned STRB : 1;
210 unsigned STRC : 1;
211 unsigned STRD : 1;
212 unsigned STRSYNC : 1;
213 unsigned : 1;
214 unsigned CMPL0 : 1;
215 unsigned CMPL1 : 1;
218 struct
220 unsigned : 6;
221 unsigned CMPL : 2;
223 } __PSTR2CONbits_t;
225 extern __at(0x0F1B) volatile __PSTR2CONbits_t PSTR2CONbits;
227 #define _PSTR2CON_STRA 0x01
228 #define _PSTR2CON_STRB 0x02
229 #define _PSTR2CON_STRC 0x04
230 #define _PSTR2CON_STRD 0x08
231 #define _PSTR2CON_STRSYNC 0x10
232 #define _PSTR2CON_CMPL0 0x40
233 #define _PSTR2CON_CMPL1 0x80
235 //==============================================================================
237 extern __at(0x0F1C) __sfr TXREG2;
238 extern __at(0x0F1D) __sfr RCREG2;
239 extern __at(0x0F1E) __sfr SPBRG2;
240 extern __at(0x0F1F) __sfr SPBRGH2;
242 //==============================================================================
243 // BAUDCON2 Bits
245 extern __at(0x0F20) __sfr BAUDCON2;
247 typedef struct
249 unsigned ABDEN : 1;
250 unsigned WUE : 1;
251 unsigned : 1;
252 unsigned BRG16 : 1;
253 unsigned TXCKP : 1;
254 unsigned RXDTP : 1;
255 unsigned RCIDL : 1;
256 unsigned ABDOVF : 1;
257 } __BAUDCON2bits_t;
259 extern __at(0x0F20) volatile __BAUDCON2bits_t BAUDCON2bits;
261 #define _BAUDCON2_ABDEN 0x01
262 #define _BAUDCON2_WUE 0x02
263 #define _BAUDCON2_BRG16 0x08
264 #define _BAUDCON2_TXCKP 0x10
265 #define _BAUDCON2_RXDTP 0x20
266 #define _BAUDCON2_RCIDL 0x40
267 #define _BAUDCON2_ABDOVF 0x80
269 //==============================================================================
272 //==============================================================================
273 // TXSTA2 Bits
275 extern __at(0x0F21) __sfr TXSTA2;
277 typedef union
279 struct
281 unsigned TX9D : 1;
282 unsigned TRMT : 1;
283 unsigned BRGH : 1;
284 unsigned SENDB : 1;
285 unsigned SYNC : 1;
286 unsigned TXEN : 1;
287 unsigned TX9 : 1;
288 unsigned CSRC : 1;
291 struct
293 unsigned TX9D2 : 1;
294 unsigned TRMT2 : 1;
295 unsigned BRGH2 : 1;
296 unsigned SENDB2 : 1;
297 unsigned SYNC2 : 1;
298 unsigned TXEN2 : 1;
299 unsigned TX92 : 1;
300 unsigned CSRC2 : 1;
302 } __TXSTA2bits_t;
304 extern __at(0x0F21) volatile __TXSTA2bits_t TXSTA2bits;
306 #define _TXSTA2_TX9D 0x01
307 #define _TXSTA2_TX9D2 0x01
308 #define _TXSTA2_TRMT 0x02
309 #define _TXSTA2_TRMT2 0x02
310 #define _TXSTA2_BRGH 0x04
311 #define _TXSTA2_BRGH2 0x04
312 #define _TXSTA2_SENDB 0x08
313 #define _TXSTA2_SENDB2 0x08
314 #define _TXSTA2_SYNC 0x10
315 #define _TXSTA2_SYNC2 0x10
316 #define _TXSTA2_TXEN 0x20
317 #define _TXSTA2_TXEN2 0x20
318 #define _TXSTA2_TX9 0x40
319 #define _TXSTA2_TX92 0x40
320 #define _TXSTA2_CSRC 0x80
321 #define _TXSTA2_CSRC2 0x80
323 //==============================================================================
326 //==============================================================================
327 // RCSTA2 Bits
329 extern __at(0x0F22) __sfr RCSTA2;
331 typedef union
333 struct
335 unsigned RX9D : 1;
336 unsigned OERR : 1;
337 unsigned FERR : 1;
338 unsigned ADDEN : 1;
339 unsigned CREN : 1;
340 unsigned SREN : 1;
341 unsigned RX9 : 1;
342 unsigned SPEN : 1;
345 struct
347 unsigned RX9D2 : 1;
348 unsigned OERR2 : 1;
349 unsigned FERR2 : 1;
350 unsigned ADDEN2 : 1;
351 unsigned CREN2 : 1;
352 unsigned SREN2 : 1;
353 unsigned RX92 : 1;
354 unsigned SPEN2 : 1;
356 } __RCSTA2bits_t;
358 extern __at(0x0F22) volatile __RCSTA2bits_t RCSTA2bits;
360 #define _RCSTA2_RX9D 0x01
361 #define _RCSTA2_RX9D2 0x01
362 #define _RCSTA2_OERR 0x02
363 #define _RCSTA2_OERR2 0x02
364 #define _RCSTA2_FERR 0x04
365 #define _RCSTA2_FERR2 0x04
366 #define _RCSTA2_ADDEN 0x08
367 #define _RCSTA2_ADDEN2 0x08
368 #define _RCSTA2_CREN 0x10
369 #define _RCSTA2_CREN2 0x10
370 #define _RCSTA2_SREN 0x20
371 #define _RCSTA2_SREN2 0x20
372 #define _RCSTA2_RX9 0x40
373 #define _RCSTA2_RX92 0x40
374 #define _RCSTA2_SPEN 0x80
375 #define _RCSTA2_SPEN2 0x80
377 //==============================================================================
380 //==============================================================================
381 // ANCON2 Bits
383 extern __at(0x0F23) __sfr ANCON2;
385 typedef struct
387 unsigned ANSEL16 : 1;
388 unsigned ANSEL17 : 1;
389 unsigned ANSEL18 : 1;
390 unsigned ANSEL19 : 1;
391 unsigned : 1;
392 unsigned : 1;
393 unsigned : 1;
394 unsigned : 1;
395 } __ANCON2bits_t;
397 extern __at(0x0F23) volatile __ANCON2bits_t ANCON2bits;
399 #define _ANSEL16 0x01
400 #define _ANSEL17 0x02
401 #define _ANSEL18 0x04
402 #define _ANSEL19 0x08
404 //==============================================================================
407 //==============================================================================
408 // ANCON1 Bits
410 extern __at(0x0F24) __sfr ANCON1;
412 typedef struct
414 unsigned ANSEL8 : 1;
415 unsigned ANSEL9 : 1;
416 unsigned ANSEL10 : 1;
417 unsigned ANSEL11 : 1;
418 unsigned : 1;
419 unsigned : 1;
420 unsigned : 1;
421 unsigned : 1;
422 } __ANCON1bits_t;
424 extern __at(0x0F24) volatile __ANCON1bits_t ANCON1bits;
426 #define _ANSEL8 0x01
427 #define _ANSEL9 0x02
428 #define _ANSEL10 0x04
429 #define _ANSEL11 0x08
431 //==============================================================================
434 //==============================================================================
435 // ANCON0 Bits
437 extern __at(0x0F25) __sfr ANCON0;
439 typedef struct
441 unsigned ANSEL0 : 1;
442 unsigned ANSEL1 : 1;
443 unsigned ANSEL2 : 1;
444 unsigned ANSEL3 : 1;
445 unsigned ANSEL4 : 1;
446 unsigned ANSEL5 : 1;
447 unsigned ANSEL6 : 1;
448 unsigned ANSEL7 : 1;
449 } __ANCON0bits_t;
451 extern __at(0x0F25) volatile __ANCON0bits_t ANCON0bits;
453 #define _ANSEL0 0x01
454 #define _ANSEL1 0x02
455 #define _ANSEL2 0x04
456 #define _ANSEL3 0x08
457 #define _ANSEL4 0x10
458 #define _ANSEL5 0x20
459 #define _ANSEL6 0x40
460 #define _ANSEL7 0x80
462 //==============================================================================
465 //==============================================================================
466 // ODCON3 Bits
468 extern __at(0x0F27) __sfr ODCON3;
470 typedef struct
472 unsigned CTMUDS : 1;
473 unsigned : 1;
474 unsigned : 1;
475 unsigned : 1;
476 unsigned : 1;
477 unsigned : 1;
478 unsigned U1OD : 1;
479 unsigned U2OD : 1;
480 } __ODCON3bits_t;
482 extern __at(0x0F27) volatile __ODCON3bits_t ODCON3bits;
484 #define _CTMUDS 0x01
485 #define _U1OD 0x40
486 #define _U2OD 0x80
488 //==============================================================================
491 //==============================================================================
492 // ODCON2 Bits
494 extern __at(0x0F28) __sfr ODCON2;
496 typedef struct
498 unsigned CCP3OD : 1;
499 unsigned CCP4OD : 1;
500 unsigned CCP5OD : 1;
501 unsigned CCP6OD : 1;
502 unsigned CCP7OD : 1;
503 unsigned CCP8OD : 1;
504 unsigned CCP9OD : 1;
505 unsigned CCP10OD : 1;
506 } __ODCON2bits_t;
508 extern __at(0x0F28) volatile __ODCON2bits_t ODCON2bits;
510 #define _CCP3OD 0x01
511 #define _CCP4OD 0x02
512 #define _CCP5OD 0x04
513 #define _CCP6OD 0x08
514 #define _CCP7OD 0x10
515 #define _CCP8OD 0x20
516 #define _CCP9OD 0x40
517 #define _CCP10OD 0x80
519 //==============================================================================
522 //==============================================================================
523 // ODCON1 Bits
525 extern __at(0x0F29) __sfr ODCON1;
527 typedef struct
529 unsigned SPI2OD : 1;
530 unsigned : 1;
531 unsigned : 1;
532 unsigned : 1;
533 unsigned : 1;
534 unsigned CCP1OD : 1;
535 unsigned CCP2OD : 1;
536 unsigned SPI1OD : 1;
537 } __ODCON1bits_t;
539 extern __at(0x0F29) volatile __ODCON1bits_t ODCON1bits;
541 #define _SPI2OD 0x01
542 #define _CCP1OD 0x20
543 #define _CCP2OD 0x40
544 #define _SPI1OD 0x80
546 //==============================================================================
549 //==============================================================================
550 // REFOCON Bits
552 extern __at(0x0F2A) __sfr REFOCON;
554 typedef union
556 struct
558 unsigned RODIV0 : 1;
559 unsigned RODIV1 : 1;
560 unsigned RODIV2 : 1;
561 unsigned RODIV3 : 1;
562 unsigned ROSEL : 1;
563 unsigned ROSSLP : 1;
564 unsigned : 1;
565 unsigned ROON : 1;
568 struct
570 unsigned RODIV : 4;
571 unsigned : 4;
573 } __REFOCONbits_t;
575 extern __at(0x0F2A) volatile __REFOCONbits_t REFOCONbits;
577 #define _RODIV0 0x01
578 #define _RODIV1 0x02
579 #define _RODIV2 0x04
580 #define _RODIV3 0x08
581 #define _ROSEL 0x10
582 #define _ROSSLP 0x20
583 #define _ROON 0x80
585 //==============================================================================
588 //==============================================================================
589 // CCPTMRS2 Bits
591 extern __at(0x0F2B) __sfr CCPTMRS2;
593 typedef union
595 struct
597 unsigned C8TSEL0 : 1;
598 unsigned C8TSEL1 : 1;
599 unsigned C9TSEL0 : 1;
600 unsigned : 1;
601 unsigned C10TSEL0 : 1;
602 unsigned : 1;
603 unsigned : 1;
604 unsigned : 1;
607 struct
609 unsigned C8TSEL : 2;
610 unsigned : 6;
612 } __CCPTMRS2bits_t;
614 extern __at(0x0F2B) volatile __CCPTMRS2bits_t CCPTMRS2bits;
616 #define _C8TSEL0 0x01
617 #define _C8TSEL1 0x02
618 #define _C9TSEL0 0x04
619 #define _C10TSEL0 0x10
621 //==============================================================================
624 //==============================================================================
625 // CCPTMRS1 Bits
627 extern __at(0x0F2C) __sfr CCPTMRS1;
629 typedef union
631 struct
633 unsigned C4TSEL0 : 1;
634 unsigned C4TSEL1 : 1;
635 unsigned C5TSEL0 : 1;
636 unsigned : 1;
637 unsigned C6TSEL0 : 1;
638 unsigned : 1;
639 unsigned C7TSEL0 : 1;
640 unsigned C7TSEL1 : 1;
643 struct
645 unsigned C4TSEL : 2;
646 unsigned : 6;
649 struct
651 unsigned : 6;
652 unsigned C7TSEL : 2;
654 } __CCPTMRS1bits_t;
656 extern __at(0x0F2C) volatile __CCPTMRS1bits_t CCPTMRS1bits;
658 #define _C4TSEL0 0x01
659 #define _C4TSEL1 0x02
660 #define _C5TSEL0 0x04
661 #define _C6TSEL0 0x10
662 #define _C7TSEL0 0x40
663 #define _C7TSEL1 0x80
665 //==============================================================================
668 //==============================================================================
669 // CCPTMRS0 Bits
671 extern __at(0x0F2D) __sfr CCPTMRS0;
673 typedef union
675 struct
677 unsigned C1TSEL0 : 1;
678 unsigned C1TSEL1 : 1;
679 unsigned C1TSEL2 : 1;
680 unsigned C2TSEL0 : 1;
681 unsigned C2TSEL1 : 1;
682 unsigned C2TSEL2 : 1;
683 unsigned C3TSEL0 : 1;
684 unsigned C3TSEL1 : 1;
687 struct
689 unsigned C1TSEL : 3;
690 unsigned : 5;
693 struct
695 unsigned : 3;
696 unsigned C2TSEL : 3;
697 unsigned : 2;
700 struct
702 unsigned : 6;
703 unsigned C3TSEL : 2;
705 } __CCPTMRS0bits_t;
707 extern __at(0x0F2D) volatile __CCPTMRS0bits_t CCPTMRS0bits;
709 #define _C1TSEL0 0x01
710 #define _C1TSEL1 0x02
711 #define _C1TSEL2 0x04
712 #define _C2TSEL0 0x08
713 #define _C2TSEL1 0x10
714 #define _C2TSEL2 0x20
715 #define _C3TSEL0 0x40
716 #define _C3TSEL1 0x80
718 //==============================================================================
721 //==============================================================================
722 // CM3CON Bits
724 extern __at(0x0F2E) __sfr CM3CON;
726 typedef union
728 struct
730 unsigned CCH0 : 1;
731 unsigned CCH1 : 1;
732 unsigned CREF : 1;
733 unsigned EVPOL0 : 1;
734 unsigned EVPOL1 : 1;
735 unsigned CPOL : 1;
736 unsigned COE : 1;
737 unsigned CON : 1;
740 struct
742 unsigned CCH : 2;
743 unsigned : 6;
746 struct
748 unsigned : 3;
749 unsigned EVPOL : 2;
750 unsigned : 3;
752 } __CM3CONbits_t;
754 extern __at(0x0F2E) volatile __CM3CONbits_t CM3CONbits;
756 #define _CM3CON_CCH0 0x01
757 #define _CM3CON_CCH1 0x02
758 #define _CM3CON_CREF 0x04
759 #define _CM3CON_EVPOL0 0x08
760 #define _CM3CON_EVPOL1 0x10
761 #define _CM3CON_CPOL 0x20
762 #define _CM3CON_COE 0x40
763 #define _CM3CON_CON 0x80
765 //==============================================================================
768 //==============================================================================
769 // CM3CON1 Bits
771 extern __at(0x0F2E) __sfr CM3CON1;
773 typedef union
775 struct
777 unsigned CCH0 : 1;
778 unsigned CCH1 : 1;
779 unsigned CREF : 1;
780 unsigned EVPOL0 : 1;
781 unsigned EVPOL1 : 1;
782 unsigned CPOL : 1;
783 unsigned COE : 1;
784 unsigned CON : 1;
787 struct
789 unsigned CCH : 2;
790 unsigned : 6;
793 struct
795 unsigned : 3;
796 unsigned EVPOL : 2;
797 unsigned : 3;
799 } __CM3CON1bits_t;
801 extern __at(0x0F2E) volatile __CM3CON1bits_t CM3CON1bits;
803 #define _CM3CON1_CCH0 0x01
804 #define _CM3CON1_CCH1 0x02
805 #define _CM3CON1_CREF 0x04
806 #define _CM3CON1_EVPOL0 0x08
807 #define _CM3CON1_EVPOL1 0x10
808 #define _CM3CON1_CPOL 0x20
809 #define _CM3CON1_COE 0x40
810 #define _CM3CON1_CON 0x80
812 //==============================================================================
815 //==============================================================================
816 // CM2CON Bits
818 extern __at(0x0F2F) __sfr CM2CON;
820 typedef union
822 struct
824 unsigned CCH0 : 1;
825 unsigned CCH1 : 1;
826 unsigned CREF : 1;
827 unsigned EVPOL0 : 1;
828 unsigned EVPOL1 : 1;
829 unsigned CPOL : 1;
830 unsigned COE : 1;
831 unsigned CON : 1;
834 struct
836 unsigned CCH : 2;
837 unsigned : 6;
840 struct
842 unsigned : 3;
843 unsigned EVPOL : 2;
844 unsigned : 3;
846 } __CM2CONbits_t;
848 extern __at(0x0F2F) volatile __CM2CONbits_t CM2CONbits;
850 #define _CM2CON_CCH0 0x01
851 #define _CM2CON_CCH1 0x02
852 #define _CM2CON_CREF 0x04
853 #define _CM2CON_EVPOL0 0x08
854 #define _CM2CON_EVPOL1 0x10
855 #define _CM2CON_CPOL 0x20
856 #define _CM2CON_COE 0x40
857 #define _CM2CON_CON 0x80
859 //==============================================================================
862 //==============================================================================
863 // CM2CON1 Bits
865 extern __at(0x0F2F) __sfr CM2CON1;
867 typedef union
869 struct
871 unsigned CCH0 : 1;
872 unsigned CCH1 : 1;
873 unsigned CREF : 1;
874 unsigned EVPOL0 : 1;
875 unsigned EVPOL1 : 1;
876 unsigned CPOL : 1;
877 unsigned COE : 1;
878 unsigned CON : 1;
881 struct
883 unsigned CCH : 2;
884 unsigned : 6;
887 struct
889 unsigned : 3;
890 unsigned EVPOL : 2;
891 unsigned : 3;
893 } __CM2CON1bits_t;
895 extern __at(0x0F2F) volatile __CM2CON1bits_t CM2CON1bits;
897 #define _CM2CON1_CCH0 0x01
898 #define _CM2CON1_CCH1 0x02
899 #define _CM2CON1_CREF 0x04
900 #define _CM2CON1_EVPOL0 0x08
901 #define _CM2CON1_EVPOL1 0x10
902 #define _CM2CON1_CPOL 0x20
903 #define _CM2CON1_COE 0x40
904 #define _CM2CON1_CON 0x80
906 //==============================================================================
909 //==============================================================================
910 // T12CON Bits
912 extern __at(0x0F30) __sfr T12CON;
914 typedef union
916 struct
918 unsigned T12CKPS0 : 1;
919 unsigned T12CKPS1 : 1;
920 unsigned TMR12ON : 1;
921 unsigned T12OUTPS0 : 1;
922 unsigned T12OUTPS1 : 1;
923 unsigned T12OUTPS2 : 1;
924 unsigned T12OUTPS3 : 1;
925 unsigned : 1;
928 struct
930 unsigned T12CKPS : 2;
931 unsigned : 6;
934 struct
936 unsigned : 3;
937 unsigned T12OUTPS : 4;
938 unsigned : 1;
940 } __T12CONbits_t;
942 extern __at(0x0F30) volatile __T12CONbits_t T12CONbits;
944 #define _T12CKPS0 0x01
945 #define _T12CKPS1 0x02
946 #define _TMR12ON 0x04
947 #define _T12OUTPS0 0x08
948 #define _T12OUTPS1 0x10
949 #define _T12OUTPS2 0x20
950 #define _T12OUTPS3 0x40
952 //==============================================================================
954 extern __at(0x0F31) __sfr PR12;
955 extern __at(0x0F32) __sfr TMR12;
957 //==============================================================================
958 // T10CON Bits
960 extern __at(0x0F33) __sfr T10CON;
962 typedef union
964 struct
966 unsigned T10CKPS0 : 1;
967 unsigned T10CKPS1 : 1;
968 unsigned TMR10ON : 1;
969 unsigned T10OUTPS0 : 1;
970 unsigned T10OUTPS1 : 1;
971 unsigned T10OUTPS2 : 1;
972 unsigned T10OUTPS3 : 1;
973 unsigned : 1;
976 struct
978 unsigned T10CKPS : 2;
979 unsigned : 6;
982 struct
984 unsigned : 3;
985 unsigned T10OUTPS : 4;
986 unsigned : 1;
988 } __T10CONbits_t;
990 extern __at(0x0F33) volatile __T10CONbits_t T10CONbits;
992 #define _T10CKPS0 0x01
993 #define _T10CKPS1 0x02
994 #define _TMR10ON 0x04
995 #define _T10OUTPS0 0x08
996 #define _T10OUTPS1 0x10
997 #define _T10OUTPS2 0x20
998 #define _T10OUTPS3 0x40
1000 //==============================================================================
1002 extern __at(0x0F34) __sfr PR10;
1003 extern __at(0x0F35) __sfr TMR10;
1005 //==============================================================================
1006 // T8CON Bits
1008 extern __at(0x0F36) __sfr T8CON;
1010 typedef union
1012 struct
1014 unsigned T8CKPS0 : 1;
1015 unsigned T8CKPS1 : 1;
1016 unsigned TMR8ON : 1;
1017 unsigned T8OUTPS0 : 1;
1018 unsigned T8OUTPS1 : 1;
1019 unsigned T8OUTPS2 : 1;
1020 unsigned T8OUTPS3 : 1;
1021 unsigned : 1;
1024 struct
1026 unsigned T8CKPS : 2;
1027 unsigned : 6;
1030 struct
1032 unsigned : 3;
1033 unsigned T8OUTPS : 4;
1034 unsigned : 1;
1036 } __T8CONbits_t;
1038 extern __at(0x0F36) volatile __T8CONbits_t T8CONbits;
1040 #define _T8CKPS0 0x01
1041 #define _T8CKPS1 0x02
1042 #define _TMR8ON 0x04
1043 #define _T8OUTPS0 0x08
1044 #define _T8OUTPS1 0x10
1045 #define _T8OUTPS2 0x20
1046 #define _T8OUTPS3 0x40
1048 //==============================================================================
1050 extern __at(0x0F37) __sfr PR8;
1051 extern __at(0x0F38) __sfr TMR8;
1053 //==============================================================================
1054 // T6CON Bits
1056 extern __at(0x0F39) __sfr T6CON;
1058 typedef union
1060 struct
1062 unsigned T6CKPS0 : 1;
1063 unsigned T6CKPS1 : 1;
1064 unsigned TMR6ON : 1;
1065 unsigned T6OUTPS0 : 1;
1066 unsigned T6OUTPS1 : 1;
1067 unsigned T6OUTPS2 : 1;
1068 unsigned T6OUTPS3 : 1;
1069 unsigned : 1;
1072 struct
1074 unsigned T6CKPS : 2;
1075 unsigned : 6;
1078 struct
1080 unsigned : 3;
1081 unsigned T6OUTPS : 4;
1082 unsigned : 1;
1084 } __T6CONbits_t;
1086 extern __at(0x0F39) volatile __T6CONbits_t T6CONbits;
1088 #define _T6CKPS0 0x01
1089 #define _T6CKPS1 0x02
1090 #define _TMR6ON 0x04
1091 #define _T6OUTPS0 0x08
1092 #define _T6OUTPS1 0x10
1093 #define _T6OUTPS2 0x20
1094 #define _T6OUTPS3 0x40
1096 //==============================================================================
1098 extern __at(0x0F3A) __sfr PR6;
1099 extern __at(0x0F3B) __sfr TMR6;
1101 //==============================================================================
1102 // T7GCON Bits
1104 extern __at(0x0F3C) __sfr T7GCON;
1106 typedef union
1108 struct
1110 unsigned T7GSS0 : 1;
1111 unsigned T7GSS1 : 1;
1112 unsigned T7GVAL : 1;
1113 unsigned T7GGO_NOT_T7DONE : 1;
1114 unsigned T7GSPM : 1;
1115 unsigned T7GTM : 1;
1116 unsigned T7GPOL : 1;
1117 unsigned TMR7GE : 1;
1120 struct
1122 unsigned : 1;
1123 unsigned : 1;
1124 unsigned : 1;
1125 unsigned T7GGO : 1;
1126 unsigned : 1;
1127 unsigned : 1;
1128 unsigned : 1;
1129 unsigned : 1;
1132 struct
1134 unsigned : 1;
1135 unsigned : 1;
1136 unsigned : 1;
1137 unsigned NOT_T7DONE : 1;
1138 unsigned : 1;
1139 unsigned : 1;
1140 unsigned : 1;
1141 unsigned : 1;
1144 struct
1146 unsigned T7GSS : 2;
1147 unsigned : 6;
1149 } __T7GCONbits_t;
1151 extern __at(0x0F3C) volatile __T7GCONbits_t T7GCONbits;
1153 #define _T7GSS0 0x01
1154 #define _T7GSS1 0x02
1155 #define _T7GVAL 0x04
1156 #define _T7GGO_NOT_T7DONE 0x08
1157 #define _T7GGO 0x08
1158 #define _NOT_T7DONE 0x08
1159 #define _T7GSPM 0x10
1160 #define _T7GTM 0x20
1161 #define _T7GPOL 0x40
1162 #define _TMR7GE 0x80
1164 //==============================================================================
1167 //==============================================================================
1168 // T7CON Bits
1170 extern __at(0x0F3D) __sfr T7CON;
1172 typedef union
1174 struct
1176 unsigned TMR7ON : 1;
1177 unsigned RD16 : 1;
1178 unsigned NOT_T7SYNC : 1;
1179 unsigned SOSCEN : 1;
1180 unsigned T7CKPS0 : 1;
1181 unsigned T7CKPS1 : 1;
1182 unsigned TMR7CS0 : 1;
1183 unsigned TMR7CS1 : 1;
1186 struct
1188 unsigned : 4;
1189 unsigned T7CKPS : 2;
1190 unsigned : 2;
1193 struct
1195 unsigned : 6;
1196 unsigned TMR7CS : 2;
1198 } __T7CONbits_t;
1200 extern __at(0x0F3D) volatile __T7CONbits_t T7CONbits;
1202 #define _T7CON_TMR7ON 0x01
1203 #define _T7CON_RD16 0x02
1204 #define _T7CON_NOT_T7SYNC 0x04
1205 #define _T7CON_SOSCEN 0x08
1206 #define _T7CON_T7CKPS0 0x10
1207 #define _T7CON_T7CKPS1 0x20
1208 #define _T7CON_TMR7CS0 0x40
1209 #define _T7CON_TMR7CS1 0x80
1211 //==============================================================================
1213 extern __at(0x0F3E) __sfr TMR7;
1214 extern __at(0x0F3E) __sfr TMR7L;
1215 extern __at(0x0F3F) __sfr TMR7H;
1217 //==============================================================================
1218 // CCP10CON Bits
1220 extern __at(0x0F40) __sfr CCP10CON;
1222 typedef union
1224 struct
1226 unsigned CCP10M0 : 1;
1227 unsigned CCP10M1 : 1;
1228 unsigned CCP10M2 : 1;
1229 unsigned CCP10M3 : 1;
1230 unsigned DC10B0 : 1;
1231 unsigned DC10B1 : 1;
1232 unsigned : 1;
1233 unsigned : 1;
1236 struct
1238 unsigned : 1;
1239 unsigned : 1;
1240 unsigned : 1;
1241 unsigned : 1;
1242 unsigned CCP10Y : 1;
1243 unsigned CCP10X : 1;
1244 unsigned : 1;
1245 unsigned : 1;
1248 struct
1250 unsigned CCP10M : 4;
1251 unsigned : 4;
1254 struct
1256 unsigned : 4;
1257 unsigned DC10B : 2;
1258 unsigned : 2;
1260 } __CCP10CONbits_t;
1262 extern __at(0x0F40) volatile __CCP10CONbits_t CCP10CONbits;
1264 #define _CCP10M0 0x01
1265 #define _CCP10M1 0x02
1266 #define _CCP10M2 0x04
1267 #define _CCP10M3 0x08
1268 #define _DC10B0 0x10
1269 #define _CCP10Y 0x10
1270 #define _DC10B1 0x20
1271 #define _CCP10X 0x20
1273 //==============================================================================
1275 extern __at(0x0F41) __sfr CCPR10;
1276 extern __at(0x0F41) __sfr CCPR10L;
1277 extern __at(0x0F42) __sfr CCPR10H;
1279 //==============================================================================
1280 // CCP9CON Bits
1282 extern __at(0x0F43) __sfr CCP9CON;
1284 typedef union
1286 struct
1288 unsigned CCP9M0 : 1;
1289 unsigned CCP9M1 : 1;
1290 unsigned CCP9M2 : 1;
1291 unsigned CCP9M3 : 1;
1292 unsigned DC9B0 : 1;
1293 unsigned DC9B1 : 1;
1294 unsigned : 1;
1295 unsigned : 1;
1298 struct
1300 unsigned : 1;
1301 unsigned : 1;
1302 unsigned : 1;
1303 unsigned : 1;
1304 unsigned CCP9Y : 1;
1305 unsigned CCP9X : 1;
1306 unsigned : 1;
1307 unsigned : 1;
1310 struct
1312 unsigned CCP9M : 4;
1313 unsigned : 4;
1316 struct
1318 unsigned : 4;
1319 unsigned DC9B : 2;
1320 unsigned : 2;
1322 } __CCP9CONbits_t;
1324 extern __at(0x0F43) volatile __CCP9CONbits_t CCP9CONbits;
1326 #define _CCP9M0 0x01
1327 #define _CCP9M1 0x02
1328 #define _CCP9M2 0x04
1329 #define _CCP9M3 0x08
1330 #define _DC9B0 0x10
1331 #define _CCP9Y 0x10
1332 #define _DC9B1 0x20
1333 #define _CCP9X 0x20
1335 //==============================================================================
1337 extern __at(0x0F44) __sfr CCPR9;
1338 extern __at(0x0F44) __sfr CCPR9L;
1339 extern __at(0x0F45) __sfr CCPR9H;
1341 //==============================================================================
1342 // CCP8CON Bits
1344 extern __at(0x0F46) __sfr CCP8CON;
1346 typedef union
1348 struct
1350 unsigned CCP8M0 : 1;
1351 unsigned CCP8M1 : 1;
1352 unsigned CCP8M2 : 1;
1353 unsigned CCP8M3 : 1;
1354 unsigned DC8B0 : 1;
1355 unsigned DC8B1 : 1;
1356 unsigned : 1;
1357 unsigned : 1;
1360 struct
1362 unsigned : 1;
1363 unsigned : 1;
1364 unsigned : 1;
1365 unsigned : 1;
1366 unsigned CCP8Y : 1;
1367 unsigned CCP8X : 1;
1368 unsigned : 1;
1369 unsigned : 1;
1372 struct
1374 unsigned CCP8M : 4;
1375 unsigned : 4;
1378 struct
1380 unsigned : 4;
1381 unsigned DC8B : 2;
1382 unsigned : 2;
1384 } __CCP8CONbits_t;
1386 extern __at(0x0F46) volatile __CCP8CONbits_t CCP8CONbits;
1388 #define _CCP8M0 0x01
1389 #define _CCP8M1 0x02
1390 #define _CCP8M2 0x04
1391 #define _CCP8M3 0x08
1392 #define _DC8B0 0x10
1393 #define _CCP8Y 0x10
1394 #define _DC8B1 0x20
1395 #define _CCP8X 0x20
1397 //==============================================================================
1399 extern __at(0x0F47) __sfr CCPR8;
1400 extern __at(0x0F47) __sfr CCPR8L;
1401 extern __at(0x0F48) __sfr CCPR8H;
1403 //==============================================================================
1404 // CCP3CON Bits
1406 extern __at(0x0F49) __sfr CCP3CON;
1408 typedef union
1410 struct
1412 unsigned CCP3M0 : 1;
1413 unsigned CCP3M1 : 1;
1414 unsigned CCP3M2 : 1;
1415 unsigned CCP3M3 : 1;
1416 unsigned DC3B0 : 1;
1417 unsigned DC3B1 : 1;
1418 unsigned P3M0 : 1;
1419 unsigned P3M1 : 1;
1422 struct
1424 unsigned CCP3M : 4;
1425 unsigned : 4;
1428 struct
1430 unsigned : 4;
1431 unsigned DC3B : 2;
1432 unsigned : 2;
1435 struct
1437 unsigned : 6;
1438 unsigned P3M : 2;
1440 } __CCP3CONbits_t;
1442 extern __at(0x0F49) volatile __CCP3CONbits_t CCP3CONbits;
1444 #define _CCP3M0 0x01
1445 #define _CCP3M1 0x02
1446 #define _CCP3M2 0x04
1447 #define _CCP3M3 0x08
1448 #define _DC3B0 0x10
1449 #define _DC3B1 0x20
1450 #define _P3M0 0x40
1451 #define _P3M1 0x80
1453 //==============================================================================
1455 extern __at(0x0F4A) __sfr CCPR3;
1456 extern __at(0x0F4A) __sfr CCPR3L;
1457 extern __at(0x0F4B) __sfr CCPR3H;
1459 //==============================================================================
1460 // ECCP3DEL Bits
1462 extern __at(0x0F4C) __sfr ECCP3DEL;
1464 typedef union
1466 struct
1468 unsigned P3DC0 : 1;
1469 unsigned P3DC1 : 1;
1470 unsigned P3DC2 : 1;
1471 unsigned P3DC3 : 1;
1472 unsigned P3DC4 : 1;
1473 unsigned P3DC5 : 1;
1474 unsigned P3DC6 : 1;
1475 unsigned P3RSEN : 1;
1478 struct
1480 unsigned P3DC : 7;
1481 unsigned : 1;
1483 } __ECCP3DELbits_t;
1485 extern __at(0x0F4C) volatile __ECCP3DELbits_t ECCP3DELbits;
1487 #define _P3DC0 0x01
1488 #define _P3DC1 0x02
1489 #define _P3DC2 0x04
1490 #define _P3DC3 0x08
1491 #define _P3DC4 0x10
1492 #define _P3DC5 0x20
1493 #define _P3DC6 0x40
1494 #define _P3RSEN 0x80
1496 //==============================================================================
1499 //==============================================================================
1500 // ECCP3AS Bits
1502 extern __at(0x0F4D) __sfr ECCP3AS;
1504 typedef union
1506 struct
1508 unsigned PSS3BD0 : 1;
1509 unsigned PSS3BD1 : 1;
1510 unsigned PSS3AC0 : 1;
1511 unsigned PSS3AC1 : 1;
1512 unsigned ECCP3AS0 : 1;
1513 unsigned ECCP3AS1 : 1;
1514 unsigned ECCP3AS2 : 1;
1515 unsigned ECCP3ASE : 1;
1518 struct
1520 unsigned PSS3BD : 2;
1521 unsigned : 6;
1524 struct
1526 unsigned : 2;
1527 unsigned PSS3AC : 2;
1528 unsigned : 4;
1531 struct
1533 unsigned : 4;
1534 unsigned ECCP3AS : 3;
1535 unsigned : 1;
1537 } __ECCP3ASbits_t;
1539 extern __at(0x0F4D) volatile __ECCP3ASbits_t ECCP3ASbits;
1541 #define _PSS3BD0 0x01
1542 #define _PSS3BD1 0x02
1543 #define _PSS3AC0 0x04
1544 #define _PSS3AC1 0x08
1545 #define _ECCP3AS0 0x10
1546 #define _ECCP3AS1 0x20
1547 #define _ECCP3AS2 0x40
1548 #define _ECCP3ASE 0x80
1550 //==============================================================================
1553 //==============================================================================
1554 // CCP2CON Bits
1556 extern __at(0x0F4E) __sfr CCP2CON;
1558 typedef union
1560 struct
1562 unsigned CCP2M0 : 1;
1563 unsigned CCP2M1 : 1;
1564 unsigned CCP2M2 : 1;
1565 unsigned CCP2M3 : 1;
1566 unsigned DC2B0 : 1;
1567 unsigned DC2B1 : 1;
1568 unsigned P2M0 : 1;
1569 unsigned P2M1 : 1;
1572 struct
1574 unsigned : 1;
1575 unsigned : 1;
1576 unsigned : 1;
1577 unsigned : 1;
1578 unsigned CCP2Y : 1;
1579 unsigned CCP2X : 1;
1580 unsigned : 1;
1581 unsigned : 1;
1584 struct
1586 unsigned CCP2M : 4;
1587 unsigned : 4;
1590 struct
1592 unsigned : 4;
1593 unsigned DC2B : 2;
1594 unsigned : 2;
1597 struct
1599 unsigned : 6;
1600 unsigned P2M : 2;
1602 } __CCP2CONbits_t;
1604 extern __at(0x0F4E) volatile __CCP2CONbits_t CCP2CONbits;
1606 #define _CCP2M0 0x01
1607 #define _CCP2M1 0x02
1608 #define _CCP2M2 0x04
1609 #define _CCP2M3 0x08
1610 #define _DC2B0 0x10
1611 #define _CCP2Y 0x10
1612 #define _DC2B1 0x20
1613 #define _CCP2X 0x20
1614 #define _P2M0 0x40
1615 #define _P2M1 0x80
1617 //==============================================================================
1620 //==============================================================================
1621 // ECCP2CON Bits
1623 extern __at(0x0F4E) __sfr ECCP2CON;
1625 typedef union
1627 struct
1629 unsigned CCP2M0 : 1;
1630 unsigned CCP2M1 : 1;
1631 unsigned CCP2M2 : 1;
1632 unsigned CCP2M3 : 1;
1633 unsigned DC2B0 : 1;
1634 unsigned DC2B1 : 1;
1635 unsigned P2M0 : 1;
1636 unsigned P2M1 : 1;
1639 struct
1641 unsigned : 1;
1642 unsigned : 1;
1643 unsigned : 1;
1644 unsigned : 1;
1645 unsigned CCP2Y : 1;
1646 unsigned CCP2X : 1;
1647 unsigned : 1;
1648 unsigned : 1;
1651 struct
1653 unsigned CCP2M : 4;
1654 unsigned : 4;
1657 struct
1659 unsigned : 4;
1660 unsigned DC2B : 2;
1661 unsigned : 2;
1664 struct
1666 unsigned : 6;
1667 unsigned P2M : 2;
1669 } __ECCP2CONbits_t;
1671 extern __at(0x0F4E) volatile __ECCP2CONbits_t ECCP2CONbits;
1673 #define _ECCP2CON_CCP2M0 0x01
1674 #define _ECCP2CON_CCP2M1 0x02
1675 #define _ECCP2CON_CCP2M2 0x04
1676 #define _ECCP2CON_CCP2M3 0x08
1677 #define _ECCP2CON_DC2B0 0x10
1678 #define _ECCP2CON_CCP2Y 0x10
1679 #define _ECCP2CON_DC2B1 0x20
1680 #define _ECCP2CON_CCP2X 0x20
1681 #define _ECCP2CON_P2M0 0x40
1682 #define _ECCP2CON_P2M1 0x80
1684 //==============================================================================
1686 extern __at(0x0F4F) __sfr CCPR2;
1687 extern __at(0x0F4F) __sfr CCPR2L;
1688 extern __at(0x0F50) __sfr CCPR2H;
1690 //==============================================================================
1691 // ECCP2DEL Bits
1693 extern __at(0x0F51) __sfr ECCP2DEL;
1695 typedef union
1697 struct
1699 unsigned P2DC0 : 1;
1700 unsigned P2DC1 : 1;
1701 unsigned P2DC2 : 1;
1702 unsigned P2DC3 : 1;
1703 unsigned P2DC4 : 1;
1704 unsigned P2DC5 : 1;
1705 unsigned P2DC6 : 1;
1706 unsigned P2RSEN : 1;
1709 struct
1711 unsigned P2DC : 7;
1712 unsigned : 1;
1714 } __ECCP2DELbits_t;
1716 extern __at(0x0F51) volatile __ECCP2DELbits_t ECCP2DELbits;
1718 #define _P2DC0 0x01
1719 #define _P2DC1 0x02
1720 #define _P2DC2 0x04
1721 #define _P2DC3 0x08
1722 #define _P2DC4 0x10
1723 #define _P2DC5 0x20
1724 #define _P2DC6 0x40
1725 #define _P2RSEN 0x80
1727 //==============================================================================
1730 //==============================================================================
1731 // PWM2CON Bits
1733 extern __at(0x0F51) __sfr PWM2CON;
1735 typedef union
1737 struct
1739 unsigned P2DC0 : 1;
1740 unsigned P2DC1 : 1;
1741 unsigned P2DC2 : 1;
1742 unsigned P2DC3 : 1;
1743 unsigned P2DC4 : 1;
1744 unsigned P2DC5 : 1;
1745 unsigned P2DC6 : 1;
1746 unsigned P2RSEN : 1;
1749 struct
1751 unsigned P2DC : 7;
1752 unsigned : 1;
1754 } __PWM2CONbits_t;
1756 extern __at(0x0F51) volatile __PWM2CONbits_t PWM2CONbits;
1758 #define _PWM2CON_P2DC0 0x01
1759 #define _PWM2CON_P2DC1 0x02
1760 #define _PWM2CON_P2DC2 0x04
1761 #define _PWM2CON_P2DC3 0x08
1762 #define _PWM2CON_P2DC4 0x10
1763 #define _PWM2CON_P2DC5 0x20
1764 #define _PWM2CON_P2DC6 0x40
1765 #define _PWM2CON_P2RSEN 0x80
1767 //==============================================================================
1770 //==============================================================================
1771 // ECCP2AS Bits
1773 extern __at(0x0F52) __sfr ECCP2AS;
1775 typedef union
1777 struct
1779 unsigned PSS2BD0 : 1;
1780 unsigned PSS2BD1 : 1;
1781 unsigned PSS2AC0 : 1;
1782 unsigned PSS2AC1 : 1;
1783 unsigned ECCP2AS0 : 1;
1784 unsigned ECCP2AS1 : 1;
1785 unsigned ECCP2AS2 : 1;
1786 unsigned ECCP2ASE : 1;
1789 struct
1791 unsigned PSS2BD : 2;
1792 unsigned : 6;
1795 struct
1797 unsigned : 2;
1798 unsigned PSS2AC : 2;
1799 unsigned : 4;
1802 struct
1804 unsigned : 4;
1805 unsigned ECCP2AS : 3;
1806 unsigned : 1;
1808 } __ECCP2ASbits_t;
1810 extern __at(0x0F52) volatile __ECCP2ASbits_t ECCP2ASbits;
1812 #define _PSS2BD0 0x01
1813 #define _PSS2BD1 0x02
1814 #define _PSS2AC0 0x04
1815 #define _PSS2AC1 0x08
1816 #define _ECCP2AS0 0x10
1817 #define _ECCP2AS1 0x20
1818 #define _ECCP2AS2 0x40
1819 #define _ECCP2ASE 0x80
1821 //==============================================================================
1824 //==============================================================================
1825 // PADCFG1 Bits
1827 extern __at(0x0F53) __sfr PADCFG1;
1829 typedef union
1831 struct
1833 unsigned : 1;
1834 unsigned RTSECSEL0 : 1;
1835 unsigned RTSECSEL1 : 1;
1836 unsigned : 1;
1837 unsigned : 1;
1838 unsigned : 1;
1839 unsigned REPU : 1;
1840 unsigned RDPU : 1;
1843 struct
1845 unsigned : 1;
1846 unsigned RTSECSEL : 2;
1847 unsigned : 5;
1849 } __PADCFG1bits_t;
1851 extern __at(0x0F53) volatile __PADCFG1bits_t PADCFG1bits;
1853 #define _RTSECSEL0 0x02
1854 #define _RTSECSEL1 0x04
1855 #define _REPU 0x40
1856 #define _RDPU 0x80
1858 //==============================================================================
1861 //==============================================================================
1862 // CM1CON Bits
1864 extern __at(0x0F54) __sfr CM1CON;
1866 typedef union
1868 struct
1870 unsigned CCH0 : 1;
1871 unsigned CCH1 : 1;
1872 unsigned CREF : 1;
1873 unsigned EVPOL0 : 1;
1874 unsigned EVPOL1 : 1;
1875 unsigned CPOL : 1;
1876 unsigned COE : 1;
1877 unsigned CON : 1;
1880 struct
1882 unsigned CCH : 2;
1883 unsigned : 6;
1886 struct
1888 unsigned : 3;
1889 unsigned EVPOL : 2;
1890 unsigned : 3;
1892 } __CM1CONbits_t;
1894 extern __at(0x0F54) volatile __CM1CONbits_t CM1CONbits;
1896 #define _CCH0 0x01
1897 #define _CCH1 0x02
1898 #define _CREF 0x04
1899 #define _EVPOL0 0x08
1900 #define _EVPOL1 0x10
1901 #define _CPOL 0x20
1902 #define _COE 0x40
1903 #define _CON 0x80
1905 //==============================================================================
1908 //==============================================================================
1909 // CM1CON1 Bits
1911 extern __at(0x0F54) __sfr CM1CON1;
1913 typedef union
1915 struct
1917 unsigned CCH0 : 1;
1918 unsigned CCH1 : 1;
1919 unsigned CREF : 1;
1920 unsigned EVPOL0 : 1;
1921 unsigned EVPOL1 : 1;
1922 unsigned CPOL : 1;
1923 unsigned COE : 1;
1924 unsigned CON : 1;
1927 struct
1929 unsigned CCH : 2;
1930 unsigned : 6;
1933 struct
1935 unsigned : 3;
1936 unsigned EVPOL : 2;
1937 unsigned : 3;
1939 } __CM1CON1bits_t;
1941 extern __at(0x0F54) volatile __CM1CON1bits_t CM1CON1bits;
1943 #define _CM1CON1_CCH0 0x01
1944 #define _CM1CON1_CCH1 0x02
1945 #define _CM1CON1_CREF 0x04
1946 #define _CM1CON1_EVPOL0 0x08
1947 #define _CM1CON1_EVPOL1 0x10
1948 #define _CM1CON1_CPOL 0x20
1949 #define _CM1CON1_COE 0x40
1950 #define _CM1CON1_CON 0x80
1952 //==============================================================================
1955 //==============================================================================
1956 // CTMUICON Bits
1958 extern __at(0x0F55) __sfr CTMUICON;
1960 typedef union
1962 struct
1964 unsigned IRNG0 : 1;
1965 unsigned IRNG1 : 1;
1966 unsigned ITRIM0 : 1;
1967 unsigned ITRIM1 : 1;
1968 unsigned ITRIM2 : 1;
1969 unsigned ITRIM3 : 1;
1970 unsigned ITRIM4 : 1;
1971 unsigned ITRIM5 : 1;
1974 struct
1976 unsigned IRNG : 2;
1977 unsigned : 6;
1980 struct
1982 unsigned : 2;
1983 unsigned ITRIM : 6;
1985 } __CTMUICONbits_t;
1987 extern __at(0x0F55) volatile __CTMUICONbits_t CTMUICONbits;
1989 #define _IRNG0 0x01
1990 #define _IRNG1 0x02
1991 #define _ITRIM0 0x04
1992 #define _ITRIM1 0x08
1993 #define _ITRIM2 0x10
1994 #define _ITRIM3 0x20
1995 #define _ITRIM4 0x40
1996 #define _ITRIM5 0x80
1998 //==============================================================================
2001 //==============================================================================
2002 // CTMUCONL Bits
2004 extern __at(0x0F56) __sfr CTMUCONL;
2006 typedef union
2008 struct
2010 unsigned EDG1STAT : 1;
2011 unsigned EDG2STAT : 1;
2012 unsigned EDG1SEL0 : 1;
2013 unsigned EDG1SEL1 : 1;
2014 unsigned EDG1POL : 1;
2015 unsigned EDG2SEL0 : 1;
2016 unsigned EDG2SEL1 : 1;
2017 unsigned EDG2POL : 1;
2020 struct
2022 unsigned : 2;
2023 unsigned EDG1SEL : 2;
2024 unsigned : 4;
2027 struct
2029 unsigned : 5;
2030 unsigned EDG2SEL : 2;
2031 unsigned : 1;
2033 } __CTMUCONLbits_t;
2035 extern __at(0x0F56) volatile __CTMUCONLbits_t CTMUCONLbits;
2037 #define _EDG1STAT 0x01
2038 #define _EDG2STAT 0x02
2039 #define _EDG1SEL0 0x04
2040 #define _EDG1SEL1 0x08
2041 #define _EDG1POL 0x10
2042 #define _EDG2SEL0 0x20
2043 #define _EDG2SEL1 0x40
2044 #define _EDG2POL 0x80
2046 //==============================================================================
2049 //==============================================================================
2050 // CTMUCONH Bits
2052 extern __at(0x0F57) __sfr CTMUCONH;
2054 typedef struct
2056 unsigned CTTRIG : 1;
2057 unsigned IDISSEN : 1;
2058 unsigned EDGSEQEN : 1;
2059 unsigned EDGEN : 1;
2060 unsigned TGEN : 1;
2061 unsigned CTMUSIDL : 1;
2062 unsigned : 1;
2063 unsigned CTMUEN : 1;
2064 } __CTMUCONHbits_t;
2066 extern __at(0x0F57) volatile __CTMUCONHbits_t CTMUCONHbits;
2068 #define _CTTRIG 0x01
2069 #define _IDISSEN 0x02
2070 #define _EDGSEQEN 0x04
2071 #define _EDGEN 0x08
2072 #define _TGEN 0x10
2073 #define _CTMUSIDL 0x20
2074 #define _CTMUEN 0x80
2076 //==============================================================================
2078 extern __at(0x0F58) __sfr ALRMVAL;
2079 extern __at(0x0F58) __sfr ALRMVALL;
2080 extern __at(0x0F59) __sfr ALRMVALH;
2082 //==============================================================================
2083 // ALRMRPT Bits
2085 extern __at(0x0F5A) __sfr ALRMRPT;
2087 typedef struct
2089 unsigned ARPT0 : 1;
2090 unsigned ARPT1 : 1;
2091 unsigned ARPT2 : 1;
2092 unsigned ARPT3 : 1;
2093 unsigned ARPT4 : 1;
2094 unsigned ARPT5 : 1;
2095 unsigned ARPT6 : 1;
2096 unsigned ARPT7 : 1;
2097 } __ALRMRPTbits_t;
2099 extern __at(0x0F5A) volatile __ALRMRPTbits_t ALRMRPTbits;
2101 #define _ARPT0 0x01
2102 #define _ARPT1 0x02
2103 #define _ARPT2 0x04
2104 #define _ARPT3 0x08
2105 #define _ARPT4 0x10
2106 #define _ARPT5 0x20
2107 #define _ARPT6 0x40
2108 #define _ARPT7 0x80
2110 //==============================================================================
2113 //==============================================================================
2114 // ALRMCFG Bits
2116 extern __at(0x0F5B) __sfr ALRMCFG;
2118 typedef union
2120 struct
2122 unsigned ALRMPTR0 : 1;
2123 unsigned ALRMPTR1 : 1;
2124 unsigned AMASK0 : 1;
2125 unsigned AMASK1 : 1;
2126 unsigned AMASK2 : 1;
2127 unsigned AMASK3 : 1;
2128 unsigned CHIME : 1;
2129 unsigned ALRMEN : 1;
2132 struct
2134 unsigned ALRMPTR : 2;
2135 unsigned : 6;
2138 struct
2140 unsigned : 2;
2141 unsigned AMASK : 4;
2142 unsigned : 2;
2144 } __ALRMCFGbits_t;
2146 extern __at(0x0F5B) volatile __ALRMCFGbits_t ALRMCFGbits;
2148 #define _ALRMPTR0 0x01
2149 #define _ALRMPTR1 0x02
2150 #define _AMASK0 0x04
2151 #define _AMASK1 0x08
2152 #define _AMASK2 0x10
2153 #define _AMASK3 0x20
2154 #define _CHIME 0x40
2155 #define _ALRMEN 0x80
2157 //==============================================================================
2159 extern __at(0x0F5C) __sfr RTCVAL;
2160 extern __at(0x0F5C) __sfr RTCVALL;
2161 extern __at(0x0F5D) __sfr RTCVALH;
2163 //==============================================================================
2164 // RTCCAL Bits
2166 extern __at(0x0F5E) __sfr RTCCAL;
2168 typedef struct
2170 unsigned CAL0 : 1;
2171 unsigned CAL1 : 1;
2172 unsigned CAL2 : 1;
2173 unsigned CAL3 : 1;
2174 unsigned CAL4 : 1;
2175 unsigned CAL5 : 1;
2176 unsigned CAL6 : 1;
2177 unsigned CAL7 : 1;
2178 } __RTCCALbits_t;
2180 extern __at(0x0F5E) volatile __RTCCALbits_t RTCCALbits;
2182 #define _CAL0 0x01
2183 #define _CAL1 0x02
2184 #define _CAL2 0x04
2185 #define _CAL3 0x08
2186 #define _CAL4 0x10
2187 #define _CAL5 0x20
2188 #define _CAL6 0x40
2189 #define _CAL7 0x80
2191 //==============================================================================
2194 //==============================================================================
2195 // RTCCFG Bits
2197 extern __at(0x0F5F) __sfr RTCCFG;
2199 typedef union
2201 struct
2203 unsigned RTCPTR0 : 1;
2204 unsigned RTCPTR1 : 1;
2205 unsigned RTCOE : 1;
2206 unsigned HALFSEC : 1;
2207 unsigned RTCSYNC : 1;
2208 unsigned RTCWREN : 1;
2209 unsigned : 1;
2210 unsigned RTCEN : 1;
2213 struct
2215 unsigned RTCPTR : 2;
2216 unsigned : 6;
2218 } __RTCCFGbits_t;
2220 extern __at(0x0F5F) volatile __RTCCFGbits_t RTCCFGbits;
2222 #define _RTCPTR0 0x01
2223 #define _RTCPTR1 0x02
2224 #define _RTCOE 0x04
2225 #define _HALFSEC 0x08
2226 #define _RTCSYNC 0x10
2227 #define _RTCWREN 0x20
2228 #define _RTCEN 0x80
2230 //==============================================================================
2233 //==============================================================================
2234 // PIE6 Bits
2236 extern __at(0x0F60) __sfr PIE6;
2238 typedef struct
2240 unsigned CMP1IE : 1;
2241 unsigned CMP2IE : 1;
2242 unsigned CMP3IE : 1;
2243 unsigned : 1;
2244 unsigned EEIE : 1;
2245 unsigned : 1;
2246 unsigned : 1;
2247 unsigned : 1;
2248 } __PIE6bits_t;
2250 extern __at(0x0F60) volatile __PIE6bits_t PIE6bits;
2252 #define _CMP1IE 0x01
2253 #define _CMP2IE 0x02
2254 #define _CMP3IE 0x04
2255 #define _EEIE 0x10
2257 //==============================================================================
2259 extern __at(0x0F61) __sfr EEDATA;
2260 extern __at(0x0F62) __sfr EEADR;
2261 extern __at(0x0F63) __sfr EEADRH;
2263 //==============================================================================
2264 // OSCCON2 Bits
2266 extern __at(0x0F64) __sfr OSCCON2;
2268 typedef struct
2270 unsigned MFIOSEL : 1;
2271 unsigned MFIOFS : 1;
2272 unsigned : 1;
2273 unsigned SOSCGO : 1;
2274 unsigned : 1;
2275 unsigned : 1;
2276 unsigned SOSCRUN : 1;
2277 unsigned : 1;
2278 } __OSCCON2bits_t;
2280 extern __at(0x0F64) volatile __OSCCON2bits_t OSCCON2bits;
2282 #define _MFIOSEL 0x01
2283 #define _MFIOFS 0x02
2284 #define _SOSCGO 0x08
2285 #define _SOSCRUN 0x40
2287 //==============================================================================
2290 //==============================================================================
2291 // BAUDCON Bits
2293 extern __at(0x0F65) __sfr BAUDCON;
2295 typedef union
2297 struct
2299 unsigned ABDEN : 1;
2300 unsigned WUE : 1;
2301 unsigned : 1;
2302 unsigned BRG16 : 1;
2303 unsigned TXCKP : 1;
2304 unsigned RXDTP : 1;
2305 unsigned RCIDL : 1;
2306 unsigned ABDOVF : 1;
2309 struct
2311 unsigned : 1;
2312 unsigned : 1;
2313 unsigned : 1;
2314 unsigned : 1;
2315 unsigned : 1;
2316 unsigned : 1;
2317 unsigned RCMT : 1;
2318 unsigned : 1;
2320 } __BAUDCONbits_t;
2322 extern __at(0x0F65) volatile __BAUDCONbits_t BAUDCONbits;
2324 #define _ABDEN 0x01
2325 #define _WUE 0x02
2326 #define _BRG16 0x08
2327 #define _TXCKP 0x10
2328 #define _RXDTP 0x20
2329 #define _RCIDL 0x40
2330 #define _RCMT 0x40
2331 #define _ABDOVF 0x80
2333 //==============================================================================
2336 //==============================================================================
2337 // BAUDCON1 Bits
2339 extern __at(0x0F65) __sfr BAUDCON1;
2341 typedef union
2343 struct
2345 unsigned ABDEN : 1;
2346 unsigned WUE : 1;
2347 unsigned : 1;
2348 unsigned BRG16 : 1;
2349 unsigned TXCKP : 1;
2350 unsigned RXDTP : 1;
2351 unsigned RCIDL : 1;
2352 unsigned ABDOVF : 1;
2355 struct
2357 unsigned : 1;
2358 unsigned : 1;
2359 unsigned : 1;
2360 unsigned : 1;
2361 unsigned : 1;
2362 unsigned : 1;
2363 unsigned RCMT : 1;
2364 unsigned : 1;
2366 } __BAUDCON1bits_t;
2368 extern __at(0x0F65) volatile __BAUDCON1bits_t BAUDCON1bits;
2370 #define _BAUDCON1_ABDEN 0x01
2371 #define _BAUDCON1_WUE 0x02
2372 #define _BAUDCON1_BRG16 0x08
2373 #define _BAUDCON1_TXCKP 0x10
2374 #define _BAUDCON1_RXDTP 0x20
2375 #define _BAUDCON1_RCIDL 0x40
2376 #define _BAUDCON1_RCMT 0x40
2377 #define _BAUDCON1_ABDOVF 0x80
2379 //==============================================================================
2382 //==============================================================================
2383 // BAUDCTL Bits
2385 extern __at(0x0F65) __sfr BAUDCTL;
2387 typedef union
2389 struct
2391 unsigned ABDEN : 1;
2392 unsigned WUE : 1;
2393 unsigned : 1;
2394 unsigned BRG16 : 1;
2395 unsigned TXCKP : 1;
2396 unsigned RXDTP : 1;
2397 unsigned RCIDL : 1;
2398 unsigned ABDOVF : 1;
2401 struct
2403 unsigned : 1;
2404 unsigned : 1;
2405 unsigned : 1;
2406 unsigned : 1;
2407 unsigned : 1;
2408 unsigned : 1;
2409 unsigned RCMT : 1;
2410 unsigned : 1;
2412 } __BAUDCTLbits_t;
2414 extern __at(0x0F65) volatile __BAUDCTLbits_t BAUDCTLbits;
2416 #define _BAUDCTL_ABDEN 0x01
2417 #define _BAUDCTL_WUE 0x02
2418 #define _BAUDCTL_BRG16 0x08
2419 #define _BAUDCTL_TXCKP 0x10
2420 #define _BAUDCTL_RXDTP 0x20
2421 #define _BAUDCTL_RCIDL 0x40
2422 #define _BAUDCTL_RCMT 0x40
2423 #define _BAUDCTL_ABDOVF 0x80
2425 //==============================================================================
2428 //==============================================================================
2429 // SSP2CON2 Bits
2431 extern __at(0x0F66) __sfr SSP2CON2;
2433 typedef union
2435 struct
2437 unsigned SEN : 1;
2438 unsigned RSEN : 1;
2439 unsigned PEN : 1;
2440 unsigned RCEN : 1;
2441 unsigned ACKEN : 1;
2442 unsigned ACKDT : 1;
2443 unsigned ACKSTAT : 1;
2444 unsigned GCEN : 1;
2447 struct
2449 unsigned : 1;
2450 unsigned ADMSK1 : 1;
2451 unsigned ADMSK2 : 1;
2452 unsigned ADMSK3 : 1;
2453 unsigned ADMSK4 : 1;
2454 unsigned ADMSK5 : 1;
2455 unsigned : 1;
2456 unsigned : 1;
2458 } __SSP2CON2bits_t;
2460 extern __at(0x0F66) volatile __SSP2CON2bits_t SSP2CON2bits;
2462 #define _SSP2CON2_SEN 0x01
2463 #define _SSP2CON2_RSEN 0x02
2464 #define _SSP2CON2_ADMSK1 0x02
2465 #define _SSP2CON2_PEN 0x04
2466 #define _SSP2CON2_ADMSK2 0x04
2467 #define _SSP2CON2_RCEN 0x08
2468 #define _SSP2CON2_ADMSK3 0x08
2469 #define _SSP2CON2_ACKEN 0x10
2470 #define _SSP2CON2_ADMSK4 0x10
2471 #define _SSP2CON2_ACKDT 0x20
2472 #define _SSP2CON2_ADMSK5 0x20
2473 #define _SSP2CON2_ACKSTAT 0x40
2474 #define _SSP2CON2_GCEN 0x80
2476 //==============================================================================
2479 //==============================================================================
2480 // SSP2CON1 Bits
2482 extern __at(0x0F67) __sfr SSP2CON1;
2484 typedef union
2486 struct
2488 unsigned SSPM0 : 1;
2489 unsigned SSPM1 : 1;
2490 unsigned SSPM2 : 1;
2491 unsigned SSPM3 : 1;
2492 unsigned CKP : 1;
2493 unsigned SSPEN : 1;
2494 unsigned SSPOV : 1;
2495 unsigned WCOL : 1;
2498 struct
2500 unsigned SSPM : 4;
2501 unsigned : 4;
2503 } __SSP2CON1bits_t;
2505 extern __at(0x0F67) volatile __SSP2CON1bits_t SSP2CON1bits;
2507 #define _SSP2CON1_SSPM0 0x01
2508 #define _SSP2CON1_SSPM1 0x02
2509 #define _SSP2CON1_SSPM2 0x04
2510 #define _SSP2CON1_SSPM3 0x08
2511 #define _SSP2CON1_CKP 0x10
2512 #define _SSP2CON1_SSPEN 0x20
2513 #define _SSP2CON1_SSPOV 0x40
2514 #define _SSP2CON1_WCOL 0x80
2516 //==============================================================================
2519 //==============================================================================
2520 // SSP2STAT Bits
2522 extern __at(0x0F68) __sfr SSP2STAT;
2524 typedef union
2526 struct
2528 unsigned BF : 1;
2529 unsigned UA : 1;
2530 unsigned R_NOT_W : 1;
2531 unsigned S : 1;
2532 unsigned P : 1;
2533 unsigned D_NOT_A : 1;
2534 unsigned CKE : 1;
2535 unsigned SMP : 1;
2538 struct
2540 unsigned : 1;
2541 unsigned : 1;
2542 unsigned R : 1;
2543 unsigned I2C_START : 1;
2544 unsigned I2C_STOP : 1;
2545 unsigned D : 1;
2546 unsigned : 1;
2547 unsigned : 1;
2550 struct
2552 unsigned : 1;
2553 unsigned : 1;
2554 unsigned R_W : 1;
2555 unsigned : 1;
2556 unsigned : 1;
2557 unsigned D_A : 1;
2558 unsigned : 1;
2559 unsigned : 1;
2562 struct
2564 unsigned : 1;
2565 unsigned : 1;
2566 unsigned NOT_W : 1;
2567 unsigned : 1;
2568 unsigned : 1;
2569 unsigned NOT_A : 1;
2570 unsigned : 1;
2571 unsigned : 1;
2574 struct
2576 unsigned : 1;
2577 unsigned : 1;
2578 unsigned NOT_WRITE : 1;
2579 unsigned : 1;
2580 unsigned : 1;
2581 unsigned NOT_ADDRESS : 1;
2582 unsigned : 1;
2583 unsigned : 1;
2586 struct
2588 unsigned : 1;
2589 unsigned : 1;
2590 unsigned READ_WRITE : 1;
2591 unsigned : 1;
2592 unsigned : 1;
2593 unsigned DATA_ADDRESS : 1;
2594 unsigned : 1;
2595 unsigned : 1;
2598 struct
2600 unsigned : 1;
2601 unsigned : 1;
2602 unsigned I2C_READ : 1;
2603 unsigned : 1;
2604 unsigned : 1;
2605 unsigned I2C_DAT : 1;
2606 unsigned : 1;
2607 unsigned : 1;
2609 } __SSP2STATbits_t;
2611 extern __at(0x0F68) volatile __SSP2STATbits_t SSP2STATbits;
2613 #define _SSP2STAT_BF 0x01
2614 #define _SSP2STAT_UA 0x02
2615 #define _SSP2STAT_R_NOT_W 0x04
2616 #define _SSP2STAT_R 0x04
2617 #define _SSP2STAT_R_W 0x04
2618 #define _SSP2STAT_NOT_W 0x04
2619 #define _SSP2STAT_NOT_WRITE 0x04
2620 #define _SSP2STAT_READ_WRITE 0x04
2621 #define _SSP2STAT_I2C_READ 0x04
2622 #define _SSP2STAT_S 0x08
2623 #define _SSP2STAT_I2C_START 0x08
2624 #define _SSP2STAT_P 0x10
2625 #define _SSP2STAT_I2C_STOP 0x10
2626 #define _SSP2STAT_D_NOT_A 0x20
2627 #define _SSP2STAT_D 0x20
2628 #define _SSP2STAT_D_A 0x20
2629 #define _SSP2STAT_NOT_A 0x20
2630 #define _SSP2STAT_NOT_ADDRESS 0x20
2631 #define _SSP2STAT_DATA_ADDRESS 0x20
2632 #define _SSP2STAT_I2C_DAT 0x20
2633 #define _SSP2STAT_CKE 0x40
2634 #define _SSP2STAT_SMP 0x80
2636 //==============================================================================
2638 extern __at(0x0F69) __sfr SSP2ADD;
2640 //==============================================================================
2641 // SSP2MSK Bits
2643 extern __at(0x0F69) __sfr SSP2MSK;
2645 typedef struct
2647 unsigned MSK0 : 1;
2648 unsigned MSK1 : 1;
2649 unsigned MSK2 : 1;
2650 unsigned MSK3 : 1;
2651 unsigned MSK4 : 1;
2652 unsigned MSK5 : 1;
2653 unsigned MSK6 : 1;
2654 unsigned MSK7 : 1;
2655 } __SSP2MSKbits_t;
2657 extern __at(0x0F69) volatile __SSP2MSKbits_t SSP2MSKbits;
2659 #define _SSP2MSK_MSK0 0x01
2660 #define _SSP2MSK_MSK1 0x02
2661 #define _SSP2MSK_MSK2 0x04
2662 #define _SSP2MSK_MSK3 0x08
2663 #define _SSP2MSK_MSK4 0x10
2664 #define _SSP2MSK_MSK5 0x20
2665 #define _SSP2MSK_MSK6 0x40
2666 #define _SSP2MSK_MSK7 0x80
2668 //==============================================================================
2670 extern __at(0x0F6A) __sfr SSP2BUF;
2672 //==============================================================================
2673 // T4CON Bits
2675 extern __at(0x0F6B) __sfr T4CON;
2677 typedef union
2679 struct
2681 unsigned T4CKPS0 : 1;
2682 unsigned T4CKPS1 : 1;
2683 unsigned TMR4ON : 1;
2684 unsigned T4OUTPS0 : 1;
2685 unsigned T4OUTPS1 : 1;
2686 unsigned T4OUTPS2 : 1;
2687 unsigned T4OUTPS3 : 1;
2688 unsigned : 1;
2691 struct
2693 unsigned T4CKPS : 2;
2694 unsigned : 6;
2697 struct
2699 unsigned : 3;
2700 unsigned T4OUTPS : 4;
2701 unsigned : 1;
2703 } __T4CONbits_t;
2705 extern __at(0x0F6B) volatile __T4CONbits_t T4CONbits;
2707 #define _T4CKPS0 0x01
2708 #define _T4CKPS1 0x02
2709 #define _TMR4ON 0x04
2710 #define _T4OUTPS0 0x08
2711 #define _T4OUTPS1 0x10
2712 #define _T4OUTPS2 0x20
2713 #define _T4OUTPS3 0x40
2715 //==============================================================================
2717 extern __at(0x0F6C) __sfr PR4;
2718 extern __at(0x0F6D) __sfr TMR4;
2720 //==============================================================================
2721 // CCP7CON Bits
2723 extern __at(0x0F6E) __sfr CCP7CON;
2725 typedef union
2727 struct
2729 unsigned CCP7M0 : 1;
2730 unsigned CCP7M1 : 1;
2731 unsigned CCP7M2 : 1;
2732 unsigned CCP7M3 : 1;
2733 unsigned DC7B0 : 1;
2734 unsigned DC7B1 : 1;
2735 unsigned : 1;
2736 unsigned : 1;
2739 struct
2741 unsigned : 1;
2742 unsigned : 1;
2743 unsigned : 1;
2744 unsigned : 1;
2745 unsigned CCP7Y : 1;
2746 unsigned CCP7X : 1;
2747 unsigned : 1;
2748 unsigned : 1;
2751 struct
2753 unsigned CCP7M : 4;
2754 unsigned : 4;
2757 struct
2759 unsigned : 4;
2760 unsigned DC7B : 2;
2761 unsigned : 2;
2763 } __CCP7CONbits_t;
2765 extern __at(0x0F6E) volatile __CCP7CONbits_t CCP7CONbits;
2767 #define _CCP7M0 0x01
2768 #define _CCP7M1 0x02
2769 #define _CCP7M2 0x04
2770 #define _CCP7M3 0x08
2771 #define _DC7B0 0x10
2772 #define _CCP7Y 0x10
2773 #define _DC7B1 0x20
2774 #define _CCP7X 0x20
2776 //==============================================================================
2778 extern __at(0x0F6F) __sfr CCPR7;
2779 extern __at(0x0F6F) __sfr CCPR7L;
2780 extern __at(0x0F70) __sfr CCPR7H;
2782 //==============================================================================
2783 // CCP6CON Bits
2785 extern __at(0x0F71) __sfr CCP6CON;
2787 typedef union
2789 struct
2791 unsigned CCP6M0 : 1;
2792 unsigned CCP6M1 : 1;
2793 unsigned CCP6M2 : 1;
2794 unsigned CCP6M3 : 1;
2795 unsigned DC6B0 : 1;
2796 unsigned DC6B1 : 1;
2797 unsigned : 1;
2798 unsigned : 1;
2801 struct
2803 unsigned : 1;
2804 unsigned : 1;
2805 unsigned : 1;
2806 unsigned : 1;
2807 unsigned CCP6Y : 1;
2808 unsigned CCP6X : 1;
2809 unsigned : 1;
2810 unsigned : 1;
2813 struct
2815 unsigned CCP6M : 4;
2816 unsigned : 4;
2819 struct
2821 unsigned : 4;
2822 unsigned DC6B : 2;
2823 unsigned : 2;
2825 } __CCP6CONbits_t;
2827 extern __at(0x0F71) volatile __CCP6CONbits_t CCP6CONbits;
2829 #define _CCP6M0 0x01
2830 #define _CCP6M1 0x02
2831 #define _CCP6M2 0x04
2832 #define _CCP6M3 0x08
2833 #define _DC6B0 0x10
2834 #define _CCP6Y 0x10
2835 #define _DC6B1 0x20
2836 #define _CCP6X 0x20
2838 //==============================================================================
2840 extern __at(0x0F72) __sfr CCPR6;
2841 extern __at(0x0F72) __sfr CCPR6L;
2842 extern __at(0x0F73) __sfr CCPR6H;
2844 //==============================================================================
2845 // CCP5CON Bits
2847 extern __at(0x0F74) __sfr CCP5CON;
2849 typedef union
2851 struct
2853 unsigned CCP5M0 : 1;
2854 unsigned CCP5M1 : 1;
2855 unsigned CCP5M2 : 1;
2856 unsigned CCP5M3 : 1;
2857 unsigned DC5B0 : 1;
2858 unsigned DC5B1 : 1;
2859 unsigned : 1;
2860 unsigned : 1;
2863 struct
2865 unsigned : 1;
2866 unsigned : 1;
2867 unsigned : 1;
2868 unsigned : 1;
2869 unsigned CCP5Y : 1;
2870 unsigned CCP5X : 1;
2871 unsigned : 1;
2872 unsigned : 1;
2875 struct
2877 unsigned CCP5M : 4;
2878 unsigned : 4;
2881 struct
2883 unsigned : 4;
2884 unsigned DC5B : 2;
2885 unsigned : 2;
2887 } __CCP5CONbits_t;
2889 extern __at(0x0F74) volatile __CCP5CONbits_t CCP5CONbits;
2891 #define _CCP5M0 0x01
2892 #define _CCP5M1 0x02
2893 #define _CCP5M2 0x04
2894 #define _CCP5M3 0x08
2895 #define _DC5B0 0x10
2896 #define _CCP5Y 0x10
2897 #define _DC5B1 0x20
2898 #define _CCP5X 0x20
2900 //==============================================================================
2902 extern __at(0x0F75) __sfr CCPR5;
2903 extern __at(0x0F75) __sfr CCPR5L;
2904 extern __at(0x0F76) __sfr CCPR5H;
2906 //==============================================================================
2907 // CCP4CON Bits
2909 extern __at(0x0F77) __sfr CCP4CON;
2911 typedef union
2913 struct
2915 unsigned CCP4M0 : 1;
2916 unsigned CCP4M1 : 1;
2917 unsigned CCP4M2 : 1;
2918 unsigned CCP4M3 : 1;
2919 unsigned DC4B0 : 1;
2920 unsigned DC4B1 : 1;
2921 unsigned : 1;
2922 unsigned : 1;
2925 struct
2927 unsigned : 1;
2928 unsigned : 1;
2929 unsigned : 1;
2930 unsigned : 1;
2931 unsigned CCP4Y : 1;
2932 unsigned CCP4X : 1;
2933 unsigned : 1;
2934 unsigned : 1;
2937 struct
2939 unsigned CCP4M : 4;
2940 unsigned : 4;
2943 struct
2945 unsigned : 4;
2946 unsigned DC4B : 2;
2947 unsigned : 2;
2949 } __CCP4CONbits_t;
2951 extern __at(0x0F77) volatile __CCP4CONbits_t CCP4CONbits;
2953 #define _CCP4M0 0x01
2954 #define _CCP4M1 0x02
2955 #define _CCP4M2 0x04
2956 #define _CCP4M3 0x08
2957 #define _DC4B0 0x10
2958 #define _CCP4Y 0x10
2959 #define _DC4B1 0x20
2960 #define _CCP4X 0x20
2962 //==============================================================================
2964 extern __at(0x0F78) __sfr CCPR4;
2965 extern __at(0x0F78) __sfr CCPR4L;
2966 extern __at(0x0F79) __sfr CCPR4H;
2968 //==============================================================================
2969 // T5GCON Bits
2971 extern __at(0x0F7A) __sfr T5GCON;
2973 typedef union
2975 struct
2977 unsigned T5GSS0 : 1;
2978 unsigned T5GSS1 : 1;
2979 unsigned T5GVAL : 1;
2980 unsigned T5GGO_NOT_T5DONE : 1;
2981 unsigned T5GSPM : 1;
2982 unsigned T5GTM : 1;
2983 unsigned T5GPOL : 1;
2984 unsigned TMR5GE : 1;
2987 struct
2989 unsigned : 1;
2990 unsigned : 1;
2991 unsigned : 1;
2992 unsigned T5GGO : 1;
2993 unsigned : 1;
2994 unsigned : 1;
2995 unsigned : 1;
2996 unsigned : 1;
2999 struct
3001 unsigned : 1;
3002 unsigned : 1;
3003 unsigned : 1;
3004 unsigned NOT_T5DONE : 1;
3005 unsigned : 1;
3006 unsigned : 1;
3007 unsigned : 1;
3008 unsigned : 1;
3011 struct
3013 unsigned T5GSS : 2;
3014 unsigned : 6;
3016 } __T5GCONbits_t;
3018 extern __at(0x0F7A) volatile __T5GCONbits_t T5GCONbits;
3020 #define _T5GSS0 0x01
3021 #define _T5GSS1 0x02
3022 #define _T5GVAL 0x04
3023 #define _T5GGO_NOT_T5DONE 0x08
3024 #define _T5GGO 0x08
3025 #define _NOT_T5DONE 0x08
3026 #define _T5GSPM 0x10
3027 #define _T5GTM 0x20
3028 #define _T5GPOL 0x40
3029 #define _TMR5GE 0x80
3031 //==============================================================================
3034 //==============================================================================
3035 // T5CON Bits
3037 extern __at(0x0F7B) __sfr T5CON;
3039 typedef union
3041 struct
3043 unsigned TMR5ON : 1;
3044 unsigned RD16 : 1;
3045 unsigned NOT_T5SYNC : 1;
3046 unsigned SOSCEN : 1;
3047 unsigned T5CKPS0 : 1;
3048 unsigned T5CKPS1 : 1;
3049 unsigned TMR5CS0 : 1;
3050 unsigned TMR5CS1 : 1;
3053 struct
3055 unsigned : 4;
3056 unsigned T5CKPS : 2;
3057 unsigned : 2;
3060 struct
3062 unsigned : 6;
3063 unsigned TMR5CS : 2;
3065 } __T5CONbits_t;
3067 extern __at(0x0F7B) volatile __T5CONbits_t T5CONbits;
3069 #define _T5CON_TMR5ON 0x01
3070 #define _T5CON_RD16 0x02
3071 #define _T5CON_NOT_T5SYNC 0x04
3072 #define _T5CON_SOSCEN 0x08
3073 #define _T5CON_T5CKPS0 0x10
3074 #define _T5CON_T5CKPS1 0x20
3075 #define _T5CON_TMR5CS0 0x40
3076 #define _T5CON_TMR5CS1 0x80
3078 //==============================================================================
3080 extern __at(0x0F7C) __sfr TMR5;
3081 extern __at(0x0F7C) __sfr TMR5L;
3082 extern __at(0x0F7D) __sfr TMR5H;
3083 extern __at(0x0F7E) __sfr EECON2;
3085 //==============================================================================
3086 // EECON1 Bits
3088 extern __at(0x0F7F) __sfr EECON1;
3090 typedef struct
3092 unsigned RD : 1;
3093 unsigned WR : 1;
3094 unsigned WREN : 1;
3095 unsigned WRERR : 1;
3096 unsigned FREE : 1;
3097 unsigned : 1;
3098 unsigned CFGS : 1;
3099 unsigned EEPGD : 1;
3100 } __EECON1bits_t;
3102 extern __at(0x0F7F) volatile __EECON1bits_t EECON1bits;
3104 #define _RD 0x01
3105 #define _WR 0x02
3106 #define _WREN 0x04
3107 #define _WRERR 0x08
3108 #define _FREE 0x10
3109 #define _CFGS 0x40
3110 #define _EEPGD 0x80
3112 //==============================================================================
3115 //==============================================================================
3116 // PORTA Bits
3118 extern __at(0x0F80) __sfr PORTA;
3120 typedef union
3122 struct
3124 unsigned RA0 : 1;
3125 unsigned RA1 : 1;
3126 unsigned RA2 : 1;
3127 unsigned RA3 : 1;
3128 unsigned RA4 : 1;
3129 unsigned RA5 : 1;
3130 unsigned RA6 : 1;
3131 unsigned RA7 : 1;
3134 struct
3136 unsigned AN0 : 1;
3137 unsigned AN1 : 1;
3138 unsigned AN2 : 1;
3139 unsigned AN3 : 1;
3140 unsigned T0CKI : 1;
3141 unsigned AN4 : 1;
3142 unsigned OSC2 : 1;
3143 unsigned OSC1 : 1;
3146 struct
3148 unsigned ULPWU : 1;
3149 unsigned : 1;
3150 unsigned VREF_MINUS : 1;
3151 unsigned VREF_PLUS : 1;
3152 unsigned : 1;
3153 unsigned T1CKI : 1;
3154 unsigned CLKO : 1;
3155 unsigned CLKI : 1;
3158 struct
3160 unsigned : 1;
3161 unsigned : 1;
3162 unsigned : 1;
3163 unsigned : 1;
3164 unsigned : 1;
3165 unsigned T3G : 1;
3166 unsigned : 1;
3167 unsigned : 1;
3170 struct
3172 unsigned : 1;
3173 unsigned : 1;
3174 unsigned : 1;
3175 unsigned : 1;
3176 unsigned : 1;
3177 unsigned HLVDIN : 1;
3178 unsigned : 1;
3179 unsigned : 1;
3181 } __PORTAbits_t;
3183 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
3185 #define _RA0 0x01
3186 #define _AN0 0x01
3187 #define _ULPWU 0x01
3188 #define _RA1 0x02
3189 #define _AN1 0x02
3190 #define _RA2 0x04
3191 #define _AN2 0x04
3192 #define _VREF_MINUS 0x04
3193 #define _RA3 0x08
3194 #define _AN3 0x08
3195 #define _VREF_PLUS 0x08
3196 #define _RA4 0x10
3197 #define _T0CKI 0x10
3198 #define _RA5 0x20
3199 #define _AN4 0x20
3200 #define _T1CKI 0x20
3201 #define _T3G 0x20
3202 #define _HLVDIN 0x20
3203 #define _RA6 0x40
3204 #define _OSC2 0x40
3205 #define _CLKO 0x40
3206 #define _RA7 0x80
3207 #define _OSC1 0x80
3208 #define _CLKI 0x80
3210 //==============================================================================
3213 //==============================================================================
3214 // PORTB Bits
3216 extern __at(0x0F81) __sfr PORTB;
3218 typedef union
3220 struct
3222 unsigned RB0 : 1;
3223 unsigned RB1 : 1;
3224 unsigned RB2 : 1;
3225 unsigned RB3 : 1;
3226 unsigned RB4 : 1;
3227 unsigned RB5 : 1;
3228 unsigned RB6 : 1;
3229 unsigned RB7 : 1;
3232 struct
3234 unsigned INT0 : 1;
3235 unsigned INT1 : 1;
3236 unsigned INT2 : 1;
3237 unsigned INT3 : 1;
3238 unsigned KBI0 : 1;
3239 unsigned KBI1 : 1;
3240 unsigned KBI2 : 1;
3241 unsigned KBI3 : 1;
3244 struct
3246 unsigned FLT0 : 1;
3247 unsigned : 1;
3248 unsigned CTED1 : 1;
3249 unsigned CTED2 : 1;
3250 unsigned : 1;
3251 unsigned T3CKI : 1;
3252 unsigned PGC : 1;
3253 unsigned PGD : 1;
3256 struct
3258 unsigned : 1;
3259 unsigned : 1;
3260 unsigned : 1;
3261 unsigned CCP2_P2A : 1;
3262 unsigned : 1;
3263 unsigned T1G : 1;
3264 unsigned : 1;
3265 unsigned : 1;
3268 struct
3270 unsigned : 1;
3271 unsigned : 1;
3272 unsigned : 1;
3273 unsigned : 1;
3274 unsigned : 1;
3275 unsigned PGM : 1;
3276 unsigned : 1;
3277 unsigned : 1;
3280 struct
3282 unsigned INT : 4;
3283 unsigned : 4;
3286 struct
3288 unsigned : 4;
3289 unsigned KBI : 4;
3291 } __PORTBbits_t;
3293 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
3295 #define _RB0 0x01
3296 #define _INT0 0x01
3297 #define _FLT0 0x01
3298 #define _RB1 0x02
3299 #define _INT1 0x02
3300 #define _RB2 0x04
3301 #define _INT2 0x04
3302 #define _CTED1 0x04
3303 #define _RB3 0x08
3304 #define _INT3 0x08
3305 #define _CTED2 0x08
3306 #define _CCP2_P2A 0x08
3307 #define _RB4 0x10
3308 #define _KBI0 0x10
3309 #define _RB5 0x20
3310 #define _KBI1 0x20
3311 #define _T3CKI 0x20
3312 #define _T1G 0x20
3313 #define _PGM 0x20
3314 #define _RB6 0x40
3315 #define _KBI2 0x40
3316 #define _PGC 0x40
3317 #define _RB7 0x80
3318 #define _KBI3 0x80
3319 #define _PGD 0x80
3321 //==============================================================================
3324 //==============================================================================
3325 // PORTC Bits
3327 extern __at(0x0F82) __sfr PORTC;
3329 typedef union
3331 struct
3333 unsigned RC0 : 1;
3334 unsigned RC1 : 1;
3335 unsigned RC2 : 1;
3336 unsigned RC3 : 1;
3337 unsigned RC4 : 1;
3338 unsigned RC5 : 1;
3339 unsigned RC6 : 1;
3340 unsigned RC7 : 1;
3343 struct
3345 unsigned SOSCO : 1;
3346 unsigned SOSCI : 1;
3347 unsigned CCP1 : 1;
3348 unsigned SCK1 : 1;
3349 unsigned SDI1 : 1;
3350 unsigned SDO1 : 1;
3351 unsigned TX1 : 1;
3352 unsigned RX1 : 1;
3355 struct
3357 unsigned SCKLI : 1;
3358 unsigned CCP2 : 1;
3359 unsigned P1A : 1;
3360 unsigned SCL1 : 1;
3361 unsigned SDA1 : 1;
3362 unsigned : 1;
3363 unsigned CK1 : 1;
3364 unsigned DT1 : 1;
3367 struct
3369 unsigned : 1;
3370 unsigned P2A : 1;
3371 unsigned : 1;
3372 unsigned : 1;
3373 unsigned : 1;
3374 unsigned : 1;
3375 unsigned : 1;
3376 unsigned : 1;
3378 } __PORTCbits_t;
3380 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
3382 #define _RC0 0x01
3383 #define _SOSCO 0x01
3384 #define _SCKLI 0x01
3385 #define _RC1 0x02
3386 #define _SOSCI 0x02
3387 #define _CCP2 0x02
3388 #define _P2A 0x02
3389 #define _RC2 0x04
3390 #define _CCP1 0x04
3391 #define _P1A 0x04
3392 #define _RC3 0x08
3393 #define _SCK1 0x08
3394 #define _SCL1 0x08
3395 #define _RC4 0x10
3396 #define _SDI1 0x10
3397 #define _SDA1 0x10
3398 #define _RC5 0x20
3399 #define _SDO1 0x20
3400 #define _RC6 0x40
3401 #define _TX1 0x40
3402 #define _CK1 0x40
3403 #define _RC7 0x80
3404 #define _RX1 0x80
3405 #define _DT1 0x80
3407 //==============================================================================
3410 //==============================================================================
3411 // PORTD Bits
3413 extern __at(0x0F83) __sfr PORTD;
3415 typedef union
3417 struct
3419 unsigned RD0 : 1;
3420 unsigned RD1 : 1;
3421 unsigned RD2 : 1;
3422 unsigned RD3 : 1;
3423 unsigned RD4 : 1;
3424 unsigned RD5 : 1;
3425 unsigned RD6 : 1;
3426 unsigned RD7 : 1;
3429 struct
3431 unsigned AD0 : 1;
3432 unsigned AD1 : 1;
3433 unsigned AD2 : 1;
3434 unsigned AD3 : 1;
3435 unsigned AD4 : 1;
3436 unsigned AD5 : 1;
3437 unsigned AD6 : 1;
3438 unsigned AD7 : 1;
3441 struct
3443 unsigned PSP0 : 1;
3444 unsigned PSP1 : 1;
3445 unsigned PSP2 : 1;
3446 unsigned PSP3 : 1;
3447 unsigned PSP4 : 1;
3448 unsigned PSP5 : 1;
3449 unsigned PSP6 : 1;
3450 unsigned PSP7 : 1;
3453 struct
3455 unsigned CTPLS : 1;
3456 unsigned T5CKI : 1;
3457 unsigned : 1;
3458 unsigned : 1;
3459 unsigned SDO2 : 1;
3460 unsigned SDI2 : 1;
3461 unsigned SCK2 : 1;
3462 unsigned NOT_SS2 : 1;
3465 struct
3467 unsigned : 1;
3468 unsigned T7G : 1;
3469 unsigned : 1;
3470 unsigned : 1;
3471 unsigned : 1;
3472 unsigned SDA2 : 1;
3473 unsigned SCL2 : 1;
3474 unsigned : 1;
3476 } __PORTDbits_t;
3478 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
3480 #define _RD0 0x01
3481 #define _AD0 0x01
3482 #define _PSP0 0x01
3483 #define _CTPLS 0x01
3484 #define _RD1 0x02
3485 #define _AD1 0x02
3486 #define _PSP1 0x02
3487 #define _T5CKI 0x02
3488 #define _T7G 0x02
3489 #define _RD2 0x04
3490 #define _AD2 0x04
3491 #define _PSP2 0x04
3492 #define _RD3 0x08
3493 #define _AD3 0x08
3494 #define _PSP3 0x08
3495 #define _RD4 0x10
3496 #define _AD4 0x10
3497 #define _PSP4 0x10
3498 #define _SDO2 0x10
3499 #define _RD5 0x20
3500 #define _AD5 0x20
3501 #define _PSP5 0x20
3502 #define _SDI2 0x20
3503 #define _SDA2 0x20
3504 #define _RD6 0x40
3505 #define _AD6 0x40
3506 #define _PSP6 0x40
3507 #define _SCK2 0x40
3508 #define _SCL2 0x40
3509 #define _RD7 0x80
3510 #define _AD7 0x80
3511 #define _PSP7 0x80
3512 #define _NOT_SS2 0x80
3514 //==============================================================================
3517 //==============================================================================
3518 // PORTE Bits
3520 extern __at(0x0F84) __sfr PORTE;
3522 typedef union
3524 struct
3526 unsigned RE0 : 1;
3527 unsigned RE1 : 1;
3528 unsigned RE2 : 1;
3529 unsigned RE3 : 1;
3530 unsigned RE4 : 1;
3531 unsigned RE5 : 1;
3532 unsigned RE6 : 1;
3533 unsigned RE7 : 1;
3536 struct
3538 unsigned AD8 : 1;
3539 unsigned AD9 : 1;
3540 unsigned AD10 : 1;
3541 unsigned AD11 : 1;
3542 unsigned AD12 : 1;
3543 unsigned AD13 : 1;
3544 unsigned AD14 : 1;
3545 unsigned AD15 : 1;
3548 struct
3550 unsigned P2D : 1;
3551 unsigned P2C : 1;
3552 unsigned P2B : 1;
3553 unsigned P3C : 1;
3554 unsigned P3B : 1;
3555 unsigned P1C : 1;
3556 unsigned P1B : 1;
3557 unsigned P2A : 1;
3560 struct
3562 unsigned NOT_RD : 1;
3563 unsigned NOT_WR : 1;
3564 unsigned CCP10 : 1;
3565 unsigned CCP9 : 1;
3566 unsigned CCP8 : 1;
3567 unsigned CCP7 : 1;
3568 unsigned CCP6 : 1;
3569 unsigned CCP2 : 1;
3572 struct
3574 unsigned : 1;
3575 unsigned : 1;
3576 unsigned NOT_CS : 1;
3577 unsigned REFO : 1;
3578 unsigned : 1;
3579 unsigned : 1;
3580 unsigned : 1;
3581 unsigned : 1;
3583 } __PORTEbits_t;
3585 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
3587 #define _PORTE_RE0 0x01
3588 #define _PORTE_AD8 0x01
3589 #define _PORTE_P2D 0x01
3590 #define _PORTE_NOT_RD 0x01
3591 #define _PORTE_RE1 0x02
3592 #define _PORTE_AD9 0x02
3593 #define _PORTE_P2C 0x02
3594 #define _PORTE_NOT_WR 0x02
3595 #define _PORTE_RE2 0x04
3596 #define _PORTE_AD10 0x04
3597 #define _PORTE_P2B 0x04
3598 #define _PORTE_CCP10 0x04
3599 #define _PORTE_NOT_CS 0x04
3600 #define _PORTE_RE3 0x08
3601 #define _PORTE_AD11 0x08
3602 #define _PORTE_P3C 0x08
3603 #define _PORTE_CCP9 0x08
3604 #define _PORTE_REFO 0x08
3605 #define _PORTE_RE4 0x10
3606 #define _PORTE_AD12 0x10
3607 #define _PORTE_P3B 0x10
3608 #define _PORTE_CCP8 0x10
3609 #define _PORTE_RE5 0x20
3610 #define _PORTE_AD13 0x20
3611 #define _PORTE_P1C 0x20
3612 #define _PORTE_CCP7 0x20
3613 #define _PORTE_RE6 0x40
3614 #define _PORTE_AD14 0x40
3615 #define _PORTE_P1B 0x40
3616 #define _PORTE_CCP6 0x40
3617 #define _PORTE_RE7 0x80
3618 #define _PORTE_AD15 0x80
3619 #define _PORTE_P2A 0x80
3620 #define _PORTE_CCP2 0x80
3622 //==============================================================================
3625 //==============================================================================
3626 // PORTF Bits
3628 extern __at(0x0F85) __sfr PORTF;
3630 typedef union
3632 struct
3634 unsigned : 1;
3635 unsigned RF1 : 1;
3636 unsigned RF2 : 1;
3637 unsigned RF3 : 1;
3638 unsigned RF4 : 1;
3639 unsigned RF5 : 1;
3640 unsigned RF6 : 1;
3641 unsigned RF7 : 1;
3644 struct
3646 unsigned : 1;
3647 unsigned AN6 : 1;
3648 unsigned AN7 : 1;
3649 unsigned AN8 : 1;
3650 unsigned AN9 : 1;
3651 unsigned AN10 : 1;
3652 unsigned AN11 : 1;
3653 unsigned AN5 : 1;
3656 struct
3658 unsigned : 1;
3659 unsigned C2OUT : 1;
3660 unsigned C1OUT : 1;
3661 unsigned C2INB : 1;
3662 unsigned C2INA : 1;
3663 unsigned C1INB : 1;
3664 unsigned C1INA : 1;
3665 unsigned SS1 : 1;
3668 struct
3670 unsigned : 1;
3671 unsigned CTDIN : 1;
3672 unsigned : 1;
3673 unsigned CTMUI : 1;
3674 unsigned : 1;
3675 unsigned CVREF : 1;
3676 unsigned : 1;
3677 unsigned : 1;
3679 } __PORTFbits_t;
3681 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
3683 #define _RF1 0x02
3684 #define _AN6 0x02
3685 #define _C2OUT 0x02
3686 #define _CTDIN 0x02
3687 #define _RF2 0x04
3688 #define _AN7 0x04
3689 #define _C1OUT 0x04
3690 #define _RF3 0x08
3691 #define _AN8 0x08
3692 #define _C2INB 0x08
3693 #define _CTMUI 0x08
3694 #define _RF4 0x10
3695 #define _AN9 0x10
3696 #define _C2INA 0x10
3697 #define _RF5 0x20
3698 #define _AN10 0x20
3699 #define _C1INB 0x20
3700 #define _CVREF 0x20
3701 #define _RF6 0x40
3702 #define _AN11 0x40
3703 #define _C1INA 0x40
3704 #define _RF7 0x80
3705 #define _AN5 0x80
3706 #define _SS1 0x80
3708 //==============================================================================
3711 //==============================================================================
3712 // PORTG Bits
3714 extern __at(0x0F86) __sfr PORTG;
3716 typedef union
3718 struct
3720 unsigned RG0 : 1;
3721 unsigned RG1 : 1;
3722 unsigned RG2 : 1;
3723 unsigned RG3 : 1;
3724 unsigned RG4 : 1;
3725 unsigned RG5 : 1;
3726 unsigned : 1;
3727 unsigned : 1;
3730 struct
3732 unsigned CCP3 : 1;
3733 unsigned C3OUT : 1;
3734 unsigned C3INA : 1;
3735 unsigned C3INB : 1;
3736 unsigned C3INC : 1;
3737 unsigned : 1;
3738 unsigned : 1;
3739 unsigned : 1;
3742 struct
3744 unsigned PA3 : 1;
3745 unsigned TX2 : 1;
3746 unsigned RX2 : 1;
3747 unsigned PD3 : 1;
3748 unsigned PD1 : 1;
3749 unsigned : 1;
3750 unsigned : 1;
3751 unsigned : 1;
3754 struct
3756 unsigned : 1;
3757 unsigned AN19 : 1;
3758 unsigned AN18 : 1;
3759 unsigned AN17 : 1;
3760 unsigned AN16 : 1;
3761 unsigned : 1;
3762 unsigned : 1;
3763 unsigned : 1;
3766 struct
3768 unsigned : 1;
3769 unsigned CK2 : 1;
3770 unsigned DT2 : 1;
3771 unsigned CCP4 : 1;
3772 unsigned CCP5 : 1;
3773 unsigned : 1;
3774 unsigned : 1;
3775 unsigned : 1;
3778 struct
3780 unsigned : 1;
3781 unsigned : 1;
3782 unsigned : 1;
3783 unsigned : 1;
3784 unsigned T7CKI : 1;
3785 unsigned : 1;
3786 unsigned : 1;
3787 unsigned : 1;
3790 struct
3792 unsigned : 1;
3793 unsigned : 1;
3794 unsigned : 1;
3795 unsigned : 1;
3796 unsigned T5G : 1;
3797 unsigned : 1;
3798 unsigned : 1;
3799 unsigned : 1;
3802 struct
3804 unsigned : 1;
3805 unsigned : 1;
3806 unsigned : 1;
3807 unsigned : 1;
3808 unsigned RTCC : 1;
3809 unsigned : 1;
3810 unsigned : 1;
3811 unsigned : 1;
3814 struct
3816 unsigned RG : 6;
3817 unsigned : 2;
3819 } __PORTGbits_t;
3821 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
3823 #define _RG0 0x01
3824 #define _CCP3 0x01
3825 #define _PA3 0x01
3826 #define _RG1 0x02
3827 #define _C3OUT 0x02
3828 #define _TX2 0x02
3829 #define _AN19 0x02
3830 #define _CK2 0x02
3831 #define _RG2 0x04
3832 #define _C3INA 0x04
3833 #define _RX2 0x04
3834 #define _AN18 0x04
3835 #define _DT2 0x04
3836 #define _RG3 0x08
3837 #define _C3INB 0x08
3838 #define _PD3 0x08
3839 #define _AN17 0x08
3840 #define _CCP4 0x08
3841 #define _RG4 0x10
3842 #define _C3INC 0x10
3843 #define _PD1 0x10
3844 #define _AN16 0x10
3845 #define _CCP5 0x10
3846 #define _T7CKI 0x10
3847 #define _T5G 0x10
3848 #define _RTCC 0x10
3849 #define _RG5 0x20
3851 //==============================================================================
3854 //==============================================================================
3855 // LATA Bits
3857 extern __at(0x0F89) __sfr LATA;
3859 typedef struct
3861 unsigned LATA0 : 1;
3862 unsigned LATA1 : 1;
3863 unsigned LATA2 : 1;
3864 unsigned LATA3 : 1;
3865 unsigned LATA4 : 1;
3866 unsigned LATA5 : 1;
3867 unsigned LATA6 : 1;
3868 unsigned LATA7 : 1;
3869 } __LATAbits_t;
3871 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
3873 #define _LATA0 0x01
3874 #define _LATA1 0x02
3875 #define _LATA2 0x04
3876 #define _LATA3 0x08
3877 #define _LATA4 0x10
3878 #define _LATA5 0x20
3879 #define _LATA6 0x40
3880 #define _LATA7 0x80
3882 //==============================================================================
3885 //==============================================================================
3886 // LATB Bits
3888 extern __at(0x0F8A) __sfr LATB;
3890 typedef struct
3892 unsigned LATB0 : 1;
3893 unsigned LATB1 : 1;
3894 unsigned LATB2 : 1;
3895 unsigned LATB3 : 1;
3896 unsigned LATB4 : 1;
3897 unsigned LATB5 : 1;
3898 unsigned LATB6 : 1;
3899 unsigned LATB7 : 1;
3900 } __LATBbits_t;
3902 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
3904 #define _LATB0 0x01
3905 #define _LATB1 0x02
3906 #define _LATB2 0x04
3907 #define _LATB3 0x08
3908 #define _LATB4 0x10
3909 #define _LATB5 0x20
3910 #define _LATB6 0x40
3911 #define _LATB7 0x80
3913 //==============================================================================
3916 //==============================================================================
3917 // LATC Bits
3919 extern __at(0x0F8B) __sfr LATC;
3921 typedef struct
3923 unsigned LATC0 : 1;
3924 unsigned LATC1 : 1;
3925 unsigned LATC2 : 1;
3926 unsigned LATC3 : 1;
3927 unsigned LATC4 : 1;
3928 unsigned LATC5 : 1;
3929 unsigned LATC6 : 1;
3930 unsigned LATC7 : 1;
3931 } __LATCbits_t;
3933 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
3935 #define _LATC0 0x01
3936 #define _LATC1 0x02
3937 #define _LATC2 0x04
3938 #define _LATC3 0x08
3939 #define _LATC4 0x10
3940 #define _LATC5 0x20
3941 #define _LATC6 0x40
3942 #define _LATC7 0x80
3944 //==============================================================================
3947 //==============================================================================
3948 // LATD Bits
3950 extern __at(0x0F8C) __sfr LATD;
3952 typedef struct
3954 unsigned LATD0 : 1;
3955 unsigned LATD1 : 1;
3956 unsigned LATD2 : 1;
3957 unsigned LATD3 : 1;
3958 unsigned LATD4 : 1;
3959 unsigned LATD5 : 1;
3960 unsigned LATD6 : 1;
3961 unsigned LATD7 : 1;
3962 } __LATDbits_t;
3964 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
3966 #define _LATD0 0x01
3967 #define _LATD1 0x02
3968 #define _LATD2 0x04
3969 #define _LATD3 0x08
3970 #define _LATD4 0x10
3971 #define _LATD5 0x20
3972 #define _LATD6 0x40
3973 #define _LATD7 0x80
3975 //==============================================================================
3978 //==============================================================================
3979 // LATE Bits
3981 extern __at(0x0F8D) __sfr LATE;
3983 typedef struct
3985 unsigned LATE0 : 1;
3986 unsigned LATE1 : 1;
3987 unsigned LATE2 : 1;
3988 unsigned LATE3 : 1;
3989 unsigned LATE4 : 1;
3990 unsigned LATE5 : 1;
3991 unsigned LATE6 : 1;
3992 unsigned LATE7 : 1;
3993 } __LATEbits_t;
3995 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
3997 #define _LATE0 0x01
3998 #define _LATE1 0x02
3999 #define _LATE2 0x04
4000 #define _LATE3 0x08
4001 #define _LATE4 0x10
4002 #define _LATE5 0x20
4003 #define _LATE6 0x40
4004 #define _LATE7 0x80
4006 //==============================================================================
4009 //==============================================================================
4010 // LATF Bits
4012 extern __at(0x0F8E) __sfr LATF;
4014 typedef struct
4016 unsigned : 1;
4017 unsigned LATF1 : 1;
4018 unsigned LATF2 : 1;
4019 unsigned LATF3 : 1;
4020 unsigned LATF4 : 1;
4021 unsigned LATF5 : 1;
4022 unsigned LATF6 : 1;
4023 unsigned LATF7 : 1;
4024 } __LATFbits_t;
4026 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
4028 #define _LATF1 0x02
4029 #define _LATF2 0x04
4030 #define _LATF3 0x08
4031 #define _LATF4 0x10
4032 #define _LATF5 0x20
4033 #define _LATF6 0x40
4034 #define _LATF7 0x80
4036 //==============================================================================
4039 //==============================================================================
4040 // LATG Bits
4042 extern __at(0x0F8F) __sfr LATG;
4044 typedef union
4046 struct
4048 unsigned LATG0 : 1;
4049 unsigned LATG1 : 1;
4050 unsigned LATG2 : 1;
4051 unsigned LATG3 : 1;
4052 unsigned LATG4 : 1;
4053 unsigned : 1;
4054 unsigned : 1;
4055 unsigned : 1;
4058 struct
4060 unsigned LATG : 5;
4061 unsigned : 3;
4063 } __LATGbits_t;
4065 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
4067 #define _LATG0 0x01
4068 #define _LATG1 0x02
4069 #define _LATG2 0x04
4070 #define _LATG3 0x08
4071 #define _LATG4 0x10
4073 //==============================================================================
4076 //==============================================================================
4077 // TRISA Bits
4079 extern __at(0x0F92) __sfr TRISA;
4081 typedef struct
4083 unsigned TRISA0 : 1;
4084 unsigned TRISA1 : 1;
4085 unsigned TRISA2 : 1;
4086 unsigned TRISA3 : 1;
4087 unsigned TRISA4 : 1;
4088 unsigned TRISA5 : 1;
4089 unsigned TRISA6 : 1;
4090 unsigned TRISA7 : 1;
4091 } __TRISAbits_t;
4093 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
4095 #define _TRISA0 0x01
4096 #define _TRISA1 0x02
4097 #define _TRISA2 0x04
4098 #define _TRISA3 0x08
4099 #define _TRISA4 0x10
4100 #define _TRISA5 0x20
4101 #define _TRISA6 0x40
4102 #define _TRISA7 0x80
4104 //==============================================================================
4107 //==============================================================================
4108 // TRISB Bits
4110 extern __at(0x0F93) __sfr TRISB;
4112 typedef struct
4114 unsigned TRISB0 : 1;
4115 unsigned TRISB1 : 1;
4116 unsigned TRISB2 : 1;
4117 unsigned TRISB3 : 1;
4118 unsigned TRISB4 : 1;
4119 unsigned TRISB5 : 1;
4120 unsigned TRISB6 : 1;
4121 unsigned TRISB7 : 1;
4122 } __TRISBbits_t;
4124 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
4126 #define _TRISB0 0x01
4127 #define _TRISB1 0x02
4128 #define _TRISB2 0x04
4129 #define _TRISB3 0x08
4130 #define _TRISB4 0x10
4131 #define _TRISB5 0x20
4132 #define _TRISB6 0x40
4133 #define _TRISB7 0x80
4135 //==============================================================================
4138 //==============================================================================
4139 // TRISC Bits
4141 extern __at(0x0F94) __sfr TRISC;
4143 typedef struct
4145 unsigned TRISC0 : 1;
4146 unsigned TRISC1 : 1;
4147 unsigned TRISC2 : 1;
4148 unsigned TRISC3 : 1;
4149 unsigned TRISC4 : 1;
4150 unsigned TRISC5 : 1;
4151 unsigned TRISC6 : 1;
4152 unsigned TRISC7 : 1;
4153 } __TRISCbits_t;
4155 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
4157 #define _TRISC0 0x01
4158 #define _TRISC1 0x02
4159 #define _TRISC2 0x04
4160 #define _TRISC3 0x08
4161 #define _TRISC4 0x10
4162 #define _TRISC5 0x20
4163 #define _TRISC6 0x40
4164 #define _TRISC7 0x80
4166 //==============================================================================
4169 //==============================================================================
4170 // TRISD Bits
4172 extern __at(0x0F95) __sfr TRISD;
4174 typedef struct
4176 unsigned TRISD0 : 1;
4177 unsigned TRISD1 : 1;
4178 unsigned TRISD2 : 1;
4179 unsigned TRISD3 : 1;
4180 unsigned TRISD4 : 1;
4181 unsigned TRISD5 : 1;
4182 unsigned TRISD6 : 1;
4183 unsigned TRISD7 : 1;
4184 } __TRISDbits_t;
4186 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
4188 #define _TRISD0 0x01
4189 #define _TRISD1 0x02
4190 #define _TRISD2 0x04
4191 #define _TRISD3 0x08
4192 #define _TRISD4 0x10
4193 #define _TRISD5 0x20
4194 #define _TRISD6 0x40
4195 #define _TRISD7 0x80
4197 //==============================================================================
4200 //==============================================================================
4201 // TRISE Bits
4203 extern __at(0x0F96) __sfr TRISE;
4205 typedef struct
4207 unsigned TRISE0 : 1;
4208 unsigned TRISE1 : 1;
4209 unsigned TRISE2 : 1;
4210 unsigned TRISE3 : 1;
4211 unsigned TRISE4 : 1;
4212 unsigned TRISE5 : 1;
4213 unsigned TRISE6 : 1;
4214 unsigned TRISE7 : 1;
4215 } __TRISEbits_t;
4217 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
4219 #define _TRISE0 0x01
4220 #define _TRISE1 0x02
4221 #define _TRISE2 0x04
4222 #define _TRISE3 0x08
4223 #define _TRISE4 0x10
4224 #define _TRISE5 0x20
4225 #define _TRISE6 0x40
4226 #define _TRISE7 0x80
4228 //==============================================================================
4231 //==============================================================================
4232 // TRISF Bits
4234 extern __at(0x0F97) __sfr TRISF;
4236 typedef struct
4238 unsigned : 1;
4239 unsigned TRISF1 : 1;
4240 unsigned TRISF2 : 1;
4241 unsigned TRISF3 : 1;
4242 unsigned TRISF4 : 1;
4243 unsigned TRISF5 : 1;
4244 unsigned TRISF6 : 1;
4245 unsigned TRISF7 : 1;
4246 } __TRISFbits_t;
4248 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
4250 #define _TRISF1 0x02
4251 #define _TRISF2 0x04
4252 #define _TRISF3 0x08
4253 #define _TRISF4 0x10
4254 #define _TRISF5 0x20
4255 #define _TRISF6 0x40
4256 #define _TRISF7 0x80
4258 //==============================================================================
4261 //==============================================================================
4262 // TRISG Bits
4264 extern __at(0x0F98) __sfr TRISG;
4266 typedef union
4268 struct
4270 unsigned TRISG0 : 1;
4271 unsigned TRISG1 : 1;
4272 unsigned TRISG2 : 1;
4273 unsigned TRISG3 : 1;
4274 unsigned TRISG4 : 1;
4275 unsigned : 1;
4276 unsigned : 1;
4277 unsigned : 1;
4280 struct
4282 unsigned TRISG : 5;
4283 unsigned : 3;
4285 } __TRISGbits_t;
4287 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
4289 #define _TRISG0 0x01
4290 #define _TRISG1 0x02
4291 #define _TRISG2 0x04
4292 #define _TRISG3 0x08
4293 #define _TRISG4 0x10
4295 //==============================================================================
4298 //==============================================================================
4299 // OSCTUNE Bits
4301 extern __at(0x0F9B) __sfr OSCTUNE;
4303 typedef union
4305 struct
4307 unsigned TUN0 : 1;
4308 unsigned TUN1 : 1;
4309 unsigned TUN2 : 1;
4310 unsigned TUN3 : 1;
4311 unsigned TUN4 : 1;
4312 unsigned TUN5 : 1;
4313 unsigned PLLEN : 1;
4314 unsigned INTSRC : 1;
4317 struct
4319 unsigned TUN : 6;
4320 unsigned : 2;
4322 } __OSCTUNEbits_t;
4324 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
4326 #define _TUN0 0x01
4327 #define _TUN1 0x02
4328 #define _TUN2 0x04
4329 #define _TUN3 0x08
4330 #define _TUN4 0x10
4331 #define _TUN5 0x20
4332 #define _PLLEN 0x40
4333 #define _INTSRC 0x80
4335 //==============================================================================
4338 //==============================================================================
4339 // PSTR1CON Bits
4341 extern __at(0x0F9C) __sfr PSTR1CON;
4343 typedef union
4345 struct
4347 unsigned STRA : 1;
4348 unsigned STRB : 1;
4349 unsigned STRC : 1;
4350 unsigned STRD : 1;
4351 unsigned STRSYNC : 1;
4352 unsigned : 1;
4353 unsigned CMPL0 : 1;
4354 unsigned CMPL1 : 1;
4357 struct
4359 unsigned : 6;
4360 unsigned CMPL : 2;
4362 } __PSTR1CONbits_t;
4364 extern __at(0x0F9C) volatile __PSTR1CONbits_t PSTR1CONbits;
4366 #define _STRA 0x01
4367 #define _STRB 0x02
4368 #define _STRC 0x04
4369 #define _STRD 0x08
4370 #define _STRSYNC 0x10
4371 #define _CMPL0 0x40
4372 #define _CMPL1 0x80
4374 //==============================================================================
4377 //==============================================================================
4378 // PIE1 Bits
4380 extern __at(0x0F9D) __sfr PIE1;
4382 typedef union
4384 struct
4386 unsigned TMR1IE : 1;
4387 unsigned TMR2IE : 1;
4388 unsigned TMR1GIE : 1;
4389 unsigned SSP1IE : 1;
4390 unsigned TX1IE : 1;
4391 unsigned RC1IE : 1;
4392 unsigned ADIE : 1;
4393 unsigned PSPIE : 1;
4396 struct
4398 unsigned : 1;
4399 unsigned : 1;
4400 unsigned : 1;
4401 unsigned SSPIE : 1;
4402 unsigned TXIE : 1;
4403 unsigned RCIE : 1;
4404 unsigned : 1;
4405 unsigned : 1;
4407 } __PIE1bits_t;
4409 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
4411 #define _TMR1IE 0x01
4412 #define _TMR2IE 0x02
4413 #define _TMR1GIE 0x04
4414 #define _SSP1IE 0x08
4415 #define _SSPIE 0x08
4416 #define _TX1IE 0x10
4417 #define _TXIE 0x10
4418 #define _RC1IE 0x20
4419 #define _RCIE 0x20
4420 #define _ADIE 0x40
4421 #define _PSPIE 0x80
4423 //==============================================================================
4426 //==============================================================================
4427 // PIR1 Bits
4429 extern __at(0x0F9E) __sfr PIR1;
4431 typedef union
4433 struct
4435 unsigned TMR1IF : 1;
4436 unsigned TMR2IF : 1;
4437 unsigned TMR1GIF : 1;
4438 unsigned SSP1IF : 1;
4439 unsigned TX1IF : 1;
4440 unsigned RC1IF : 1;
4441 unsigned ADIF : 1;
4442 unsigned PSPIF : 1;
4445 struct
4447 unsigned : 1;
4448 unsigned : 1;
4449 unsigned : 1;
4450 unsigned SSPIF : 1;
4451 unsigned TXIF : 1;
4452 unsigned RCIF : 1;
4453 unsigned : 1;
4454 unsigned : 1;
4456 } __PIR1bits_t;
4458 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
4460 #define _TMR1IF 0x01
4461 #define _TMR2IF 0x02
4462 #define _TMR1GIF 0x04
4463 #define _SSP1IF 0x08
4464 #define _SSPIF 0x08
4465 #define _TX1IF 0x10
4466 #define _TXIF 0x10
4467 #define _RC1IF 0x20
4468 #define _RCIF 0x20
4469 #define _ADIF 0x40
4470 #define _PSPIF 0x80
4472 //==============================================================================
4475 //==============================================================================
4476 // IPR1 Bits
4478 extern __at(0x0F9F) __sfr IPR1;
4480 typedef union
4482 struct
4484 unsigned TMR1IP : 1;
4485 unsigned TMR2IP : 1;
4486 unsigned TMR1GIP : 1;
4487 unsigned SSP1IP : 1;
4488 unsigned TX1IP : 1;
4489 unsigned RC1IP : 1;
4490 unsigned ADIP : 1;
4491 unsigned PSPIP : 1;
4494 struct
4496 unsigned : 1;
4497 unsigned : 1;
4498 unsigned : 1;
4499 unsigned SSPIP : 1;
4500 unsigned TXIP : 1;
4501 unsigned RCIP : 1;
4502 unsigned : 1;
4503 unsigned : 1;
4505 } __IPR1bits_t;
4507 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
4509 #define _TMR1IP 0x01
4510 #define _TMR2IP 0x02
4511 #define _TMR1GIP 0x04
4512 #define _SSP1IP 0x08
4513 #define _SSPIP 0x08
4514 #define _TX1IP 0x10
4515 #define _TXIP 0x10
4516 #define _RC1IP 0x20
4517 #define _RCIP 0x20
4518 #define _ADIP 0x40
4519 #define _PSPIP 0x80
4521 //==============================================================================
4524 //==============================================================================
4525 // PIE2 Bits
4527 extern __at(0x0FA0) __sfr PIE2;
4529 typedef union
4531 struct
4533 unsigned TMR3GIE : 1;
4534 unsigned TMR3IE : 1;
4535 unsigned HLVDIE : 1;
4536 unsigned BCL1IE : 1;
4537 unsigned BCL2IE : 1;
4538 unsigned SSP2IE : 1;
4539 unsigned : 1;
4540 unsigned OSCFIE : 1;
4543 struct
4545 unsigned : 1;
4546 unsigned : 1;
4547 unsigned LVDIE : 1;
4548 unsigned BCLIE : 1;
4549 unsigned : 1;
4550 unsigned : 1;
4551 unsigned : 1;
4552 unsigned : 1;
4554 } __PIE2bits_t;
4556 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
4558 #define _TMR3GIE 0x01
4559 #define _TMR3IE 0x02
4560 #define _HLVDIE 0x04
4561 #define _LVDIE 0x04
4562 #define _BCL1IE 0x08
4563 #define _BCLIE 0x08
4564 #define _BCL2IE 0x10
4565 #define _SSP2IE 0x20
4566 #define _OSCFIE 0x80
4568 //==============================================================================
4571 //==============================================================================
4572 // PIR2 Bits
4574 extern __at(0x0FA1) __sfr PIR2;
4576 typedef union
4578 struct
4580 unsigned TMR3GIF : 1;
4581 unsigned TMR3IF : 1;
4582 unsigned HLVDIF : 1;
4583 unsigned BCL1IF : 1;
4584 unsigned BCL2IF : 1;
4585 unsigned SSP2IF : 1;
4586 unsigned : 1;
4587 unsigned OSCFIF : 1;
4590 struct
4592 unsigned : 1;
4593 unsigned : 1;
4594 unsigned LVDIF : 1;
4595 unsigned BCLIF : 1;
4596 unsigned : 1;
4597 unsigned : 1;
4598 unsigned : 1;
4599 unsigned : 1;
4601 } __PIR2bits_t;
4603 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
4605 #define _TMR3GIF 0x01
4606 #define _TMR3IF 0x02
4607 #define _HLVDIF 0x04
4608 #define _LVDIF 0x04
4609 #define _BCL1IF 0x08
4610 #define _BCLIF 0x08
4611 #define _BCL2IF 0x10
4612 #define _SSP2IF 0x20
4613 #define _OSCFIF 0x80
4615 //==============================================================================
4618 //==============================================================================
4619 // IPR2 Bits
4621 extern __at(0x0FA2) __sfr IPR2;
4623 typedef union
4625 struct
4627 unsigned TMR3GIP : 1;
4628 unsigned TMR3IP : 1;
4629 unsigned HLVDIP : 1;
4630 unsigned BCL1IP : 1;
4631 unsigned BCL2IP : 1;
4632 unsigned SSP2IP : 1;
4633 unsigned : 1;
4634 unsigned OSCFIP : 1;
4637 struct
4639 unsigned : 1;
4640 unsigned : 1;
4641 unsigned LVDIP : 1;
4642 unsigned BCLIP : 1;
4643 unsigned : 1;
4644 unsigned : 1;
4645 unsigned : 1;
4646 unsigned : 1;
4648 } __IPR2bits_t;
4650 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
4652 #define _TMR3GIP 0x01
4653 #define _TMR3IP 0x02
4654 #define _HLVDIP 0x04
4655 #define _LVDIP 0x04
4656 #define _BCL1IP 0x08
4657 #define _BCLIP 0x08
4658 #define _BCL2IP 0x10
4659 #define _SSP2IP 0x20
4660 #define _OSCFIP 0x80
4662 //==============================================================================
4665 //==============================================================================
4666 // PIE3 Bits
4668 extern __at(0x0FA3) __sfr PIE3;
4670 typedef struct
4672 unsigned RTCCIE : 1;
4673 unsigned CCP1IE : 1;
4674 unsigned CCP2IE : 1;
4675 unsigned CTMUIE : 1;
4676 unsigned TX2IE : 1;
4677 unsigned RC2IE : 1;
4678 unsigned : 1;
4679 unsigned TMR5GIE : 1;
4680 } __PIE3bits_t;
4682 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
4684 #define _RTCCIE 0x01
4685 #define _CCP1IE 0x02
4686 #define _CCP2IE 0x04
4687 #define _CTMUIE 0x08
4688 #define _TX2IE 0x10
4689 #define _RC2IE 0x20
4690 #define _TMR5GIE 0x80
4692 //==============================================================================
4695 //==============================================================================
4696 // PIR3 Bits
4698 extern __at(0x0FA4) __sfr PIR3;
4700 typedef struct
4702 unsigned RTCCIF : 1;
4703 unsigned CCP1IF : 1;
4704 unsigned CCP2IF : 1;
4705 unsigned CTMUIF : 1;
4706 unsigned TX2IF : 1;
4707 unsigned RC2IF : 1;
4708 unsigned : 1;
4709 unsigned TMR5GIF : 1;
4710 } __PIR3bits_t;
4712 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
4714 #define _RTCCIF 0x01
4715 #define _CCP1IF 0x02
4716 #define _CCP2IF 0x04
4717 #define _CTMUIF 0x08
4718 #define _TX2IF 0x10
4719 #define _RC2IF 0x20
4720 #define _TMR5GIF 0x80
4722 //==============================================================================
4725 //==============================================================================
4726 // IPR3 Bits
4728 extern __at(0x0FA5) __sfr IPR3;
4730 typedef struct
4732 unsigned RTCCIP : 1;
4733 unsigned CCP1IP : 1;
4734 unsigned CCP2IP : 1;
4735 unsigned CTMUIP : 1;
4736 unsigned TX2IP : 1;
4737 unsigned RC2IP : 1;
4738 unsigned : 1;
4739 unsigned TMR5GIP : 1;
4740 } __IPR3bits_t;
4742 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
4744 #define _RTCCIP 0x01
4745 #define _CCP1IP 0x02
4746 #define _CCP2IP 0x04
4747 #define _CTMUIP 0x08
4748 #define _TX2IP 0x10
4749 #define _RC2IP 0x20
4750 #define _TMR5GIP 0x80
4752 //==============================================================================
4755 //==============================================================================
4756 // PIR6 Bits
4758 extern __at(0x0FA6) __sfr PIR6;
4760 typedef struct
4762 unsigned CMP1IF : 1;
4763 unsigned CMP2IF : 1;
4764 unsigned CMP3IF : 1;
4765 unsigned : 1;
4766 unsigned EEIF : 1;
4767 unsigned : 1;
4768 unsigned : 1;
4769 unsigned : 1;
4770 } __PIR6bits_t;
4772 extern __at(0x0FA6) volatile __PIR6bits_t PIR6bits;
4774 #define _CMP1IF 0x01
4775 #define _CMP2IF 0x02
4776 #define _CMP3IF 0x04
4777 #define _EEIF 0x10
4779 //==============================================================================
4782 //==============================================================================
4783 // PSPCON Bits
4785 extern __at(0x0FA7) __sfr PSPCON;
4787 typedef struct
4789 unsigned : 1;
4790 unsigned : 1;
4791 unsigned : 1;
4792 unsigned : 1;
4793 unsigned PSPMODE : 1;
4794 unsigned IBOV : 1;
4795 unsigned OBF : 1;
4796 unsigned IBF : 1;
4797 } __PSPCONbits_t;
4799 extern __at(0x0FA7) volatile __PSPCONbits_t PSPCONbits;
4801 #define _PSPMODE 0x10
4802 #define _IBOV 0x20
4803 #define _OBF 0x40
4804 #define _IBF 0x80
4806 //==============================================================================
4809 //==============================================================================
4810 // HLVDCON Bits
4812 extern __at(0x0FA8) __sfr HLVDCON;
4814 typedef union
4816 struct
4818 unsigned HLVDL0 : 1;
4819 unsigned HLVDL1 : 1;
4820 unsigned HLVDL2 : 1;
4821 unsigned HLVDL3 : 1;
4822 unsigned HLVDEN : 1;
4823 unsigned IRVST : 1;
4824 unsigned BGVST : 1;
4825 unsigned VDIRMAG : 1;
4828 struct
4830 unsigned HLVDL : 4;
4831 unsigned : 4;
4833 } __HLVDCONbits_t;
4835 extern __at(0x0FA8) volatile __HLVDCONbits_t HLVDCONbits;
4837 #define _HLVDL0 0x01
4838 #define _HLVDL1 0x02
4839 #define _HLVDL2 0x04
4840 #define _HLVDL3 0x08
4841 #define _HLVDEN 0x10
4842 #define _IRVST 0x20
4843 #define _BGVST 0x40
4844 #define _VDIRMAG 0x80
4846 //==============================================================================
4849 //==============================================================================
4850 // IPR6 Bits
4852 extern __at(0x0FA9) __sfr IPR6;
4854 typedef struct
4856 unsigned CMP1IP : 1;
4857 unsigned CMP2IP : 1;
4858 unsigned CMP3IP : 1;
4859 unsigned : 1;
4860 unsigned EEIP : 1;
4861 unsigned : 1;
4862 unsigned : 1;
4863 unsigned : 1;
4864 } __IPR6bits_t;
4866 extern __at(0x0FA9) volatile __IPR6bits_t IPR6bits;
4868 #define _CMP1IP 0x01
4869 #define _CMP2IP 0x02
4870 #define _CMP3IP 0x04
4871 #define _EEIP 0x10
4873 //==============================================================================
4876 //==============================================================================
4877 // T1GCON Bits
4879 extern __at(0x0FAA) __sfr T1GCON;
4881 typedef union
4883 struct
4885 unsigned T1GSS0 : 1;
4886 unsigned T1GSS1 : 1;
4887 unsigned T1GVAL : 1;
4888 unsigned T1GGO_NOT_T1DONE : 1;
4889 unsigned T1GSPM : 1;
4890 unsigned T1GTM : 1;
4891 unsigned T1GPOL : 1;
4892 unsigned TMR1GE : 1;
4895 struct
4897 unsigned : 1;
4898 unsigned : 1;
4899 unsigned : 1;
4900 unsigned T1GGO : 1;
4901 unsigned : 1;
4902 unsigned : 1;
4903 unsigned : 1;
4904 unsigned : 1;
4907 struct
4909 unsigned : 1;
4910 unsigned : 1;
4911 unsigned : 1;
4912 unsigned NOT_T1DONE : 1;
4913 unsigned : 1;
4914 unsigned : 1;
4915 unsigned : 1;
4916 unsigned : 1;
4919 struct
4921 unsigned T1GSS : 2;
4922 unsigned : 6;
4924 } __T1GCONbits_t;
4926 extern __at(0x0FAA) volatile __T1GCONbits_t T1GCONbits;
4928 #define _T1GSS0 0x01
4929 #define _T1GSS1 0x02
4930 #define _T1GVAL 0x04
4931 #define _T1GGO_NOT_T1DONE 0x08
4932 #define _T1GGO 0x08
4933 #define _NOT_T1DONE 0x08
4934 #define _T1GSPM 0x10
4935 #define _T1GTM 0x20
4936 #define _T1GPOL 0x40
4937 #define _TMR1GE 0x80
4939 //==============================================================================
4942 //==============================================================================
4943 // RCSTA Bits
4945 extern __at(0x0FAB) __sfr RCSTA;
4947 typedef union
4949 struct
4951 unsigned RX9D : 1;
4952 unsigned OERR : 1;
4953 unsigned FERR : 1;
4954 unsigned ADDEN : 1;
4955 unsigned CREN : 1;
4956 unsigned SREN : 1;
4957 unsigned RX9 : 1;
4958 unsigned SPEN : 1;
4961 struct
4963 unsigned RCD8 : 1;
4964 unsigned OERR1 : 1;
4965 unsigned FERR1 : 1;
4966 unsigned ADEN : 1;
4967 unsigned CREN1 : 1;
4968 unsigned SREN1 : 1;
4969 unsigned RC9 : 1;
4970 unsigned SPEN1 : 1;
4973 struct
4975 unsigned RX9D1 : 1;
4976 unsigned : 1;
4977 unsigned : 1;
4978 unsigned ADDEN1 : 1;
4979 unsigned : 1;
4980 unsigned : 1;
4981 unsigned NOT_RC8 : 1;
4982 unsigned : 1;
4985 struct
4987 unsigned : 1;
4988 unsigned : 1;
4989 unsigned : 1;
4990 unsigned : 1;
4991 unsigned : 1;
4992 unsigned : 1;
4993 unsigned RC8_9 : 1;
4994 unsigned : 1;
4997 struct
4999 unsigned : 1;
5000 unsigned : 1;
5001 unsigned : 1;
5002 unsigned : 1;
5003 unsigned : 1;
5004 unsigned : 1;
5005 unsigned RX91 : 1;
5006 unsigned : 1;
5008 } __RCSTAbits_t;
5010 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
5012 #define _RX9D 0x01
5013 #define _RCD8 0x01
5014 #define _RX9D1 0x01
5015 #define _OERR 0x02
5016 #define _OERR1 0x02
5017 #define _FERR 0x04
5018 #define _FERR1 0x04
5019 #define _ADDEN 0x08
5020 #define _ADEN 0x08
5021 #define _ADDEN1 0x08
5022 #define _CREN 0x10
5023 #define _CREN1 0x10
5024 #define _SREN 0x20
5025 #define _SREN1 0x20
5026 #define _RX9 0x40
5027 #define _RC9 0x40
5028 #define _NOT_RC8 0x40
5029 #define _RC8_9 0x40
5030 #define _RX91 0x40
5031 #define _SPEN 0x80
5032 #define _SPEN1 0x80
5034 //==============================================================================
5037 //==============================================================================
5038 // RCSTA1 Bits
5040 extern __at(0x0FAB) __sfr RCSTA1;
5042 typedef union
5044 struct
5046 unsigned RX9D : 1;
5047 unsigned OERR : 1;
5048 unsigned FERR : 1;
5049 unsigned ADDEN : 1;
5050 unsigned CREN : 1;
5051 unsigned SREN : 1;
5052 unsigned RX9 : 1;
5053 unsigned SPEN : 1;
5056 struct
5058 unsigned RCD8 : 1;
5059 unsigned OERR1 : 1;
5060 unsigned FERR1 : 1;
5061 unsigned ADEN : 1;
5062 unsigned CREN1 : 1;
5063 unsigned SREN1 : 1;
5064 unsigned RC9 : 1;
5065 unsigned SPEN1 : 1;
5068 struct
5070 unsigned RX9D1 : 1;
5071 unsigned : 1;
5072 unsigned : 1;
5073 unsigned ADDEN1 : 1;
5074 unsigned : 1;
5075 unsigned : 1;
5076 unsigned NOT_RC8 : 1;
5077 unsigned : 1;
5080 struct
5082 unsigned : 1;
5083 unsigned : 1;
5084 unsigned : 1;
5085 unsigned : 1;
5086 unsigned : 1;
5087 unsigned : 1;
5088 unsigned RC8_9 : 1;
5089 unsigned : 1;
5092 struct
5094 unsigned : 1;
5095 unsigned : 1;
5096 unsigned : 1;
5097 unsigned : 1;
5098 unsigned : 1;
5099 unsigned : 1;
5100 unsigned RX91 : 1;
5101 unsigned : 1;
5103 } __RCSTA1bits_t;
5105 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
5107 #define _RCSTA1_RX9D 0x01
5108 #define _RCSTA1_RCD8 0x01
5109 #define _RCSTA1_RX9D1 0x01
5110 #define _RCSTA1_OERR 0x02
5111 #define _RCSTA1_OERR1 0x02
5112 #define _RCSTA1_FERR 0x04
5113 #define _RCSTA1_FERR1 0x04
5114 #define _RCSTA1_ADDEN 0x08
5115 #define _RCSTA1_ADEN 0x08
5116 #define _RCSTA1_ADDEN1 0x08
5117 #define _RCSTA1_CREN 0x10
5118 #define _RCSTA1_CREN1 0x10
5119 #define _RCSTA1_SREN 0x20
5120 #define _RCSTA1_SREN1 0x20
5121 #define _RCSTA1_RX9 0x40
5122 #define _RCSTA1_RC9 0x40
5123 #define _RCSTA1_NOT_RC8 0x40
5124 #define _RCSTA1_RC8_9 0x40
5125 #define _RCSTA1_RX91 0x40
5126 #define _RCSTA1_SPEN 0x80
5127 #define _RCSTA1_SPEN1 0x80
5129 //==============================================================================
5132 //==============================================================================
5133 // TXSTA Bits
5135 extern __at(0x0FAC) __sfr TXSTA;
5137 typedef union
5139 struct
5141 unsigned TX9D : 1;
5142 unsigned TRMT : 1;
5143 unsigned BRGH : 1;
5144 unsigned SENDB : 1;
5145 unsigned SYNC : 1;
5146 unsigned TXEN : 1;
5147 unsigned TX9 : 1;
5148 unsigned CSRC : 1;
5151 struct
5153 unsigned TXD8 : 1;
5154 unsigned TRMT1 : 1;
5155 unsigned BRGH1 : 1;
5156 unsigned SENDB1 : 1;
5157 unsigned SYNC1 : 1;
5158 unsigned TXEN1 : 1;
5159 unsigned TX8_9 : 1;
5160 unsigned CSRC1 : 1;
5163 struct
5165 unsigned TX9D1 : 1;
5166 unsigned : 1;
5167 unsigned : 1;
5168 unsigned : 1;
5169 unsigned : 1;
5170 unsigned : 1;
5171 unsigned NOT_TX8 : 1;
5172 unsigned : 1;
5175 struct
5177 unsigned : 1;
5178 unsigned : 1;
5179 unsigned : 1;
5180 unsigned : 1;
5181 unsigned : 1;
5182 unsigned : 1;
5183 unsigned TX91 : 1;
5184 unsigned : 1;
5186 } __TXSTAbits_t;
5188 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
5190 #define _TX9D 0x01
5191 #define _TXD8 0x01
5192 #define _TX9D1 0x01
5193 #define _TRMT 0x02
5194 #define _TRMT1 0x02
5195 #define _BRGH 0x04
5196 #define _BRGH1 0x04
5197 #define _SENDB 0x08
5198 #define _SENDB1 0x08
5199 #define _SYNC 0x10
5200 #define _SYNC1 0x10
5201 #define _TXEN 0x20
5202 #define _TXEN1 0x20
5203 #define _TX9 0x40
5204 #define _TX8_9 0x40
5205 #define _NOT_TX8 0x40
5206 #define _TX91 0x40
5207 #define _CSRC 0x80
5208 #define _CSRC1 0x80
5210 //==============================================================================
5213 //==============================================================================
5214 // TXSTA1 Bits
5216 extern __at(0x0FAC) __sfr TXSTA1;
5218 typedef union
5220 struct
5222 unsigned TX9D : 1;
5223 unsigned TRMT : 1;
5224 unsigned BRGH : 1;
5225 unsigned SENDB : 1;
5226 unsigned SYNC : 1;
5227 unsigned TXEN : 1;
5228 unsigned TX9 : 1;
5229 unsigned CSRC : 1;
5232 struct
5234 unsigned TXD8 : 1;
5235 unsigned TRMT1 : 1;
5236 unsigned BRGH1 : 1;
5237 unsigned SENDB1 : 1;
5238 unsigned SYNC1 : 1;
5239 unsigned TXEN1 : 1;
5240 unsigned TX8_9 : 1;
5241 unsigned CSRC1 : 1;
5244 struct
5246 unsigned TX9D1 : 1;
5247 unsigned : 1;
5248 unsigned : 1;
5249 unsigned : 1;
5250 unsigned : 1;
5251 unsigned : 1;
5252 unsigned NOT_TX8 : 1;
5253 unsigned : 1;
5256 struct
5258 unsigned : 1;
5259 unsigned : 1;
5260 unsigned : 1;
5261 unsigned : 1;
5262 unsigned : 1;
5263 unsigned : 1;
5264 unsigned TX91 : 1;
5265 unsigned : 1;
5267 } __TXSTA1bits_t;
5269 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
5271 #define _TXSTA1_TX9D 0x01
5272 #define _TXSTA1_TXD8 0x01
5273 #define _TXSTA1_TX9D1 0x01
5274 #define _TXSTA1_TRMT 0x02
5275 #define _TXSTA1_TRMT1 0x02
5276 #define _TXSTA1_BRGH 0x04
5277 #define _TXSTA1_BRGH1 0x04
5278 #define _TXSTA1_SENDB 0x08
5279 #define _TXSTA1_SENDB1 0x08
5280 #define _TXSTA1_SYNC 0x10
5281 #define _TXSTA1_SYNC1 0x10
5282 #define _TXSTA1_TXEN 0x20
5283 #define _TXSTA1_TXEN1 0x20
5284 #define _TXSTA1_TX9 0x40
5285 #define _TXSTA1_TX8_9 0x40
5286 #define _TXSTA1_NOT_TX8 0x40
5287 #define _TXSTA1_TX91 0x40
5288 #define _TXSTA1_CSRC 0x80
5289 #define _TXSTA1_CSRC1 0x80
5291 //==============================================================================
5293 extern __at(0x0FAD) __sfr TXREG;
5294 extern __at(0x0FAD) __sfr TXREG1;
5295 extern __at(0x0FAE) __sfr RCREG;
5296 extern __at(0x0FAE) __sfr RCREG1;
5297 extern __at(0x0FAF) __sfr SPBRG;
5298 extern __at(0x0FAF) __sfr SPBRG1;
5300 //==============================================================================
5301 // T3GCON Bits
5303 extern __at(0x0FB0) __sfr T3GCON;
5305 typedef union
5307 struct
5309 unsigned T3GSS0 : 1;
5310 unsigned T3GSS1 : 1;
5311 unsigned T3GVAL : 1;
5312 unsigned T3GGO_NOT_T3DONE : 1;
5313 unsigned T3GSPM : 1;
5314 unsigned T3GTM : 1;
5315 unsigned T3GPOL : 1;
5316 unsigned TMR3GE : 1;
5319 struct
5321 unsigned : 1;
5322 unsigned : 1;
5323 unsigned : 1;
5324 unsigned T3GGO : 1;
5325 unsigned : 1;
5326 unsigned : 1;
5327 unsigned : 1;
5328 unsigned : 1;
5331 struct
5333 unsigned : 1;
5334 unsigned : 1;
5335 unsigned : 1;
5336 unsigned NOT_T3DONE : 1;
5337 unsigned : 1;
5338 unsigned : 1;
5339 unsigned : 1;
5340 unsigned : 1;
5343 struct
5345 unsigned T3GSS : 2;
5346 unsigned : 6;
5348 } __T3GCONbits_t;
5350 extern __at(0x0FB0) volatile __T3GCONbits_t T3GCONbits;
5352 #define _T3GSS0 0x01
5353 #define _T3GSS1 0x02
5354 #define _T3GVAL 0x04
5355 #define _T3GGO_NOT_T3DONE 0x08
5356 #define _T3GGO 0x08
5357 #define _NOT_T3DONE 0x08
5358 #define _T3GSPM 0x10
5359 #define _T3GTM 0x20
5360 #define _T3GPOL 0x40
5361 #define _TMR3GE 0x80
5363 //==============================================================================
5366 //==============================================================================
5367 // T3CON Bits
5369 extern __at(0x0FB1) __sfr T3CON;
5371 typedef union
5373 struct
5375 unsigned TMR3ON : 1;
5376 unsigned RD16 : 1;
5377 unsigned NOT_T3SYNC : 1;
5378 unsigned SOSCEN : 1;
5379 unsigned T3CKPS0 : 1;
5380 unsigned T3CKPS1 : 1;
5381 unsigned TMR3CS0 : 1;
5382 unsigned TMR3CS1 : 1;
5385 struct
5387 unsigned : 4;
5388 unsigned T3CKPS : 2;
5389 unsigned : 2;
5392 struct
5394 unsigned : 6;
5395 unsigned TMR3CS : 2;
5397 } __T3CONbits_t;
5399 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
5401 #define _T3CON_TMR3ON 0x01
5402 #define _T3CON_RD16 0x02
5403 #define _T3CON_NOT_T3SYNC 0x04
5404 #define _T3CON_SOSCEN 0x08
5405 #define _T3CON_T3CKPS0 0x10
5406 #define _T3CON_T3CKPS1 0x20
5407 #define _T3CON_TMR3CS0 0x40
5408 #define _T3CON_TMR3CS1 0x80
5410 //==============================================================================
5412 extern __at(0x0FB2) __sfr TMR3;
5413 extern __at(0x0FB2) __sfr TMR3L;
5414 extern __at(0x0FB3) __sfr TMR3H;
5416 //==============================================================================
5417 // CMSTAT Bits
5419 extern __at(0x0FB4) __sfr CMSTAT;
5421 typedef struct
5423 unsigned : 1;
5424 unsigned : 1;
5425 unsigned : 1;
5426 unsigned : 1;
5427 unsigned : 1;
5428 unsigned CMP1OUT : 1;
5429 unsigned CMP2OUT : 1;
5430 unsigned CMP3OUT : 1;
5431 } __CMSTATbits_t;
5433 extern __at(0x0FB4) volatile __CMSTATbits_t CMSTATbits;
5435 #define _CMP1OUT 0x20
5436 #define _CMP2OUT 0x40
5437 #define _CMP3OUT 0x80
5439 //==============================================================================
5442 //==============================================================================
5443 // CMSTATUS Bits
5445 extern __at(0x0FB4) __sfr CMSTATUS;
5447 typedef struct
5449 unsigned : 1;
5450 unsigned : 1;
5451 unsigned : 1;
5452 unsigned : 1;
5453 unsigned : 1;
5454 unsigned CMP1OUT : 1;
5455 unsigned CMP2OUT : 1;
5456 unsigned CMP3OUT : 1;
5457 } __CMSTATUSbits_t;
5459 extern __at(0x0FB4) volatile __CMSTATUSbits_t CMSTATUSbits;
5461 #define _CMSTATUS_CMP1OUT 0x20
5462 #define _CMSTATUS_CMP2OUT 0x40
5463 #define _CMSTATUS_CMP3OUT 0x80
5465 //==============================================================================
5468 //==============================================================================
5469 // CVRCON Bits
5471 extern __at(0x0FB5) __sfr CVRCON;
5473 typedef union
5475 struct
5477 unsigned CVR0 : 1;
5478 unsigned CVR1 : 1;
5479 unsigned CVR2 : 1;
5480 unsigned CVR3 : 1;
5481 unsigned CVR4 : 1;
5482 unsigned CVRSS : 1;
5483 unsigned CVROE : 1;
5484 unsigned CVREN : 1;
5487 struct
5489 unsigned CVR : 5;
5490 unsigned : 3;
5492 } __CVRCONbits_t;
5494 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
5496 #define _CVR0 0x01
5497 #define _CVR1 0x02
5498 #define _CVR2 0x04
5499 #define _CVR3 0x08
5500 #define _CVR4 0x10
5501 #define _CVRSS 0x20
5502 #define _CVROE 0x40
5503 #define _CVREN 0x80
5505 //==============================================================================
5508 //==============================================================================
5509 // PIE4 Bits
5511 extern __at(0x0FB6) __sfr PIE4;
5513 typedef struct
5515 unsigned CCP3IE : 1;
5516 unsigned CCP4IE : 1;
5517 unsigned CCP5IE : 1;
5518 unsigned CCP6IE : 1;
5519 unsigned CCP7IE : 1;
5520 unsigned CCP8IE : 1;
5521 unsigned CCP9IE : 1;
5522 unsigned CCP10IE : 1;
5523 } __PIE4bits_t;
5525 extern __at(0x0FB6) volatile __PIE4bits_t PIE4bits;
5527 #define _CCP3IE 0x01
5528 #define _CCP4IE 0x02
5529 #define _CCP5IE 0x04
5530 #define _CCP6IE 0x08
5531 #define _CCP7IE 0x10
5532 #define _CCP8IE 0x20
5533 #define _CCP9IE 0x40
5534 #define _CCP10IE 0x80
5536 //==============================================================================
5539 //==============================================================================
5540 // PIR4 Bits
5542 extern __at(0x0FB7) __sfr PIR4;
5544 typedef struct
5546 unsigned CCP3IF : 1;
5547 unsigned CCP4IF : 1;
5548 unsigned CCP5IF : 1;
5549 unsigned CCP6IF : 1;
5550 unsigned CCP7IF : 1;
5551 unsigned CCP8IF : 1;
5552 unsigned CCP9IF : 1;
5553 unsigned CCP10IF : 1;
5554 } __PIR4bits_t;
5556 extern __at(0x0FB7) volatile __PIR4bits_t PIR4bits;
5558 #define _CCP3IF 0x01
5559 #define _CCP4IF 0x02
5560 #define _CCP5IF 0x04
5561 #define _CCP6IF 0x08
5562 #define _CCP7IF 0x10
5563 #define _CCP8IF 0x20
5564 #define _CCP9IF 0x40
5565 #define _CCP10IF 0x80
5567 //==============================================================================
5570 //==============================================================================
5571 // IPR4 Bits
5573 extern __at(0x0FB8) __sfr IPR4;
5575 typedef struct
5577 unsigned CCP3IP : 1;
5578 unsigned CCP4IP : 1;
5579 unsigned CCP5IP : 1;
5580 unsigned CCP6IP : 1;
5581 unsigned CCP7IP : 1;
5582 unsigned CCP8IP : 1;
5583 unsigned CCP9IP : 1;
5584 unsigned CCP10IP : 1;
5585 } __IPR4bits_t;
5587 extern __at(0x0FB8) volatile __IPR4bits_t IPR4bits;
5589 #define _CCP3IP 0x01
5590 #define _CCP4IP 0x02
5591 #define _CCP5IP 0x04
5592 #define _CCP6IP 0x08
5593 #define _CCP7IP 0x10
5594 #define _CCP8IP 0x20
5595 #define _CCP9IP 0x40
5596 #define _CCP10IP 0x80
5598 //==============================================================================
5601 //==============================================================================
5602 // PIE5 Bits
5604 extern __at(0x0FB9) __sfr PIE5;
5606 typedef struct
5608 unsigned TMR4IE : 1;
5609 unsigned TMR5IE : 1;
5610 unsigned TMR6IE : 1;
5611 unsigned TMR7IE : 1;
5612 unsigned TMR8IE : 1;
5613 unsigned TMR10IE : 1;
5614 unsigned TMR12IE : 1;
5615 unsigned TMR7GIE : 1;
5616 } __PIE5bits_t;
5618 extern __at(0x0FB9) volatile __PIE5bits_t PIE5bits;
5620 #define _TMR4IE 0x01
5621 #define _TMR5IE 0x02
5622 #define _TMR6IE 0x04
5623 #define _TMR7IE 0x08
5624 #define _TMR8IE 0x10
5625 #define _TMR10IE 0x20
5626 #define _TMR12IE 0x40
5627 #define _TMR7GIE 0x80
5629 //==============================================================================
5632 //==============================================================================
5633 // PIR5 Bits
5635 extern __at(0x0FBA) __sfr PIR5;
5637 typedef struct
5639 unsigned TMR4IF : 1;
5640 unsigned TMR5IF : 1;
5641 unsigned TMR6IF : 1;
5642 unsigned TMR7IF : 1;
5643 unsigned TMR8IF : 1;
5644 unsigned TMR10IF : 1;
5645 unsigned TMR12IF : 1;
5646 unsigned TMR7GIF : 1;
5647 } __PIR5bits_t;
5649 extern __at(0x0FBA) volatile __PIR5bits_t PIR5bits;
5651 #define _TMR4IF 0x01
5652 #define _TMR5IF 0x02
5653 #define _TMR6IF 0x04
5654 #define _TMR7IF 0x08
5655 #define _TMR8IF 0x10
5656 #define _TMR10IF 0x20
5657 #define _TMR12IF 0x40
5658 #define _TMR7GIF 0x80
5660 //==============================================================================
5663 //==============================================================================
5664 // CCP1CON Bits
5666 extern __at(0x0FBB) __sfr CCP1CON;
5668 typedef union
5670 struct
5672 unsigned CCP1M0 : 1;
5673 unsigned CCP1M1 : 1;
5674 unsigned CCP1M2 : 1;
5675 unsigned CCP1M3 : 1;
5676 unsigned DC1B0 : 1;
5677 unsigned DC1B1 : 1;
5678 unsigned P1M0 : 1;
5679 unsigned P1M1 : 1;
5682 struct
5684 unsigned : 1;
5685 unsigned : 1;
5686 unsigned : 1;
5687 unsigned : 1;
5688 unsigned CCP1Y : 1;
5689 unsigned CCP1X : 1;
5690 unsigned : 1;
5691 unsigned : 1;
5694 struct
5696 unsigned CCP1M : 4;
5697 unsigned : 4;
5700 struct
5702 unsigned : 4;
5703 unsigned DC1B : 2;
5704 unsigned : 2;
5707 struct
5709 unsigned : 6;
5710 unsigned P1M : 2;
5712 } __CCP1CONbits_t;
5714 extern __at(0x0FBB) volatile __CCP1CONbits_t CCP1CONbits;
5716 #define _CCP1M0 0x01
5717 #define _CCP1M1 0x02
5718 #define _CCP1M2 0x04
5719 #define _CCP1M3 0x08
5720 #define _DC1B0 0x10
5721 #define _CCP1Y 0x10
5722 #define _DC1B1 0x20
5723 #define _CCP1X 0x20
5724 #define _P1M0 0x40
5725 #define _P1M1 0x80
5727 //==============================================================================
5730 //==============================================================================
5731 // ECCP1CON Bits
5733 extern __at(0x0FBB) __sfr ECCP1CON;
5735 typedef union
5737 struct
5739 unsigned CCP1M0 : 1;
5740 unsigned CCP1M1 : 1;
5741 unsigned CCP1M2 : 1;
5742 unsigned CCP1M3 : 1;
5743 unsigned DC1B0 : 1;
5744 unsigned DC1B1 : 1;
5745 unsigned P1M0 : 1;
5746 unsigned P1M1 : 1;
5749 struct
5751 unsigned : 1;
5752 unsigned : 1;
5753 unsigned : 1;
5754 unsigned : 1;
5755 unsigned CCP1Y : 1;
5756 unsigned CCP1X : 1;
5757 unsigned : 1;
5758 unsigned : 1;
5761 struct
5763 unsigned CCP1M : 4;
5764 unsigned : 4;
5767 struct
5769 unsigned : 4;
5770 unsigned DC1B : 2;
5771 unsigned : 2;
5774 struct
5776 unsigned : 6;
5777 unsigned P1M : 2;
5779 } __ECCP1CONbits_t;
5781 extern __at(0x0FBB) volatile __ECCP1CONbits_t ECCP1CONbits;
5783 #define _ECCP1CON_CCP1M0 0x01
5784 #define _ECCP1CON_CCP1M1 0x02
5785 #define _ECCP1CON_CCP1M2 0x04
5786 #define _ECCP1CON_CCP1M3 0x08
5787 #define _ECCP1CON_DC1B0 0x10
5788 #define _ECCP1CON_CCP1Y 0x10
5789 #define _ECCP1CON_DC1B1 0x20
5790 #define _ECCP1CON_CCP1X 0x20
5791 #define _ECCP1CON_P1M0 0x40
5792 #define _ECCP1CON_P1M1 0x80
5794 //==============================================================================
5796 extern __at(0x0FBC) __sfr CCPR1;
5797 extern __at(0x0FBC) __sfr CCPR1L;
5798 extern __at(0x0FBD) __sfr CCPR1H;
5800 //==============================================================================
5801 // ECCP1DEL Bits
5803 extern __at(0x0FBE) __sfr ECCP1DEL;
5805 typedef union
5807 struct
5809 unsigned P1DC0 : 1;
5810 unsigned P1DC1 : 1;
5811 unsigned P1DC2 : 1;
5812 unsigned P1DC3 : 1;
5813 unsigned P1DC4 : 1;
5814 unsigned P1DC5 : 1;
5815 unsigned P1DC6 : 1;
5816 unsigned P1RSEN : 1;
5819 struct
5821 unsigned P1DC : 7;
5822 unsigned : 1;
5824 } __ECCP1DELbits_t;
5826 extern __at(0x0FBE) volatile __ECCP1DELbits_t ECCP1DELbits;
5828 #define _P1DC0 0x01
5829 #define _P1DC1 0x02
5830 #define _P1DC2 0x04
5831 #define _P1DC3 0x08
5832 #define _P1DC4 0x10
5833 #define _P1DC5 0x20
5834 #define _P1DC6 0x40
5835 #define _P1RSEN 0x80
5837 //==============================================================================
5840 //==============================================================================
5841 // PWM1CON Bits
5843 extern __at(0x0FBE) __sfr PWM1CON;
5845 typedef union
5847 struct
5849 unsigned P1DC0 : 1;
5850 unsigned P1DC1 : 1;
5851 unsigned P1DC2 : 1;
5852 unsigned P1DC3 : 1;
5853 unsigned P1DC4 : 1;
5854 unsigned P1DC5 : 1;
5855 unsigned P1DC6 : 1;
5856 unsigned P1RSEN : 1;
5859 struct
5861 unsigned P1DC : 7;
5862 unsigned : 1;
5864 } __PWM1CONbits_t;
5866 extern __at(0x0FBE) volatile __PWM1CONbits_t PWM1CONbits;
5868 #define _PWM1CON_P1DC0 0x01
5869 #define _PWM1CON_P1DC1 0x02
5870 #define _PWM1CON_P1DC2 0x04
5871 #define _PWM1CON_P1DC3 0x08
5872 #define _PWM1CON_P1DC4 0x10
5873 #define _PWM1CON_P1DC5 0x20
5874 #define _PWM1CON_P1DC6 0x40
5875 #define _PWM1CON_P1RSEN 0x80
5877 //==============================================================================
5880 //==============================================================================
5881 // ECCP1AS Bits
5883 extern __at(0x0FBF) __sfr ECCP1AS;
5885 typedef union
5887 struct
5889 unsigned PSS1BD0 : 1;
5890 unsigned PSS1BD1 : 1;
5891 unsigned PSS1AC0 : 1;
5892 unsigned PSS1AC1 : 1;
5893 unsigned ECCP1AS0 : 1;
5894 unsigned ECCP1AS1 : 1;
5895 unsigned ECCP1AS2 : 1;
5896 unsigned ECCP1ASE : 1;
5899 struct
5901 unsigned PSS1BD : 2;
5902 unsigned : 6;
5905 struct
5907 unsigned : 2;
5908 unsigned PSS1AC : 2;
5909 unsigned : 4;
5912 struct
5914 unsigned : 4;
5915 unsigned ECCP1AS : 3;
5916 unsigned : 1;
5918 } __ECCP1ASbits_t;
5920 extern __at(0x0FBF) volatile __ECCP1ASbits_t ECCP1ASbits;
5922 #define _PSS1BD0 0x01
5923 #define _PSS1BD1 0x02
5924 #define _PSS1AC0 0x04
5925 #define _PSS1AC1 0x08
5926 #define _ECCP1AS0 0x10
5927 #define _ECCP1AS1 0x20
5928 #define _ECCP1AS2 0x40
5929 #define _ECCP1ASE 0x80
5931 //==============================================================================
5934 //==============================================================================
5935 // ADCON2 Bits
5937 extern __at(0x0FC0) __sfr ADCON2;
5939 typedef union
5941 struct
5943 unsigned ADCS0 : 1;
5944 unsigned ADCS1 : 1;
5945 unsigned ADCS2 : 1;
5946 unsigned ACQT0 : 1;
5947 unsigned ACQT1 : 1;
5948 unsigned ACQT2 : 1;
5949 unsigned : 1;
5950 unsigned ADFM : 1;
5953 struct
5955 unsigned ADCS : 3;
5956 unsigned : 5;
5959 struct
5961 unsigned : 3;
5962 unsigned ACQT : 3;
5963 unsigned : 2;
5965 } __ADCON2bits_t;
5967 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
5969 #define _ADCS0 0x01
5970 #define _ADCS1 0x02
5971 #define _ADCS2 0x04
5972 #define _ACQT0 0x08
5973 #define _ACQT1 0x10
5974 #define _ACQT2 0x20
5975 #define _ADFM 0x80
5977 //==============================================================================
5980 //==============================================================================
5981 // ADCON1 Bits
5983 extern __at(0x0FC1) __sfr ADCON1;
5985 typedef union
5987 struct
5989 unsigned CHSN0 : 1;
5990 unsigned CHSN1 : 1;
5991 unsigned CHSN2 : 1;
5992 unsigned VNCFG : 1;
5993 unsigned VCFG0 : 1;
5994 unsigned VCFG1 : 1;
5995 unsigned TRIGSEL0 : 1;
5996 unsigned TRIGSEL1 : 1;
5999 struct
6001 unsigned CHSN : 3;
6002 unsigned : 5;
6005 struct
6007 unsigned : 4;
6008 unsigned VCFG : 2;
6009 unsigned : 2;
6012 struct
6014 unsigned : 6;
6015 unsigned TRIGSEL : 2;
6017 } __ADCON1bits_t;
6019 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
6021 #define _CHSN0 0x01
6022 #define _CHSN1 0x02
6023 #define _CHSN2 0x04
6024 #define _VNCFG 0x08
6025 #define _VCFG0 0x10
6026 #define _VCFG1 0x20
6027 #define _TRIGSEL0 0x40
6028 #define _TRIGSEL1 0x80
6030 //==============================================================================
6033 //==============================================================================
6034 // ADCON0 Bits
6036 extern __at(0x0FC2) __sfr ADCON0;
6038 typedef union
6040 struct
6042 unsigned ADON : 1;
6043 unsigned GO_NOT_DONE : 1;
6044 unsigned CHS0 : 1;
6045 unsigned CHS1 : 1;
6046 unsigned CHS2 : 1;
6047 unsigned CHS3 : 1;
6048 unsigned CHS4 : 1;
6049 unsigned : 1;
6052 struct
6054 unsigned : 1;
6055 unsigned DONE : 1;
6056 unsigned : 1;
6057 unsigned : 1;
6058 unsigned : 1;
6059 unsigned : 1;
6060 unsigned : 1;
6061 unsigned : 1;
6064 struct
6066 unsigned : 1;
6067 unsigned GO : 1;
6068 unsigned : 1;
6069 unsigned : 1;
6070 unsigned : 1;
6071 unsigned : 1;
6072 unsigned : 1;
6073 unsigned : 1;
6076 struct
6078 unsigned : 1;
6079 unsigned NOT_DONE : 1;
6080 unsigned : 1;
6081 unsigned : 1;
6082 unsigned : 1;
6083 unsigned : 1;
6084 unsigned : 1;
6085 unsigned : 1;
6088 struct
6090 unsigned : 2;
6091 unsigned CHS : 5;
6092 unsigned : 1;
6094 } __ADCON0bits_t;
6096 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
6098 #define _ADON 0x01
6099 #define _GO_NOT_DONE 0x02
6100 #define _DONE 0x02
6101 #define _GO 0x02
6102 #define _NOT_DONE 0x02
6103 #define _CHS0 0x04
6104 #define _CHS1 0x08
6105 #define _CHS2 0x10
6106 #define _CHS3 0x20
6107 #define _CHS4 0x40
6109 //==============================================================================
6111 extern __at(0x0FC3) __sfr ADRES;
6112 extern __at(0x0FC3) __sfr ADRESL;
6113 extern __at(0x0FC4) __sfr ADRESH;
6115 //==============================================================================
6116 // SSP1CON2 Bits
6118 extern __at(0x0FC5) __sfr SSP1CON2;
6120 typedef union
6122 struct
6124 unsigned SEN : 1;
6125 unsigned RSEN : 1;
6126 unsigned PEN : 1;
6127 unsigned RCEN : 1;
6128 unsigned ACKEN : 1;
6129 unsigned ACKDT : 1;
6130 unsigned ACKSTAT : 1;
6131 unsigned GCEN : 1;
6134 struct
6136 unsigned : 1;
6137 unsigned ADMSK1 : 1;
6138 unsigned ADMSK2 : 1;
6139 unsigned ADMSK3 : 1;
6140 unsigned ADMSK4 : 1;
6141 unsigned ADMSK5 : 1;
6142 unsigned : 1;
6143 unsigned : 1;
6145 } __SSP1CON2bits_t;
6147 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
6149 #define _SEN 0x01
6150 #define _RSEN 0x02
6151 #define _ADMSK1 0x02
6152 #define _PEN 0x04
6153 #define _ADMSK2 0x04
6154 #define _RCEN 0x08
6155 #define _ADMSK3 0x08
6156 #define _ACKEN 0x10
6157 #define _ADMSK4 0x10
6158 #define _ACKDT 0x20
6159 #define _ADMSK5 0x20
6160 #define _ACKSTAT 0x40
6161 #define _GCEN 0x80
6163 //==============================================================================
6166 //==============================================================================
6167 // SSPCON2 Bits
6169 extern __at(0x0FC5) __sfr SSPCON2;
6171 typedef union
6173 struct
6175 unsigned SEN : 1;
6176 unsigned RSEN : 1;
6177 unsigned PEN : 1;
6178 unsigned RCEN : 1;
6179 unsigned ACKEN : 1;
6180 unsigned ACKDT : 1;
6181 unsigned ACKSTAT : 1;
6182 unsigned GCEN : 1;
6185 struct
6187 unsigned : 1;
6188 unsigned ADMSK1 : 1;
6189 unsigned ADMSK2 : 1;
6190 unsigned ADMSK3 : 1;
6191 unsigned ADMSK4 : 1;
6192 unsigned ADMSK5 : 1;
6193 unsigned : 1;
6194 unsigned : 1;
6196 } __SSPCON2bits_t;
6198 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
6200 #define _SSPCON2_SEN 0x01
6201 #define _SSPCON2_RSEN 0x02
6202 #define _SSPCON2_ADMSK1 0x02
6203 #define _SSPCON2_PEN 0x04
6204 #define _SSPCON2_ADMSK2 0x04
6205 #define _SSPCON2_RCEN 0x08
6206 #define _SSPCON2_ADMSK3 0x08
6207 #define _SSPCON2_ACKEN 0x10
6208 #define _SSPCON2_ADMSK4 0x10
6209 #define _SSPCON2_ACKDT 0x20
6210 #define _SSPCON2_ADMSK5 0x20
6211 #define _SSPCON2_ACKSTAT 0x40
6212 #define _SSPCON2_GCEN 0x80
6214 //==============================================================================
6217 //==============================================================================
6218 // SSP1CON1 Bits
6220 extern __at(0x0FC6) __sfr SSP1CON1;
6222 typedef union
6224 struct
6226 unsigned SSPM0 : 1;
6227 unsigned SSPM1 : 1;
6228 unsigned SSPM2 : 1;
6229 unsigned SSPM3 : 1;
6230 unsigned CKP : 1;
6231 unsigned SSPEN : 1;
6232 unsigned SSPOV : 1;
6233 unsigned WCOL : 1;
6236 struct
6238 unsigned SSPM : 4;
6239 unsigned : 4;
6241 } __SSP1CON1bits_t;
6243 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
6245 #define _SSPM0 0x01
6246 #define _SSPM1 0x02
6247 #define _SSPM2 0x04
6248 #define _SSPM3 0x08
6249 #define _CKP 0x10
6250 #define _SSPEN 0x20
6251 #define _SSPOV 0x40
6252 #define _WCOL 0x80
6254 //==============================================================================
6257 //==============================================================================
6258 // SSPCON1 Bits
6260 extern __at(0x0FC6) __sfr SSPCON1;
6262 typedef union
6264 struct
6266 unsigned SSPM0 : 1;
6267 unsigned SSPM1 : 1;
6268 unsigned SSPM2 : 1;
6269 unsigned SSPM3 : 1;
6270 unsigned CKP : 1;
6271 unsigned SSPEN : 1;
6272 unsigned SSPOV : 1;
6273 unsigned WCOL : 1;
6276 struct
6278 unsigned SSPM : 4;
6279 unsigned : 4;
6281 } __SSPCON1bits_t;
6283 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
6285 #define _SSPCON1_SSPM0 0x01
6286 #define _SSPCON1_SSPM1 0x02
6287 #define _SSPCON1_SSPM2 0x04
6288 #define _SSPCON1_SSPM3 0x08
6289 #define _SSPCON1_CKP 0x10
6290 #define _SSPCON1_SSPEN 0x20
6291 #define _SSPCON1_SSPOV 0x40
6292 #define _SSPCON1_WCOL 0x80
6294 //==============================================================================
6297 //==============================================================================
6298 // SSP1STAT Bits
6300 extern __at(0x0FC7) __sfr SSP1STAT;
6302 typedef union
6304 struct
6306 unsigned BF : 1;
6307 unsigned UA : 1;
6308 unsigned R_NOT_W : 1;
6309 unsigned S : 1;
6310 unsigned P : 1;
6311 unsigned D_NOT_A : 1;
6312 unsigned CKE : 1;
6313 unsigned SMP : 1;
6316 struct
6318 unsigned : 1;
6319 unsigned : 1;
6320 unsigned R : 1;
6321 unsigned I2C_START : 1;
6322 unsigned I2C_STOP : 1;
6323 unsigned D : 1;
6324 unsigned : 1;
6325 unsigned : 1;
6328 struct
6330 unsigned : 1;
6331 unsigned : 1;
6332 unsigned R_W : 1;
6333 unsigned : 1;
6334 unsigned : 1;
6335 unsigned D_A : 1;
6336 unsigned : 1;
6337 unsigned : 1;
6340 struct
6342 unsigned : 1;
6343 unsigned : 1;
6344 unsigned NOT_W : 1;
6345 unsigned : 1;
6346 unsigned : 1;
6347 unsigned NOT_A : 1;
6348 unsigned : 1;
6349 unsigned : 1;
6352 struct
6354 unsigned : 1;
6355 unsigned : 1;
6356 unsigned NOT_WRITE : 1;
6357 unsigned : 1;
6358 unsigned : 1;
6359 unsigned NOT_ADDRESS : 1;
6360 unsigned : 1;
6361 unsigned : 1;
6364 struct
6366 unsigned : 1;
6367 unsigned : 1;
6368 unsigned READ_WRITE : 1;
6369 unsigned : 1;
6370 unsigned : 1;
6371 unsigned DATA_ADDRESS : 1;
6372 unsigned : 1;
6373 unsigned : 1;
6376 struct
6378 unsigned : 1;
6379 unsigned : 1;
6380 unsigned I2C_READ : 1;
6381 unsigned : 1;
6382 unsigned : 1;
6383 unsigned I2C_DAT : 1;
6384 unsigned : 1;
6385 unsigned : 1;
6387 } __SSP1STATbits_t;
6389 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
6391 #define _BF 0x01
6392 #define _UA 0x02
6393 #define _R_NOT_W 0x04
6394 #define _R 0x04
6395 #define _R_W 0x04
6396 #define _NOT_W 0x04
6397 #define _NOT_WRITE 0x04
6398 #define _READ_WRITE 0x04
6399 #define _I2C_READ 0x04
6400 #define _S 0x08
6401 #define _I2C_START 0x08
6402 #define _P 0x10
6403 #define _I2C_STOP 0x10
6404 #define _D_NOT_A 0x20
6405 #define _D 0x20
6406 #define _D_A 0x20
6407 #define _NOT_A 0x20
6408 #define _NOT_ADDRESS 0x20
6409 #define _DATA_ADDRESS 0x20
6410 #define _I2C_DAT 0x20
6411 #define _CKE 0x40
6412 #define _SMP 0x80
6414 //==============================================================================
6417 //==============================================================================
6418 // SSPSTAT Bits
6420 extern __at(0x0FC7) __sfr SSPSTAT;
6422 typedef union
6424 struct
6426 unsigned BF : 1;
6427 unsigned UA : 1;
6428 unsigned R_NOT_W : 1;
6429 unsigned S : 1;
6430 unsigned P : 1;
6431 unsigned D_NOT_A : 1;
6432 unsigned CKE : 1;
6433 unsigned SMP : 1;
6436 struct
6438 unsigned : 1;
6439 unsigned : 1;
6440 unsigned R : 1;
6441 unsigned I2C_START : 1;
6442 unsigned I2C_STOP : 1;
6443 unsigned D : 1;
6444 unsigned : 1;
6445 unsigned : 1;
6448 struct
6450 unsigned : 1;
6451 unsigned : 1;
6452 unsigned R_W : 1;
6453 unsigned : 1;
6454 unsigned : 1;
6455 unsigned D_A : 1;
6456 unsigned : 1;
6457 unsigned : 1;
6460 struct
6462 unsigned : 1;
6463 unsigned : 1;
6464 unsigned NOT_W : 1;
6465 unsigned : 1;
6466 unsigned : 1;
6467 unsigned NOT_A : 1;
6468 unsigned : 1;
6469 unsigned : 1;
6472 struct
6474 unsigned : 1;
6475 unsigned : 1;
6476 unsigned NOT_WRITE : 1;
6477 unsigned : 1;
6478 unsigned : 1;
6479 unsigned NOT_ADDRESS : 1;
6480 unsigned : 1;
6481 unsigned : 1;
6484 struct
6486 unsigned : 1;
6487 unsigned : 1;
6488 unsigned READ_WRITE : 1;
6489 unsigned : 1;
6490 unsigned : 1;
6491 unsigned DATA_ADDRESS : 1;
6492 unsigned : 1;
6493 unsigned : 1;
6496 struct
6498 unsigned : 1;
6499 unsigned : 1;
6500 unsigned I2C_READ : 1;
6501 unsigned : 1;
6502 unsigned : 1;
6503 unsigned I2C_DAT : 1;
6504 unsigned : 1;
6505 unsigned : 1;
6507 } __SSPSTATbits_t;
6509 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
6511 #define _SSPSTAT_BF 0x01
6512 #define _SSPSTAT_UA 0x02
6513 #define _SSPSTAT_R_NOT_W 0x04
6514 #define _SSPSTAT_R 0x04
6515 #define _SSPSTAT_R_W 0x04
6516 #define _SSPSTAT_NOT_W 0x04
6517 #define _SSPSTAT_NOT_WRITE 0x04
6518 #define _SSPSTAT_READ_WRITE 0x04
6519 #define _SSPSTAT_I2C_READ 0x04
6520 #define _SSPSTAT_S 0x08
6521 #define _SSPSTAT_I2C_START 0x08
6522 #define _SSPSTAT_P 0x10
6523 #define _SSPSTAT_I2C_STOP 0x10
6524 #define _SSPSTAT_D_NOT_A 0x20
6525 #define _SSPSTAT_D 0x20
6526 #define _SSPSTAT_D_A 0x20
6527 #define _SSPSTAT_NOT_A 0x20
6528 #define _SSPSTAT_NOT_ADDRESS 0x20
6529 #define _SSPSTAT_DATA_ADDRESS 0x20
6530 #define _SSPSTAT_I2C_DAT 0x20
6531 #define _SSPSTAT_CKE 0x40
6532 #define _SSPSTAT_SMP 0x80
6534 //==============================================================================
6536 extern __at(0x0FC8) __sfr SSP1ADD;
6538 //==============================================================================
6539 // SSP1MSK Bits
6541 extern __at(0x0FC8) __sfr SSP1MSK;
6543 typedef struct
6545 unsigned MSK0 : 1;
6546 unsigned MSK1 : 1;
6547 unsigned MSK2 : 1;
6548 unsigned MSK3 : 1;
6549 unsigned MSK4 : 1;
6550 unsigned MSK5 : 1;
6551 unsigned MSK6 : 1;
6552 unsigned MSK7 : 1;
6553 } __SSP1MSKbits_t;
6555 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
6557 #define _MSK0 0x01
6558 #define _MSK1 0x02
6559 #define _MSK2 0x04
6560 #define _MSK3 0x08
6561 #define _MSK4 0x10
6562 #define _MSK5 0x20
6563 #define _MSK6 0x40
6564 #define _MSK7 0x80
6566 //==============================================================================
6568 extern __at(0x0FC8) __sfr SSPADD;
6569 extern __at(0x0FC9) __sfr SSP1BUF;
6570 extern __at(0x0FC9) __sfr SSPBUF;
6572 //==============================================================================
6573 // T2CON Bits
6575 extern __at(0x0FCA) __sfr T2CON;
6577 typedef union
6579 struct
6581 unsigned T2CKPS0 : 1;
6582 unsigned T2CKPS1 : 1;
6583 unsigned TMR2ON : 1;
6584 unsigned T2OUTPS0 : 1;
6585 unsigned T2OUTPS1 : 1;
6586 unsigned T2OUTPS2 : 1;
6587 unsigned T2OUTPS3 : 1;
6588 unsigned : 1;
6591 struct
6593 unsigned T2CKPS : 2;
6594 unsigned : 6;
6597 struct
6599 unsigned : 3;
6600 unsigned T2OUTPS : 4;
6601 unsigned : 1;
6603 } __T2CONbits_t;
6605 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
6607 #define _T2CKPS0 0x01
6608 #define _T2CKPS1 0x02
6609 #define _TMR2ON 0x04
6610 #define _T2OUTPS0 0x08
6611 #define _T2OUTPS1 0x10
6612 #define _T2OUTPS2 0x20
6613 #define _T2OUTPS3 0x40
6615 //==============================================================================
6617 extern __at(0x0FCB) __sfr PR2;
6618 extern __at(0x0FCC) __sfr TMR2;
6620 //==============================================================================
6621 // T1CON Bits
6623 extern __at(0x0FCD) __sfr T1CON;
6625 typedef union
6627 struct
6629 unsigned TMR1ON : 1;
6630 unsigned RD16 : 1;
6631 unsigned NOT_T1SYNC : 1;
6632 unsigned SOSCEN : 1;
6633 unsigned T1CKPS0 : 1;
6634 unsigned T1CKPS1 : 1;
6635 unsigned TMR1CS0 : 1;
6636 unsigned TMR1CS1 : 1;
6639 struct
6641 unsigned : 4;
6642 unsigned T1CKPS : 2;
6643 unsigned : 2;
6646 struct
6648 unsigned : 6;
6649 unsigned TMR1CS : 2;
6651 } __T1CONbits_t;
6653 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6655 #define _TMR1ON 0x01
6656 #define _RD16 0x02
6657 #define _NOT_T1SYNC 0x04
6658 #define _SOSCEN 0x08
6659 #define _T1CKPS0 0x10
6660 #define _T1CKPS1 0x20
6661 #define _TMR1CS0 0x40
6662 #define _TMR1CS1 0x80
6664 //==============================================================================
6666 extern __at(0x0FCE) __sfr TMR1;
6667 extern __at(0x0FCE) __sfr TMR1L;
6668 extern __at(0x0FCF) __sfr TMR1H;
6670 //==============================================================================
6671 // RCON Bits
6673 extern __at(0x0FD0) __sfr RCON;
6675 typedef union
6677 struct
6679 unsigned NOT_BOR : 1;
6680 unsigned NOT_POR : 1;
6681 unsigned NOT_PD : 1;
6682 unsigned NOT_TO : 1;
6683 unsigned NOT_RI : 1;
6684 unsigned NOT_CM : 1;
6685 unsigned SBOREN : 1;
6686 unsigned IPEN : 1;
6689 struct
6691 unsigned BOR : 1;
6692 unsigned POR : 1;
6693 unsigned PD : 1;
6694 unsigned TO : 1;
6695 unsigned RI : 1;
6696 unsigned CM : 1;
6697 unsigned : 1;
6698 unsigned : 1;
6700 } __RCONbits_t;
6702 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6704 #define _NOT_BOR 0x01
6705 #define _BOR 0x01
6706 #define _NOT_POR 0x02
6707 #define _POR 0x02
6708 #define _NOT_PD 0x04
6709 #define _PD 0x04
6710 #define _NOT_TO 0x08
6711 #define _TO 0x08
6712 #define _NOT_RI 0x10
6713 #define _RI 0x10
6714 #define _NOT_CM 0x20
6715 #define _CM 0x20
6716 #define _SBOREN 0x40
6717 #define _IPEN 0x80
6719 //==============================================================================
6722 //==============================================================================
6723 // WDTCON Bits
6725 extern __at(0x0FD1) __sfr WDTCON;
6727 typedef union
6729 struct
6731 unsigned SWDTEN : 1;
6732 unsigned ULPSINK : 1;
6733 unsigned ULPEN : 1;
6734 unsigned : 1;
6735 unsigned SRETEN : 1;
6736 unsigned ULPLVL : 1;
6737 unsigned : 1;
6738 unsigned REGSLP : 1;
6741 struct
6743 unsigned SWDTE : 1;
6744 unsigned : 1;
6745 unsigned : 1;
6746 unsigned : 1;
6747 unsigned : 1;
6748 unsigned : 1;
6749 unsigned : 1;
6750 unsigned : 1;
6752 } __WDTCONbits_t;
6754 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
6756 #define _SWDTEN 0x01
6757 #define _SWDTE 0x01
6758 #define _ULPSINK 0x02
6759 #define _ULPEN 0x04
6760 #define _SRETEN 0x10
6761 #define _ULPLVL 0x20
6762 #define _REGSLP 0x80
6764 //==============================================================================
6767 //==============================================================================
6768 // IPR5 Bits
6770 extern __at(0x0FD2) __sfr IPR5;
6772 typedef struct
6774 unsigned TMR4IP : 1;
6775 unsigned TMR5IP : 1;
6776 unsigned TMR6IP : 1;
6777 unsigned TMR7IP : 1;
6778 unsigned TMR8IP : 1;
6779 unsigned TMR10IP : 1;
6780 unsigned TMR12IP : 1;
6781 unsigned TMR7GIP : 1;
6782 } __IPR5bits_t;
6784 extern __at(0x0FD2) volatile __IPR5bits_t IPR5bits;
6786 #define _TMR4IP 0x01
6787 #define _TMR5IP 0x02
6788 #define _TMR6IP 0x04
6789 #define _TMR7IP 0x08
6790 #define _TMR8IP 0x10
6791 #define _TMR10IP 0x20
6792 #define _TMR12IP 0x40
6793 #define _TMR7GIP 0x80
6795 //==============================================================================
6798 //==============================================================================
6799 // OSCCON Bits
6801 extern __at(0x0FD3) __sfr OSCCON;
6803 typedef union
6805 struct
6807 unsigned SCS0 : 1;
6808 unsigned SCS1 : 1;
6809 unsigned HFIOFS : 1;
6810 unsigned OSTS : 1;
6811 unsigned IRCF0 : 1;
6812 unsigned IRCF1 : 1;
6813 unsigned IRCF2 : 1;
6814 unsigned IDLEN : 1;
6817 struct
6819 unsigned SCS : 2;
6820 unsigned : 6;
6823 struct
6825 unsigned : 4;
6826 unsigned IRCF : 3;
6827 unsigned : 1;
6829 } __OSCCONbits_t;
6831 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
6833 #define _SCS0 0x01
6834 #define _SCS1 0x02
6835 #define _HFIOFS 0x04
6836 #define _OSTS 0x08
6837 #define _IRCF0 0x10
6838 #define _IRCF1 0x20
6839 #define _IRCF2 0x40
6840 #define _IDLEN 0x80
6842 //==============================================================================
6844 extern __at(0x0FD4) __sfr SPBRGH1;
6846 //==============================================================================
6847 // T0CON Bits
6849 extern __at(0x0FD5) __sfr T0CON;
6851 typedef union
6853 struct
6855 unsigned T0PS0 : 1;
6856 unsigned T0PS1 : 1;
6857 unsigned T0PS2 : 1;
6858 unsigned PSA : 1;
6859 unsigned T0SE : 1;
6860 unsigned T0CS : 1;
6861 unsigned T08BIT : 1;
6862 unsigned TMR0ON : 1;
6865 struct
6867 unsigned T0PS : 3;
6868 unsigned : 5;
6870 } __T0CONbits_t;
6872 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
6874 #define _T0PS0 0x01
6875 #define _T0PS1 0x02
6876 #define _T0PS2 0x04
6877 #define _PSA 0x08
6878 #define _T0SE 0x10
6879 #define _T0CS 0x20
6880 #define _T08BIT 0x40
6881 #define _TMR0ON 0x80
6883 //==============================================================================
6885 extern __at(0x0FD6) __sfr TMR0;
6886 extern __at(0x0FD6) __sfr TMR0L;
6887 extern __at(0x0FD7) __sfr TMR0H;
6889 //==============================================================================
6890 // STATUS Bits
6892 extern __at(0x0FD8) __sfr STATUS;
6894 typedef struct
6896 unsigned C : 1;
6897 unsigned DC : 1;
6898 unsigned Z : 1;
6899 unsigned OV : 1;
6900 unsigned N : 1;
6901 unsigned : 1;
6902 unsigned : 1;
6903 unsigned : 1;
6904 } __STATUSbits_t;
6906 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
6908 #define _C 0x01
6909 #define _DC 0x02
6910 #define _Z 0x04
6911 #define _OV 0x08
6912 #define _N 0x10
6914 //==============================================================================
6916 extern __at(0x0FD9) __sfr FSR2L;
6917 extern __at(0x0FDA) __sfr FSR2H;
6918 extern __at(0x0FDB) __sfr PLUSW2;
6919 extern __at(0x0FDC) __sfr PREINC2;
6920 extern __at(0x0FDD) __sfr POSTDEC2;
6921 extern __at(0x0FDE) __sfr POSTINC2;
6922 extern __at(0x0FDF) __sfr INDF2;
6923 extern __at(0x0FE0) __sfr BSR;
6924 extern __at(0x0FE1) __sfr FSR1L;
6925 extern __at(0x0FE2) __sfr FSR1H;
6926 extern __at(0x0FE3) __sfr PLUSW1;
6927 extern __at(0x0FE4) __sfr PREINC1;
6928 extern __at(0x0FE5) __sfr POSTDEC1;
6929 extern __at(0x0FE6) __sfr POSTINC1;
6930 extern __at(0x0FE7) __sfr INDF1;
6931 extern __at(0x0FE8) __sfr WREG;
6932 extern __at(0x0FE9) __sfr FSR0L;
6933 extern __at(0x0FEA) __sfr FSR0H;
6934 extern __at(0x0FEB) __sfr PLUSW0;
6935 extern __at(0x0FEC) __sfr PREINC0;
6936 extern __at(0x0FED) __sfr POSTDEC0;
6937 extern __at(0x0FEE) __sfr POSTINC0;
6938 extern __at(0x0FEF) __sfr INDF0;
6940 //==============================================================================
6941 // INTCON3 Bits
6943 extern __at(0x0FF0) __sfr INTCON3;
6945 typedef union
6947 struct
6949 unsigned INT1IF : 1;
6950 unsigned INT2IF : 1;
6951 unsigned INT3IF : 1;
6952 unsigned INT1IE : 1;
6953 unsigned INT2IE : 1;
6954 unsigned INT3IE : 1;
6955 unsigned INT1IP : 1;
6956 unsigned INT2IP : 1;
6959 struct
6961 unsigned INT1F : 1;
6962 unsigned INT2F : 1;
6963 unsigned INT3F : 1;
6964 unsigned INT1E : 1;
6965 unsigned INT2E : 1;
6966 unsigned INT3E : 1;
6967 unsigned INT1P : 1;
6968 unsigned INT2P : 1;
6970 } __INTCON3bits_t;
6972 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6974 #define _INT1IF 0x01
6975 #define _INT1F 0x01
6976 #define _INT2IF 0x02
6977 #define _INT2F 0x02
6978 #define _INT3IF 0x04
6979 #define _INT3F 0x04
6980 #define _INT1IE 0x08
6981 #define _INT1E 0x08
6982 #define _INT2IE 0x10
6983 #define _INT2E 0x10
6984 #define _INT3IE 0x20
6985 #define _INT3E 0x20
6986 #define _INT1IP 0x40
6987 #define _INT1P 0x40
6988 #define _INT2IP 0x80
6989 #define _INT2P 0x80
6991 //==============================================================================
6994 //==============================================================================
6995 // INTCON2 Bits
6997 extern __at(0x0FF1) __sfr INTCON2;
6999 typedef union
7001 struct
7003 unsigned RBIP : 1;
7004 unsigned INT3IP : 1;
7005 unsigned TMR0IP : 1;
7006 unsigned INTEDG3 : 1;
7007 unsigned INTEDG2 : 1;
7008 unsigned INTEDG1 : 1;
7009 unsigned INTEDG0 : 1;
7010 unsigned NOT_RBPU : 1;
7013 struct
7015 unsigned : 1;
7016 unsigned INT3P : 1;
7017 unsigned T0IP : 1;
7018 unsigned : 1;
7019 unsigned : 1;
7020 unsigned : 1;
7021 unsigned : 1;
7022 unsigned RBPU : 1;
7024 } __INTCON2bits_t;
7026 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
7028 #define _RBIP 0x01
7029 #define _INT3IP 0x02
7030 #define _INT3P 0x02
7031 #define _TMR0IP 0x04
7032 #define _T0IP 0x04
7033 #define _INTEDG3 0x08
7034 #define _INTEDG2 0x10
7035 #define _INTEDG1 0x20
7036 #define _INTEDG0 0x40
7037 #define _NOT_RBPU 0x80
7038 #define _RBPU 0x80
7040 //==============================================================================
7043 //==============================================================================
7044 // INTCON Bits
7046 extern __at(0x0FF2) __sfr INTCON;
7048 typedef union
7050 struct
7052 unsigned RBIF : 1;
7053 unsigned INT0IF : 1;
7054 unsigned TMR0IF : 1;
7055 unsigned RBIE : 1;
7056 unsigned INT0IE : 1;
7057 unsigned TMR0IE : 1;
7058 unsigned PEIE_GIEL : 1;
7059 unsigned GIE_GIEH : 1;
7062 struct
7064 unsigned : 1;
7065 unsigned INT0F : 1;
7066 unsigned T0IF : 1;
7067 unsigned : 1;
7068 unsigned INT0E : 1;
7069 unsigned T0IE : 1;
7070 unsigned PEIE : 1;
7071 unsigned GIE : 1;
7074 struct
7076 unsigned : 1;
7077 unsigned : 1;
7078 unsigned : 1;
7079 unsigned : 1;
7080 unsigned : 1;
7081 unsigned : 1;
7082 unsigned GIEL : 1;
7083 unsigned GIEH : 1;
7085 } __INTCONbits_t;
7087 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
7089 #define _RBIF 0x01
7090 #define _INT0IF 0x02
7091 #define _INT0F 0x02
7092 #define _TMR0IF 0x04
7093 #define _T0IF 0x04
7094 #define _RBIE 0x08
7095 #define _INT0IE 0x10
7096 #define _INT0E 0x10
7097 #define _TMR0IE 0x20
7098 #define _T0IE 0x20
7099 #define _PEIE_GIEL 0x40
7100 #define _PEIE 0x40
7101 #define _GIEL 0x40
7102 #define _GIE_GIEH 0x80
7103 #define _GIE 0x80
7104 #define _GIEH 0x80
7106 //==============================================================================
7108 extern __at(0x0FF3) __sfr PROD;
7109 extern __at(0x0FF3) __sfr PRODL;
7110 extern __at(0x0FF4) __sfr PRODH;
7111 extern __at(0x0FF5) __sfr TABLAT;
7112 extern __at(0x0FF6) __sfr TBLPTR;
7113 extern __at(0x0FF6) __sfr TBLPTRL;
7114 extern __at(0x0FF7) __sfr TBLPTRH;
7115 extern __at(0x0FF8) __sfr TBLPTRU;
7116 extern __at(0x0FF9) __sfr PC;
7117 extern __at(0x0FF9) __sfr PCL;
7118 extern __at(0x0FFA) __sfr PCLATH;
7119 extern __at(0x0FFB) __sfr PCLATU;
7121 //==============================================================================
7122 // STKPTR Bits
7124 extern __at(0x0FFC) __sfr STKPTR;
7126 typedef union
7128 struct
7130 unsigned SP0 : 1;
7131 unsigned SP1 : 1;
7132 unsigned SP2 : 1;
7133 unsigned SP3 : 1;
7134 unsigned SP4 : 1;
7135 unsigned : 1;
7136 unsigned STKUNF : 1;
7137 unsigned STKFUL : 1;
7140 struct
7142 unsigned : 1;
7143 unsigned : 1;
7144 unsigned : 1;
7145 unsigned : 1;
7146 unsigned : 1;
7147 unsigned : 1;
7148 unsigned : 1;
7149 unsigned STKOVF : 1;
7152 struct
7154 unsigned SP : 5;
7155 unsigned : 3;
7157 } __STKPTRbits_t;
7159 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
7161 #define _SP0 0x01
7162 #define _SP1 0x02
7163 #define _SP2 0x04
7164 #define _SP3 0x08
7165 #define _SP4 0x10
7166 #define _STKUNF 0x40
7167 #define _STKFUL 0x80
7168 #define _STKOVF 0x80
7170 //==============================================================================
7172 extern __at(0x0FFD) __sfr TOS;
7173 extern __at(0x0FFD) __sfr TOSL;
7174 extern __at(0x0FFE) __sfr TOSH;
7175 extern __at(0x0FFF) __sfr TOSU;
7177 //==============================================================================
7179 // Configuration Bits
7181 //==============================================================================
7183 #define __CONFIG1L 0x300000
7184 #define __CONFIG1H 0x300001
7185 #define __CONFIG2L 0x300002
7186 #define __CONFIG2H 0x300003
7187 #define __CONFIG3L 0x300004
7188 #define __CONFIG3H 0x300005
7189 #define __CONFIG4L 0x300006
7190 #define __CONFIG5L 0x300008
7191 #define __CONFIG5H 0x300009
7192 #define __CONFIG6L 0x30000A
7193 #define __CONFIG6H 0x30000B
7194 #define __CONFIG7L 0x30000C
7195 #define __CONFIG7H 0x30000D
7197 //----------------------------- CONFIG1L Options -------------------------------
7199 #define _RETEN_OFF_1L 0xFE // Disabled - Controlled by SRETEN bit.
7200 #define _RETEN_ON_1L 0xFF // Enabled.
7201 #define _INTOSCSEL_LOW_1L 0xFB // LF-INTOSC in Low-power mode during Sleep.
7202 #define _INTOSCSEL_HIGH_1L 0xFF // LF-INTOSC in High-power mode during Sleep.
7203 #define _SOSCSEL_LOW_1L 0xEF // Low Power SOSC circuit selected.
7204 #define _SOSCSEL_DIG_1L 0xF7 // Digital (SCLKI) mode.
7205 #define _SOSCSEL_HIGH_1L 0xFF // High Power SOSC circuit selected.
7206 #define _XINST_OFF_1L 0xBF // Disabled.
7207 #define _XINST_ON_1L 0xFF // Enabled.
7209 //----------------------------- CONFIG1H Options -------------------------------
7211 #define _FOSC_LP_1H 0xF0 // LP oscillator.
7212 #define _FOSC_XT_1H 0xF1 // XT oscillator.
7213 #define _FOSC_HS2_1H 0xF2 // HS oscillator (High power, 16 MHz - 25 MHz).
7214 #define _FOSC_HS1_1H 0xF3 // HS oscillator (Medium power, 4 MHz - 16 MHz).
7215 #define _FOSC_EC3IO_1H 0xF4 // EC oscillator, CLKOUT function on OSC2 (High power, 16 MHz - 64 MHz).
7216 #define _FOSC_EC3_1H 0xF5 // EC oscillator (High power, 16 MHz - 64 MHz).
7217 #define _FOSC_RC_1H 0xF6 // External RC oscillator, CLKOUT function on OSC2.
7218 #define _FOSC_RCIO_1H 0xF7 // External RC oscillator.
7219 #define _FOSC_INTIO2_1H 0xF8 // Internal RC oscillator.
7220 #define _FOSC_INTIO1_1H 0xF9 // Internal RC oscillator, CLKOUT function on OSC2.
7221 #define _FOSC_EC2IO_1H 0xFA // EC oscillator, CLKOUT function on OSC2 (Medium power, 160 kHz - 16 MHz).
7222 #define _FOSC_EC2_1H 0xFB // EC oscillator (Medium power, 160 kHz - 16 MHz).
7223 #define _FOSC_EC1IO_1H 0xFC // EC oscillator, CLKOUT function on OSC2 (Low power, DC - 160 kHz).
7224 #define _FOSC_EC1_1H 0xFD // EC oscillator (Low power, DC - 160 kHz).
7225 #define _PLLCFG_OFF_1H 0xEF // Disabled.
7226 #define _PLLCFG_ON_1H 0xFF // Enabled.
7227 #define _FCMEN_OFF_1H 0xBF // Disabled.
7228 #define _FCMEN_ON_1H 0xFF // Enabled.
7229 #define _IESO_OFF_1H 0x7F // Disabled.
7230 #define _IESO_ON_1H 0xFF // Enabled.
7232 //----------------------------- CONFIG2L Options -------------------------------
7234 #define _PWRTEN_ON_2L 0xFE // Enabled.
7235 #define _PWRTEN_OFF_2L 0xFF // Disabled.
7236 #define _BOREN_OFF_2L 0xF9 // Disabled in hardware, SBOREN disabled.
7237 #define _BOREN_ON_2L 0xFB // Controlled with SBOREN bit.
7238 #define _BOREN_NOSLP_2L 0xFD // Enabled while active, disabled in SLEEP, SBOREN disabled.
7239 #define _BOREN_SBORDIS_2L 0xFF // Enabled in hardware, SBOREN disabled.
7240 #define _BORV_0_2L 0xE7 // 3.0V.
7241 #define _BORV_1_2L 0xEF // 2.7V.
7242 #define _BORV_2_2L 0xF7 // 2.0V.
7243 #define _BORV_3_2L 0xFF // 1.8V.
7244 #define _BORPWR_LOW_2L 0x9F // BORMV set to low power level.
7245 #define _BORPWR_MEDIUM_2L 0xBF // BORMV set to medium power level.
7246 #define _BORPWR_HIGH_2L 0xDF // BORMV set to high power level.
7247 #define _BORPWR_ZPBORMV_2L 0xFF // ZPBORMV instead of BORMV is selected.
7249 //----------------------------- CONFIG2H Options -------------------------------
7251 #define _WDTEN_OFF_2H 0xFC // WDT disabled in hardware; SWDTEN bit disabled.
7252 #define _WDTEN_NOSLP_2H 0xFD // WDT enabled only while device is active and disabled in Sleep mode; SWDTEN bit disabled.
7253 #define _WDTEN_ON_2H 0xFE // WDT controlled by SWDTEN bit setting.
7254 #define _WDTEN_SWDTDIS_2H 0xFF // WDT enabled in hardware; SWDTEN bit disabled.
7255 #define _WDTPS_1_2H 0x83 // 1:1.
7256 #define _WDTPS_2_2H 0x87 // 1:2.
7257 #define _WDTPS_4_2H 0x8B // 1:4.
7258 #define _WDTPS_8_2H 0x8F // 1:8.
7259 #define _WDTPS_16_2H 0x93 // 1:16.
7260 #define _WDTPS_32_2H 0x97 // 1:32.
7261 #define _WDTPS_64_2H 0x9B // 1:64.
7262 #define _WDTPS_128_2H 0x9F // 1:128.
7263 #define _WDTPS_256_2H 0xA3 // 1:256.
7264 #define _WDTPS_512_2H 0xA7 // 1:512.
7265 #define _WDTPS_1024_2H 0xAB // 1:1024.
7266 #define _WDTPS_2048_2H 0xAF // 1:2048.
7267 #define _WDTPS_4096_2H 0xB3 // 1:4096.
7268 #define _WDTPS_8192_2H 0xB7 // 1:8192.
7269 #define _WDTPS_16384_2H 0xBB // 1:16384.
7270 #define _WDTPS_32768_2H 0xBF // 1:32768.
7271 #define _WDTPS_65536_2H 0xC3 // 1:65536.
7272 #define _WDTPS_131072_2H 0xC7 // 1:131072.
7273 #define _WDTPS_262144_2H 0xCB // 1:262144.
7274 #define _WDTPS_524288_2H 0xCF // 1:524288.
7275 #define _WDTPS_1048576_2H 0xFF // 1:1048576.
7277 //----------------------------- CONFIG3L Options -------------------------------
7279 #define _RTCOSC_INTOSCREF_3L 0xFE // RTCC uses INTRC.
7280 #define _RTCOSC_SOSCREF_3L 0xFF // RTCC uses SOSC.
7282 //----------------------------- CONFIG3H Options -------------------------------
7284 #define _CCP2MX_PORTBE_3H 0xFE // RE7-Microcontroller Mode/RB3-All other modes.
7285 #define _CCP2MX_PORTC_3H 0xFF // RC1.
7286 #define _MSSPMSK_MSK5_3H 0xF7 // 5 bit address masking mode.
7287 #define _MSSPMSK_MSK7_3H 0xFF // 7 Bit address masking mode.
7288 #define _MCLRE_OFF_3H 0x7F // MCLR Disabled, RG5 Enabled.
7289 #define _MCLRE_ON_3H 0xFF // MCLR Enabled, RG5 Disabled.
7291 //----------------------------- CONFIG4L Options -------------------------------
7293 #define _STVREN_OFF_4L 0xFE // Disabled.
7294 #define _STVREN_ON_4L 0xFF // Enabled.
7295 #define _BBSIZ_BB1K_4L 0xEF // 1K word Boot Block size.
7296 #define _BBSIZ_BB2K_4L 0xFF // 2K word Boot Block size.
7297 #define _DEBUG_ON_4L 0x7F // Enabled.
7298 #define _DEBUG_OFF_4L 0xFF // Disabled.
7300 //----------------------------- CONFIG5L Options -------------------------------
7302 #define _CP0_ON_5L 0xFE // Enabled.
7303 #define _CP0_OFF_5L 0xFF // Disabled.
7304 #define _CP1_ON_5L 0xFD // Enabled.
7305 #define _CP1_OFF_5L 0xFF // Disabled.
7306 #define _CP2_ON_5L 0xFB // Enabled.
7307 #define _CP2_OFF_5L 0xFF // Disabled.
7308 #define _CP3_ON_5L 0xF7 // Enabled.
7309 #define _CP3_OFF_5L 0xFF // Disabled.
7310 #define _CP4_ON_5L 0xEF // Enabled.
7311 #define _CP4_OFF_5L 0xFF // Disabled.
7312 #define _CP5_ON_5L 0xDF // Enabled.
7313 #define _CP5_OFF_5L 0xFF // Disabled.
7314 #define _CP6_ON_5L 0xBF // Enabled.
7315 #define _CP6_OFF_5L 0xFF // Disabled.
7316 #define _CP7_ON_5L 0x7F // Enabled.
7317 #define _CP7_OFF_5L 0xFF // Disabled.
7319 //----------------------------- CONFIG5H Options -------------------------------
7321 #define _CPB_ON_5H 0xBF // Enabled.
7322 #define _CPB_OFF_5H 0xFF // Disabled.
7323 #define _CPD_ON_5H 0x7F // Enabled.
7324 #define _CPD_OFF_5H 0xFF // Disabled.
7326 //----------------------------- CONFIG6L Options -------------------------------
7328 #define _WRT0_ON_6L 0xFE // Enabled.
7329 #define _WRT0_OFF_6L 0xFF // Disabled.
7330 #define _WRT1_ON_6L 0xFD // Enabled.
7331 #define _WRT1_OFF_6L 0xFF // Disabled.
7332 #define _WRT2_ON_6L 0xFB // Enabled.
7333 #define _WRT2_OFF_6L 0xFF // Disabled.
7334 #define _WRT3_ON_6L 0xF7 // Enabled.
7335 #define _WRT3_OFF_6L 0xFF // Disabled.
7336 #define _WRT4_ON_6L 0xEF // Enabled.
7337 #define _WRT4_OFF_6L 0xFF // Disabled.
7338 #define _WRT5_ON_6L 0xDF // Enabled.
7339 #define _WRT5_OFF_6L 0xFF // Disabled.
7340 #define _WRT6_ON_6L 0xBF // Enabled.
7341 #define _WRT6_OFF_6L 0xFF // Disabled.
7342 #define _WRT7_ON_6L 0x7F // Enabled.
7343 #define _WRT7_OFF_6L 0xFF // Disabled.
7345 //----------------------------- CONFIG6H Options -------------------------------
7347 #define _WRTC_ON_6H 0xDF // Enabled.
7348 #define _WRTC_OFF_6H 0xFF // Disabled.
7349 #define _WRTB_ON_6H 0xBF // Enabled.
7350 #define _WRTB_OFF_6H 0xFF // Disabled.
7351 #define _WRTD_ON_6H 0x7F // Enabled.
7352 #define _WRTD_OFF_6H 0xFF // Disabled.
7354 //----------------------------- CONFIG7L Options -------------------------------
7356 #define _EBRT0_ON_7L 0xFE // Enabled.
7357 #define _EBRT0_OFF_7L 0xFF // Disabled.
7358 #define _EBRT1_ON_7L 0xFD // Enabled.
7359 #define _EBRT1_OFF_7L 0xFF // Disabled.
7360 #define _EBRT2_ON_7L 0xFB // Enabled.
7361 #define _EBRT2_OFF_7L 0xFF // Disabled.
7362 #define _EBRT3_ON_7L 0xF7 // Enabled.
7363 #define _EBRT3_OFF_7L 0xFF // Disabled.
7364 #define _EBRT4_ON_7L 0xEF // Enabled.
7365 #define _EBRT4_OFF_7L 0xFF // Disabled.
7366 #define _EBRT5_ON_7L 0xDF // Enabled.
7367 #define _EBRT5_OFF_7L 0xFF // Disabled.
7368 #define _EBRT6_ON_7L 0xBF // Enabled.
7369 #define _EBRT6_OFF_7L 0xFF // Disabled.
7370 #define _EBRT7_ON_7L 0x7F // Enabled.
7371 #define _EBRT7_OFF_7L 0xFF // Disabled.
7373 //----------------------------- CONFIG7H Options -------------------------------
7375 #define _EBRTB_ON_7H 0xBF // Enabled.
7376 #define _EBRTB_OFF_7H 0xFF // Disabled.
7378 //==============================================================================
7380 #define __DEVID1 0x3FFFFE
7381 #define __DEVID2 0x3FFFFF
7383 #define __IDLOC0 0x200000
7384 #define __IDLOC1 0x200001
7385 #define __IDLOC2 0x200002
7386 #define __IDLOC3 0x200003
7387 #define __IDLOC4 0x200004
7388 #define __IDLOC5 0x200005
7389 #define __IDLOC6 0x200006
7390 #define __IDLOC7 0x200007
7392 #endif // #ifndef __PIC18F67K22_H__