1 /*
2  * This declarations of the PIC16LF876 MCU.
3  *
4  * This file is part of the GNU PIC library for SDCC, originally
5  * created by Molnar Karoly <molnarkaroly@users.sf.net> 2016.
6  *
7  * This file is generated automatically by the cinc2h.pl, 2016-04-13 17:23:00 UTC.
8  *
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.
12  *
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.
21  *
22  * See http://sdcc.sourceforge.net/ for the latest information on sdcc.
23  */
24 
25 #ifndef __PIC16LF876_H__
26 #define __PIC16LF876_H__
27 
28 //==============================================================================
29 //
30 //	Register Addresses
31 //
32 //==============================================================================
33 
34 #ifndef NO_ADDR_DEFINES
35 
36 #define INDF_ADDR               0x0000
37 #define TMR0_ADDR               0x0001
38 #define PCL_ADDR                0x0002
39 #define STATUS_ADDR             0x0003
40 #define FSR_ADDR                0x0004
41 #define PORTA_ADDR              0x0005
42 #define PORTB_ADDR              0x0006
43 #define PORTC_ADDR              0x0007
44 #define PCLATH_ADDR             0x000A
45 #define INTCON_ADDR             0x000B
46 #define PIR1_ADDR               0x000C
47 #define PIR2_ADDR               0x000D
48 #define TMR1_ADDR               0x000E
49 #define TMR1L_ADDR              0x000E
50 #define TMR1H_ADDR              0x000F
51 #define T1CON_ADDR              0x0010
52 #define TMR2_ADDR               0x0011
53 #define T2CON_ADDR              0x0012
54 #define SSPBUF_ADDR             0x0013
55 #define SSPCON_ADDR             0x0014
56 #define CCPR1_ADDR              0x0015
57 #define CCPR1L_ADDR             0x0015
58 #define CCPR1H_ADDR             0x0016
59 #define CCP1CON_ADDR            0x0017
60 #define RCSTA_ADDR              0x0018
61 #define TXREG_ADDR              0x0019
62 #define RCREG_ADDR              0x001A
63 #define CCPR2_ADDR              0x001B
64 #define CCPR2L_ADDR             0x001B
65 #define CCPR2H_ADDR             0x001C
66 #define CCP2CON_ADDR            0x001D
67 #define ADRESH_ADDR             0x001E
68 #define ADCON0_ADDR             0x001F
69 #define OPTION_REG_ADDR         0x0081
70 #define TRISA_ADDR              0x0085
71 #define TRISB_ADDR              0x0086
72 #define TRISC_ADDR              0x0087
73 #define PIE1_ADDR               0x008C
74 #define PIE2_ADDR               0x008D
75 #define PCON_ADDR               0x008E
76 #define SSPCON2_ADDR            0x0091
77 #define PR2_ADDR                0x0092
78 #define SSPADD_ADDR             0x0093
79 #define SSPSTAT_ADDR            0x0094
80 #define TXSTA_ADDR              0x0098
81 #define SPBRG_ADDR              0x0099
82 #define ADRESL_ADDR             0x009E
83 #define ADCON1_ADDR             0x009F
84 #define EEDATA_ADDR             0x010C
85 #define EEADR_ADDR              0x010D
86 #define EEDATH_ADDR             0x010E
87 #define EEADRH_ADDR             0x010F
88 #define EECON1_ADDR             0x018C
89 #define EECON2_ADDR             0x018D
90 
91 #endif // #ifndef NO_ADDR_DEFINES
92 
93 //==============================================================================
94 //
95 //	Register Definitions
96 //
97 //==============================================================================
98 
99 extern __at(0x0000) __sfr INDF;
100 extern __at(0x0001) __sfr TMR0;
101 extern __at(0x0002) __sfr PCL;
102 
103 //==============================================================================
104 //        STATUS Bits
105 
106 extern __at(0x0003) __sfr STATUS;
107 
108 typedef union
109   {
110   struct
111     {
112     unsigned C                  : 1;
113     unsigned DC                 : 1;
114     unsigned Z                  : 1;
115     unsigned NOT_PD             : 1;
116     unsigned NOT_TO             : 1;
117     unsigned RP0                : 1;
118     unsigned RP1                : 1;
119     unsigned IRP                : 1;
120     };
121 
122   struct
123     {
124     unsigned                    : 5;
125     unsigned RP                 : 2;
126     unsigned                    : 1;
127     };
128   } __STATUSbits_t;
129 
130 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
131 
132 #define _C                      0x01
133 #define _DC                     0x02
134 #define _Z                      0x04
135 #define _NOT_PD                 0x08
136 #define _NOT_TO                 0x10
137 #define _RP0                    0x20
138 #define _RP1                    0x40
139 #define _IRP                    0x80
140 
141 //==============================================================================
142 
143 extern __at(0x0004) __sfr FSR;
144 
145 //==============================================================================
146 //        PORTA Bits
147 
148 extern __at(0x0005) __sfr PORTA;
149 
150 typedef union
151   {
152   struct
153     {
154     unsigned RA0                : 1;
155     unsigned RA1                : 1;
156     unsigned RA2                : 1;
157     unsigned RA3                : 1;
158     unsigned RA4                : 1;
159     unsigned RA5                : 1;
160     unsigned                    : 1;
161     unsigned                    : 1;
162     };
163 
164   struct
165     {
166     unsigned RA                 : 6;
167     unsigned                    : 2;
168     };
169   } __PORTAbits_t;
170 
171 extern __at(0x0005) volatile __PORTAbits_t PORTAbits;
172 
173 #define _RA0                    0x01
174 #define _RA1                    0x02
175 #define _RA2                    0x04
176 #define _RA3                    0x08
177 #define _RA4                    0x10
178 #define _RA5                    0x20
179 
180 //==============================================================================
181 
182 
183 //==============================================================================
184 //        PORTB Bits
185 
186 extern __at(0x0006) __sfr PORTB;
187 
188 typedef struct
189   {
190   unsigned RB0                  : 1;
191   unsigned RB1                  : 1;
192   unsigned RB2                  : 1;
193   unsigned RB3                  : 1;
194   unsigned RB4                  : 1;
195   unsigned RB5                  : 1;
196   unsigned RB6                  : 1;
197   unsigned RB7                  : 1;
198   } __PORTBbits_t;
199 
200 extern __at(0x0006) volatile __PORTBbits_t PORTBbits;
201 
202 #define _RB0                    0x01
203 #define _RB1                    0x02
204 #define _RB2                    0x04
205 #define _RB3                    0x08
206 #define _RB4                    0x10
207 #define _RB5                    0x20
208 #define _RB6                    0x40
209 #define _RB7                    0x80
210 
211 //==============================================================================
212 
213 
214 //==============================================================================
215 //        PORTC Bits
216 
217 extern __at(0x0007) __sfr PORTC;
218 
219 typedef struct
220   {
221   unsigned RC0                  : 1;
222   unsigned RC1                  : 1;
223   unsigned RC2                  : 1;
224   unsigned RC3                  : 1;
225   unsigned RC4                  : 1;
226   unsigned RC5                  : 1;
227   unsigned RC6                  : 1;
228   unsigned RC7                  : 1;
229   } __PORTCbits_t;
230 
231 extern __at(0x0007) volatile __PORTCbits_t PORTCbits;
232 
233 #define _RC0                    0x01
234 #define _RC1                    0x02
235 #define _RC2                    0x04
236 #define _RC3                    0x08
237 #define _RC4                    0x10
238 #define _RC5                    0x20
239 #define _RC6                    0x40
240 #define _RC7                    0x80
241 
242 //==============================================================================
243 
244 extern __at(0x000A) __sfr PCLATH;
245 
246 //==============================================================================
247 //        INTCON Bits
248 
249 extern __at(0x000B) __sfr INTCON;
250 
251 typedef union
252   {
253   struct
254     {
255     unsigned RBIF               : 1;
256     unsigned INTF               : 1;
257     unsigned T0IF               : 1;
258     unsigned RBIE               : 1;
259     unsigned INTE               : 1;
260     unsigned T0IE               : 1;
261     unsigned PEIE               : 1;
262     unsigned GIE                : 1;
263     };
264 
265   struct
266     {
267     unsigned                    : 1;
268     unsigned                    : 1;
269     unsigned TMR0IF             : 1;
270     unsigned                    : 1;
271     unsigned                    : 1;
272     unsigned TMR0IE             : 1;
273     unsigned                    : 1;
274     unsigned                    : 1;
275     };
276   } __INTCONbits_t;
277 
278 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
279 
280 #define _RBIF                   0x01
281 #define _INTF                   0x02
282 #define _T0IF                   0x04
283 #define _TMR0IF                 0x04
284 #define _RBIE                   0x08
285 #define _INTE                   0x10
286 #define _T0IE                   0x20
287 #define _TMR0IE                 0x20
288 #define _PEIE                   0x40
289 #define _GIE                    0x80
290 
291 //==============================================================================
292 
293 
294 //==============================================================================
295 //        PIR1 Bits
296 
297 extern __at(0x000C) __sfr PIR1;
298 
299 typedef struct
300   {
301   unsigned TMR1IF               : 1;
302   unsigned TMR2IF               : 1;
303   unsigned CCP1IF               : 1;
304   unsigned SSPIF                : 1;
305   unsigned TXIF                 : 1;
306   unsigned RCIF                 : 1;
307   unsigned ADIF                 : 1;
308   unsigned                      : 1;
309   } __PIR1bits_t;
310 
311 extern __at(0x000C) volatile __PIR1bits_t PIR1bits;
312 
313 #define _TMR1IF                 0x01
314 #define _TMR2IF                 0x02
315 #define _CCP1IF                 0x04
316 #define _SSPIF                  0x08
317 #define _TXIF                   0x10
318 #define _RCIF                   0x20
319 #define _ADIF                   0x40
320 
321 //==============================================================================
322 
323 
324 //==============================================================================
325 //        PIR2 Bits
326 
327 extern __at(0x000D) __sfr PIR2;
328 
329 typedef struct
330   {
331   unsigned CCP2IF               : 1;
332   unsigned                      : 1;
333   unsigned                      : 1;
334   unsigned BCLIF                : 1;
335   unsigned EEIF                 : 1;
336   unsigned                      : 1;
337   unsigned                      : 1;
338   unsigned                      : 1;
339   } __PIR2bits_t;
340 
341 extern __at(0x000D) volatile __PIR2bits_t PIR2bits;
342 
343 #define _CCP2IF                 0x01
344 #define _BCLIF                  0x08
345 #define _EEIF                   0x10
346 
347 //==============================================================================
348 
349 extern __at(0x000E) __sfr TMR1;
350 extern __at(0x000E) __sfr TMR1L;
351 extern __at(0x000F) __sfr TMR1H;
352 
353 //==============================================================================
354 //        T1CON Bits
355 
356 extern __at(0x0010) __sfr T1CON;
357 
358 typedef union
359   {
360   struct
361     {
362     unsigned TMR1ON             : 1;
363     unsigned TMR1CS             : 1;
364     unsigned NOT_T1SYNC         : 1;
365     unsigned T1OSCEN            : 1;
366     unsigned T1CKPS0            : 1;
367     unsigned T1CKPS1            : 1;
368     unsigned                    : 1;
369     unsigned                    : 1;
370     };
371 
372   struct
373     {
374     unsigned                    : 1;
375     unsigned                    : 1;
376     unsigned T1INSYNC           : 1;
377     unsigned                    : 1;
378     unsigned                    : 1;
379     unsigned                    : 1;
380     unsigned                    : 1;
381     unsigned                    : 1;
382     };
383 
384   struct
385     {
386     unsigned                    : 1;
387     unsigned                    : 1;
388     unsigned T1SYNC             : 1;
389     unsigned                    : 1;
390     unsigned                    : 1;
391     unsigned                    : 1;
392     unsigned                    : 1;
393     unsigned                    : 1;
394     };
395 
396   struct
397     {
398     unsigned                    : 4;
399     unsigned T1CKPS             : 2;
400     unsigned                    : 2;
401     };
402   } __T1CONbits_t;
403 
404 extern __at(0x0010) volatile __T1CONbits_t T1CONbits;
405 
406 #define _TMR1ON                 0x01
407 #define _TMR1CS                 0x02
408 #define _NOT_T1SYNC             0x04
409 #define _T1INSYNC               0x04
410 #define _T1SYNC                 0x04
411 #define _T1OSCEN                0x08
412 #define _T1CKPS0                0x10
413 #define _T1CKPS1                0x20
414 
415 //==============================================================================
416 
417 extern __at(0x0011) __sfr TMR2;
418 
419 //==============================================================================
420 //        T2CON Bits
421 
422 extern __at(0x0012) __sfr T2CON;
423 
424 typedef union
425   {
426   struct
427     {
428     unsigned T2CKPS0            : 1;
429     unsigned T2CKPS1            : 1;
430     unsigned TMR2ON             : 1;
431     unsigned TOUTPS0            : 1;
432     unsigned TOUTPS1            : 1;
433     unsigned TOUTPS2            : 1;
434     unsigned TOUTPS3            : 1;
435     unsigned                    : 1;
436     };
437 
438   struct
439     {
440     unsigned T2CKPS             : 2;
441     unsigned                    : 6;
442     };
443 
444   struct
445     {
446     unsigned                    : 3;
447     unsigned TOUTPS             : 4;
448     unsigned                    : 1;
449     };
450   } __T2CONbits_t;
451 
452 extern __at(0x0012) volatile __T2CONbits_t T2CONbits;
453 
454 #define _T2CKPS0                0x01
455 #define _T2CKPS1                0x02
456 #define _TMR2ON                 0x04
457 #define _TOUTPS0                0x08
458 #define _TOUTPS1                0x10
459 #define _TOUTPS2                0x20
460 #define _TOUTPS3                0x40
461 
462 //==============================================================================
463 
464 extern __at(0x0013) __sfr SSPBUF;
465 
466 //==============================================================================
467 //        SSPCON Bits
468 
469 extern __at(0x0014) __sfr SSPCON;
470 
471 typedef union
472   {
473   struct
474     {
475     unsigned SSPM0              : 1;
476     unsigned SSPM1              : 1;
477     unsigned SSPM2              : 1;
478     unsigned SSPM3              : 1;
479     unsigned CKP                : 1;
480     unsigned SSPEN              : 1;
481     unsigned SSPOV              : 1;
482     unsigned WCOL               : 1;
483     };
484 
485   struct
486     {
487     unsigned SSPM               : 4;
488     unsigned                    : 4;
489     };
490   } __SSPCONbits_t;
491 
492 extern __at(0x0014) volatile __SSPCONbits_t SSPCONbits;
493 
494 #define _SSPM0                  0x01
495 #define _SSPM1                  0x02
496 #define _SSPM2                  0x04
497 #define _SSPM3                  0x08
498 #define _CKP                    0x10
499 #define _SSPEN                  0x20
500 #define _SSPOV                  0x40
501 #define _WCOL                   0x80
502 
503 //==============================================================================
504 
505 extern __at(0x0015) __sfr CCPR1;
506 extern __at(0x0015) __sfr CCPR1L;
507 extern __at(0x0016) __sfr CCPR1H;
508 
509 //==============================================================================
510 //        CCP1CON Bits
511 
512 extern __at(0x0017) __sfr CCP1CON;
513 
514 typedef union
515   {
516   struct
517     {
518     unsigned CCP1M0             : 1;
519     unsigned CCP1M1             : 1;
520     unsigned CCP1M2             : 1;
521     unsigned CCP1M3             : 1;
522     unsigned CCP1Y              : 1;
523     unsigned CCP1X              : 1;
524     unsigned                    : 1;
525     unsigned                    : 1;
526     };
527 
528   struct
529     {
530     unsigned CCP1M              : 4;
531     unsigned                    : 4;
532     };
533   } __CCP1CONbits_t;
534 
535 extern __at(0x0017) volatile __CCP1CONbits_t CCP1CONbits;
536 
537 #define _CCP1M0                 0x01
538 #define _CCP1M1                 0x02
539 #define _CCP1M2                 0x04
540 #define _CCP1M3                 0x08
541 #define _CCP1Y                  0x10
542 #define _CCP1X                  0x20
543 
544 //==============================================================================
545 
546 
547 //==============================================================================
548 //        RCSTA Bits
549 
550 extern __at(0x0018) __sfr RCSTA;
551 
552 typedef union
553   {
554   struct
555     {
556     unsigned RX9D               : 1;
557     unsigned OERR               : 1;
558     unsigned FERR               : 1;
559     unsigned ADDEN              : 1;
560     unsigned CREN               : 1;
561     unsigned SREN               : 1;
562     unsigned RX9                : 1;
563     unsigned SPEN               : 1;
564     };
565 
566   struct
567     {
568     unsigned RCD8               : 1;
569     unsigned                    : 1;
570     unsigned                    : 1;
571     unsigned                    : 1;
572     unsigned                    : 1;
573     unsigned                    : 1;
574     unsigned RC9                : 1;
575     unsigned                    : 1;
576     };
577 
578   struct
579     {
580     unsigned                    : 1;
581     unsigned                    : 1;
582     unsigned                    : 1;
583     unsigned                    : 1;
584     unsigned                    : 1;
585     unsigned                    : 1;
586     unsigned NOT_RC8            : 1;
587     unsigned                    : 1;
588     };
589 
590   struct
591     {
592     unsigned                    : 1;
593     unsigned                    : 1;
594     unsigned                    : 1;
595     unsigned                    : 1;
596     unsigned                    : 1;
597     unsigned                    : 1;
598     unsigned RC8_9              : 1;
599     unsigned                    : 1;
600     };
601   } __RCSTAbits_t;
602 
603 extern __at(0x0018) volatile __RCSTAbits_t RCSTAbits;
604 
605 #define _RX9D                   0x01
606 #define _RCD8                   0x01
607 #define _OERR                   0x02
608 #define _FERR                   0x04
609 #define _ADDEN                  0x08
610 #define _CREN                   0x10
611 #define _SREN                   0x20
612 #define _RX9                    0x40
613 #define _RC9                    0x40
614 #define _NOT_RC8                0x40
615 #define _RC8_9                  0x40
616 #define _SPEN                   0x80
617 
618 //==============================================================================
619 
620 extern __at(0x0019) __sfr TXREG;
621 extern __at(0x001A) __sfr RCREG;
622 extern __at(0x001B) __sfr CCPR2;
623 extern __at(0x001B) __sfr CCPR2L;
624 extern __at(0x001C) __sfr CCPR2H;
625 
626 //==============================================================================
627 //        CCP2CON Bits
628 
629 extern __at(0x001D) __sfr CCP2CON;
630 
631 typedef union
632   {
633   struct
634     {
635     unsigned CCP2M0             : 1;
636     unsigned CCP2M1             : 1;
637     unsigned CCP2M2             : 1;
638     unsigned CCP2M3             : 1;
639     unsigned CCP2Y              : 1;
640     unsigned CCP2X              : 1;
641     unsigned                    : 1;
642     unsigned                    : 1;
643     };
644 
645   struct
646     {
647     unsigned CCP2M              : 4;
648     unsigned                    : 4;
649     };
650   } __CCP2CONbits_t;
651 
652 extern __at(0x001D) volatile __CCP2CONbits_t CCP2CONbits;
653 
654 #define _CCP2M0                 0x01
655 #define _CCP2M1                 0x02
656 #define _CCP2M2                 0x04
657 #define _CCP2M3                 0x08
658 #define _CCP2Y                  0x10
659 #define _CCP2X                  0x20
660 
661 //==============================================================================
662 
663 extern __at(0x001E) __sfr ADRESH;
664 
665 //==============================================================================
666 //        ADCON0 Bits
667 
668 extern __at(0x001F) __sfr ADCON0;
669 
670 typedef union
671   {
672   struct
673     {
674     unsigned ADON               : 1;
675     unsigned                    : 1;
676     unsigned GO_NOT_DONE        : 1;
677     unsigned CHS0               : 1;
678     unsigned CHS1               : 1;
679     unsigned CHS2               : 1;
680     unsigned ADCS0              : 1;
681     unsigned ADCS1              : 1;
682     };
683 
684   struct
685     {
686     unsigned                    : 1;
687     unsigned                    : 1;
688     unsigned GO                 : 1;
689     unsigned                    : 1;
690     unsigned                    : 1;
691     unsigned                    : 1;
692     unsigned                    : 1;
693     unsigned                    : 1;
694     };
695 
696   struct
697     {
698     unsigned                    : 1;
699     unsigned                    : 1;
700     unsigned NOT_DONE           : 1;
701     unsigned                    : 1;
702     unsigned                    : 1;
703     unsigned                    : 1;
704     unsigned                    : 1;
705     unsigned                    : 1;
706     };
707 
708   struct
709     {
710     unsigned                    : 1;
711     unsigned                    : 1;
712     unsigned GO_DONE            : 1;
713     unsigned                    : 1;
714     unsigned                    : 1;
715     unsigned                    : 1;
716     unsigned                    : 1;
717     unsigned                    : 1;
718     };
719 
720   struct
721     {
722     unsigned                    : 3;
723     unsigned CHS                : 3;
724     unsigned                    : 2;
725     };
726 
727   struct
728     {
729     unsigned                    : 6;
730     unsigned ADCS               : 2;
731     };
732   } __ADCON0bits_t;
733 
734 extern __at(0x001F) volatile __ADCON0bits_t ADCON0bits;
735 
736 #define _ADON                   0x01
737 #define _GO_NOT_DONE            0x04
738 #define _GO                     0x04
739 #define _NOT_DONE               0x04
740 #define _GO_DONE                0x04
741 #define _CHS0                   0x08
742 #define _CHS1                   0x10
743 #define _CHS2                   0x20
744 #define _ADCS0                  0x40
745 #define _ADCS1                  0x80
746 
747 //==============================================================================
748 
749 
750 //==============================================================================
751 //        OPTION_REG Bits
752 
753 extern __at(0x0081) __sfr OPTION_REG;
754 
755 typedef union
756   {
757   struct
758     {
759     unsigned PS0                : 1;
760     unsigned PS1                : 1;
761     unsigned PS2                : 1;
762     unsigned PSA                : 1;
763     unsigned T0SE               : 1;
764     unsigned T0CS               : 1;
765     unsigned INTEDG             : 1;
766     unsigned NOT_RBPU           : 1;
767     };
768 
769   struct
770     {
771     unsigned PS                 : 3;
772     unsigned                    : 5;
773     };
774   } __OPTION_REGbits_t;
775 
776 extern __at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits;
777 
778 #define _PS0                    0x01
779 #define _PS1                    0x02
780 #define _PS2                    0x04
781 #define _PSA                    0x08
782 #define _T0SE                   0x10
783 #define _T0CS                   0x20
784 #define _INTEDG                 0x40
785 #define _NOT_RBPU               0x80
786 
787 //==============================================================================
788 
789 
790 //==============================================================================
791 //        TRISA Bits
792 
793 extern __at(0x0085) __sfr TRISA;
794 
795 typedef union
796   {
797   struct
798     {
799     unsigned TRISA0             : 1;
800     unsigned TRISA1             : 1;
801     unsigned TRISA2             : 1;
802     unsigned TRISA3             : 1;
803     unsigned TRISA4             : 1;
804     unsigned TRISA5             : 1;
805     unsigned                    : 1;
806     unsigned                    : 1;
807     };
808 
809   struct
810     {
811     unsigned TRISA              : 6;
812     unsigned                    : 2;
813     };
814   } __TRISAbits_t;
815 
816 extern __at(0x0085) volatile __TRISAbits_t TRISAbits;
817 
818 #define _TRISA0                 0x01
819 #define _TRISA1                 0x02
820 #define _TRISA2                 0x04
821 #define _TRISA3                 0x08
822 #define _TRISA4                 0x10
823 #define _TRISA5                 0x20
824 
825 //==============================================================================
826 
827 
828 //==============================================================================
829 //        TRISB Bits
830 
831 extern __at(0x0086) __sfr TRISB;
832 
833 typedef struct
834   {
835   unsigned TRISB0               : 1;
836   unsigned TRISB1               : 1;
837   unsigned TRISB2               : 1;
838   unsigned TRISB3               : 1;
839   unsigned TRISB4               : 1;
840   unsigned TRISB5               : 1;
841   unsigned TRISB6               : 1;
842   unsigned TRISB7               : 1;
843   } __TRISBbits_t;
844 
845 extern __at(0x0086) volatile __TRISBbits_t TRISBbits;
846 
847 #define _TRISB0                 0x01
848 #define _TRISB1                 0x02
849 #define _TRISB2                 0x04
850 #define _TRISB3                 0x08
851 #define _TRISB4                 0x10
852 #define _TRISB5                 0x20
853 #define _TRISB6                 0x40
854 #define _TRISB7                 0x80
855 
856 //==============================================================================
857 
858 
859 //==============================================================================
860 //        TRISC Bits
861 
862 extern __at(0x0087) __sfr TRISC;
863 
864 typedef struct
865   {
866   unsigned TRISC0               : 1;
867   unsigned TRISC1               : 1;
868   unsigned TRISC2               : 1;
869   unsigned TRISC3               : 1;
870   unsigned TRISC4               : 1;
871   unsigned TRISC5               : 1;
872   unsigned TRISC6               : 1;
873   unsigned TRISC7               : 1;
874   } __TRISCbits_t;
875 
876 extern __at(0x0087) volatile __TRISCbits_t TRISCbits;
877 
878 #define _TRISC0                 0x01
879 #define _TRISC1                 0x02
880 #define _TRISC2                 0x04
881 #define _TRISC3                 0x08
882 #define _TRISC4                 0x10
883 #define _TRISC5                 0x20
884 #define _TRISC6                 0x40
885 #define _TRISC7                 0x80
886 
887 //==============================================================================
888 
889 
890 //==============================================================================
891 //        PIE1 Bits
892 
893 extern __at(0x008C) __sfr PIE1;
894 
895 typedef struct
896   {
897   unsigned TMR1IE               : 1;
898   unsigned TMR2IE               : 1;
899   unsigned CCP1IE               : 1;
900   unsigned SSPIE                : 1;
901   unsigned TXIE                 : 1;
902   unsigned RCIE                 : 1;
903   unsigned ADIE                 : 1;
904   unsigned                      : 1;
905   } __PIE1bits_t;
906 
907 extern __at(0x008C) volatile __PIE1bits_t PIE1bits;
908 
909 #define _TMR1IE                 0x01
910 #define _TMR2IE                 0x02
911 #define _CCP1IE                 0x04
912 #define _SSPIE                  0x08
913 #define _TXIE                   0x10
914 #define _RCIE                   0x20
915 #define _ADIE                   0x40
916 
917 //==============================================================================
918 
919 
920 //==============================================================================
921 //        PIE2 Bits
922 
923 extern __at(0x008D) __sfr PIE2;
924 
925 typedef struct
926   {
927   unsigned CCP2IE               : 1;
928   unsigned                      : 1;
929   unsigned                      : 1;
930   unsigned BCLIE                : 1;
931   unsigned EEIE                 : 1;
932   unsigned                      : 1;
933   unsigned                      : 1;
934   unsigned                      : 1;
935   } __PIE2bits_t;
936 
937 extern __at(0x008D) volatile __PIE2bits_t PIE2bits;
938 
939 #define _CCP2IE                 0x01
940 #define _BCLIE                  0x08
941 #define _EEIE                   0x10
942 
943 //==============================================================================
944 
945 
946 //==============================================================================
947 //        PCON Bits
948 
949 extern __at(0x008E) __sfr PCON;
950 
951 typedef union
952   {
953   struct
954     {
955     unsigned NOT_BOR            : 1;
956     unsigned NOT_POR            : 1;
957     unsigned                    : 1;
958     unsigned                    : 1;
959     unsigned                    : 1;
960     unsigned                    : 1;
961     unsigned                    : 1;
962     unsigned                    : 1;
963     };
964 
965   struct
966     {
967     unsigned NOT_BO             : 1;
968     unsigned                    : 1;
969     unsigned                    : 1;
970     unsigned                    : 1;
971     unsigned                    : 1;
972     unsigned                    : 1;
973     unsigned                    : 1;
974     unsigned                    : 1;
975     };
976   } __PCONbits_t;
977 
978 extern __at(0x008E) volatile __PCONbits_t PCONbits;
979 
980 #define _NOT_BOR                0x01
981 #define _NOT_BO                 0x01
982 #define _NOT_POR                0x02
983 
984 //==============================================================================
985 
986 
987 //==============================================================================
988 //        SSPCON2 Bits
989 
990 extern __at(0x0091) __sfr SSPCON2;
991 
992 typedef struct
993   {
994   unsigned SEN                  : 1;
995   unsigned RSEN                 : 1;
996   unsigned PEN                  : 1;
997   unsigned RCEN                 : 1;
998   unsigned ACKEN                : 1;
999   unsigned ACKDT                : 1;
1000   unsigned ACKSTAT              : 1;
1001   unsigned GCEN                 : 1;
1002   } __SSPCON2bits_t;
1003 
1004 extern __at(0x0091) volatile __SSPCON2bits_t SSPCON2bits;
1005 
1006 #define _SEN                    0x01
1007 #define _RSEN                   0x02
1008 #define _PEN                    0x04
1009 #define _RCEN                   0x08
1010 #define _ACKEN                  0x10
1011 #define _ACKDT                  0x20
1012 #define _ACKSTAT                0x40
1013 #define _GCEN                   0x80
1014 
1015 //==============================================================================
1016 
1017 extern __at(0x0092) __sfr PR2;
1018 extern __at(0x0093) __sfr SSPADD;
1019 
1020 //==============================================================================
1021 //        SSPSTAT Bits
1022 
1023 extern __at(0x0094) __sfr SSPSTAT;
1024 
1025 typedef union
1026   {
1027   struct
1028     {
1029     unsigned BF                 : 1;
1030     unsigned UA                 : 1;
1031     unsigned R_NOT_W            : 1;
1032     unsigned S                  : 1;
1033     unsigned P                  : 1;
1034     unsigned D_NOT_A            : 1;
1035     unsigned CKE                : 1;
1036     unsigned SMP                : 1;
1037     };
1038 
1039   struct
1040     {
1041     unsigned                    : 1;
1042     unsigned                    : 1;
1043     unsigned R                  : 1;
1044     unsigned I2C_START          : 1;
1045     unsigned I2C_STOP           : 1;
1046     unsigned D                  : 1;
1047     unsigned                    : 1;
1048     unsigned                    : 1;
1049     };
1050 
1051   struct
1052     {
1053     unsigned                    : 1;
1054     unsigned                    : 1;
1055     unsigned I2C_READ           : 1;
1056     unsigned                    : 1;
1057     unsigned                    : 1;
1058     unsigned I2C_DATA           : 1;
1059     unsigned                    : 1;
1060     unsigned                    : 1;
1061     };
1062 
1063   struct
1064     {
1065     unsigned                    : 1;
1066     unsigned                    : 1;
1067     unsigned NOT_W              : 1;
1068     unsigned                    : 1;
1069     unsigned                    : 1;
1070     unsigned NOT_A              : 1;
1071     unsigned                    : 1;
1072     unsigned                    : 1;
1073     };
1074 
1075   struct
1076     {
1077     unsigned                    : 1;
1078     unsigned                    : 1;
1079     unsigned NOT_WRITE          : 1;
1080     unsigned                    : 1;
1081     unsigned                    : 1;
1082     unsigned NOT_ADDRESS        : 1;
1083     unsigned                    : 1;
1084     unsigned                    : 1;
1085     };
1086 
1087   struct
1088     {
1089     unsigned                    : 1;
1090     unsigned                    : 1;
1091     unsigned R_W                : 1;
1092     unsigned                    : 1;
1093     unsigned                    : 1;
1094     unsigned D_A                : 1;
1095     unsigned                    : 1;
1096     unsigned                    : 1;
1097     };
1098 
1099   struct
1100     {
1101     unsigned                    : 1;
1102     unsigned                    : 1;
1103     unsigned READ_WRITE         : 1;
1104     unsigned                    : 1;
1105     unsigned                    : 1;
1106     unsigned DATA_ADDRESS       : 1;
1107     unsigned                    : 1;
1108     unsigned                    : 1;
1109     };
1110   } __SSPSTATbits_t;
1111 
1112 extern __at(0x0094) volatile __SSPSTATbits_t SSPSTATbits;
1113 
1114 #define _BF                     0x01
1115 #define _UA                     0x02
1116 #define _R_NOT_W                0x04
1117 #define _R                      0x04
1118 #define _I2C_READ               0x04
1119 #define _NOT_W                  0x04
1120 #define _NOT_WRITE              0x04
1121 #define _R_W                    0x04
1122 #define _READ_WRITE             0x04
1123 #define _S                      0x08
1124 #define _I2C_START              0x08
1125 #define _P                      0x10
1126 #define _I2C_STOP               0x10
1127 #define _D_NOT_A                0x20
1128 #define _D                      0x20
1129 #define _I2C_DATA               0x20
1130 #define _NOT_A                  0x20
1131 #define _NOT_ADDRESS            0x20
1132 #define _D_A                    0x20
1133 #define _DATA_ADDRESS           0x20
1134 #define _CKE                    0x40
1135 #define _SMP                    0x80
1136 
1137 //==============================================================================
1138 
1139 
1140 //==============================================================================
1141 //        TXSTA Bits
1142 
1143 extern __at(0x0098) __sfr TXSTA;
1144 
1145 typedef union
1146   {
1147   struct
1148     {
1149     unsigned TX9D               : 1;
1150     unsigned TRMT               : 1;
1151     unsigned BRGH               : 1;
1152     unsigned                    : 1;
1153     unsigned SYNC               : 1;
1154     unsigned TXEN               : 1;
1155     unsigned TX9                : 1;
1156     unsigned CSRC               : 1;
1157     };
1158 
1159   struct
1160     {
1161     unsigned TXD8               : 1;
1162     unsigned                    : 1;
1163     unsigned                    : 1;
1164     unsigned                    : 1;
1165     unsigned                    : 1;
1166     unsigned                    : 1;
1167     unsigned NOT_TX8            : 1;
1168     unsigned                    : 1;
1169     };
1170 
1171   struct
1172     {
1173     unsigned                    : 1;
1174     unsigned                    : 1;
1175     unsigned                    : 1;
1176     unsigned                    : 1;
1177     unsigned                    : 1;
1178     unsigned                    : 1;
1179     unsigned TX8_9              : 1;
1180     unsigned                    : 1;
1181     };
1182   } __TXSTAbits_t;
1183 
1184 extern __at(0x0098) volatile __TXSTAbits_t TXSTAbits;
1185 
1186 #define _TX9D                   0x01
1187 #define _TXD8                   0x01
1188 #define _TRMT                   0x02
1189 #define _BRGH                   0x04
1190 #define _SYNC                   0x10
1191 #define _TXEN                   0x20
1192 #define _TX9                    0x40
1193 #define _NOT_TX8                0x40
1194 #define _TX8_9                  0x40
1195 #define _CSRC                   0x80
1196 
1197 //==============================================================================
1198 
1199 extern __at(0x0099) __sfr SPBRG;
1200 extern __at(0x009E) __sfr ADRESL;
1201 
1202 //==============================================================================
1203 //        ADCON1 Bits
1204 
1205 extern __at(0x009F) __sfr ADCON1;
1206 
1207 typedef union
1208   {
1209   struct
1210     {
1211     unsigned PCFG0              : 1;
1212     unsigned PCFG1              : 1;
1213     unsigned PCFG2              : 1;
1214     unsigned PCFG3              : 1;
1215     unsigned                    : 1;
1216     unsigned                    : 1;
1217     unsigned                    : 1;
1218     unsigned ADFM               : 1;
1219     };
1220 
1221   struct
1222     {
1223     unsigned PCFG               : 4;
1224     unsigned                    : 4;
1225     };
1226   } __ADCON1bits_t;
1227 
1228 extern __at(0x009F) volatile __ADCON1bits_t ADCON1bits;
1229 
1230 #define _PCFG0                  0x01
1231 #define _PCFG1                  0x02
1232 #define _PCFG2                  0x04
1233 #define _PCFG3                  0x08
1234 #define _ADFM                   0x80
1235 
1236 //==============================================================================
1237 
1238 extern __at(0x010C) __sfr EEDATA;
1239 extern __at(0x010D) __sfr EEADR;
1240 extern __at(0x010E) __sfr EEDATH;
1241 extern __at(0x010F) __sfr EEADRH;
1242 
1243 //==============================================================================
1244 //        EECON1 Bits
1245 
1246 extern __at(0x018C) __sfr EECON1;
1247 
1248 typedef struct
1249   {
1250   unsigned RD                   : 1;
1251   unsigned WR                   : 1;
1252   unsigned WREN                 : 1;
1253   unsigned WRERR                : 1;
1254   unsigned                      : 1;
1255   unsigned                      : 1;
1256   unsigned                      : 1;
1257   unsigned EEPGD                : 1;
1258   } __EECON1bits_t;
1259 
1260 extern __at(0x018C) volatile __EECON1bits_t EECON1bits;
1261 
1262 #define _RD                     0x01
1263 #define _WR                     0x02
1264 #define _WREN                   0x04
1265 #define _WRERR                  0x08
1266 #define _EEPGD                  0x80
1267 
1268 //==============================================================================
1269 
1270 extern __at(0x018D) __sfr EECON2;
1271 
1272 //==============================================================================
1273 //
1274 //        Configuration Bits
1275 //
1276 //==============================================================================
1277 
1278 #define _CONFIG                 0x2007
1279 
1280 //----------------------------- CONFIG Options -------------------------------
1281 
1282 #define _FOSC_LP                0x3FFC  // LP oscillator.
1283 #define _LP_OSC                 0x3FFC  // LP oscillator.
1284 #define _FOSC_XT                0x3FFD  // XT oscillator.
1285 #define _XT_OSC                 0x3FFD  // XT oscillator.
1286 #define _FOSC_HS                0x3FFE  // HS oscillator.
1287 #define _HS_OSC                 0x3FFE  // HS oscillator.
1288 #define _FOSC_EXTRC             0x3FFF  // RC oscillator.
1289 #define _RC_OSC                 0x3FFF  // RC oscillator.
1290 #define _WDTE_OFF               0x3FFB  // WDT disabled.
1291 #define _WDT_OFF                0x3FFB  // WDT disabled.
1292 #define _WDTE_ON                0x3FFF  // WDT enabled.
1293 #define _WDT_ON                 0x3FFF  // WDT enabled.
1294 #define _PWRTE_ON               0x3FF7  // PWRT enabled.
1295 #define _PWRTE_OFF              0x3FFF  // PWRT disabled.
1296 #define _CP_ALL                 0x0FCF  // 0000h to 1FFFh code protected.
1297 #define _CP_HALF                0x1FDF  // 1000h to 1FFFh code protected.
1298 #define _CP_UPPER_256           0x2FEF  // 1F00h to 1FFFh code protected.
1299 #define _CP_OFF                 0x3FFF  // Code protection off.
1300 #define _BOREN_OFF              0x3FBF  // BOR disabled.
1301 #define _BODEN_OFF              0x3FBF  // BOR disabled.
1302 #define _BOREN_ON               0x3FFF  // BOR enabled.
1303 #define _BODEN_ON               0x3FFF  // BOR enabled.
1304 #define _LVP_OFF                0x3F7F  // RB3 is digital I/O, HV on MCLR must be used for programming.
1305 #define _LVP_ON                 0x3FFF  // RB3/PGM pin has PGM function; low-voltage programming enabled.
1306 #define _CPD_ON                 0x3EFF  // Data EEPROM memory code-protected.
1307 #define _CPD_OFF                0x3FFF  // Code Protection off.
1308 #define _WRT_OFF                0x3DFF  // Unprotected program memory may not be written to by EECON control.
1309 #define _WRT_ENABLE_OFF         0x3DFF  // Unprotected program memory may not be written to by EECON control.
1310 #define _WRT_ON                 0x3FFF  // Unprotected program memory may be written to by EECON control.
1311 #define _WRT_ENABLE_ON          0x3FFF  // Unprotected program memory may be written to by EECON control.
1312 #define _DEBUG_ON               0x37FF  // In-Circuit Debugger enabled, RB6 and RB7 are dedicated to the debugger.
1313 #define _DEBUG_OFF              0x3FFF  // In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins.
1314 
1315 //==============================================================================
1316 
1317 #define _DEVID1                 0x2006
1318 
1319 #define _IDLOC0                 0x2000
1320 #define _IDLOC1                 0x2001
1321 #define _IDLOC2                 0x2002
1322 #define _IDLOC3                 0x2003
1323 
1324 //==============================================================================
1325 
1326 #ifndef NO_BIT_DEFINES
1327 
1328 #define ADON                    ADCON0bits.ADON                 // bit 0
1329 #define GO_NOT_DONE             ADCON0bits.GO_NOT_DONE          // bit 2, shadows bit in ADCON0bits
1330 #define GO                      ADCON0bits.GO                   // bit 2, shadows bit in ADCON0bits
1331 #define NOT_DONE                ADCON0bits.NOT_DONE             // bit 2, shadows bit in ADCON0bits
1332 #define GO_DONE                 ADCON0bits.GO_DONE              // bit 2, shadows bit in ADCON0bits
1333 #define CHS0                    ADCON0bits.CHS0                 // bit 3
1334 #define CHS1                    ADCON0bits.CHS1                 // bit 4
1335 #define CHS2                    ADCON0bits.CHS2                 // bit 5
1336 #define ADCS0                   ADCON0bits.ADCS0                // bit 6
1337 #define ADCS1                   ADCON0bits.ADCS1                // bit 7
1338 
1339 #define PCFG0                   ADCON1bits.PCFG0                // bit 0
1340 #define PCFG1                   ADCON1bits.PCFG1                // bit 1
1341 #define PCFG2                   ADCON1bits.PCFG2                // bit 2
1342 #define PCFG3                   ADCON1bits.PCFG3                // bit 3
1343 #define ADFM                    ADCON1bits.ADFM                 // bit 7
1344 
1345 #define CCP1M0                  CCP1CONbits.CCP1M0              // bit 0
1346 #define CCP1M1                  CCP1CONbits.CCP1M1              // bit 1
1347 #define CCP1M2                  CCP1CONbits.CCP1M2              // bit 2
1348 #define CCP1M3                  CCP1CONbits.CCP1M3              // bit 3
1349 #define CCP1Y                   CCP1CONbits.CCP1Y               // bit 4
1350 #define CCP1X                   CCP1CONbits.CCP1X               // bit 5
1351 
1352 #define CCP2M0                  CCP2CONbits.CCP2M0              // bit 0
1353 #define CCP2M1                  CCP2CONbits.CCP2M1              // bit 1
1354 #define CCP2M2                  CCP2CONbits.CCP2M2              // bit 2
1355 #define CCP2M3                  CCP2CONbits.CCP2M3              // bit 3
1356 #define CCP2Y                   CCP2CONbits.CCP2Y               // bit 4
1357 #define CCP2X                   CCP2CONbits.CCP2X               // bit 5
1358 
1359 #define RD                      EECON1bits.RD                   // bit 0
1360 #define WR                      EECON1bits.WR                   // bit 1
1361 #define WREN                    EECON1bits.WREN                 // bit 2
1362 #define WRERR                   EECON1bits.WRERR                // bit 3
1363 #define EEPGD                   EECON1bits.EEPGD                // bit 7
1364 
1365 #define RBIF                    INTCONbits.RBIF                 // bit 0
1366 #define INTF                    INTCONbits.INTF                 // bit 1
1367 #define T0IF                    INTCONbits.T0IF                 // bit 2, shadows bit in INTCONbits
1368 #define TMR0IF                  INTCONbits.TMR0IF               // bit 2, shadows bit in INTCONbits
1369 #define RBIE                    INTCONbits.RBIE                 // bit 3
1370 #define INTE                    INTCONbits.INTE                 // bit 4
1371 #define T0IE                    INTCONbits.T0IE                 // bit 5, shadows bit in INTCONbits
1372 #define TMR0IE                  INTCONbits.TMR0IE               // bit 5, shadows bit in INTCONbits
1373 #define PEIE                    INTCONbits.PEIE                 // bit 6
1374 #define GIE                     INTCONbits.GIE                  // bit 7
1375 
1376 #define PS0                     OPTION_REGbits.PS0              // bit 0
1377 #define PS1                     OPTION_REGbits.PS1              // bit 1
1378 #define PS2                     OPTION_REGbits.PS2              // bit 2
1379 #define PSA                     OPTION_REGbits.PSA              // bit 3
1380 #define T0SE                    OPTION_REGbits.T0SE             // bit 4
1381 #define T0CS                    OPTION_REGbits.T0CS             // bit 5
1382 #define INTEDG                  OPTION_REGbits.INTEDG           // bit 6
1383 #define NOT_RBPU                OPTION_REGbits.NOT_RBPU         // bit 7
1384 
1385 #define NOT_BOR                 PCONbits.NOT_BOR                // bit 0, shadows bit in PCONbits
1386 #define NOT_BO                  PCONbits.NOT_BO                 // bit 0, shadows bit in PCONbits
1387 #define NOT_POR                 PCONbits.NOT_POR                // bit 1
1388 
1389 #define TMR1IE                  PIE1bits.TMR1IE                 // bit 0
1390 #define TMR2IE                  PIE1bits.TMR2IE                 // bit 1
1391 #define CCP1IE                  PIE1bits.CCP1IE                 // bit 2
1392 #define SSPIE                   PIE1bits.SSPIE                  // bit 3
1393 #define TXIE                    PIE1bits.TXIE                   // bit 4
1394 #define RCIE                    PIE1bits.RCIE                   // bit 5
1395 #define ADIE                    PIE1bits.ADIE                   // bit 6
1396 
1397 #define CCP2IE                  PIE2bits.CCP2IE                 // bit 0
1398 #define BCLIE                   PIE2bits.BCLIE                  // bit 3
1399 #define EEIE                    PIE2bits.EEIE                   // bit 4
1400 
1401 #define TMR1IF                  PIR1bits.TMR1IF                 // bit 0
1402 #define TMR2IF                  PIR1bits.TMR2IF                 // bit 1
1403 #define CCP1IF                  PIR1bits.CCP1IF                 // bit 2
1404 #define SSPIF                   PIR1bits.SSPIF                  // bit 3
1405 #define TXIF                    PIR1bits.TXIF                   // bit 4
1406 #define RCIF                    PIR1bits.RCIF                   // bit 5
1407 #define ADIF                    PIR1bits.ADIF                   // bit 6
1408 
1409 #define CCP2IF                  PIR2bits.CCP2IF                 // bit 0
1410 #define BCLIF                   PIR2bits.BCLIF                  // bit 3
1411 #define EEIF                    PIR2bits.EEIF                   // bit 4
1412 
1413 #define RA0                     PORTAbits.RA0                   // bit 0
1414 #define RA1                     PORTAbits.RA1                   // bit 1
1415 #define RA2                     PORTAbits.RA2                   // bit 2
1416 #define RA3                     PORTAbits.RA3                   // bit 3
1417 #define RA4                     PORTAbits.RA4                   // bit 4
1418 #define RA5                     PORTAbits.RA5                   // bit 5
1419 
1420 #define RB0                     PORTBbits.RB0                   // bit 0
1421 #define RB1                     PORTBbits.RB1                   // bit 1
1422 #define RB2                     PORTBbits.RB2                   // bit 2
1423 #define RB3                     PORTBbits.RB3                   // bit 3
1424 #define RB4                     PORTBbits.RB4                   // bit 4
1425 #define RB5                     PORTBbits.RB5                   // bit 5
1426 #define RB6                     PORTBbits.RB6                   // bit 6
1427 #define RB7                     PORTBbits.RB7                   // bit 7
1428 
1429 #define RC0                     PORTCbits.RC0                   // bit 0
1430 #define RC1                     PORTCbits.RC1                   // bit 1
1431 #define RC2                     PORTCbits.RC2                   // bit 2
1432 #define RC3                     PORTCbits.RC3                   // bit 3
1433 #define RC4                     PORTCbits.RC4                   // bit 4
1434 #define RC5                     PORTCbits.RC5                   // bit 5
1435 #define RC6                     PORTCbits.RC6                   // bit 6
1436 #define RC7                     PORTCbits.RC7                   // bit 7
1437 
1438 #define RX9D                    RCSTAbits.RX9D                  // bit 0, shadows bit in RCSTAbits
1439 #define RCD8                    RCSTAbits.RCD8                  // bit 0, shadows bit in RCSTAbits
1440 #define OERR                    RCSTAbits.OERR                  // bit 1
1441 #define FERR                    RCSTAbits.FERR                  // bit 2
1442 #define ADDEN                   RCSTAbits.ADDEN                 // bit 3
1443 #define CREN                    RCSTAbits.CREN                  // bit 4
1444 #define SREN                    RCSTAbits.SREN                  // bit 5
1445 #define RX9                     RCSTAbits.RX9                   // bit 6, shadows bit in RCSTAbits
1446 #define RC9                     RCSTAbits.RC9                   // bit 6, shadows bit in RCSTAbits
1447 #define NOT_RC8                 RCSTAbits.NOT_RC8               // bit 6, shadows bit in RCSTAbits
1448 #define RC8_9                   RCSTAbits.RC8_9                 // bit 6, shadows bit in RCSTAbits
1449 #define SPEN                    RCSTAbits.SPEN                  // bit 7
1450 
1451 #define SSPM0                   SSPCONbits.SSPM0                // bit 0
1452 #define SSPM1                   SSPCONbits.SSPM1                // bit 1
1453 #define SSPM2                   SSPCONbits.SSPM2                // bit 2
1454 #define SSPM3                   SSPCONbits.SSPM3                // bit 3
1455 #define CKP                     SSPCONbits.CKP                  // bit 4
1456 #define SSPEN                   SSPCONbits.SSPEN                // bit 5
1457 #define SSPOV                   SSPCONbits.SSPOV                // bit 6
1458 #define WCOL                    SSPCONbits.WCOL                 // bit 7
1459 
1460 #define SEN                     SSPCON2bits.SEN                 // bit 0
1461 #define RSEN                    SSPCON2bits.RSEN                // bit 1
1462 #define PEN                     SSPCON2bits.PEN                 // bit 2
1463 #define RCEN                    SSPCON2bits.RCEN                // bit 3
1464 #define ACKEN                   SSPCON2bits.ACKEN               // bit 4
1465 #define ACKDT                   SSPCON2bits.ACKDT               // bit 5
1466 #define ACKSTAT                 SSPCON2bits.ACKSTAT             // bit 6
1467 #define GCEN                    SSPCON2bits.GCEN                // bit 7
1468 
1469 #define BF                      SSPSTATbits.BF                  // bit 0
1470 #define UA                      SSPSTATbits.UA                  // bit 1
1471 #define R_NOT_W                 SSPSTATbits.R_NOT_W             // bit 2, shadows bit in SSPSTATbits
1472 #define R                       SSPSTATbits.R                   // bit 2, shadows bit in SSPSTATbits
1473 #define I2C_READ                SSPSTATbits.I2C_READ            // bit 2, shadows bit in SSPSTATbits
1474 #define NOT_W                   SSPSTATbits.NOT_W               // bit 2, shadows bit in SSPSTATbits
1475 #define NOT_WRITE               SSPSTATbits.NOT_WRITE           // bit 2, shadows bit in SSPSTATbits
1476 #define R_W                     SSPSTATbits.R_W                 // bit 2, shadows bit in SSPSTATbits
1477 #define READ_WRITE              SSPSTATbits.READ_WRITE          // bit 2, shadows bit in SSPSTATbits
1478 #define S                       SSPSTATbits.S                   // bit 3, shadows bit in SSPSTATbits
1479 #define I2C_START               SSPSTATbits.I2C_START           // bit 3, shadows bit in SSPSTATbits
1480 #define P                       SSPSTATbits.P                   // bit 4, shadows bit in SSPSTATbits
1481 #define I2C_STOP                SSPSTATbits.I2C_STOP            // bit 4, shadows bit in SSPSTATbits
1482 #define D_NOT_A                 SSPSTATbits.D_NOT_A             // bit 5, shadows bit in SSPSTATbits
1483 #define D                       SSPSTATbits.D                   // bit 5, shadows bit in SSPSTATbits
1484 #define I2C_DATA                SSPSTATbits.I2C_DATA            // bit 5, shadows bit in SSPSTATbits
1485 #define NOT_A                   SSPSTATbits.NOT_A               // bit 5, shadows bit in SSPSTATbits
1486 #define NOT_ADDRESS             SSPSTATbits.NOT_ADDRESS         // bit 5, shadows bit in SSPSTATbits
1487 #define D_A                     SSPSTATbits.D_A                 // bit 5, shadows bit in SSPSTATbits
1488 #define DATA_ADDRESS            SSPSTATbits.DATA_ADDRESS        // bit 5, shadows bit in SSPSTATbits
1489 #define CKE                     SSPSTATbits.CKE                 // bit 6
1490 #define SMP                     SSPSTATbits.SMP                 // bit 7
1491 
1492 #define C                       STATUSbits.C                    // bit 0
1493 #define DC                      STATUSbits.DC                   // bit 1
1494 #define Z                       STATUSbits.Z                    // bit 2
1495 #define NOT_PD                  STATUSbits.NOT_PD               // bit 3
1496 #define NOT_TO                  STATUSbits.NOT_TO               // bit 4
1497 #define RP0                     STATUSbits.RP0                  // bit 5
1498 #define RP1                     STATUSbits.RP1                  // bit 6
1499 #define IRP                     STATUSbits.IRP                  // bit 7
1500 
1501 #define TMR1ON                  T1CONbits.TMR1ON                // bit 0
1502 #define TMR1CS                  T1CONbits.TMR1CS                // bit 1
1503 #define NOT_T1SYNC              T1CONbits.NOT_T1SYNC            // bit 2, shadows bit in T1CONbits
1504 #define T1INSYNC                T1CONbits.T1INSYNC              // bit 2, shadows bit in T1CONbits
1505 #define T1SYNC                  T1CONbits.T1SYNC                // bit 2, shadows bit in T1CONbits
1506 #define T1OSCEN                 T1CONbits.T1OSCEN               // bit 3
1507 #define T1CKPS0                 T1CONbits.T1CKPS0               // bit 4
1508 #define T1CKPS1                 T1CONbits.T1CKPS1               // bit 5
1509 
1510 #define T2CKPS0                 T2CONbits.T2CKPS0               // bit 0
1511 #define T2CKPS1                 T2CONbits.T2CKPS1               // bit 1
1512 #define TMR2ON                  T2CONbits.TMR2ON                // bit 2
1513 #define TOUTPS0                 T2CONbits.TOUTPS0               // bit 3
1514 #define TOUTPS1                 T2CONbits.TOUTPS1               // bit 4
1515 #define TOUTPS2                 T2CONbits.TOUTPS2               // bit 5
1516 #define TOUTPS3                 T2CONbits.TOUTPS3               // bit 6
1517 
1518 #define TRISA0                  TRISAbits.TRISA0                // bit 0
1519 #define TRISA1                  TRISAbits.TRISA1                // bit 1
1520 #define TRISA2                  TRISAbits.TRISA2                // bit 2
1521 #define TRISA3                  TRISAbits.TRISA3                // bit 3
1522 #define TRISA4                  TRISAbits.TRISA4                // bit 4
1523 #define TRISA5                  TRISAbits.TRISA5                // bit 5
1524 
1525 #define TRISB0                  TRISBbits.TRISB0                // bit 0
1526 #define TRISB1                  TRISBbits.TRISB1                // bit 1
1527 #define TRISB2                  TRISBbits.TRISB2                // bit 2
1528 #define TRISB3                  TRISBbits.TRISB3                // bit 3
1529 #define TRISB4                  TRISBbits.TRISB4                // bit 4
1530 #define TRISB5                  TRISBbits.TRISB5                // bit 5
1531 #define TRISB6                  TRISBbits.TRISB6                // bit 6
1532 #define TRISB7                  TRISBbits.TRISB7                // bit 7
1533 
1534 #define TRISC0                  TRISCbits.TRISC0                // bit 0
1535 #define TRISC1                  TRISCbits.TRISC1                // bit 1
1536 #define TRISC2                  TRISCbits.TRISC2                // bit 2
1537 #define TRISC3                  TRISCbits.TRISC3                // bit 3
1538 #define TRISC4                  TRISCbits.TRISC4                // bit 4
1539 #define TRISC5                  TRISCbits.TRISC5                // bit 5
1540 #define TRISC6                  TRISCbits.TRISC6                // bit 6
1541 #define TRISC7                  TRISCbits.TRISC7                // bit 7
1542 
1543 #define TX9D                    TXSTAbits.TX9D                  // bit 0, shadows bit in TXSTAbits
1544 #define TXD8                    TXSTAbits.TXD8                  // bit 0, shadows bit in TXSTAbits
1545 #define TRMT                    TXSTAbits.TRMT                  // bit 1
1546 #define BRGH                    TXSTAbits.BRGH                  // bit 2
1547 #define SYNC                    TXSTAbits.SYNC                  // bit 4
1548 #define TXEN                    TXSTAbits.TXEN                  // bit 5
1549 #define TX9                     TXSTAbits.TX9                   // bit 6, shadows bit in TXSTAbits
1550 #define NOT_TX8                 TXSTAbits.NOT_TX8               // bit 6, shadows bit in TXSTAbits
1551 #define TX8_9                   TXSTAbits.TX8_9                 // bit 6, shadows bit in TXSTAbits
1552 #define CSRC                    TXSTAbits.CSRC                  // bit 7
1553 
1554 #endif // #ifndef NO_BIT_DEFINES
1555 
1556 #endif // #ifndef __PIC16LF876_H__
1557