Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16f873a.h
blobb36c4edb3d57a930479545eb61f7561cd556c083
1 /*
2 * This declarations of the PIC16F873A 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 __PIC16F873A_H__
26 #define __PIC16F873A_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 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 CMCON_ADDR 0x009C
83 #define CVRCON_ADDR 0x009D
84 #define ADRESL_ADDR 0x009E
85 #define ADCON1_ADDR 0x009F
86 #define EEDATA_ADDR 0x010C
87 #define EEADR_ADDR 0x010D
88 #define EEDATH_ADDR 0x010E
89 #define EEADRH_ADDR 0x010F
90 #define EECON1_ADDR 0x018C
91 #define EECON2_ADDR 0x018D
93 #endif // #ifndef NO_ADDR_DEFINES
95 //==============================================================================
97 // Register Definitions
99 //==============================================================================
101 extern __at(0x0000) __sfr INDF;
102 extern __at(0x0001) __sfr TMR0;
103 extern __at(0x0002) __sfr PCL;
105 //==============================================================================
106 // STATUS Bits
108 extern __at(0x0003) __sfr STATUS;
110 typedef union
112 struct
114 unsigned C : 1;
115 unsigned DC : 1;
116 unsigned Z : 1;
117 unsigned NOT_PD : 1;
118 unsigned NOT_TO : 1;
119 unsigned RP0 : 1;
120 unsigned RP1 : 1;
121 unsigned IRP : 1;
124 struct
126 unsigned : 5;
127 unsigned RP : 2;
128 unsigned : 1;
130 } __STATUSbits_t;
132 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
134 #define _C 0x01
135 #define _DC 0x02
136 #define _Z 0x04
137 #define _NOT_PD 0x08
138 #define _NOT_TO 0x10
139 #define _RP0 0x20
140 #define _RP1 0x40
141 #define _IRP 0x80
143 //==============================================================================
145 extern __at(0x0004) __sfr FSR;
147 //==============================================================================
148 // PORTA Bits
150 extern __at(0x0005) __sfr PORTA;
152 typedef union
154 struct
156 unsigned RA0 : 1;
157 unsigned RA1 : 1;
158 unsigned RA2 : 1;
159 unsigned RA3 : 1;
160 unsigned RA4 : 1;
161 unsigned RA5 : 1;
162 unsigned : 1;
163 unsigned : 1;
166 struct
168 unsigned RA : 6;
169 unsigned : 2;
171 } __PORTAbits_t;
173 extern __at(0x0005) volatile __PORTAbits_t PORTAbits;
175 #define _RA0 0x01
176 #define _RA1 0x02
177 #define _RA2 0x04
178 #define _RA3 0x08
179 #define _RA4 0x10
180 #define _RA5 0x20
182 //==============================================================================
185 //==============================================================================
186 // PORTB Bits
188 extern __at(0x0006) __sfr PORTB;
190 typedef struct
192 unsigned RB0 : 1;
193 unsigned RB1 : 1;
194 unsigned RB2 : 1;
195 unsigned RB3 : 1;
196 unsigned RB4 : 1;
197 unsigned RB5 : 1;
198 unsigned RB6 : 1;
199 unsigned RB7 : 1;
200 } __PORTBbits_t;
202 extern __at(0x0006) volatile __PORTBbits_t PORTBbits;
204 #define _RB0 0x01
205 #define _RB1 0x02
206 #define _RB2 0x04
207 #define _RB3 0x08
208 #define _RB4 0x10
209 #define _RB5 0x20
210 #define _RB6 0x40
211 #define _RB7 0x80
213 //==============================================================================
216 //==============================================================================
217 // PORTC Bits
219 extern __at(0x0007) __sfr PORTC;
221 typedef struct
223 unsigned RC0 : 1;
224 unsigned RC1 : 1;
225 unsigned RC2 : 1;
226 unsigned RC3 : 1;
227 unsigned RC4 : 1;
228 unsigned RC5 : 1;
229 unsigned RC6 : 1;
230 unsigned RC7 : 1;
231 } __PORTCbits_t;
233 extern __at(0x0007) volatile __PORTCbits_t PORTCbits;
235 #define _RC0 0x01
236 #define _RC1 0x02
237 #define _RC2 0x04
238 #define _RC3 0x08
239 #define _RC4 0x10
240 #define _RC5 0x20
241 #define _RC6 0x40
242 #define _RC7 0x80
244 //==============================================================================
246 extern __at(0x000A) __sfr PCLATH;
248 //==============================================================================
249 // INTCON Bits
251 extern __at(0x000B) __sfr INTCON;
253 typedef union
255 struct
257 unsigned RBIF : 1;
258 unsigned INTF : 1;
259 unsigned TMR0IF : 1;
260 unsigned RBIE : 1;
261 unsigned INTE : 1;
262 unsigned TMR0IE : 1;
263 unsigned PEIE : 1;
264 unsigned GIE : 1;
267 struct
269 unsigned : 1;
270 unsigned : 1;
271 unsigned T0IF : 1;
272 unsigned : 1;
273 unsigned : 1;
274 unsigned T0IE : 1;
275 unsigned : 1;
276 unsigned : 1;
278 } __INTCONbits_t;
280 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
282 #define _RBIF 0x01
283 #define _INTF 0x02
284 #define _TMR0IF 0x04
285 #define _T0IF 0x04
286 #define _RBIE 0x08
287 #define _INTE 0x10
288 #define _TMR0IE 0x20
289 #define _T0IE 0x20
290 #define _PEIE 0x40
291 #define _GIE 0x80
293 //==============================================================================
296 //==============================================================================
297 // PIR1 Bits
299 extern __at(0x000C) __sfr PIR1;
301 typedef struct
303 unsigned TMR1IF : 1;
304 unsigned TMR2IF : 1;
305 unsigned CCP1IF : 1;
306 unsigned SSPIF : 1;
307 unsigned TXIF : 1;
308 unsigned RCIF : 1;
309 unsigned ADIF : 1;
310 unsigned : 1;
311 } __PIR1bits_t;
313 extern __at(0x000C) volatile __PIR1bits_t PIR1bits;
315 #define _TMR1IF 0x01
316 #define _TMR2IF 0x02
317 #define _CCP1IF 0x04
318 #define _SSPIF 0x08
319 #define _TXIF 0x10
320 #define _RCIF 0x20
321 #define _ADIF 0x40
323 //==============================================================================
326 //==============================================================================
327 // PIR2 Bits
329 extern __at(0x000D) __sfr PIR2;
331 typedef struct
333 unsigned CCP2IF : 1;
334 unsigned : 1;
335 unsigned : 1;
336 unsigned BCLIF : 1;
337 unsigned EEIF : 1;
338 unsigned : 1;
339 unsigned CMIF : 1;
340 unsigned : 1;
341 } __PIR2bits_t;
343 extern __at(0x000D) volatile __PIR2bits_t PIR2bits;
345 #define _CCP2IF 0x01
346 #define _BCLIF 0x08
347 #define _EEIF 0x10
348 #define _CMIF 0x40
350 //==============================================================================
352 extern __at(0x000E) __sfr TMR1;
353 extern __at(0x000E) __sfr TMR1L;
354 extern __at(0x000F) __sfr TMR1H;
356 //==============================================================================
357 // T1CON Bits
359 extern __at(0x0010) __sfr T1CON;
361 typedef union
363 struct
365 unsigned TMR1ON : 1;
366 unsigned TMR1CS : 1;
367 unsigned NOT_T1SYNC : 1;
368 unsigned T1OSCEN : 1;
369 unsigned T1CKPS0 : 1;
370 unsigned T1CKPS1 : 1;
371 unsigned : 1;
372 unsigned : 1;
375 struct
377 unsigned : 1;
378 unsigned : 1;
379 unsigned T1SYNC : 1;
380 unsigned : 1;
381 unsigned : 1;
382 unsigned : 1;
383 unsigned : 1;
384 unsigned : 1;
387 struct
389 unsigned : 1;
390 unsigned : 1;
391 unsigned T1INSYNC : 1;
392 unsigned : 1;
393 unsigned : 1;
394 unsigned : 1;
395 unsigned : 1;
396 unsigned : 1;
399 struct
401 unsigned : 4;
402 unsigned T1CKPS : 2;
403 unsigned : 2;
405 } __T1CONbits_t;
407 extern __at(0x0010) volatile __T1CONbits_t T1CONbits;
409 #define _TMR1ON 0x01
410 #define _TMR1CS 0x02
411 #define _NOT_T1SYNC 0x04
412 #define _T1SYNC 0x04
413 #define _T1INSYNC 0x04
414 #define _T1OSCEN 0x08
415 #define _T1CKPS0 0x10
416 #define _T1CKPS1 0x20
418 //==============================================================================
420 extern __at(0x0011) __sfr TMR2;
422 //==============================================================================
423 // T2CON Bits
425 extern __at(0x0012) __sfr T2CON;
427 typedef union
429 struct
431 unsigned T2CKPS0 : 1;
432 unsigned T2CKPS1 : 1;
433 unsigned TMR2ON : 1;
434 unsigned TOUTPS0 : 1;
435 unsigned TOUTPS1 : 1;
436 unsigned TOUTPS2 : 1;
437 unsigned TOUTPS3 : 1;
438 unsigned : 1;
441 struct
443 unsigned T2CKPS : 2;
444 unsigned : 6;
447 struct
449 unsigned : 3;
450 unsigned TOUTPS : 4;
451 unsigned : 1;
453 } __T2CONbits_t;
455 extern __at(0x0012) volatile __T2CONbits_t T2CONbits;
457 #define _T2CKPS0 0x01
458 #define _T2CKPS1 0x02
459 #define _TMR2ON 0x04
460 #define _TOUTPS0 0x08
461 #define _TOUTPS1 0x10
462 #define _TOUTPS2 0x20
463 #define _TOUTPS3 0x40
465 //==============================================================================
467 extern __at(0x0013) __sfr SSPBUF;
469 //==============================================================================
470 // SSPCON Bits
472 extern __at(0x0014) __sfr SSPCON;
474 typedef union
476 struct
478 unsigned SSPM0 : 1;
479 unsigned SSPM1 : 1;
480 unsigned SSPM2 : 1;
481 unsigned SSPM3 : 1;
482 unsigned CKP : 1;
483 unsigned SSPEN : 1;
484 unsigned SSPOV : 1;
485 unsigned WCOL : 1;
488 struct
490 unsigned SSPM : 4;
491 unsigned : 4;
493 } __SSPCONbits_t;
495 extern __at(0x0014) volatile __SSPCONbits_t SSPCONbits;
497 #define _SSPM0 0x01
498 #define _SSPM1 0x02
499 #define _SSPM2 0x04
500 #define _SSPM3 0x08
501 #define _CKP 0x10
502 #define _SSPEN 0x20
503 #define _SSPOV 0x40
504 #define _WCOL 0x80
506 //==============================================================================
508 extern __at(0x0015) __sfr CCPR1;
509 extern __at(0x0015) __sfr CCPR1L;
510 extern __at(0x0016) __sfr CCPR1H;
512 //==============================================================================
513 // CCP1CON Bits
515 extern __at(0x0017) __sfr CCP1CON;
517 typedef union
519 struct
521 unsigned CCP1M0 : 1;
522 unsigned CCP1M1 : 1;
523 unsigned CCP1M2 : 1;
524 unsigned CCP1M3 : 1;
525 unsigned CCP1Y : 1;
526 unsigned CCP1X : 1;
527 unsigned : 1;
528 unsigned : 1;
531 struct
533 unsigned CCP1M : 4;
534 unsigned : 4;
536 } __CCP1CONbits_t;
538 extern __at(0x0017) volatile __CCP1CONbits_t CCP1CONbits;
540 #define _CCP1M0 0x01
541 #define _CCP1M1 0x02
542 #define _CCP1M2 0x04
543 #define _CCP1M3 0x08
544 #define _CCP1Y 0x10
545 #define _CCP1X 0x20
547 //==============================================================================
550 //==============================================================================
551 // RCSTA Bits
553 extern __at(0x0018) __sfr RCSTA;
555 typedef union
557 struct
559 unsigned RX9D : 1;
560 unsigned OERR : 1;
561 unsigned FERR : 1;
562 unsigned ADDEN : 1;
563 unsigned CREN : 1;
564 unsigned SREN : 1;
565 unsigned RX9 : 1;
566 unsigned SPEN : 1;
569 struct
571 unsigned RCD8 : 1;
572 unsigned : 1;
573 unsigned : 1;
574 unsigned : 1;
575 unsigned : 1;
576 unsigned : 1;
577 unsigned RC9 : 1;
578 unsigned : 1;
581 struct
583 unsigned : 1;
584 unsigned : 1;
585 unsigned : 1;
586 unsigned : 1;
587 unsigned : 1;
588 unsigned : 1;
589 unsigned NOT_RC8 : 1;
590 unsigned : 1;
593 struct
595 unsigned : 1;
596 unsigned : 1;
597 unsigned : 1;
598 unsigned : 1;
599 unsigned : 1;
600 unsigned : 1;
601 unsigned RC8_9 : 1;
602 unsigned : 1;
604 } __RCSTAbits_t;
606 extern __at(0x0018) volatile __RCSTAbits_t RCSTAbits;
608 #define _RX9D 0x01
609 #define _RCD8 0x01
610 #define _OERR 0x02
611 #define _FERR 0x04
612 #define _ADDEN 0x08
613 #define _CREN 0x10
614 #define _SREN 0x20
615 #define _RX9 0x40
616 #define _RC9 0x40
617 #define _NOT_RC8 0x40
618 #define _RC8_9 0x40
619 #define _SPEN 0x80
621 //==============================================================================
623 extern __at(0x0019) __sfr TXREG;
624 extern __at(0x001A) __sfr RCREG;
625 extern __at(0x001B) __sfr CCPR2;
626 extern __at(0x001B) __sfr CCPR2L;
627 extern __at(0x001C) __sfr CCPR2H;
629 //==============================================================================
630 // CCP2CON Bits
632 extern __at(0x001D) __sfr CCP2CON;
634 typedef union
636 struct
638 unsigned CCP2M0 : 1;
639 unsigned CCP2M1 : 1;
640 unsigned CCP2M2 : 1;
641 unsigned CCP2M3 : 1;
642 unsigned CCP2Y : 1;
643 unsigned CCP2X : 1;
644 unsigned : 1;
645 unsigned : 1;
648 struct
650 unsigned CCP2M : 4;
651 unsigned : 4;
653 } __CCP2CONbits_t;
655 extern __at(0x001D) volatile __CCP2CONbits_t CCP2CONbits;
657 #define _CCP2M0 0x01
658 #define _CCP2M1 0x02
659 #define _CCP2M2 0x04
660 #define _CCP2M3 0x08
661 #define _CCP2Y 0x10
662 #define _CCP2X 0x20
664 //==============================================================================
666 extern __at(0x001E) __sfr ADRESH;
668 //==============================================================================
669 // ADCON0 Bits
671 extern __at(0x001F) __sfr ADCON0;
673 typedef union
675 struct
677 unsigned ADON : 1;
678 unsigned : 1;
679 unsigned GO_NOT_DONE : 1;
680 unsigned CHS0 : 1;
681 unsigned CHS1 : 1;
682 unsigned CHS2 : 1;
683 unsigned ADCS0 : 1;
684 unsigned ADCS1 : 1;
687 struct
689 unsigned : 1;
690 unsigned : 1;
691 unsigned GO : 1;
692 unsigned : 1;
693 unsigned : 1;
694 unsigned : 1;
695 unsigned : 1;
696 unsigned : 1;
699 struct
701 unsigned : 1;
702 unsigned : 1;
703 unsigned NOT_DONE : 1;
704 unsigned : 1;
705 unsigned : 1;
706 unsigned : 1;
707 unsigned : 1;
708 unsigned : 1;
711 struct
713 unsigned : 1;
714 unsigned : 1;
715 unsigned GO_DONE : 1;
716 unsigned : 1;
717 unsigned : 1;
718 unsigned : 1;
719 unsigned : 1;
720 unsigned : 1;
723 struct
725 unsigned : 3;
726 unsigned CHS : 3;
727 unsigned : 2;
730 struct
732 unsigned : 6;
733 unsigned ADCS : 2;
735 } __ADCON0bits_t;
737 extern __at(0x001F) volatile __ADCON0bits_t ADCON0bits;
739 #define _ADON 0x01
740 #define _GO_NOT_DONE 0x04
741 #define _GO 0x04
742 #define _NOT_DONE 0x04
743 #define _GO_DONE 0x04
744 #define _CHS0 0x08
745 #define _CHS1 0x10
746 #define _CHS2 0x20
747 #define _ADCS0 0x40
748 #define _ADCS1 0x80
750 //==============================================================================
753 //==============================================================================
754 // OPTION_REG Bits
756 extern __at(0x0081) __sfr OPTION_REG;
758 typedef union
760 struct
762 unsigned PS0 : 1;
763 unsigned PS1 : 1;
764 unsigned PS2 : 1;
765 unsigned PSA : 1;
766 unsigned T0SE : 1;
767 unsigned T0CS : 1;
768 unsigned INTEDG : 1;
769 unsigned NOT_RBPU : 1;
772 struct
774 unsigned PS : 3;
775 unsigned : 5;
777 } __OPTION_REGbits_t;
779 extern __at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits;
781 #define _PS0 0x01
782 #define _PS1 0x02
783 #define _PS2 0x04
784 #define _PSA 0x08
785 #define _T0SE 0x10
786 #define _T0CS 0x20
787 #define _INTEDG 0x40
788 #define _NOT_RBPU 0x80
790 //==============================================================================
793 //==============================================================================
794 // TRISA Bits
796 extern __at(0x0085) __sfr TRISA;
798 typedef union
800 struct
802 unsigned TRISA0 : 1;
803 unsigned TRISA1 : 1;
804 unsigned TRISA2 : 1;
805 unsigned TRISA3 : 1;
806 unsigned TRISA4 : 1;
807 unsigned TRISA5 : 1;
808 unsigned : 1;
809 unsigned : 1;
812 struct
814 unsigned TRISA : 6;
815 unsigned : 2;
817 } __TRISAbits_t;
819 extern __at(0x0085) volatile __TRISAbits_t TRISAbits;
821 #define _TRISA0 0x01
822 #define _TRISA1 0x02
823 #define _TRISA2 0x04
824 #define _TRISA3 0x08
825 #define _TRISA4 0x10
826 #define _TRISA5 0x20
828 //==============================================================================
831 //==============================================================================
832 // TRISB Bits
834 extern __at(0x0086) __sfr TRISB;
836 typedef struct
838 unsigned TRISB0 : 1;
839 unsigned TRISB1 : 1;
840 unsigned TRISB2 : 1;
841 unsigned TRISB3 : 1;
842 unsigned TRISB4 : 1;
843 unsigned TRISB5 : 1;
844 unsigned TRISB6 : 1;
845 unsigned TRISB7 : 1;
846 } __TRISBbits_t;
848 extern __at(0x0086) volatile __TRISBbits_t TRISBbits;
850 #define _TRISB0 0x01
851 #define _TRISB1 0x02
852 #define _TRISB2 0x04
853 #define _TRISB3 0x08
854 #define _TRISB4 0x10
855 #define _TRISB5 0x20
856 #define _TRISB6 0x40
857 #define _TRISB7 0x80
859 //==============================================================================
862 //==============================================================================
863 // TRISC Bits
865 extern __at(0x0087) __sfr TRISC;
867 typedef struct
869 unsigned TRISC0 : 1;
870 unsigned TRISC1 : 1;
871 unsigned TRISC2 : 1;
872 unsigned TRISC3 : 1;
873 unsigned TRISC4 : 1;
874 unsigned TRISC5 : 1;
875 unsigned TRISC6 : 1;
876 unsigned TRISC7 : 1;
877 } __TRISCbits_t;
879 extern __at(0x0087) volatile __TRISCbits_t TRISCbits;
881 #define _TRISC0 0x01
882 #define _TRISC1 0x02
883 #define _TRISC2 0x04
884 #define _TRISC3 0x08
885 #define _TRISC4 0x10
886 #define _TRISC5 0x20
887 #define _TRISC6 0x40
888 #define _TRISC7 0x80
890 //==============================================================================
893 //==============================================================================
894 // PIE1 Bits
896 extern __at(0x008C) __sfr PIE1;
898 typedef struct
900 unsigned TMR1IE : 1;
901 unsigned TMR2IE : 1;
902 unsigned CCP1IE : 1;
903 unsigned SSPIE : 1;
904 unsigned TXIE : 1;
905 unsigned RCIE : 1;
906 unsigned ADIE : 1;
907 unsigned : 1;
908 } __PIE1bits_t;
910 extern __at(0x008C) volatile __PIE1bits_t PIE1bits;
912 #define _TMR1IE 0x01
913 #define _TMR2IE 0x02
914 #define _CCP1IE 0x04
915 #define _SSPIE 0x08
916 #define _TXIE 0x10
917 #define _RCIE 0x20
918 #define _ADIE 0x40
920 //==============================================================================
923 //==============================================================================
924 // PIE2 Bits
926 extern __at(0x008D) __sfr PIE2;
928 typedef struct
930 unsigned CCP2IE : 1;
931 unsigned : 1;
932 unsigned : 1;
933 unsigned BCLIE : 1;
934 unsigned EEIE : 1;
935 unsigned : 1;
936 unsigned CMIE : 1;
937 unsigned : 1;
938 } __PIE2bits_t;
940 extern __at(0x008D) volatile __PIE2bits_t PIE2bits;
942 #define _CCP2IE 0x01
943 #define _BCLIE 0x08
944 #define _EEIE 0x10
945 #define _CMIE 0x40
947 //==============================================================================
950 //==============================================================================
951 // PCON Bits
953 extern __at(0x008E) __sfr PCON;
955 typedef union
957 struct
959 unsigned NOT_BOR : 1;
960 unsigned NOT_POR : 1;
961 unsigned : 1;
962 unsigned : 1;
963 unsigned : 1;
964 unsigned : 1;
965 unsigned : 1;
966 unsigned : 1;
969 struct
971 unsigned NOT_BO : 1;
972 unsigned : 1;
973 unsigned : 1;
974 unsigned : 1;
975 unsigned : 1;
976 unsigned : 1;
977 unsigned : 1;
978 unsigned : 1;
980 } __PCONbits_t;
982 extern __at(0x008E) volatile __PCONbits_t PCONbits;
984 #define _NOT_BOR 0x01
985 #define _NOT_BO 0x01
986 #define _NOT_POR 0x02
988 //==============================================================================
991 //==============================================================================
992 // SSPCON2 Bits
994 extern __at(0x0091) __sfr SSPCON2;
996 typedef struct
998 unsigned SEN : 1;
999 unsigned RSEN : 1;
1000 unsigned PEN : 1;
1001 unsigned RCEN : 1;
1002 unsigned ACKEN : 1;
1003 unsigned ACKDT : 1;
1004 unsigned ACKSTAT : 1;
1005 unsigned GCEN : 1;
1006 } __SSPCON2bits_t;
1008 extern __at(0x0091) volatile __SSPCON2bits_t SSPCON2bits;
1010 #define _SEN 0x01
1011 #define _RSEN 0x02
1012 #define _PEN 0x04
1013 #define _RCEN 0x08
1014 #define _ACKEN 0x10
1015 #define _ACKDT 0x20
1016 #define _ACKSTAT 0x40
1017 #define _GCEN 0x80
1019 //==============================================================================
1021 extern __at(0x0092) __sfr PR2;
1022 extern __at(0x0093) __sfr SSPADD;
1024 //==============================================================================
1025 // SSPSTAT Bits
1027 extern __at(0x0094) __sfr SSPSTAT;
1029 typedef union
1031 struct
1033 unsigned BF : 1;
1034 unsigned UA : 1;
1035 unsigned R_NOT_W : 1;
1036 unsigned S : 1;
1037 unsigned P : 1;
1038 unsigned D_NOT_A : 1;
1039 unsigned CKE : 1;
1040 unsigned SMP : 1;
1043 struct
1045 unsigned : 1;
1046 unsigned : 1;
1047 unsigned R : 1;
1048 unsigned I2C_START : 1;
1049 unsigned I2C_STOP : 1;
1050 unsigned D : 1;
1051 unsigned : 1;
1052 unsigned : 1;
1055 struct
1057 unsigned : 1;
1058 unsigned : 1;
1059 unsigned I2C_READ : 1;
1060 unsigned : 1;
1061 unsigned : 1;
1062 unsigned I2C_DATA : 1;
1063 unsigned : 1;
1064 unsigned : 1;
1067 struct
1069 unsigned : 1;
1070 unsigned : 1;
1071 unsigned NOT_W : 1;
1072 unsigned : 1;
1073 unsigned : 1;
1074 unsigned NOT_A : 1;
1075 unsigned : 1;
1076 unsigned : 1;
1079 struct
1081 unsigned : 1;
1082 unsigned : 1;
1083 unsigned NOT_WRITE : 1;
1084 unsigned : 1;
1085 unsigned : 1;
1086 unsigned NOT_ADDRESS : 1;
1087 unsigned : 1;
1088 unsigned : 1;
1091 struct
1093 unsigned : 1;
1094 unsigned : 1;
1095 unsigned R_W : 1;
1096 unsigned : 1;
1097 unsigned : 1;
1098 unsigned D_A : 1;
1099 unsigned : 1;
1100 unsigned : 1;
1103 struct
1105 unsigned : 1;
1106 unsigned : 1;
1107 unsigned READ_WRITE : 1;
1108 unsigned : 1;
1109 unsigned : 1;
1110 unsigned DATA_ADDRESS : 1;
1111 unsigned : 1;
1112 unsigned : 1;
1114 } __SSPSTATbits_t;
1116 extern __at(0x0094) volatile __SSPSTATbits_t SSPSTATbits;
1118 #define _BF 0x01
1119 #define _UA 0x02
1120 #define _R_NOT_W 0x04
1121 #define _R 0x04
1122 #define _I2C_READ 0x04
1123 #define _NOT_W 0x04
1124 #define _NOT_WRITE 0x04
1125 #define _R_W 0x04
1126 #define _READ_WRITE 0x04
1127 #define _S 0x08
1128 #define _I2C_START 0x08
1129 #define _P 0x10
1130 #define _I2C_STOP 0x10
1131 #define _D_NOT_A 0x20
1132 #define _D 0x20
1133 #define _I2C_DATA 0x20
1134 #define _NOT_A 0x20
1135 #define _NOT_ADDRESS 0x20
1136 #define _D_A 0x20
1137 #define _DATA_ADDRESS 0x20
1138 #define _CKE 0x40
1139 #define _SMP 0x80
1141 //==============================================================================
1144 //==============================================================================
1145 // TXSTA Bits
1147 extern __at(0x0098) __sfr TXSTA;
1149 typedef union
1151 struct
1153 unsigned TX9D : 1;
1154 unsigned TRMT : 1;
1155 unsigned BRGH : 1;
1156 unsigned : 1;
1157 unsigned SYNC : 1;
1158 unsigned TXEN : 1;
1159 unsigned TX9 : 1;
1160 unsigned CSRC : 1;
1163 struct
1165 unsigned TXD8 : 1;
1166 unsigned : 1;
1167 unsigned : 1;
1168 unsigned : 1;
1169 unsigned : 1;
1170 unsigned : 1;
1171 unsigned NOT_TX8 : 1;
1172 unsigned : 1;
1175 struct
1177 unsigned : 1;
1178 unsigned : 1;
1179 unsigned : 1;
1180 unsigned : 1;
1181 unsigned : 1;
1182 unsigned : 1;
1183 unsigned TX8_9 : 1;
1184 unsigned : 1;
1186 } __TXSTAbits_t;
1188 extern __at(0x0098) volatile __TXSTAbits_t TXSTAbits;
1190 #define _TX9D 0x01
1191 #define _TXD8 0x01
1192 #define _TRMT 0x02
1193 #define _BRGH 0x04
1194 #define _SYNC 0x10
1195 #define _TXEN 0x20
1196 #define _TX9 0x40
1197 #define _NOT_TX8 0x40
1198 #define _TX8_9 0x40
1199 #define _CSRC 0x80
1201 //==============================================================================
1203 extern __at(0x0099) __sfr SPBRG;
1205 //==============================================================================
1206 // CMCON Bits
1208 extern __at(0x009C) __sfr CMCON;
1210 typedef union
1212 struct
1214 unsigned CM0 : 1;
1215 unsigned CM1 : 1;
1216 unsigned CM2 : 1;
1217 unsigned CIS : 1;
1218 unsigned C1INV : 1;
1219 unsigned C2INV : 1;
1220 unsigned C1OUT : 1;
1221 unsigned C2OUT : 1;
1224 struct
1226 unsigned CM : 3;
1227 unsigned : 5;
1229 } __CMCONbits_t;
1231 extern __at(0x009C) volatile __CMCONbits_t CMCONbits;
1233 #define _CM0 0x01
1234 #define _CM1 0x02
1235 #define _CM2 0x04
1236 #define _CIS 0x08
1237 #define _C1INV 0x10
1238 #define _C2INV 0x20
1239 #define _C1OUT 0x40
1240 #define _C2OUT 0x80
1242 //==============================================================================
1245 //==============================================================================
1246 // CVRCON Bits
1248 extern __at(0x009D) __sfr CVRCON;
1250 typedef union
1252 struct
1254 unsigned CVR0 : 1;
1255 unsigned CVR1 : 1;
1256 unsigned CVR2 : 1;
1257 unsigned CVR3 : 1;
1258 unsigned : 1;
1259 unsigned CVRR : 1;
1260 unsigned CVROE : 1;
1261 unsigned CVREN : 1;
1264 struct
1266 unsigned CVR : 4;
1267 unsigned : 4;
1269 } __CVRCONbits_t;
1271 extern __at(0x009D) volatile __CVRCONbits_t CVRCONbits;
1273 #define _CVR0 0x01
1274 #define _CVR1 0x02
1275 #define _CVR2 0x04
1276 #define _CVR3 0x08
1277 #define _CVRR 0x20
1278 #define _CVROE 0x40
1279 #define _CVREN 0x80
1281 //==============================================================================
1283 extern __at(0x009E) __sfr ADRESL;
1285 //==============================================================================
1286 // ADCON1 Bits
1288 extern __at(0x009F) __sfr ADCON1;
1290 typedef union
1292 struct
1294 unsigned PCFG0 : 1;
1295 unsigned PCFG1 : 1;
1296 unsigned PCFG2 : 1;
1297 unsigned PCFG3 : 1;
1298 unsigned : 1;
1299 unsigned : 1;
1300 unsigned ADCS2 : 1;
1301 unsigned ADFM : 1;
1304 struct
1306 unsigned PCFG : 4;
1307 unsigned : 4;
1309 } __ADCON1bits_t;
1311 extern __at(0x009F) volatile __ADCON1bits_t ADCON1bits;
1313 #define _PCFG0 0x01
1314 #define _PCFG1 0x02
1315 #define _PCFG2 0x04
1316 #define _PCFG3 0x08
1317 #define _ADCS2 0x40
1318 #define _ADFM 0x80
1320 //==============================================================================
1322 extern __at(0x010C) __sfr EEDATA;
1323 extern __at(0x010D) __sfr EEADR;
1324 extern __at(0x010E) __sfr EEDATH;
1325 extern __at(0x010F) __sfr EEADRH;
1327 //==============================================================================
1328 // EECON1 Bits
1330 extern __at(0x018C) __sfr EECON1;
1332 typedef struct
1334 unsigned RD : 1;
1335 unsigned WR : 1;
1336 unsigned WREN : 1;
1337 unsigned WRERR : 1;
1338 unsigned : 1;
1339 unsigned : 1;
1340 unsigned : 1;
1341 unsigned EEPGD : 1;
1342 } __EECON1bits_t;
1344 extern __at(0x018C) volatile __EECON1bits_t EECON1bits;
1346 #define _RD 0x01
1347 #define _WR 0x02
1348 #define _WREN 0x04
1349 #define _WRERR 0x08
1350 #define _EEPGD 0x80
1352 //==============================================================================
1354 extern __at(0x018D) __sfr EECON2;
1356 //==============================================================================
1358 // Configuration Bits
1360 //==============================================================================
1362 #define _CONFIG 0x2007
1364 //----------------------------- CONFIG Options -------------------------------
1366 #define _FOSC_LP 0x3FFC // LP oscillator.
1367 #define _LP_OSC 0x3FFC // LP oscillator.
1368 #define _FOSC_XT 0x3FFD // XT oscillator.
1369 #define _XT_OSC 0x3FFD // XT oscillator.
1370 #define _FOSC_HS 0x3FFE // HS oscillator.
1371 #define _HS_OSC 0x3FFE // HS oscillator.
1372 #define _FOSC_EXTRC 0x3FFF // RC oscillator.
1373 #define _RC_OSC 0x3FFF // RC oscillator.
1374 #define _WDTE_OFF 0x3FFB // WDT disabled.
1375 #define _WDT_OFF 0x3FFB // WDT disabled.
1376 #define _WDTE_ON 0x3FFF // WDT enabled.
1377 #define _WDT_ON 0x3FFF // WDT enabled.
1378 #define _PWRTE_ON 0x3FF7 // PWRT enabled.
1379 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
1380 #define _BOREN_OFF 0x3FBF // BOR disabled.
1381 #define _BODEN_OFF 0x3FBF // BOR disabled.
1382 #define _BOREN_ON 0x3FFF // BOR enabled.
1383 #define _BODEN_ON 0x3FFF // BOR enabled.
1384 #define _LVP_OFF 0x3F7F // RB3 is digital I/O, HV on MCLR must be used for programming.
1385 #define _LVP_ON 0x3FFF // RB3/PGM pin has PGM function; low-voltage programming enabled.
1386 #define _CPD_ON 0x3EFF // Data EEPROM code-protected.
1387 #define _CPD_OFF 0x3FFF // Data EEPROM code protection off.
1388 #define _WRT_HALF 0x39FF // 0000h to 07FFh write-protected; 0800h to 0FFFh may be written to by EECON control.
1389 #define _WRT_1FOURTH 0x3BFF // 0000h to 03FFh write-protected; 0400h to 0FFFh may be written to by EECON control.
1390 #define _WRT_256 0x3DFF // 0000h to 00FFh write-protected; 0100h to 0FFFh may be written to by EECON control.
1391 #define _WRT_OFF 0x3FFF // Write protection off; all program memory may be written to by EECON control.
1392 #define _DEBUG_ON 0x37FF // In-Circuit Debugger enabled, RB6 and RB7 are dedicated to the debugger.
1393 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins.
1394 #define _CP_ON 0x1FFF // All program memory code-protected.
1395 #define _CP_ALL 0x1FFF // All program memory code-protected.
1396 #define _CP_OFF 0x3FFF // Code protection off.
1398 //==============================================================================
1400 #define _DEVID1 0x2006
1402 #define _IDLOC0 0x2000
1403 #define _IDLOC1 0x2001
1404 #define _IDLOC2 0x2002
1405 #define _IDLOC3 0x2003
1407 //==============================================================================
1409 #ifndef NO_BIT_DEFINES
1411 #define ADON ADCON0bits.ADON // bit 0
1412 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 2, shadows bit in ADCON0bits
1413 #define GO ADCON0bits.GO // bit 2, shadows bit in ADCON0bits
1414 #define NOT_DONE ADCON0bits.NOT_DONE // bit 2, shadows bit in ADCON0bits
1415 #define GO_DONE ADCON0bits.GO_DONE // bit 2, shadows bit in ADCON0bits
1416 #define CHS0 ADCON0bits.CHS0 // bit 3
1417 #define CHS1 ADCON0bits.CHS1 // bit 4
1418 #define CHS2 ADCON0bits.CHS2 // bit 5
1419 #define ADCS0 ADCON0bits.ADCS0 // bit 6
1420 #define ADCS1 ADCON0bits.ADCS1 // bit 7
1422 #define PCFG0 ADCON1bits.PCFG0 // bit 0
1423 #define PCFG1 ADCON1bits.PCFG1 // bit 1
1424 #define PCFG2 ADCON1bits.PCFG2 // bit 2
1425 #define PCFG3 ADCON1bits.PCFG3 // bit 3
1426 #define ADCS2 ADCON1bits.ADCS2 // bit 6
1427 #define ADFM ADCON1bits.ADFM // bit 7
1429 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
1430 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
1431 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
1432 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
1433 #define CCP1Y CCP1CONbits.CCP1Y // bit 4
1434 #define CCP1X CCP1CONbits.CCP1X // bit 5
1436 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
1437 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
1438 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
1439 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
1440 #define CCP2Y CCP2CONbits.CCP2Y // bit 4
1441 #define CCP2X CCP2CONbits.CCP2X // bit 5
1443 #define CM0 CMCONbits.CM0 // bit 0
1444 #define CM1 CMCONbits.CM1 // bit 1
1445 #define CM2 CMCONbits.CM2 // bit 2
1446 #define CIS CMCONbits.CIS // bit 3
1447 #define C1INV CMCONbits.C1INV // bit 4
1448 #define C2INV CMCONbits.C2INV // bit 5
1449 #define C1OUT CMCONbits.C1OUT // bit 6
1450 #define C2OUT CMCONbits.C2OUT // bit 7
1452 #define CVR0 CVRCONbits.CVR0 // bit 0
1453 #define CVR1 CVRCONbits.CVR1 // bit 1
1454 #define CVR2 CVRCONbits.CVR2 // bit 2
1455 #define CVR3 CVRCONbits.CVR3 // bit 3
1456 #define CVRR CVRCONbits.CVRR // bit 5
1457 #define CVROE CVRCONbits.CVROE // bit 6
1458 #define CVREN CVRCONbits.CVREN // bit 7
1460 #define RD EECON1bits.RD // bit 0
1461 #define WR EECON1bits.WR // bit 1
1462 #define WREN EECON1bits.WREN // bit 2
1463 #define WRERR EECON1bits.WRERR // bit 3
1464 #define EEPGD EECON1bits.EEPGD // bit 7
1466 #define RBIF INTCONbits.RBIF // bit 0
1467 #define INTF INTCONbits.INTF // bit 1
1468 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
1469 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
1470 #define RBIE INTCONbits.RBIE // bit 3
1471 #define INTE INTCONbits.INTE // bit 4
1472 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
1473 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
1474 #define PEIE INTCONbits.PEIE // bit 6
1475 #define GIE INTCONbits.GIE // bit 7
1477 #define PS0 OPTION_REGbits.PS0 // bit 0
1478 #define PS1 OPTION_REGbits.PS1 // bit 1
1479 #define PS2 OPTION_REGbits.PS2 // bit 2
1480 #define PSA OPTION_REGbits.PSA // bit 3
1481 #define T0SE OPTION_REGbits.T0SE // bit 4
1482 #define T0CS OPTION_REGbits.T0CS // bit 5
1483 #define INTEDG OPTION_REGbits.INTEDG // bit 6
1484 #define NOT_RBPU OPTION_REGbits.NOT_RBPU // bit 7
1486 #define NOT_BOR PCONbits.NOT_BOR // bit 0, shadows bit in PCONbits
1487 #define NOT_BO PCONbits.NOT_BO // bit 0, shadows bit in PCONbits
1488 #define NOT_POR PCONbits.NOT_POR // bit 1
1490 #define TMR1IE PIE1bits.TMR1IE // bit 0
1491 #define TMR2IE PIE1bits.TMR2IE // bit 1
1492 #define CCP1IE PIE1bits.CCP1IE // bit 2
1493 #define SSPIE PIE1bits.SSPIE // bit 3
1494 #define TXIE PIE1bits.TXIE // bit 4
1495 #define RCIE PIE1bits.RCIE // bit 5
1496 #define ADIE PIE1bits.ADIE // bit 6
1498 #define CCP2IE PIE2bits.CCP2IE // bit 0
1499 #define BCLIE PIE2bits.BCLIE // bit 3
1500 #define EEIE PIE2bits.EEIE // bit 4
1501 #define CMIE PIE2bits.CMIE // bit 6
1503 #define TMR1IF PIR1bits.TMR1IF // bit 0
1504 #define TMR2IF PIR1bits.TMR2IF // bit 1
1505 #define CCP1IF PIR1bits.CCP1IF // bit 2
1506 #define SSPIF PIR1bits.SSPIF // bit 3
1507 #define TXIF PIR1bits.TXIF // bit 4
1508 #define RCIF PIR1bits.RCIF // bit 5
1509 #define ADIF PIR1bits.ADIF // bit 6
1511 #define CCP2IF PIR2bits.CCP2IF // bit 0
1512 #define BCLIF PIR2bits.BCLIF // bit 3
1513 #define EEIF PIR2bits.EEIF // bit 4
1514 #define CMIF PIR2bits.CMIF // bit 6
1516 #define RA0 PORTAbits.RA0 // bit 0
1517 #define RA1 PORTAbits.RA1 // bit 1
1518 #define RA2 PORTAbits.RA2 // bit 2
1519 #define RA3 PORTAbits.RA3 // bit 3
1520 #define RA4 PORTAbits.RA4 // bit 4
1521 #define RA5 PORTAbits.RA5 // bit 5
1523 #define RB0 PORTBbits.RB0 // bit 0
1524 #define RB1 PORTBbits.RB1 // bit 1
1525 #define RB2 PORTBbits.RB2 // bit 2
1526 #define RB3 PORTBbits.RB3 // bit 3
1527 #define RB4 PORTBbits.RB4 // bit 4
1528 #define RB5 PORTBbits.RB5 // bit 5
1529 #define RB6 PORTBbits.RB6 // bit 6
1530 #define RB7 PORTBbits.RB7 // bit 7
1532 #define RC0 PORTCbits.RC0 // bit 0
1533 #define RC1 PORTCbits.RC1 // bit 1
1534 #define RC2 PORTCbits.RC2 // bit 2
1535 #define RC3 PORTCbits.RC3 // bit 3
1536 #define RC4 PORTCbits.RC4 // bit 4
1537 #define RC5 PORTCbits.RC5 // bit 5
1538 #define RC6 PORTCbits.RC6 // bit 6
1539 #define RC7 PORTCbits.RC7 // bit 7
1541 #define RX9D RCSTAbits.RX9D // bit 0, shadows bit in RCSTAbits
1542 #define RCD8 RCSTAbits.RCD8 // bit 0, shadows bit in RCSTAbits
1543 #define OERR RCSTAbits.OERR // bit 1
1544 #define FERR RCSTAbits.FERR // bit 2
1545 #define ADDEN RCSTAbits.ADDEN // bit 3
1546 #define CREN RCSTAbits.CREN // bit 4
1547 #define SREN RCSTAbits.SREN // bit 5
1548 #define RX9 RCSTAbits.RX9 // bit 6, shadows bit in RCSTAbits
1549 #define RC9 RCSTAbits.RC9 // bit 6, shadows bit in RCSTAbits
1550 #define NOT_RC8 RCSTAbits.NOT_RC8 // bit 6, shadows bit in RCSTAbits
1551 #define RC8_9 RCSTAbits.RC8_9 // bit 6, shadows bit in RCSTAbits
1552 #define SPEN RCSTAbits.SPEN // bit 7
1554 #define SSPM0 SSPCONbits.SSPM0 // bit 0
1555 #define SSPM1 SSPCONbits.SSPM1 // bit 1
1556 #define SSPM2 SSPCONbits.SSPM2 // bit 2
1557 #define SSPM3 SSPCONbits.SSPM3 // bit 3
1558 #define CKP SSPCONbits.CKP // bit 4
1559 #define SSPEN SSPCONbits.SSPEN // bit 5
1560 #define SSPOV SSPCONbits.SSPOV // bit 6
1561 #define WCOL SSPCONbits.WCOL // bit 7
1563 #define SEN SSPCON2bits.SEN // bit 0
1564 #define RSEN SSPCON2bits.RSEN // bit 1
1565 #define PEN SSPCON2bits.PEN // bit 2
1566 #define RCEN SSPCON2bits.RCEN // bit 3
1567 #define ACKEN SSPCON2bits.ACKEN // bit 4
1568 #define ACKDT SSPCON2bits.ACKDT // bit 5
1569 #define ACKSTAT SSPCON2bits.ACKSTAT // bit 6
1570 #define GCEN SSPCON2bits.GCEN // bit 7
1572 #define BF SSPSTATbits.BF // bit 0
1573 #define UA SSPSTATbits.UA // bit 1
1574 #define R_NOT_W SSPSTATbits.R_NOT_W // bit 2, shadows bit in SSPSTATbits
1575 #define R SSPSTATbits.R // bit 2, shadows bit in SSPSTATbits
1576 #define I2C_READ SSPSTATbits.I2C_READ // bit 2, shadows bit in SSPSTATbits
1577 #define NOT_W SSPSTATbits.NOT_W // bit 2, shadows bit in SSPSTATbits
1578 #define NOT_WRITE SSPSTATbits.NOT_WRITE // bit 2, shadows bit in SSPSTATbits
1579 #define R_W SSPSTATbits.R_W // bit 2, shadows bit in SSPSTATbits
1580 #define READ_WRITE SSPSTATbits.READ_WRITE // bit 2, shadows bit in SSPSTATbits
1581 #define S SSPSTATbits.S // bit 3, shadows bit in SSPSTATbits
1582 #define I2C_START SSPSTATbits.I2C_START // bit 3, shadows bit in SSPSTATbits
1583 #define P SSPSTATbits.P // bit 4, shadows bit in SSPSTATbits
1584 #define I2C_STOP SSPSTATbits.I2C_STOP // bit 4, shadows bit in SSPSTATbits
1585 #define D_NOT_A SSPSTATbits.D_NOT_A // bit 5, shadows bit in SSPSTATbits
1586 #define D SSPSTATbits.D // bit 5, shadows bit in SSPSTATbits
1587 #define I2C_DATA SSPSTATbits.I2C_DATA // bit 5, shadows bit in SSPSTATbits
1588 #define NOT_A SSPSTATbits.NOT_A // bit 5, shadows bit in SSPSTATbits
1589 #define NOT_ADDRESS SSPSTATbits.NOT_ADDRESS // bit 5, shadows bit in SSPSTATbits
1590 #define D_A SSPSTATbits.D_A // bit 5, shadows bit in SSPSTATbits
1591 #define DATA_ADDRESS SSPSTATbits.DATA_ADDRESS // bit 5, shadows bit in SSPSTATbits
1592 #define CKE SSPSTATbits.CKE // bit 6
1593 #define SMP SSPSTATbits.SMP // bit 7
1595 #define C STATUSbits.C // bit 0
1596 #define DC STATUSbits.DC // bit 1
1597 #define Z STATUSbits.Z // bit 2
1598 #define NOT_PD STATUSbits.NOT_PD // bit 3
1599 #define NOT_TO STATUSbits.NOT_TO // bit 4
1600 #define RP0 STATUSbits.RP0 // bit 5
1601 #define RP1 STATUSbits.RP1 // bit 6
1602 #define IRP STATUSbits.IRP // bit 7
1604 #define TMR1ON T1CONbits.TMR1ON // bit 0
1605 #define TMR1CS T1CONbits.TMR1CS // bit 1
1606 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2, shadows bit in T1CONbits
1607 #define T1SYNC T1CONbits.T1SYNC // bit 2, shadows bit in T1CONbits
1608 #define T1INSYNC T1CONbits.T1INSYNC // bit 2, shadows bit in T1CONbits
1609 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
1610 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
1611 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
1613 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
1614 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
1615 #define TMR2ON T2CONbits.TMR2ON // bit 2
1616 #define TOUTPS0 T2CONbits.TOUTPS0 // bit 3
1617 #define TOUTPS1 T2CONbits.TOUTPS1 // bit 4
1618 #define TOUTPS2 T2CONbits.TOUTPS2 // bit 5
1619 #define TOUTPS3 T2CONbits.TOUTPS3 // bit 6
1621 #define TRISA0 TRISAbits.TRISA0 // bit 0
1622 #define TRISA1 TRISAbits.TRISA1 // bit 1
1623 #define TRISA2 TRISAbits.TRISA2 // bit 2
1624 #define TRISA3 TRISAbits.TRISA3 // bit 3
1625 #define TRISA4 TRISAbits.TRISA4 // bit 4
1626 #define TRISA5 TRISAbits.TRISA5 // bit 5
1628 #define TRISB0 TRISBbits.TRISB0 // bit 0
1629 #define TRISB1 TRISBbits.TRISB1 // bit 1
1630 #define TRISB2 TRISBbits.TRISB2 // bit 2
1631 #define TRISB3 TRISBbits.TRISB3 // bit 3
1632 #define TRISB4 TRISBbits.TRISB4 // bit 4
1633 #define TRISB5 TRISBbits.TRISB5 // bit 5
1634 #define TRISB6 TRISBbits.TRISB6 // bit 6
1635 #define TRISB7 TRISBbits.TRISB7 // bit 7
1637 #define TRISC0 TRISCbits.TRISC0 // bit 0
1638 #define TRISC1 TRISCbits.TRISC1 // bit 1
1639 #define TRISC2 TRISCbits.TRISC2 // bit 2
1640 #define TRISC3 TRISCbits.TRISC3 // bit 3
1641 #define TRISC4 TRISCbits.TRISC4 // bit 4
1642 #define TRISC5 TRISCbits.TRISC5 // bit 5
1643 #define TRISC6 TRISCbits.TRISC6 // bit 6
1644 #define TRISC7 TRISCbits.TRISC7 // bit 7
1646 #define TX9D TXSTAbits.TX9D // bit 0, shadows bit in TXSTAbits
1647 #define TXD8 TXSTAbits.TXD8 // bit 0, shadows bit in TXSTAbits
1648 #define TRMT TXSTAbits.TRMT // bit 1
1649 #define BRGH TXSTAbits.BRGH // bit 2
1650 #define SYNC TXSTAbits.SYNC // bit 4
1651 #define TXEN TXSTAbits.TXEN // bit 5
1652 #define TX9 TXSTAbits.TX9 // bit 6, shadows bit in TXSTAbits
1653 #define NOT_TX8 TXSTAbits.NOT_TX8 // bit 6, shadows bit in TXSTAbits
1654 #define TX8_9 TXSTAbits.TX8_9 // bit 6, shadows bit in TXSTAbits
1655 #define CSRC TXSTAbits.CSRC // bit 7
1657 #endif // #ifndef NO_BIT_DEFINES
1659 #endif // #ifndef __PIC16F873A_H__