struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16f877a.h
blob0b9f163aa8a6b3bba701313fb862e8e24f5e03b0
1 /*
2 * This declarations of the PIC16F877A 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:00 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 __PIC16F877A_H__
26 #define __PIC16F877A_H__
28 //==============================================================================
30 // Register Addresses
32 //==============================================================================
34 #ifndef NO_ADDR_DEFINES
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 PORTD_ADDR 0x0008
45 #define PORTE_ADDR 0x0009
46 #define PCLATH_ADDR 0x000A
47 #define INTCON_ADDR 0x000B
48 #define PIR1_ADDR 0x000C
49 #define PIR2_ADDR 0x000D
50 #define TMR1_ADDR 0x000E
51 #define TMR1L_ADDR 0x000E
52 #define TMR1H_ADDR 0x000F
53 #define T1CON_ADDR 0x0010
54 #define TMR2_ADDR 0x0011
55 #define T2CON_ADDR 0x0012
56 #define SSPBUF_ADDR 0x0013
57 #define SSPCON_ADDR 0x0014
58 #define CCPR1_ADDR 0x0015
59 #define CCPR1L_ADDR 0x0015
60 #define CCPR1H_ADDR 0x0016
61 #define CCP1CON_ADDR 0x0017
62 #define RCSTA_ADDR 0x0018
63 #define TXREG_ADDR 0x0019
64 #define RCREG_ADDR 0x001A
65 #define CCPR2_ADDR 0x001B
66 #define CCPR2L_ADDR 0x001B
67 #define CCPR2H_ADDR 0x001C
68 #define CCP2CON_ADDR 0x001D
69 #define ADRESH_ADDR 0x001E
70 #define ADCON0_ADDR 0x001F
71 #define OPTION_REG_ADDR 0x0081
72 #define TRISA_ADDR 0x0085
73 #define TRISB_ADDR 0x0086
74 #define TRISC_ADDR 0x0087
75 #define TRISD_ADDR 0x0088
76 #define TRISE_ADDR 0x0089
77 #define PIE1_ADDR 0x008C
78 #define PIE2_ADDR 0x008D
79 #define PCON_ADDR 0x008E
80 #define SSPCON2_ADDR 0x0091
81 #define PR2_ADDR 0x0092
82 #define SSPADD_ADDR 0x0093
83 #define SSPSTAT_ADDR 0x0094
84 #define TXSTA_ADDR 0x0098
85 #define SPBRG_ADDR 0x0099
86 #define CMCON_ADDR 0x009C
87 #define CVRCON_ADDR 0x009D
88 #define ADRESL_ADDR 0x009E
89 #define ADCON1_ADDR 0x009F
90 #define EEDATA_ADDR 0x010C
91 #define EEADR_ADDR 0x010D
92 #define EEDATH_ADDR 0x010E
93 #define EEADRH_ADDR 0x010F
94 #define EECON1_ADDR 0x018C
95 #define EECON2_ADDR 0x018D
97 #endif // #ifndef NO_ADDR_DEFINES
99 //==============================================================================
101 // Register Definitions
103 //==============================================================================
105 extern __at(0x0000) __sfr INDF;
106 extern __at(0x0001) __sfr TMR0;
107 extern __at(0x0002) __sfr PCL;
109 //==============================================================================
110 // STATUS Bits
112 extern __at(0x0003) __sfr STATUS;
114 typedef union
116 struct
118 unsigned C : 1;
119 unsigned DC : 1;
120 unsigned Z : 1;
121 unsigned NOT_PD : 1;
122 unsigned NOT_TO : 1;
123 unsigned RP0 : 1;
124 unsigned RP1 : 1;
125 unsigned IRP : 1;
128 struct
130 unsigned : 5;
131 unsigned RP : 2;
132 unsigned : 1;
134 } __STATUSbits_t;
136 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
138 #define _C 0x01
139 #define _DC 0x02
140 #define _Z 0x04
141 #define _NOT_PD 0x08
142 #define _NOT_TO 0x10
143 #define _RP0 0x20
144 #define _RP1 0x40
145 #define _IRP 0x80
147 //==============================================================================
149 extern __at(0x0004) __sfr FSR;
151 //==============================================================================
152 // PORTA Bits
154 extern __at(0x0005) __sfr PORTA;
156 typedef union
158 struct
160 unsigned RA0 : 1;
161 unsigned RA1 : 1;
162 unsigned RA2 : 1;
163 unsigned RA3 : 1;
164 unsigned RA4 : 1;
165 unsigned RA5 : 1;
166 unsigned : 1;
167 unsigned : 1;
170 struct
172 unsigned RA : 6;
173 unsigned : 2;
175 } __PORTAbits_t;
177 extern __at(0x0005) volatile __PORTAbits_t PORTAbits;
179 #define _RA0 0x01
180 #define _RA1 0x02
181 #define _RA2 0x04
182 #define _RA3 0x08
183 #define _RA4 0x10
184 #define _RA5 0x20
186 //==============================================================================
189 //==============================================================================
190 // PORTB Bits
192 extern __at(0x0006) __sfr PORTB;
194 typedef struct
196 unsigned RB0 : 1;
197 unsigned RB1 : 1;
198 unsigned RB2 : 1;
199 unsigned RB3 : 1;
200 unsigned RB4 : 1;
201 unsigned RB5 : 1;
202 unsigned RB6 : 1;
203 unsigned RB7 : 1;
204 } __PORTBbits_t;
206 extern __at(0x0006) volatile __PORTBbits_t PORTBbits;
208 #define _RB0 0x01
209 #define _RB1 0x02
210 #define _RB2 0x04
211 #define _RB3 0x08
212 #define _RB4 0x10
213 #define _RB5 0x20
214 #define _RB6 0x40
215 #define _RB7 0x80
217 //==============================================================================
220 //==============================================================================
221 // PORTC Bits
223 extern __at(0x0007) __sfr PORTC;
225 typedef struct
227 unsigned RC0 : 1;
228 unsigned RC1 : 1;
229 unsigned RC2 : 1;
230 unsigned RC3 : 1;
231 unsigned RC4 : 1;
232 unsigned RC5 : 1;
233 unsigned RC6 : 1;
234 unsigned RC7 : 1;
235 } __PORTCbits_t;
237 extern __at(0x0007) volatile __PORTCbits_t PORTCbits;
239 #define _RC0 0x01
240 #define _RC1 0x02
241 #define _RC2 0x04
242 #define _RC3 0x08
243 #define _RC4 0x10
244 #define _RC5 0x20
245 #define _RC6 0x40
246 #define _RC7 0x80
248 //==============================================================================
251 //==============================================================================
252 // PORTD Bits
254 extern __at(0x0008) __sfr PORTD;
256 typedef struct
258 unsigned RD0 : 1;
259 unsigned RD1 : 1;
260 unsigned RD2 : 1;
261 unsigned RD3 : 1;
262 unsigned RD4 : 1;
263 unsigned RD5 : 1;
264 unsigned RD6 : 1;
265 unsigned RD7 : 1;
266 } __PORTDbits_t;
268 extern __at(0x0008) volatile __PORTDbits_t PORTDbits;
270 #define _RD0 0x01
271 #define _RD1 0x02
272 #define _RD2 0x04
273 #define _RD3 0x08
274 #define _RD4 0x10
275 #define _RD5 0x20
276 #define _RD6 0x40
277 #define _RD7 0x80
279 //==============================================================================
282 //==============================================================================
283 // PORTE Bits
285 extern __at(0x0009) __sfr PORTE;
287 typedef union
289 struct
291 unsigned RE0 : 1;
292 unsigned RE1 : 1;
293 unsigned RE2 : 1;
294 unsigned : 1;
295 unsigned : 1;
296 unsigned : 1;
297 unsigned : 1;
298 unsigned : 1;
301 struct
303 unsigned RE : 3;
304 unsigned : 5;
306 } __PORTEbits_t;
308 extern __at(0x0009) volatile __PORTEbits_t PORTEbits;
310 #define _RE0 0x01
311 #define _RE1 0x02
312 #define _RE2 0x04
314 //==============================================================================
316 extern __at(0x000A) __sfr PCLATH;
318 //==============================================================================
319 // INTCON Bits
321 extern __at(0x000B) __sfr INTCON;
323 typedef union
325 struct
327 unsigned RBIF : 1;
328 unsigned INTF : 1;
329 unsigned TMR0IF : 1;
330 unsigned RBIE : 1;
331 unsigned INTE : 1;
332 unsigned TMR0IE : 1;
333 unsigned PEIE : 1;
334 unsigned GIE : 1;
337 struct
339 unsigned : 1;
340 unsigned : 1;
341 unsigned T0IF : 1;
342 unsigned : 1;
343 unsigned : 1;
344 unsigned T0IE : 1;
345 unsigned : 1;
346 unsigned : 1;
348 } __INTCONbits_t;
350 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
352 #define _RBIF 0x01
353 #define _INTF 0x02
354 #define _TMR0IF 0x04
355 #define _T0IF 0x04
356 #define _RBIE 0x08
357 #define _INTE 0x10
358 #define _TMR0IE 0x20
359 #define _T0IE 0x20
360 #define _PEIE 0x40
361 #define _GIE 0x80
363 //==============================================================================
366 //==============================================================================
367 // PIR1 Bits
369 extern __at(0x000C) __sfr PIR1;
371 typedef struct
373 unsigned TMR1IF : 1;
374 unsigned TMR2IF : 1;
375 unsigned CCP1IF : 1;
376 unsigned SSPIF : 1;
377 unsigned TXIF : 1;
378 unsigned RCIF : 1;
379 unsigned ADIF : 1;
380 unsigned PSPIF : 1;
381 } __PIR1bits_t;
383 extern __at(0x000C) volatile __PIR1bits_t PIR1bits;
385 #define _TMR1IF 0x01
386 #define _TMR2IF 0x02
387 #define _CCP1IF 0x04
388 #define _SSPIF 0x08
389 #define _TXIF 0x10
390 #define _RCIF 0x20
391 #define _ADIF 0x40
392 #define _PSPIF 0x80
394 //==============================================================================
397 //==============================================================================
398 // PIR2 Bits
400 extern __at(0x000D) __sfr PIR2;
402 typedef struct
404 unsigned CCP2IF : 1;
405 unsigned : 1;
406 unsigned : 1;
407 unsigned BCLIF : 1;
408 unsigned EEIF : 1;
409 unsigned : 1;
410 unsigned CMIF : 1;
411 unsigned : 1;
412 } __PIR2bits_t;
414 extern __at(0x000D) volatile __PIR2bits_t PIR2bits;
416 #define _CCP2IF 0x01
417 #define _BCLIF 0x08
418 #define _EEIF 0x10
419 #define _CMIF 0x40
421 //==============================================================================
423 extern __at(0x000E) __sfr TMR1;
424 extern __at(0x000E) __sfr TMR1L;
425 extern __at(0x000F) __sfr TMR1H;
427 //==============================================================================
428 // T1CON Bits
430 extern __at(0x0010) __sfr T1CON;
432 typedef union
434 struct
436 unsigned TMR1ON : 1;
437 unsigned TMR1CS : 1;
438 unsigned NOT_T1SYNC : 1;
439 unsigned T1OSCEN : 1;
440 unsigned T1CKPS0 : 1;
441 unsigned T1CKPS1 : 1;
442 unsigned : 1;
443 unsigned : 1;
446 struct
448 unsigned : 1;
449 unsigned : 1;
450 unsigned T1SYNC : 1;
451 unsigned : 1;
452 unsigned : 1;
453 unsigned : 1;
454 unsigned : 1;
455 unsigned : 1;
458 struct
460 unsigned : 1;
461 unsigned : 1;
462 unsigned T1INSYNC : 1;
463 unsigned : 1;
464 unsigned : 1;
465 unsigned : 1;
466 unsigned : 1;
467 unsigned : 1;
470 struct
472 unsigned : 4;
473 unsigned T1CKPS : 2;
474 unsigned : 2;
476 } __T1CONbits_t;
478 extern __at(0x0010) volatile __T1CONbits_t T1CONbits;
480 #define _TMR1ON 0x01
481 #define _TMR1CS 0x02
482 #define _NOT_T1SYNC 0x04
483 #define _T1SYNC 0x04
484 #define _T1INSYNC 0x04
485 #define _T1OSCEN 0x08
486 #define _T1CKPS0 0x10
487 #define _T1CKPS1 0x20
489 //==============================================================================
491 extern __at(0x0011) __sfr TMR2;
493 //==============================================================================
494 // T2CON Bits
496 extern __at(0x0012) __sfr T2CON;
498 typedef union
500 struct
502 unsigned T2CKPS0 : 1;
503 unsigned T2CKPS1 : 1;
504 unsigned TMR2ON : 1;
505 unsigned TOUTPS0 : 1;
506 unsigned TOUTPS1 : 1;
507 unsigned TOUTPS2 : 1;
508 unsigned TOUTPS3 : 1;
509 unsigned : 1;
512 struct
514 unsigned T2CKPS : 2;
515 unsigned : 6;
518 struct
520 unsigned : 3;
521 unsigned TOUTPS : 4;
522 unsigned : 1;
524 } __T2CONbits_t;
526 extern __at(0x0012) volatile __T2CONbits_t T2CONbits;
528 #define _T2CKPS0 0x01
529 #define _T2CKPS1 0x02
530 #define _TMR2ON 0x04
531 #define _TOUTPS0 0x08
532 #define _TOUTPS1 0x10
533 #define _TOUTPS2 0x20
534 #define _TOUTPS3 0x40
536 //==============================================================================
538 extern __at(0x0013) __sfr SSPBUF;
540 //==============================================================================
541 // SSPCON Bits
543 extern __at(0x0014) __sfr SSPCON;
545 typedef union
547 struct
549 unsigned SSPM0 : 1;
550 unsigned SSPM1 : 1;
551 unsigned SSPM2 : 1;
552 unsigned SSPM3 : 1;
553 unsigned CKP : 1;
554 unsigned SSPEN : 1;
555 unsigned SSPOV : 1;
556 unsigned WCOL : 1;
559 struct
561 unsigned SSPM : 4;
562 unsigned : 4;
564 } __SSPCONbits_t;
566 extern __at(0x0014) volatile __SSPCONbits_t SSPCONbits;
568 #define _SSPM0 0x01
569 #define _SSPM1 0x02
570 #define _SSPM2 0x04
571 #define _SSPM3 0x08
572 #define _CKP 0x10
573 #define _SSPEN 0x20
574 #define _SSPOV 0x40
575 #define _WCOL 0x80
577 //==============================================================================
579 extern __at(0x0015) __sfr CCPR1;
580 extern __at(0x0015) __sfr CCPR1L;
581 extern __at(0x0016) __sfr CCPR1H;
583 //==============================================================================
584 // CCP1CON Bits
586 extern __at(0x0017) __sfr CCP1CON;
588 typedef union
590 struct
592 unsigned CCP1M0 : 1;
593 unsigned CCP1M1 : 1;
594 unsigned CCP1M2 : 1;
595 unsigned CCP1M3 : 1;
596 unsigned CCP1Y : 1;
597 unsigned CCP1X : 1;
598 unsigned : 1;
599 unsigned : 1;
602 struct
604 unsigned CCP1M : 4;
605 unsigned : 4;
607 } __CCP1CONbits_t;
609 extern __at(0x0017) volatile __CCP1CONbits_t CCP1CONbits;
611 #define _CCP1M0 0x01
612 #define _CCP1M1 0x02
613 #define _CCP1M2 0x04
614 #define _CCP1M3 0x08
615 #define _CCP1Y 0x10
616 #define _CCP1X 0x20
618 //==============================================================================
621 //==============================================================================
622 // RCSTA Bits
624 extern __at(0x0018) __sfr RCSTA;
626 typedef union
628 struct
630 unsigned RX9D : 1;
631 unsigned OERR : 1;
632 unsigned FERR : 1;
633 unsigned ADDEN : 1;
634 unsigned CREN : 1;
635 unsigned SREN : 1;
636 unsigned RX9 : 1;
637 unsigned SPEN : 1;
640 struct
642 unsigned RCD8 : 1;
643 unsigned : 1;
644 unsigned : 1;
645 unsigned : 1;
646 unsigned : 1;
647 unsigned : 1;
648 unsigned RC9 : 1;
649 unsigned : 1;
652 struct
654 unsigned : 1;
655 unsigned : 1;
656 unsigned : 1;
657 unsigned : 1;
658 unsigned : 1;
659 unsigned : 1;
660 unsigned NOT_RC8 : 1;
661 unsigned : 1;
664 struct
666 unsigned : 1;
667 unsigned : 1;
668 unsigned : 1;
669 unsigned : 1;
670 unsigned : 1;
671 unsigned : 1;
672 unsigned RC8_9 : 1;
673 unsigned : 1;
675 } __RCSTAbits_t;
677 extern __at(0x0018) volatile __RCSTAbits_t RCSTAbits;
679 #define _RX9D 0x01
680 #define _RCD8 0x01
681 #define _OERR 0x02
682 #define _FERR 0x04
683 #define _ADDEN 0x08
684 #define _CREN 0x10
685 #define _SREN 0x20
686 #define _RX9 0x40
687 #define _RC9 0x40
688 #define _NOT_RC8 0x40
689 #define _RC8_9 0x40
690 #define _SPEN 0x80
692 //==============================================================================
694 extern __at(0x0019) __sfr TXREG;
695 extern __at(0x001A) __sfr RCREG;
696 extern __at(0x001B) __sfr CCPR2;
697 extern __at(0x001B) __sfr CCPR2L;
698 extern __at(0x001C) __sfr CCPR2H;
700 //==============================================================================
701 // CCP2CON Bits
703 extern __at(0x001D) __sfr CCP2CON;
705 typedef union
707 struct
709 unsigned CCP2M0 : 1;
710 unsigned CCP2M1 : 1;
711 unsigned CCP2M2 : 1;
712 unsigned CCP2M3 : 1;
713 unsigned CCP2Y : 1;
714 unsigned CCP2X : 1;
715 unsigned : 1;
716 unsigned : 1;
719 struct
721 unsigned CCP2M : 4;
722 unsigned : 4;
724 } __CCP2CONbits_t;
726 extern __at(0x001D) volatile __CCP2CONbits_t CCP2CONbits;
728 #define _CCP2M0 0x01
729 #define _CCP2M1 0x02
730 #define _CCP2M2 0x04
731 #define _CCP2M3 0x08
732 #define _CCP2Y 0x10
733 #define _CCP2X 0x20
735 //==============================================================================
737 extern __at(0x001E) __sfr ADRESH;
739 //==============================================================================
740 // ADCON0 Bits
742 extern __at(0x001F) __sfr ADCON0;
744 typedef union
746 struct
748 unsigned ADON : 1;
749 unsigned : 1;
750 unsigned GO_NOT_DONE : 1;
751 unsigned CHS0 : 1;
752 unsigned CHS1 : 1;
753 unsigned CHS2 : 1;
754 unsigned ADCS0 : 1;
755 unsigned ADCS1 : 1;
758 struct
760 unsigned : 1;
761 unsigned : 1;
762 unsigned GO : 1;
763 unsigned : 1;
764 unsigned : 1;
765 unsigned : 1;
766 unsigned : 1;
767 unsigned : 1;
770 struct
772 unsigned : 1;
773 unsigned : 1;
774 unsigned NOT_DONE : 1;
775 unsigned : 1;
776 unsigned : 1;
777 unsigned : 1;
778 unsigned : 1;
779 unsigned : 1;
782 struct
784 unsigned : 1;
785 unsigned : 1;
786 unsigned GO_DONE : 1;
787 unsigned : 1;
788 unsigned : 1;
789 unsigned : 1;
790 unsigned : 1;
791 unsigned : 1;
794 struct
796 unsigned : 3;
797 unsigned CHS : 3;
798 unsigned : 2;
801 struct
803 unsigned : 6;
804 unsigned ADCS : 2;
806 } __ADCON0bits_t;
808 extern __at(0x001F) volatile __ADCON0bits_t ADCON0bits;
810 #define _ADON 0x01
811 #define _GO_NOT_DONE 0x04
812 #define _GO 0x04
813 #define _NOT_DONE 0x04
814 #define _GO_DONE 0x04
815 #define _CHS0 0x08
816 #define _CHS1 0x10
817 #define _CHS2 0x20
818 #define _ADCS0 0x40
819 #define _ADCS1 0x80
821 //==============================================================================
824 //==============================================================================
825 // OPTION_REG Bits
827 extern __at(0x0081) __sfr OPTION_REG;
829 typedef union
831 struct
833 unsigned PS0 : 1;
834 unsigned PS1 : 1;
835 unsigned PS2 : 1;
836 unsigned PSA : 1;
837 unsigned T0SE : 1;
838 unsigned T0CS : 1;
839 unsigned INTEDG : 1;
840 unsigned NOT_RBPU : 1;
843 struct
845 unsigned PS : 3;
846 unsigned : 5;
848 } __OPTION_REGbits_t;
850 extern __at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits;
852 #define _PS0 0x01
853 #define _PS1 0x02
854 #define _PS2 0x04
855 #define _PSA 0x08
856 #define _T0SE 0x10
857 #define _T0CS 0x20
858 #define _INTEDG 0x40
859 #define _NOT_RBPU 0x80
861 //==============================================================================
864 //==============================================================================
865 // TRISA Bits
867 extern __at(0x0085) __sfr TRISA;
869 typedef union
871 struct
873 unsigned TRISA0 : 1;
874 unsigned TRISA1 : 1;
875 unsigned TRISA2 : 1;
876 unsigned TRISA3 : 1;
877 unsigned TRISA4 : 1;
878 unsigned TRISA5 : 1;
879 unsigned : 1;
880 unsigned : 1;
883 struct
885 unsigned TRISA : 6;
886 unsigned : 2;
888 } __TRISAbits_t;
890 extern __at(0x0085) volatile __TRISAbits_t TRISAbits;
892 #define _TRISA0 0x01
893 #define _TRISA1 0x02
894 #define _TRISA2 0x04
895 #define _TRISA3 0x08
896 #define _TRISA4 0x10
897 #define _TRISA5 0x20
899 //==============================================================================
902 //==============================================================================
903 // TRISB Bits
905 extern __at(0x0086) __sfr TRISB;
907 typedef struct
909 unsigned TRISB0 : 1;
910 unsigned TRISB1 : 1;
911 unsigned TRISB2 : 1;
912 unsigned TRISB3 : 1;
913 unsigned TRISB4 : 1;
914 unsigned TRISB5 : 1;
915 unsigned TRISB6 : 1;
916 unsigned TRISB7 : 1;
917 } __TRISBbits_t;
919 extern __at(0x0086) volatile __TRISBbits_t TRISBbits;
921 #define _TRISB0 0x01
922 #define _TRISB1 0x02
923 #define _TRISB2 0x04
924 #define _TRISB3 0x08
925 #define _TRISB4 0x10
926 #define _TRISB5 0x20
927 #define _TRISB6 0x40
928 #define _TRISB7 0x80
930 //==============================================================================
933 //==============================================================================
934 // TRISC Bits
936 extern __at(0x0087) __sfr TRISC;
938 typedef struct
940 unsigned TRISC0 : 1;
941 unsigned TRISC1 : 1;
942 unsigned TRISC2 : 1;
943 unsigned TRISC3 : 1;
944 unsigned TRISC4 : 1;
945 unsigned TRISC5 : 1;
946 unsigned TRISC6 : 1;
947 unsigned TRISC7 : 1;
948 } __TRISCbits_t;
950 extern __at(0x0087) volatile __TRISCbits_t TRISCbits;
952 #define _TRISC0 0x01
953 #define _TRISC1 0x02
954 #define _TRISC2 0x04
955 #define _TRISC3 0x08
956 #define _TRISC4 0x10
957 #define _TRISC5 0x20
958 #define _TRISC6 0x40
959 #define _TRISC7 0x80
961 //==============================================================================
964 //==============================================================================
965 // TRISD Bits
967 extern __at(0x0088) __sfr TRISD;
969 typedef struct
971 unsigned TRISD0 : 1;
972 unsigned TRISD1 : 1;
973 unsigned TRISD2 : 1;
974 unsigned TRISD3 : 1;
975 unsigned TRISD4 : 1;
976 unsigned TRISD5 : 1;
977 unsigned TRISD6 : 1;
978 unsigned TRISD7 : 1;
979 } __TRISDbits_t;
981 extern __at(0x0088) volatile __TRISDbits_t TRISDbits;
983 #define _TRISD0 0x01
984 #define _TRISD1 0x02
985 #define _TRISD2 0x04
986 #define _TRISD3 0x08
987 #define _TRISD4 0x10
988 #define _TRISD5 0x20
989 #define _TRISD6 0x40
990 #define _TRISD7 0x80
992 //==============================================================================
995 //==============================================================================
996 // TRISE Bits
998 extern __at(0x0089) __sfr TRISE;
1000 typedef union
1002 struct
1004 unsigned TRISE0 : 1;
1005 unsigned TRISE1 : 1;
1006 unsigned TRISE2 : 1;
1007 unsigned : 1;
1008 unsigned PSPMODE : 1;
1009 unsigned IBOV : 1;
1010 unsigned OBF : 1;
1011 unsigned IBF : 1;
1014 struct
1016 unsigned TRISE : 3;
1017 unsigned : 5;
1019 } __TRISEbits_t;
1021 extern __at(0x0089) volatile __TRISEbits_t TRISEbits;
1023 #define _TRISE0 0x01
1024 #define _TRISE1 0x02
1025 #define _TRISE2 0x04
1026 #define _PSPMODE 0x10
1027 #define _IBOV 0x20
1028 #define _OBF 0x40
1029 #define _IBF 0x80
1031 //==============================================================================
1034 //==============================================================================
1035 // PIE1 Bits
1037 extern __at(0x008C) __sfr PIE1;
1039 typedef struct
1041 unsigned TMR1IE : 1;
1042 unsigned TMR2IE : 1;
1043 unsigned CCP1IE : 1;
1044 unsigned SSPIE : 1;
1045 unsigned TXIE : 1;
1046 unsigned RCIE : 1;
1047 unsigned ADIE : 1;
1048 unsigned PSPIE : 1;
1049 } __PIE1bits_t;
1051 extern __at(0x008C) volatile __PIE1bits_t PIE1bits;
1053 #define _TMR1IE 0x01
1054 #define _TMR2IE 0x02
1055 #define _CCP1IE 0x04
1056 #define _SSPIE 0x08
1057 #define _TXIE 0x10
1058 #define _RCIE 0x20
1059 #define _ADIE 0x40
1060 #define _PSPIE 0x80
1062 //==============================================================================
1065 //==============================================================================
1066 // PIE2 Bits
1068 extern __at(0x008D) __sfr PIE2;
1070 typedef struct
1072 unsigned CCP2IE : 1;
1073 unsigned : 1;
1074 unsigned : 1;
1075 unsigned BCLIE : 1;
1076 unsigned EEIE : 1;
1077 unsigned : 1;
1078 unsigned CMIE : 1;
1079 unsigned : 1;
1080 } __PIE2bits_t;
1082 extern __at(0x008D) volatile __PIE2bits_t PIE2bits;
1084 #define _CCP2IE 0x01
1085 #define _BCLIE 0x08
1086 #define _EEIE 0x10
1087 #define _CMIE 0x40
1089 //==============================================================================
1092 //==============================================================================
1093 // PCON Bits
1095 extern __at(0x008E) __sfr PCON;
1097 typedef union
1099 struct
1101 unsigned NOT_BOR : 1;
1102 unsigned NOT_POR : 1;
1103 unsigned : 1;
1104 unsigned : 1;
1105 unsigned : 1;
1106 unsigned : 1;
1107 unsigned : 1;
1108 unsigned : 1;
1111 struct
1113 unsigned NOT_BO : 1;
1114 unsigned : 1;
1115 unsigned : 1;
1116 unsigned : 1;
1117 unsigned : 1;
1118 unsigned : 1;
1119 unsigned : 1;
1120 unsigned : 1;
1122 } __PCONbits_t;
1124 extern __at(0x008E) volatile __PCONbits_t PCONbits;
1126 #define _NOT_BOR 0x01
1127 #define _NOT_BO 0x01
1128 #define _NOT_POR 0x02
1130 //==============================================================================
1133 //==============================================================================
1134 // SSPCON2 Bits
1136 extern __at(0x0091) __sfr SSPCON2;
1138 typedef struct
1140 unsigned SEN : 1;
1141 unsigned RSEN : 1;
1142 unsigned PEN : 1;
1143 unsigned RCEN : 1;
1144 unsigned ACKEN : 1;
1145 unsigned ACKDT : 1;
1146 unsigned ACKSTAT : 1;
1147 unsigned GCEN : 1;
1148 } __SSPCON2bits_t;
1150 extern __at(0x0091) volatile __SSPCON2bits_t SSPCON2bits;
1152 #define _SEN 0x01
1153 #define _RSEN 0x02
1154 #define _PEN 0x04
1155 #define _RCEN 0x08
1156 #define _ACKEN 0x10
1157 #define _ACKDT 0x20
1158 #define _ACKSTAT 0x40
1159 #define _GCEN 0x80
1161 //==============================================================================
1163 extern __at(0x0092) __sfr PR2;
1164 extern __at(0x0093) __sfr SSPADD;
1166 //==============================================================================
1167 // SSPSTAT Bits
1169 extern __at(0x0094) __sfr SSPSTAT;
1171 typedef union
1173 struct
1175 unsigned BF : 1;
1176 unsigned UA : 1;
1177 unsigned R_NOT_W : 1;
1178 unsigned S : 1;
1179 unsigned P : 1;
1180 unsigned D_NOT_A : 1;
1181 unsigned CKE : 1;
1182 unsigned SMP : 1;
1185 struct
1187 unsigned : 1;
1188 unsigned : 1;
1189 unsigned R : 1;
1190 unsigned I2C_START : 1;
1191 unsigned I2C_STOP : 1;
1192 unsigned D : 1;
1193 unsigned : 1;
1194 unsigned : 1;
1197 struct
1199 unsigned : 1;
1200 unsigned : 1;
1201 unsigned I2C_READ : 1;
1202 unsigned : 1;
1203 unsigned : 1;
1204 unsigned I2C_DATA : 1;
1205 unsigned : 1;
1206 unsigned : 1;
1209 struct
1211 unsigned : 1;
1212 unsigned : 1;
1213 unsigned NOT_W : 1;
1214 unsigned : 1;
1215 unsigned : 1;
1216 unsigned NOT_A : 1;
1217 unsigned : 1;
1218 unsigned : 1;
1221 struct
1223 unsigned : 1;
1224 unsigned : 1;
1225 unsigned NOT_WRITE : 1;
1226 unsigned : 1;
1227 unsigned : 1;
1228 unsigned NOT_ADDRESS : 1;
1229 unsigned : 1;
1230 unsigned : 1;
1233 struct
1235 unsigned : 1;
1236 unsigned : 1;
1237 unsigned R_W : 1;
1238 unsigned : 1;
1239 unsigned : 1;
1240 unsigned D_A : 1;
1241 unsigned : 1;
1242 unsigned : 1;
1245 struct
1247 unsigned : 1;
1248 unsigned : 1;
1249 unsigned READ_WRITE : 1;
1250 unsigned : 1;
1251 unsigned : 1;
1252 unsigned DATA_ADDRESS : 1;
1253 unsigned : 1;
1254 unsigned : 1;
1256 } __SSPSTATbits_t;
1258 extern __at(0x0094) volatile __SSPSTATbits_t SSPSTATbits;
1260 #define _BF 0x01
1261 #define _UA 0x02
1262 #define _R_NOT_W 0x04
1263 #define _R 0x04
1264 #define _I2C_READ 0x04
1265 #define _NOT_W 0x04
1266 #define _NOT_WRITE 0x04
1267 #define _R_W 0x04
1268 #define _READ_WRITE 0x04
1269 #define _S 0x08
1270 #define _I2C_START 0x08
1271 #define _P 0x10
1272 #define _I2C_STOP 0x10
1273 #define _D_NOT_A 0x20
1274 #define _D 0x20
1275 #define _I2C_DATA 0x20
1276 #define _NOT_A 0x20
1277 #define _NOT_ADDRESS 0x20
1278 #define _D_A 0x20
1279 #define _DATA_ADDRESS 0x20
1280 #define _CKE 0x40
1281 #define _SMP 0x80
1283 //==============================================================================
1286 //==============================================================================
1287 // TXSTA Bits
1289 extern __at(0x0098) __sfr TXSTA;
1291 typedef union
1293 struct
1295 unsigned TX9D : 1;
1296 unsigned TRMT : 1;
1297 unsigned BRGH : 1;
1298 unsigned : 1;
1299 unsigned SYNC : 1;
1300 unsigned TXEN : 1;
1301 unsigned TX9 : 1;
1302 unsigned CSRC : 1;
1305 struct
1307 unsigned TXD8 : 1;
1308 unsigned : 1;
1309 unsigned : 1;
1310 unsigned : 1;
1311 unsigned : 1;
1312 unsigned : 1;
1313 unsigned NOT_TX8 : 1;
1314 unsigned : 1;
1317 struct
1319 unsigned : 1;
1320 unsigned : 1;
1321 unsigned : 1;
1322 unsigned : 1;
1323 unsigned : 1;
1324 unsigned : 1;
1325 unsigned TX8_9 : 1;
1326 unsigned : 1;
1328 } __TXSTAbits_t;
1330 extern __at(0x0098) volatile __TXSTAbits_t TXSTAbits;
1332 #define _TX9D 0x01
1333 #define _TXD8 0x01
1334 #define _TRMT 0x02
1335 #define _BRGH 0x04
1336 #define _SYNC 0x10
1337 #define _TXEN 0x20
1338 #define _TX9 0x40
1339 #define _NOT_TX8 0x40
1340 #define _TX8_9 0x40
1341 #define _CSRC 0x80
1343 //==============================================================================
1345 extern __at(0x0099) __sfr SPBRG;
1347 //==============================================================================
1348 // CMCON Bits
1350 extern __at(0x009C) __sfr CMCON;
1352 typedef union
1354 struct
1356 unsigned CM0 : 1;
1357 unsigned CM1 : 1;
1358 unsigned CM2 : 1;
1359 unsigned CIS : 1;
1360 unsigned C1INV : 1;
1361 unsigned C2INV : 1;
1362 unsigned C1OUT : 1;
1363 unsigned C2OUT : 1;
1366 struct
1368 unsigned CM : 3;
1369 unsigned : 5;
1371 } __CMCONbits_t;
1373 extern __at(0x009C) volatile __CMCONbits_t CMCONbits;
1375 #define _CM0 0x01
1376 #define _CM1 0x02
1377 #define _CM2 0x04
1378 #define _CIS 0x08
1379 #define _C1INV 0x10
1380 #define _C2INV 0x20
1381 #define _C1OUT 0x40
1382 #define _C2OUT 0x80
1384 //==============================================================================
1387 //==============================================================================
1388 // CVRCON Bits
1390 extern __at(0x009D) __sfr CVRCON;
1392 typedef union
1394 struct
1396 unsigned CVR0 : 1;
1397 unsigned CVR1 : 1;
1398 unsigned CVR2 : 1;
1399 unsigned CVR3 : 1;
1400 unsigned : 1;
1401 unsigned CVRR : 1;
1402 unsigned CVROE : 1;
1403 unsigned CVREN : 1;
1406 struct
1408 unsigned CVR : 4;
1409 unsigned : 4;
1411 } __CVRCONbits_t;
1413 extern __at(0x009D) volatile __CVRCONbits_t CVRCONbits;
1415 #define _CVR0 0x01
1416 #define _CVR1 0x02
1417 #define _CVR2 0x04
1418 #define _CVR3 0x08
1419 #define _CVRR 0x20
1420 #define _CVROE 0x40
1421 #define _CVREN 0x80
1423 //==============================================================================
1425 extern __at(0x009E) __sfr ADRESL;
1427 //==============================================================================
1428 // ADCON1 Bits
1430 extern __at(0x009F) __sfr ADCON1;
1432 typedef union
1434 struct
1436 unsigned PCFG0 : 1;
1437 unsigned PCFG1 : 1;
1438 unsigned PCFG2 : 1;
1439 unsigned PCFG3 : 1;
1440 unsigned : 1;
1441 unsigned : 1;
1442 unsigned ADCS2 : 1;
1443 unsigned ADFM : 1;
1446 struct
1448 unsigned PCFG : 4;
1449 unsigned : 4;
1451 } __ADCON1bits_t;
1453 extern __at(0x009F) volatile __ADCON1bits_t ADCON1bits;
1455 #define _PCFG0 0x01
1456 #define _PCFG1 0x02
1457 #define _PCFG2 0x04
1458 #define _PCFG3 0x08
1459 #define _ADCS2 0x40
1460 #define _ADFM 0x80
1462 //==============================================================================
1464 extern __at(0x010C) __sfr EEDATA;
1465 extern __at(0x010D) __sfr EEADR;
1466 extern __at(0x010E) __sfr EEDATH;
1467 extern __at(0x010F) __sfr EEADRH;
1469 //==============================================================================
1470 // EECON1 Bits
1472 extern __at(0x018C) __sfr EECON1;
1474 typedef struct
1476 unsigned RD : 1;
1477 unsigned WR : 1;
1478 unsigned WREN : 1;
1479 unsigned WRERR : 1;
1480 unsigned : 1;
1481 unsigned : 1;
1482 unsigned : 1;
1483 unsigned EEPGD : 1;
1484 } __EECON1bits_t;
1486 extern __at(0x018C) volatile __EECON1bits_t EECON1bits;
1488 #define _RD 0x01
1489 #define _WR 0x02
1490 #define _WREN 0x04
1491 #define _WRERR 0x08
1492 #define _EEPGD 0x80
1494 //==============================================================================
1496 extern __at(0x018D) __sfr EECON2;
1498 //==============================================================================
1500 // Configuration Bits
1502 //==============================================================================
1504 #define _CONFIG 0x2007
1506 //----------------------------- CONFIG Options -------------------------------
1508 #define _FOSC_LP 0x3FFC // LP oscillator.
1509 #define _LP_OSC 0x3FFC // LP oscillator.
1510 #define _FOSC_XT 0x3FFD // XT oscillator.
1511 #define _XT_OSC 0x3FFD // XT oscillator.
1512 #define _FOSC_HS 0x3FFE // HS oscillator.
1513 #define _HS_OSC 0x3FFE // HS oscillator.
1514 #define _FOSC_EXTRC 0x3FFF // RC oscillator.
1515 #define _RC_OSC 0x3FFF // RC oscillator.
1516 #define _WDTE_OFF 0x3FFB // WDT disabled.
1517 #define _WDT_OFF 0x3FFB // WDT disabled.
1518 #define _WDTE_ON 0x3FFF // WDT enabled.
1519 #define _WDT_ON 0x3FFF // WDT enabled.
1520 #define _PWRTE_ON 0x3FF7 // PWRT enabled.
1521 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
1522 #define _BOREN_OFF 0x3FBF // BOR disabled.
1523 #define _BODEN_OFF 0x3FBF // BOR disabled.
1524 #define _BOREN_ON 0x3FFF // BOR enabled.
1525 #define _BODEN_ON 0x3FFF // BOR enabled.
1526 #define _LVP_OFF 0x3F7F // RB3 is digital I/O, HV on MCLR must be used for programming.
1527 #define _LVP_ON 0x3FFF // RB3/PGM pin has PGM function; low-voltage programming enabled.
1528 #define _CPD_ON 0x3EFF // Data EEPROM code-protected.
1529 #define _CPD_OFF 0x3FFF // Data EEPROM code protection off.
1530 #define _WRT_HALF 0x39FF // 0000h to 0FFFh write-protected; 1000h to 1FFFh may be written to by EECON control.
1531 #define _WRT_1FOURTH 0x3BFF // 0000h to 07FFh write-protected; 0800h to 1FFFh may be written to by EECON control.
1532 #define _WRT_256 0x3DFF // 0000h to 00FFh write-protected; 0100h to 1FFFh may be written to by EECON control.
1533 #define _WRT_OFF 0x3FFF // Write protection off; all program memory may be written to by EECON control.
1534 #define _DEBUG_ON 0x37FF // In-Circuit Debugger enabled, RB6 and RB7 are dedicated to the debugger.
1535 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins.
1536 #define _CP_ON 0x1FFF // All program memory code-protected.
1537 #define _CP_ALL 0x1FFF // All program memory code-protected.
1538 #define _CP_OFF 0x3FFF // Code protection off.
1540 //==============================================================================
1542 #define _DEVID1 0x2006
1544 #define _IDLOC0 0x2000
1545 #define _IDLOC1 0x2001
1546 #define _IDLOC2 0x2002
1547 #define _IDLOC3 0x2003
1549 //==============================================================================
1551 #ifndef NO_BIT_DEFINES
1553 #define ADON ADCON0bits.ADON // bit 0
1554 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 2, shadows bit in ADCON0bits
1555 #define GO ADCON0bits.GO // bit 2, shadows bit in ADCON0bits
1556 #define NOT_DONE ADCON0bits.NOT_DONE // bit 2, shadows bit in ADCON0bits
1557 #define GO_DONE ADCON0bits.GO_DONE // bit 2, shadows bit in ADCON0bits
1558 #define CHS0 ADCON0bits.CHS0 // bit 3
1559 #define CHS1 ADCON0bits.CHS1 // bit 4
1560 #define CHS2 ADCON0bits.CHS2 // bit 5
1561 #define ADCS0 ADCON0bits.ADCS0 // bit 6
1562 #define ADCS1 ADCON0bits.ADCS1 // bit 7
1564 #define PCFG0 ADCON1bits.PCFG0 // bit 0
1565 #define PCFG1 ADCON1bits.PCFG1 // bit 1
1566 #define PCFG2 ADCON1bits.PCFG2 // bit 2
1567 #define PCFG3 ADCON1bits.PCFG3 // bit 3
1568 #define ADCS2 ADCON1bits.ADCS2 // bit 6
1569 #define ADFM ADCON1bits.ADFM // bit 7
1571 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
1572 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
1573 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
1574 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
1575 #define CCP1Y CCP1CONbits.CCP1Y // bit 4
1576 #define CCP1X CCP1CONbits.CCP1X // bit 5
1578 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
1579 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
1580 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
1581 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
1582 #define CCP2Y CCP2CONbits.CCP2Y // bit 4
1583 #define CCP2X CCP2CONbits.CCP2X // bit 5
1585 #define CM0 CMCONbits.CM0 // bit 0
1586 #define CM1 CMCONbits.CM1 // bit 1
1587 #define CM2 CMCONbits.CM2 // bit 2
1588 #define CIS CMCONbits.CIS // bit 3
1589 #define C1INV CMCONbits.C1INV // bit 4
1590 #define C2INV CMCONbits.C2INV // bit 5
1591 #define C1OUT CMCONbits.C1OUT // bit 6
1592 #define C2OUT CMCONbits.C2OUT // bit 7
1594 #define CVR0 CVRCONbits.CVR0 // bit 0
1595 #define CVR1 CVRCONbits.CVR1 // bit 1
1596 #define CVR2 CVRCONbits.CVR2 // bit 2
1597 #define CVR3 CVRCONbits.CVR3 // bit 3
1598 #define CVRR CVRCONbits.CVRR // bit 5
1599 #define CVROE CVRCONbits.CVROE // bit 6
1600 #define CVREN CVRCONbits.CVREN // bit 7
1602 #define RD EECON1bits.RD // bit 0
1603 #define WR EECON1bits.WR // bit 1
1604 #define WREN EECON1bits.WREN // bit 2
1605 #define WRERR EECON1bits.WRERR // bit 3
1606 #define EEPGD EECON1bits.EEPGD // bit 7
1608 #define RBIF INTCONbits.RBIF // bit 0
1609 #define INTF INTCONbits.INTF // bit 1
1610 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
1611 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
1612 #define RBIE INTCONbits.RBIE // bit 3
1613 #define INTE INTCONbits.INTE // bit 4
1614 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
1615 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
1616 #define PEIE INTCONbits.PEIE // bit 6
1617 #define GIE INTCONbits.GIE // bit 7
1619 #define PS0 OPTION_REGbits.PS0 // bit 0
1620 #define PS1 OPTION_REGbits.PS1 // bit 1
1621 #define PS2 OPTION_REGbits.PS2 // bit 2
1622 #define PSA OPTION_REGbits.PSA // bit 3
1623 #define T0SE OPTION_REGbits.T0SE // bit 4
1624 #define T0CS OPTION_REGbits.T0CS // bit 5
1625 #define INTEDG OPTION_REGbits.INTEDG // bit 6
1626 #define NOT_RBPU OPTION_REGbits.NOT_RBPU // bit 7
1628 #define NOT_BOR PCONbits.NOT_BOR // bit 0, shadows bit in PCONbits
1629 #define NOT_BO PCONbits.NOT_BO // bit 0, shadows bit in PCONbits
1630 #define NOT_POR PCONbits.NOT_POR // bit 1
1632 #define TMR1IE PIE1bits.TMR1IE // bit 0
1633 #define TMR2IE PIE1bits.TMR2IE // bit 1
1634 #define CCP1IE PIE1bits.CCP1IE // bit 2
1635 #define SSPIE PIE1bits.SSPIE // bit 3
1636 #define TXIE PIE1bits.TXIE // bit 4
1637 #define RCIE PIE1bits.RCIE // bit 5
1638 #define ADIE PIE1bits.ADIE // bit 6
1639 #define PSPIE PIE1bits.PSPIE // bit 7
1641 #define CCP2IE PIE2bits.CCP2IE // bit 0
1642 #define BCLIE PIE2bits.BCLIE // bit 3
1643 #define EEIE PIE2bits.EEIE // bit 4
1644 #define CMIE PIE2bits.CMIE // bit 6
1646 #define TMR1IF PIR1bits.TMR1IF // bit 0
1647 #define TMR2IF PIR1bits.TMR2IF // bit 1
1648 #define CCP1IF PIR1bits.CCP1IF // bit 2
1649 #define SSPIF PIR1bits.SSPIF // bit 3
1650 #define TXIF PIR1bits.TXIF // bit 4
1651 #define RCIF PIR1bits.RCIF // bit 5
1652 #define ADIF PIR1bits.ADIF // bit 6
1653 #define PSPIF PIR1bits.PSPIF // bit 7
1655 #define CCP2IF PIR2bits.CCP2IF // bit 0
1656 #define BCLIF PIR2bits.BCLIF // bit 3
1657 #define EEIF PIR2bits.EEIF // bit 4
1658 #define CMIF PIR2bits.CMIF // bit 6
1660 #define RA0 PORTAbits.RA0 // bit 0
1661 #define RA1 PORTAbits.RA1 // bit 1
1662 #define RA2 PORTAbits.RA2 // bit 2
1663 #define RA3 PORTAbits.RA3 // bit 3
1664 #define RA4 PORTAbits.RA4 // bit 4
1665 #define RA5 PORTAbits.RA5 // bit 5
1667 #define RB0 PORTBbits.RB0 // bit 0
1668 #define RB1 PORTBbits.RB1 // bit 1
1669 #define RB2 PORTBbits.RB2 // bit 2
1670 #define RB3 PORTBbits.RB3 // bit 3
1671 #define RB4 PORTBbits.RB4 // bit 4
1672 #define RB5 PORTBbits.RB5 // bit 5
1673 #define RB6 PORTBbits.RB6 // bit 6
1674 #define RB7 PORTBbits.RB7 // bit 7
1676 #define RC0 PORTCbits.RC0 // bit 0
1677 #define RC1 PORTCbits.RC1 // bit 1
1678 #define RC2 PORTCbits.RC2 // bit 2
1679 #define RC3 PORTCbits.RC3 // bit 3
1680 #define RC4 PORTCbits.RC4 // bit 4
1681 #define RC5 PORTCbits.RC5 // bit 5
1682 #define RC6 PORTCbits.RC6 // bit 6
1683 #define RC7 PORTCbits.RC7 // bit 7
1685 #define RD0 PORTDbits.RD0 // bit 0
1686 #define RD1 PORTDbits.RD1 // bit 1
1687 #define RD2 PORTDbits.RD2 // bit 2
1688 #define RD3 PORTDbits.RD3 // bit 3
1689 #define RD4 PORTDbits.RD4 // bit 4
1690 #define RD5 PORTDbits.RD5 // bit 5
1691 #define RD6 PORTDbits.RD6 // bit 6
1692 #define RD7 PORTDbits.RD7 // bit 7
1694 #define RE0 PORTEbits.RE0 // bit 0
1695 #define RE1 PORTEbits.RE1 // bit 1
1696 #define RE2 PORTEbits.RE2 // bit 2
1698 #define RX9D RCSTAbits.RX9D // bit 0, shadows bit in RCSTAbits
1699 #define RCD8 RCSTAbits.RCD8 // bit 0, shadows bit in RCSTAbits
1700 #define OERR RCSTAbits.OERR // bit 1
1701 #define FERR RCSTAbits.FERR // bit 2
1702 #define ADDEN RCSTAbits.ADDEN // bit 3
1703 #define CREN RCSTAbits.CREN // bit 4
1704 #define SREN RCSTAbits.SREN // bit 5
1705 #define RX9 RCSTAbits.RX9 // bit 6, shadows bit in RCSTAbits
1706 #define RC9 RCSTAbits.RC9 // bit 6, shadows bit in RCSTAbits
1707 #define NOT_RC8 RCSTAbits.NOT_RC8 // bit 6, shadows bit in RCSTAbits
1708 #define RC8_9 RCSTAbits.RC8_9 // bit 6, shadows bit in RCSTAbits
1709 #define SPEN RCSTAbits.SPEN // bit 7
1711 #define SSPM0 SSPCONbits.SSPM0 // bit 0
1712 #define SSPM1 SSPCONbits.SSPM1 // bit 1
1713 #define SSPM2 SSPCONbits.SSPM2 // bit 2
1714 #define SSPM3 SSPCONbits.SSPM3 // bit 3
1715 #define CKP SSPCONbits.CKP // bit 4
1716 #define SSPEN SSPCONbits.SSPEN // bit 5
1717 #define SSPOV SSPCONbits.SSPOV // bit 6
1718 #define WCOL SSPCONbits.WCOL // bit 7
1720 #define SEN SSPCON2bits.SEN // bit 0
1721 #define RSEN SSPCON2bits.RSEN // bit 1
1722 #define PEN SSPCON2bits.PEN // bit 2
1723 #define RCEN SSPCON2bits.RCEN // bit 3
1724 #define ACKEN SSPCON2bits.ACKEN // bit 4
1725 #define ACKDT SSPCON2bits.ACKDT // bit 5
1726 #define ACKSTAT SSPCON2bits.ACKSTAT // bit 6
1727 #define GCEN SSPCON2bits.GCEN // bit 7
1729 #define BF SSPSTATbits.BF // bit 0
1730 #define UA SSPSTATbits.UA // bit 1
1731 #define R_NOT_W SSPSTATbits.R_NOT_W // bit 2, shadows bit in SSPSTATbits
1732 #define R SSPSTATbits.R // bit 2, shadows bit in SSPSTATbits
1733 #define I2C_READ SSPSTATbits.I2C_READ // bit 2, shadows bit in SSPSTATbits
1734 #define NOT_W SSPSTATbits.NOT_W // bit 2, shadows bit in SSPSTATbits
1735 #define NOT_WRITE SSPSTATbits.NOT_WRITE // bit 2, shadows bit in SSPSTATbits
1736 #define R_W SSPSTATbits.R_W // bit 2, shadows bit in SSPSTATbits
1737 #define READ_WRITE SSPSTATbits.READ_WRITE // bit 2, shadows bit in SSPSTATbits
1738 #define S SSPSTATbits.S // bit 3, shadows bit in SSPSTATbits
1739 #define I2C_START SSPSTATbits.I2C_START // bit 3, shadows bit in SSPSTATbits
1740 #define P SSPSTATbits.P // bit 4, shadows bit in SSPSTATbits
1741 #define I2C_STOP SSPSTATbits.I2C_STOP // bit 4, shadows bit in SSPSTATbits
1742 #define D_NOT_A SSPSTATbits.D_NOT_A // bit 5, shadows bit in SSPSTATbits
1743 #define D SSPSTATbits.D // bit 5, shadows bit in SSPSTATbits
1744 #define I2C_DATA SSPSTATbits.I2C_DATA // bit 5, shadows bit in SSPSTATbits
1745 #define NOT_A SSPSTATbits.NOT_A // bit 5, shadows bit in SSPSTATbits
1746 #define NOT_ADDRESS SSPSTATbits.NOT_ADDRESS // bit 5, shadows bit in SSPSTATbits
1747 #define D_A SSPSTATbits.D_A // bit 5, shadows bit in SSPSTATbits
1748 #define DATA_ADDRESS SSPSTATbits.DATA_ADDRESS // bit 5, shadows bit in SSPSTATbits
1749 #define CKE SSPSTATbits.CKE // bit 6
1750 #define SMP SSPSTATbits.SMP // bit 7
1752 #define C STATUSbits.C // bit 0
1753 #define DC STATUSbits.DC // bit 1
1754 #define Z STATUSbits.Z // bit 2
1755 #define NOT_PD STATUSbits.NOT_PD // bit 3
1756 #define NOT_TO STATUSbits.NOT_TO // bit 4
1757 #define RP0 STATUSbits.RP0 // bit 5
1758 #define RP1 STATUSbits.RP1 // bit 6
1759 #define IRP STATUSbits.IRP // bit 7
1761 #define TMR1ON T1CONbits.TMR1ON // bit 0
1762 #define TMR1CS T1CONbits.TMR1CS // bit 1
1763 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2, shadows bit in T1CONbits
1764 #define T1SYNC T1CONbits.T1SYNC // bit 2, shadows bit in T1CONbits
1765 #define T1INSYNC T1CONbits.T1INSYNC // bit 2, shadows bit in T1CONbits
1766 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
1767 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
1768 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
1770 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
1771 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
1772 #define TMR2ON T2CONbits.TMR2ON // bit 2
1773 #define TOUTPS0 T2CONbits.TOUTPS0 // bit 3
1774 #define TOUTPS1 T2CONbits.TOUTPS1 // bit 4
1775 #define TOUTPS2 T2CONbits.TOUTPS2 // bit 5
1776 #define TOUTPS3 T2CONbits.TOUTPS3 // bit 6
1778 #define TRISA0 TRISAbits.TRISA0 // bit 0
1779 #define TRISA1 TRISAbits.TRISA1 // bit 1
1780 #define TRISA2 TRISAbits.TRISA2 // bit 2
1781 #define TRISA3 TRISAbits.TRISA3 // bit 3
1782 #define TRISA4 TRISAbits.TRISA4 // bit 4
1783 #define TRISA5 TRISAbits.TRISA5 // bit 5
1785 #define TRISB0 TRISBbits.TRISB0 // bit 0
1786 #define TRISB1 TRISBbits.TRISB1 // bit 1
1787 #define TRISB2 TRISBbits.TRISB2 // bit 2
1788 #define TRISB3 TRISBbits.TRISB3 // bit 3
1789 #define TRISB4 TRISBbits.TRISB4 // bit 4
1790 #define TRISB5 TRISBbits.TRISB5 // bit 5
1791 #define TRISB6 TRISBbits.TRISB6 // bit 6
1792 #define TRISB7 TRISBbits.TRISB7 // bit 7
1794 #define TRISC0 TRISCbits.TRISC0 // bit 0
1795 #define TRISC1 TRISCbits.TRISC1 // bit 1
1796 #define TRISC2 TRISCbits.TRISC2 // bit 2
1797 #define TRISC3 TRISCbits.TRISC3 // bit 3
1798 #define TRISC4 TRISCbits.TRISC4 // bit 4
1799 #define TRISC5 TRISCbits.TRISC5 // bit 5
1800 #define TRISC6 TRISCbits.TRISC6 // bit 6
1801 #define TRISC7 TRISCbits.TRISC7 // bit 7
1803 #define TRISD0 TRISDbits.TRISD0 // bit 0
1804 #define TRISD1 TRISDbits.TRISD1 // bit 1
1805 #define TRISD2 TRISDbits.TRISD2 // bit 2
1806 #define TRISD3 TRISDbits.TRISD3 // bit 3
1807 #define TRISD4 TRISDbits.TRISD4 // bit 4
1808 #define TRISD5 TRISDbits.TRISD5 // bit 5
1809 #define TRISD6 TRISDbits.TRISD6 // bit 6
1810 #define TRISD7 TRISDbits.TRISD7 // bit 7
1812 #define TRISE0 TRISEbits.TRISE0 // bit 0
1813 #define TRISE1 TRISEbits.TRISE1 // bit 1
1814 #define TRISE2 TRISEbits.TRISE2 // bit 2
1815 #define PSPMODE TRISEbits.PSPMODE // bit 4
1816 #define IBOV TRISEbits.IBOV // bit 5
1817 #define OBF TRISEbits.OBF // bit 6
1818 #define IBF TRISEbits.IBF // bit 7
1820 #define TX9D TXSTAbits.TX9D // bit 0, shadows bit in TXSTAbits
1821 #define TXD8 TXSTAbits.TXD8 // bit 0, shadows bit in TXSTAbits
1822 #define TRMT TXSTAbits.TRMT // bit 1
1823 #define BRGH TXSTAbits.BRGH // bit 2
1824 #define SYNC TXSTAbits.SYNC // bit 4
1825 #define TXEN TXSTAbits.TXEN // bit 5
1826 #define TX9 TXSTAbits.TX9 // bit 6, shadows bit in TXSTAbits
1827 #define NOT_TX8 TXSTAbits.NOT_TX8 // bit 6, shadows bit in TXSTAbits
1828 #define TX8_9 TXSTAbits.TX8_9 // bit 6, shadows bit in TXSTAbits
1829 #define CSRC TXSTAbits.CSRC // bit 7
1831 #endif // #ifndef NO_BIT_DEFINES
1833 #endif // #ifndef __PIC16F877A_H__