Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16c774.h
blobb8688096efec04c2d56aa4f769ceba68b16d227e
1 /*
2 * This declarations of the PIC16C774 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:03 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 __PIC16C774_H__
26 #define __PIC16C774_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 REFCON_ADDR 0x009B
87 #define LVDCON_ADDR 0x009C
88 #define ADRESL_ADDR 0x009E
89 #define ADCON1_ADDR 0x009F
91 #endif // #ifndef NO_ADDR_DEFINES
93 //==============================================================================
95 // Register Definitions
97 //==============================================================================
99 extern __at(0x0000) __sfr INDF;
100 extern __at(0x0001) __sfr TMR0;
101 extern __at(0x0002) __sfr PCL;
103 //==============================================================================
104 // STATUS Bits
106 extern __at(0x0003) __sfr STATUS;
108 typedef union
110 struct
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;
122 struct
124 unsigned : 5;
125 unsigned RP : 2;
126 unsigned : 1;
128 } __STATUSbits_t;
130 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
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
141 //==============================================================================
143 extern __at(0x0004) __sfr FSR;
145 //==============================================================================
146 // PORTA Bits
148 extern __at(0x0005) __sfr PORTA;
150 typedef union
152 struct
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;
164 struct
166 unsigned RA : 6;
167 unsigned : 2;
169 } __PORTAbits_t;
171 extern __at(0x0005) volatile __PORTAbits_t PORTAbits;
173 #define _RA0 0x01
174 #define _RA1 0x02
175 #define _RA2 0x04
176 #define _RA3 0x08
177 #define _RA4 0x10
178 #define _RA5 0x20
180 //==============================================================================
183 //==============================================================================
184 // PORTB Bits
186 extern __at(0x0006) __sfr PORTB;
188 typedef struct
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;
200 extern __at(0x0006) volatile __PORTBbits_t PORTBbits;
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
211 //==============================================================================
214 //==============================================================================
215 // PORTC Bits
217 extern __at(0x0007) __sfr PORTC;
219 typedef struct
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;
231 extern __at(0x0007) volatile __PORTCbits_t PORTCbits;
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
242 //==============================================================================
245 //==============================================================================
246 // PORTD Bits
248 extern __at(0x0008) __sfr PORTD;
250 typedef struct
252 unsigned RD0 : 1;
253 unsigned RD1 : 1;
254 unsigned RD2 : 1;
255 unsigned RD3 : 1;
256 unsigned RD4 : 1;
257 unsigned RD5 : 1;
258 unsigned RD6 : 1;
259 unsigned RD7 : 1;
260 } __PORTDbits_t;
262 extern __at(0x0008) volatile __PORTDbits_t PORTDbits;
264 #define _RD0 0x01
265 #define _RD1 0x02
266 #define _RD2 0x04
267 #define _RD3 0x08
268 #define _RD4 0x10
269 #define _RD5 0x20
270 #define _RD6 0x40
271 #define _RD7 0x80
273 //==============================================================================
276 //==============================================================================
277 // PORTE Bits
279 extern __at(0x0009) __sfr PORTE;
281 typedef union
283 struct
285 unsigned RE0 : 1;
286 unsigned RE1 : 1;
287 unsigned RE2 : 1;
288 unsigned : 1;
289 unsigned : 1;
290 unsigned : 1;
291 unsigned : 1;
292 unsigned : 1;
295 struct
297 unsigned RE : 3;
298 unsigned : 5;
300 } __PORTEbits_t;
302 extern __at(0x0009) volatile __PORTEbits_t PORTEbits;
304 #define _RE0 0x01
305 #define _RE1 0x02
306 #define _RE2 0x04
308 //==============================================================================
310 extern __at(0x000A) __sfr PCLATH;
312 //==============================================================================
313 // INTCON Bits
315 extern __at(0x000B) __sfr INTCON;
317 typedef struct
319 unsigned RBIF : 1;
320 unsigned INTF : 1;
321 unsigned T0IF : 1;
322 unsigned RBIE : 1;
323 unsigned INTE : 1;
324 unsigned T0IE : 1;
325 unsigned PEIE : 1;
326 unsigned GIE : 1;
327 } __INTCONbits_t;
329 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
331 #define _RBIF 0x01
332 #define _INTF 0x02
333 #define _T0IF 0x04
334 #define _RBIE 0x08
335 #define _INTE 0x10
336 #define _T0IE 0x20
337 #define _PEIE 0x40
338 #define _GIE 0x80
340 //==============================================================================
343 //==============================================================================
344 // PIR1 Bits
346 extern __at(0x000C) __sfr PIR1;
348 typedef struct
350 unsigned TMR1IF : 1;
351 unsigned TMR2IF : 1;
352 unsigned CCP1IF : 1;
353 unsigned SSPIF : 1;
354 unsigned TXIF : 1;
355 unsigned RCIF : 1;
356 unsigned ADIF : 1;
357 unsigned PSPIF : 1;
358 } __PIR1bits_t;
360 extern __at(0x000C) volatile __PIR1bits_t PIR1bits;
362 #define _TMR1IF 0x01
363 #define _TMR2IF 0x02
364 #define _CCP1IF 0x04
365 #define _SSPIF 0x08
366 #define _TXIF 0x10
367 #define _RCIF 0x20
368 #define _ADIF 0x40
369 #define _PSPIF 0x80
371 //==============================================================================
374 //==============================================================================
375 // PIR2 Bits
377 extern __at(0x000D) __sfr PIR2;
379 typedef struct
381 unsigned CCP2IF : 1;
382 unsigned : 1;
383 unsigned : 1;
384 unsigned BCLIF : 1;
385 unsigned : 1;
386 unsigned : 1;
387 unsigned : 1;
388 unsigned LVDIF : 1;
389 } __PIR2bits_t;
391 extern __at(0x000D) volatile __PIR2bits_t PIR2bits;
393 #define _CCP2IF 0x01
394 #define _BCLIF 0x08
395 #define _LVDIF 0x80
397 //==============================================================================
399 extern __at(0x000E) __sfr TMR1;
400 extern __at(0x000E) __sfr TMR1L;
401 extern __at(0x000F) __sfr TMR1H;
403 //==============================================================================
404 // T1CON Bits
406 extern __at(0x0010) __sfr T1CON;
408 typedef union
410 struct
412 unsigned TMR1ON : 1;
413 unsigned TMR1CS : 1;
414 unsigned NOT_T1SYNC : 1;
415 unsigned T1OSCEN : 1;
416 unsigned T1CKPS0 : 1;
417 unsigned T1CKPS1 : 1;
418 unsigned : 1;
419 unsigned : 1;
422 struct
424 unsigned : 1;
425 unsigned : 1;
426 unsigned T1INSYNC : 1;
427 unsigned : 1;
428 unsigned : 1;
429 unsigned : 1;
430 unsigned : 1;
431 unsigned : 1;
434 struct
436 unsigned : 1;
437 unsigned : 1;
438 unsigned T1SYNC : 1;
439 unsigned : 1;
440 unsigned : 1;
441 unsigned : 1;
442 unsigned : 1;
443 unsigned : 1;
446 struct
448 unsigned : 4;
449 unsigned T1CKPS : 2;
450 unsigned : 2;
452 } __T1CONbits_t;
454 extern __at(0x0010) volatile __T1CONbits_t T1CONbits;
456 #define _TMR1ON 0x01
457 #define _TMR1CS 0x02
458 #define _NOT_T1SYNC 0x04
459 #define _T1INSYNC 0x04
460 #define _T1SYNC 0x04
461 #define _T1OSCEN 0x08
462 #define _T1CKPS0 0x10
463 #define _T1CKPS1 0x20
465 //==============================================================================
467 extern __at(0x0011) __sfr TMR2;
469 //==============================================================================
470 // T2CON Bits
472 extern __at(0x0012) __sfr T2CON;
474 typedef union
476 struct
478 unsigned T2CKPS0 : 1;
479 unsigned T2CKPS1 : 1;
480 unsigned TMR2ON : 1;
481 unsigned TOUTPS0 : 1;
482 unsigned TOUTPS1 : 1;
483 unsigned TOUTPS2 : 1;
484 unsigned TOUTPS3 : 1;
485 unsigned : 1;
488 struct
490 unsigned T2CKPS : 2;
491 unsigned : 6;
494 struct
496 unsigned : 3;
497 unsigned TOUTPS : 4;
498 unsigned : 1;
500 } __T2CONbits_t;
502 extern __at(0x0012) volatile __T2CONbits_t T2CONbits;
504 #define _T2CKPS0 0x01
505 #define _T2CKPS1 0x02
506 #define _TMR2ON 0x04
507 #define _TOUTPS0 0x08
508 #define _TOUTPS1 0x10
509 #define _TOUTPS2 0x20
510 #define _TOUTPS3 0x40
512 //==============================================================================
514 extern __at(0x0013) __sfr SSPBUF;
516 //==============================================================================
517 // SSPCON Bits
519 extern __at(0x0014) __sfr SSPCON;
521 typedef union
523 struct
525 unsigned SSPM0 : 1;
526 unsigned SSPM1 : 1;
527 unsigned SSPM2 : 1;
528 unsigned SSPM3 : 1;
529 unsigned CKP : 1;
530 unsigned SSPEN : 1;
531 unsigned SSPOV : 1;
532 unsigned WCOL : 1;
535 struct
537 unsigned SSPM : 4;
538 unsigned : 4;
540 } __SSPCONbits_t;
542 extern __at(0x0014) volatile __SSPCONbits_t SSPCONbits;
544 #define _SSPM0 0x01
545 #define _SSPM1 0x02
546 #define _SSPM2 0x04
547 #define _SSPM3 0x08
548 #define _CKP 0x10
549 #define _SSPEN 0x20
550 #define _SSPOV 0x40
551 #define _WCOL 0x80
553 //==============================================================================
555 extern __at(0x0015) __sfr CCPR1;
556 extern __at(0x0015) __sfr CCPR1L;
557 extern __at(0x0016) __sfr CCPR1H;
559 //==============================================================================
560 // CCP1CON Bits
562 extern __at(0x0017) __sfr CCP1CON;
564 typedef union
566 struct
568 unsigned CCP1M0 : 1;
569 unsigned CCP1M1 : 1;
570 unsigned CCP1M2 : 1;
571 unsigned CCP1M3 : 1;
572 unsigned DC1B0 : 1;
573 unsigned DC1B1 : 1;
574 unsigned : 1;
575 unsigned : 1;
578 struct
580 unsigned : 1;
581 unsigned : 1;
582 unsigned : 1;
583 unsigned : 1;
584 unsigned CCP1Y : 1;
585 unsigned CCP1X : 1;
586 unsigned : 1;
587 unsigned : 1;
590 struct
592 unsigned CCP1M : 4;
593 unsigned : 4;
596 struct
598 unsigned : 4;
599 unsigned DC1B : 2;
600 unsigned : 2;
602 } __CCP1CONbits_t;
604 extern __at(0x0017) volatile __CCP1CONbits_t CCP1CONbits;
606 #define _CCP1M0 0x01
607 #define _CCP1M1 0x02
608 #define _CCP1M2 0x04
609 #define _CCP1M3 0x08
610 #define _DC1B0 0x10
611 #define _CCP1Y 0x10
612 #define _DC1B1 0x20
613 #define _CCP1X 0x20
615 //==============================================================================
618 //==============================================================================
619 // RCSTA Bits
621 extern __at(0x0018) __sfr RCSTA;
623 typedef union
625 struct
627 unsigned RX9D : 1;
628 unsigned OERR : 1;
629 unsigned FERR : 1;
630 unsigned ADDEN : 1;
631 unsigned CREN : 1;
632 unsigned SREN : 1;
633 unsigned RX9 : 1;
634 unsigned SPEN : 1;
637 struct
639 unsigned RCD8 : 1;
640 unsigned : 1;
641 unsigned : 1;
642 unsigned : 1;
643 unsigned : 1;
644 unsigned : 1;
645 unsigned RC9 : 1;
646 unsigned : 1;
649 struct
651 unsigned : 1;
652 unsigned : 1;
653 unsigned : 1;
654 unsigned : 1;
655 unsigned : 1;
656 unsigned : 1;
657 unsigned NOT_RC8 : 1;
658 unsigned : 1;
661 struct
663 unsigned : 1;
664 unsigned : 1;
665 unsigned : 1;
666 unsigned : 1;
667 unsigned : 1;
668 unsigned : 1;
669 unsigned RC8_9 : 1;
670 unsigned : 1;
672 } __RCSTAbits_t;
674 extern __at(0x0018) volatile __RCSTAbits_t RCSTAbits;
676 #define _RX9D 0x01
677 #define _RCD8 0x01
678 #define _OERR 0x02
679 #define _FERR 0x04
680 #define _ADDEN 0x08
681 #define _CREN 0x10
682 #define _SREN 0x20
683 #define _RX9 0x40
684 #define _RC9 0x40
685 #define _NOT_RC8 0x40
686 #define _RC8_9 0x40
687 #define _SPEN 0x80
689 //==============================================================================
691 extern __at(0x0019) __sfr TXREG;
692 extern __at(0x001A) __sfr RCREG;
693 extern __at(0x001B) __sfr CCPR2;
694 extern __at(0x001B) __sfr CCPR2L;
695 extern __at(0x001C) __sfr CCPR2H;
697 //==============================================================================
698 // CCP2CON Bits
700 extern __at(0x001D) __sfr CCP2CON;
702 typedef union
704 struct
706 unsigned CCP2M0 : 1;
707 unsigned CCP2M1 : 1;
708 unsigned CCP2M2 : 1;
709 unsigned CCP2M3 : 1;
710 unsigned CCP2Y : 1;
711 unsigned CCP2X : 1;
712 unsigned : 1;
713 unsigned : 1;
716 struct
718 unsigned CCP2M : 4;
719 unsigned : 4;
721 } __CCP2CONbits_t;
723 extern __at(0x001D) volatile __CCP2CONbits_t CCP2CONbits;
725 #define _CCP2M0 0x01
726 #define _CCP2M1 0x02
727 #define _CCP2M2 0x04
728 #define _CCP2M3 0x08
729 #define _CCP2Y 0x10
730 #define _CCP2X 0x20
732 //==============================================================================
734 extern __at(0x001E) __sfr ADRESH;
736 //==============================================================================
737 // ADCON0 Bits
739 extern __at(0x001F) __sfr ADCON0;
741 typedef union
743 struct
745 unsigned ADON : 1;
746 unsigned CHS3 : 1;
747 unsigned GO_NOT_DONE : 1;
748 unsigned CHS0 : 1;
749 unsigned CHS1 : 1;
750 unsigned CHS2 : 1;
751 unsigned ADCS0 : 1;
752 unsigned ADCS1 : 1;
755 struct
757 unsigned : 1;
758 unsigned : 1;
759 unsigned GO : 1;
760 unsigned : 1;
761 unsigned : 1;
762 unsigned : 1;
763 unsigned : 1;
764 unsigned : 1;
767 struct
769 unsigned : 1;
770 unsigned : 1;
771 unsigned NOT_DONE : 1;
772 unsigned : 1;
773 unsigned : 1;
774 unsigned : 1;
775 unsigned : 1;
776 unsigned : 1;
779 struct
781 unsigned : 1;
782 unsigned : 1;
783 unsigned GO_DONE : 1;
784 unsigned : 1;
785 unsigned : 1;
786 unsigned : 1;
787 unsigned : 1;
788 unsigned : 1;
791 struct
793 unsigned : 6;
794 unsigned ADCS : 2;
796 } __ADCON0bits_t;
798 extern __at(0x001F) volatile __ADCON0bits_t ADCON0bits;
800 #define _ADON 0x01
801 #define _CHS3 0x02
802 #define _GO_NOT_DONE 0x04
803 #define _GO 0x04
804 #define _NOT_DONE 0x04
805 #define _GO_DONE 0x04
806 #define _CHS0 0x08
807 #define _CHS1 0x10
808 #define _CHS2 0x20
809 #define _ADCS0 0x40
810 #define _ADCS1 0x80
812 //==============================================================================
815 //==============================================================================
816 // OPTION_REG Bits
818 extern __at(0x0081) __sfr OPTION_REG;
820 typedef union
822 struct
824 unsigned PS0 : 1;
825 unsigned PS1 : 1;
826 unsigned PS2 : 1;
827 unsigned PSA : 1;
828 unsigned T0SE : 1;
829 unsigned T0CS : 1;
830 unsigned INTEDG : 1;
831 unsigned NOT_RBPU : 1;
834 struct
836 unsigned PS : 3;
837 unsigned : 5;
839 } __OPTION_REGbits_t;
841 extern __at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits;
843 #define _PS0 0x01
844 #define _PS1 0x02
845 #define _PS2 0x04
846 #define _PSA 0x08
847 #define _T0SE 0x10
848 #define _T0CS 0x20
849 #define _INTEDG 0x40
850 #define _NOT_RBPU 0x80
852 //==============================================================================
855 //==============================================================================
856 // TRISA Bits
858 extern __at(0x0085) __sfr TRISA;
860 typedef union
862 struct
864 unsigned TRISA0 : 1;
865 unsigned TRISA1 : 1;
866 unsigned TRISA2 : 1;
867 unsigned TRISA3 : 1;
868 unsigned TRISA4 : 1;
869 unsigned TRISA5 : 1;
870 unsigned : 1;
871 unsigned : 1;
874 struct
876 unsigned TRISA : 6;
877 unsigned : 2;
879 } __TRISAbits_t;
881 extern __at(0x0085) volatile __TRISAbits_t TRISAbits;
883 #define _TRISA0 0x01
884 #define _TRISA1 0x02
885 #define _TRISA2 0x04
886 #define _TRISA3 0x08
887 #define _TRISA4 0x10
888 #define _TRISA5 0x20
890 //==============================================================================
893 //==============================================================================
894 // TRISB Bits
896 extern __at(0x0086) __sfr TRISB;
898 typedef struct
900 unsigned TRISB0 : 1;
901 unsigned TRISB1 : 1;
902 unsigned TRISB2 : 1;
903 unsigned TRISB3 : 1;
904 unsigned TRISB4 : 1;
905 unsigned TRISB5 : 1;
906 unsigned TRISB6 : 1;
907 unsigned TRISB7 : 1;
908 } __TRISBbits_t;
910 extern __at(0x0086) volatile __TRISBbits_t TRISBbits;
912 #define _TRISB0 0x01
913 #define _TRISB1 0x02
914 #define _TRISB2 0x04
915 #define _TRISB3 0x08
916 #define _TRISB4 0x10
917 #define _TRISB5 0x20
918 #define _TRISB6 0x40
919 #define _TRISB7 0x80
921 //==============================================================================
924 //==============================================================================
925 // TRISC Bits
927 extern __at(0x0087) __sfr TRISC;
929 typedef struct
931 unsigned TRISC0 : 1;
932 unsigned TRISC1 : 1;
933 unsigned TRISC2 : 1;
934 unsigned TRISC3 : 1;
935 unsigned TRISC4 : 1;
936 unsigned TRISC5 : 1;
937 unsigned TRISC6 : 1;
938 unsigned TRISC7 : 1;
939 } __TRISCbits_t;
941 extern __at(0x0087) volatile __TRISCbits_t TRISCbits;
943 #define _TRISC0 0x01
944 #define _TRISC1 0x02
945 #define _TRISC2 0x04
946 #define _TRISC3 0x08
947 #define _TRISC4 0x10
948 #define _TRISC5 0x20
949 #define _TRISC6 0x40
950 #define _TRISC7 0x80
952 //==============================================================================
955 //==============================================================================
956 // TRISD Bits
958 extern __at(0x0088) __sfr TRISD;
960 typedef struct
962 unsigned TRISD0 : 1;
963 unsigned TRISD1 : 1;
964 unsigned TRISD2 : 1;
965 unsigned TRISD3 : 1;
966 unsigned TRISD4 : 1;
967 unsigned TRISD5 : 1;
968 unsigned TRISD6 : 1;
969 unsigned TRISD7 : 1;
970 } __TRISDbits_t;
972 extern __at(0x0088) volatile __TRISDbits_t TRISDbits;
974 #define _TRISD0 0x01
975 #define _TRISD1 0x02
976 #define _TRISD2 0x04
977 #define _TRISD3 0x08
978 #define _TRISD4 0x10
979 #define _TRISD5 0x20
980 #define _TRISD6 0x40
981 #define _TRISD7 0x80
983 //==============================================================================
986 //==============================================================================
987 // TRISE Bits
989 extern __at(0x0089) __sfr TRISE;
991 typedef union
993 struct
995 unsigned TRISE0 : 1;
996 unsigned TRISE1 : 1;
997 unsigned TRISE2 : 1;
998 unsigned : 1;
999 unsigned PSPMODE : 1;
1000 unsigned IBOV : 1;
1001 unsigned OBF : 1;
1002 unsigned IBF : 1;
1005 struct
1007 unsigned TRISE : 3;
1008 unsigned : 5;
1010 } __TRISEbits_t;
1012 extern __at(0x0089) volatile __TRISEbits_t TRISEbits;
1014 #define _TRISE0 0x01
1015 #define _TRISE1 0x02
1016 #define _TRISE2 0x04
1017 #define _PSPMODE 0x10
1018 #define _IBOV 0x20
1019 #define _OBF 0x40
1020 #define _IBF 0x80
1022 //==============================================================================
1025 //==============================================================================
1026 // PIE1 Bits
1028 extern __at(0x008C) __sfr PIE1;
1030 typedef struct
1032 unsigned TMR1IE : 1;
1033 unsigned TMR2IE : 1;
1034 unsigned CCP1IE : 1;
1035 unsigned SSPIE : 1;
1036 unsigned TXIE : 1;
1037 unsigned RCIE : 1;
1038 unsigned ADIE : 1;
1039 unsigned PSPIE : 1;
1040 } __PIE1bits_t;
1042 extern __at(0x008C) volatile __PIE1bits_t PIE1bits;
1044 #define _TMR1IE 0x01
1045 #define _TMR2IE 0x02
1046 #define _CCP1IE 0x04
1047 #define _SSPIE 0x08
1048 #define _TXIE 0x10
1049 #define _RCIE 0x20
1050 #define _ADIE 0x40
1051 #define _PSPIE 0x80
1053 //==============================================================================
1056 //==============================================================================
1057 // PIE2 Bits
1059 extern __at(0x008D) __sfr PIE2;
1061 typedef struct
1063 unsigned CCP2IE : 1;
1064 unsigned : 1;
1065 unsigned : 1;
1066 unsigned BCLIE : 1;
1067 unsigned : 1;
1068 unsigned : 1;
1069 unsigned : 1;
1070 unsigned LVDIE : 1;
1071 } __PIE2bits_t;
1073 extern __at(0x008D) volatile __PIE2bits_t PIE2bits;
1075 #define _CCP2IE 0x01
1076 #define _BCLIE 0x08
1077 #define _LVDIE 0x80
1079 //==============================================================================
1082 //==============================================================================
1083 // PCON Bits
1085 extern __at(0x008E) __sfr PCON;
1087 typedef union
1089 struct
1091 unsigned NOT_BOR : 1;
1092 unsigned NOT_POR : 1;
1093 unsigned : 1;
1094 unsigned : 1;
1095 unsigned : 1;
1096 unsigned : 1;
1097 unsigned : 1;
1098 unsigned : 1;
1101 struct
1103 unsigned NOT_BO : 1;
1104 unsigned : 1;
1105 unsigned : 1;
1106 unsigned : 1;
1107 unsigned : 1;
1108 unsigned : 1;
1109 unsigned : 1;
1110 unsigned : 1;
1112 } __PCONbits_t;
1114 extern __at(0x008E) volatile __PCONbits_t PCONbits;
1116 #define _NOT_BOR 0x01
1117 #define _NOT_BO 0x01
1118 #define _NOT_POR 0x02
1120 //==============================================================================
1123 //==============================================================================
1124 // SSPCON2 Bits
1126 extern __at(0x0091) __sfr SSPCON2;
1128 typedef struct
1130 unsigned SEN : 1;
1131 unsigned RSEN : 1;
1132 unsigned PEN : 1;
1133 unsigned RCEN : 1;
1134 unsigned ACKEN : 1;
1135 unsigned ACKDT : 1;
1136 unsigned ACKSTAT : 1;
1137 unsigned GCEN : 1;
1138 } __SSPCON2bits_t;
1140 extern __at(0x0091) volatile __SSPCON2bits_t SSPCON2bits;
1142 #define _SEN 0x01
1143 #define _RSEN 0x02
1144 #define _PEN 0x04
1145 #define _RCEN 0x08
1146 #define _ACKEN 0x10
1147 #define _ACKDT 0x20
1148 #define _ACKSTAT 0x40
1149 #define _GCEN 0x80
1151 //==============================================================================
1153 extern __at(0x0092) __sfr PR2;
1154 extern __at(0x0093) __sfr SSPADD;
1156 //==============================================================================
1157 // SSPSTAT Bits
1159 extern __at(0x0094) __sfr SSPSTAT;
1161 typedef union
1163 struct
1165 unsigned BF : 1;
1166 unsigned UA : 1;
1167 unsigned R_NOT_W : 1;
1168 unsigned S : 1;
1169 unsigned P : 1;
1170 unsigned D_NOT_A : 1;
1171 unsigned CKE : 1;
1172 unsigned SMP : 1;
1175 struct
1177 unsigned : 1;
1178 unsigned : 1;
1179 unsigned R : 1;
1180 unsigned I2C_START : 1;
1181 unsigned I2C_STOP : 1;
1182 unsigned D : 1;
1183 unsigned : 1;
1184 unsigned : 1;
1187 struct
1189 unsigned : 1;
1190 unsigned : 1;
1191 unsigned I2C_READ : 1;
1192 unsigned : 1;
1193 unsigned : 1;
1194 unsigned I2C_DATA : 1;
1195 unsigned : 1;
1196 unsigned : 1;
1199 struct
1201 unsigned : 1;
1202 unsigned : 1;
1203 unsigned R_W : 1;
1204 unsigned : 1;
1205 unsigned : 1;
1206 unsigned D_A : 1;
1207 unsigned : 1;
1208 unsigned : 1;
1211 struct
1213 unsigned : 1;
1214 unsigned : 1;
1215 unsigned READ_WRITE : 1;
1216 unsigned : 1;
1217 unsigned : 1;
1218 unsigned DATA_ADDRESS : 1;
1219 unsigned : 1;
1220 unsigned : 1;
1223 struct
1225 unsigned : 1;
1226 unsigned : 1;
1227 unsigned NOT_W : 1;
1228 unsigned : 1;
1229 unsigned : 1;
1230 unsigned NOT_A : 1;
1231 unsigned : 1;
1232 unsigned : 1;
1235 struct
1237 unsigned : 1;
1238 unsigned : 1;
1239 unsigned NOT_WRITE : 1;
1240 unsigned : 1;
1241 unsigned : 1;
1242 unsigned NOT_ADDRESS : 1;
1243 unsigned : 1;
1244 unsigned : 1;
1246 } __SSPSTATbits_t;
1248 extern __at(0x0094) volatile __SSPSTATbits_t SSPSTATbits;
1250 #define _BF 0x01
1251 #define _UA 0x02
1252 #define _R_NOT_W 0x04
1253 #define _R 0x04
1254 #define _I2C_READ 0x04
1255 #define _R_W 0x04
1256 #define _READ_WRITE 0x04
1257 #define _NOT_W 0x04
1258 #define _NOT_WRITE 0x04
1259 #define _S 0x08
1260 #define _I2C_START 0x08
1261 #define _P 0x10
1262 #define _I2C_STOP 0x10
1263 #define _D_NOT_A 0x20
1264 #define _D 0x20
1265 #define _I2C_DATA 0x20
1266 #define _D_A 0x20
1267 #define _DATA_ADDRESS 0x20
1268 #define _NOT_A 0x20
1269 #define _NOT_ADDRESS 0x20
1270 #define _CKE 0x40
1271 #define _SMP 0x80
1273 //==============================================================================
1276 //==============================================================================
1277 // TXSTA Bits
1279 extern __at(0x0098) __sfr TXSTA;
1281 typedef union
1283 struct
1285 unsigned TX9D : 1;
1286 unsigned TRMT : 1;
1287 unsigned BRGH : 1;
1288 unsigned : 1;
1289 unsigned SYNC : 1;
1290 unsigned TXEN : 1;
1291 unsigned TX9 : 1;
1292 unsigned CSRC : 1;
1295 struct
1297 unsigned TXD8 : 1;
1298 unsigned : 1;
1299 unsigned : 1;
1300 unsigned : 1;
1301 unsigned : 1;
1302 unsigned : 1;
1303 unsigned NOT_TX8 : 1;
1304 unsigned : 1;
1307 struct
1309 unsigned : 1;
1310 unsigned : 1;
1311 unsigned : 1;
1312 unsigned : 1;
1313 unsigned : 1;
1314 unsigned : 1;
1315 unsigned TX8_9 : 1;
1316 unsigned : 1;
1318 } __TXSTAbits_t;
1320 extern __at(0x0098) volatile __TXSTAbits_t TXSTAbits;
1322 #define _TX9D 0x01
1323 #define _TXD8 0x01
1324 #define _TRMT 0x02
1325 #define _BRGH 0x04
1326 #define _SYNC 0x10
1327 #define _TXEN 0x20
1328 #define _TX9 0x40
1329 #define _NOT_TX8 0x40
1330 #define _TX8_9 0x40
1331 #define _CSRC 0x80
1333 //==============================================================================
1335 extern __at(0x0099) __sfr SPBRG;
1337 //==============================================================================
1338 // REFCON Bits
1340 extern __at(0x009B) __sfr REFCON;
1342 typedef struct
1344 unsigned : 1;
1345 unsigned : 1;
1346 unsigned : 1;
1347 unsigned : 1;
1348 unsigned VRLOEN : 1;
1349 unsigned VRHOEN : 1;
1350 unsigned VRLEN : 1;
1351 unsigned VRHEN : 1;
1352 } __REFCONbits_t;
1354 extern __at(0x009B) volatile __REFCONbits_t REFCONbits;
1356 #define _VRLOEN 0x10
1357 #define _VRHOEN 0x20
1358 #define _VRLEN 0x40
1359 #define _VRHEN 0x80
1361 //==============================================================================
1364 //==============================================================================
1365 // LVDCON Bits
1367 extern __at(0x009C) __sfr LVDCON;
1369 typedef union
1371 struct
1373 unsigned LV0 : 1;
1374 unsigned LV1 : 1;
1375 unsigned LV2 : 1;
1376 unsigned LV3 : 1;
1377 unsigned LVDEN : 1;
1378 unsigned BGST : 1;
1379 unsigned : 1;
1380 unsigned : 1;
1383 struct
1385 unsigned LV : 4;
1386 unsigned : 4;
1388 } __LVDCONbits_t;
1390 extern __at(0x009C) volatile __LVDCONbits_t LVDCONbits;
1392 #define _LV0 0x01
1393 #define _LV1 0x02
1394 #define _LV2 0x04
1395 #define _LV3 0x08
1396 #define _LVDEN 0x10
1397 #define _BGST 0x20
1399 //==============================================================================
1401 extern __at(0x009E) __sfr ADRESL;
1403 //==============================================================================
1404 // ADCON1 Bits
1406 extern __at(0x009F) __sfr ADCON1;
1408 typedef union
1410 struct
1412 unsigned PCFG0 : 1;
1413 unsigned PCFG1 : 1;
1414 unsigned PCFG2 : 1;
1415 unsigned PCFG3 : 1;
1416 unsigned VCFG0 : 1;
1417 unsigned VCFG1 : 1;
1418 unsigned VCFG2 : 1;
1419 unsigned ADFM : 1;
1422 struct
1424 unsigned PCFG : 4;
1425 unsigned : 4;
1428 struct
1430 unsigned : 4;
1431 unsigned VCFG : 3;
1432 unsigned : 1;
1434 } __ADCON1bits_t;
1436 extern __at(0x009F) volatile __ADCON1bits_t ADCON1bits;
1438 #define _PCFG0 0x01
1439 #define _PCFG1 0x02
1440 #define _PCFG2 0x04
1441 #define _PCFG3 0x08
1442 #define _VCFG0 0x10
1443 #define _VCFG1 0x20
1444 #define _VCFG2 0x40
1445 #define _ADFM 0x80
1447 //==============================================================================
1450 //==============================================================================
1452 // Configuration Bits
1454 //==============================================================================
1456 #define _CONFIG 0x2007
1458 //----------------------------- CONFIG Options -------------------------------
1460 #define _FOSC_LP 0x3FFC // LP oscillator.
1461 #define _LP_OSC 0x3FFC // LP oscillator.
1462 #define _FOSC_XT 0x3FFD // XT oscillator.
1463 #define _XT_OSC 0x3FFD // XT oscillator.
1464 #define _FOSC_HS 0x3FFE // HS oscillator.
1465 #define _HS_OSC 0x3FFE // HS oscillator.
1466 #define _FOSC_RC 0x3FFF // RC oscillator.
1467 #define _RC_OSC 0x3FFF // RC oscillator.
1468 #define _WDTE_OFF 0x3FFB // WDT disabled.
1469 #define _WDT_OFF 0x3FFB // WDT disabled.
1470 #define _WDTE_ON 0x3FFF // WDT enabled.
1471 #define _WDT_ON 0x3FFF // WDT enabled.
1472 #define _PWRTE_ON 0x3FF7 // PWRT enabled.
1473 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
1474 #define _CP_ALL 0x0CCF // All memory is code protected.
1475 #define _CP_75 0x1DDF // 0400h-0FFFh code protected.
1476 #define _CP_50 0x2EEF // 0800h-0FFFh code protected.
1477 #define _CP_OFF 0x3FFF // Code protection off.
1478 #define _BOREN_OFF 0x3FBF // BOR disabled.
1479 #define _BODEN_OFF 0x3FBF // BOR disabled.
1480 #define _BOREN_ON 0x3FFF // BOR enabled.
1481 #define _BODEN_ON 0x3FFF // BOR enabled.
1482 #define _BODENV_45 0x33FF // VBOR set to 4.5V.
1483 #define _VBOR_45 0x33FF // VBOR set to 4.5V.
1484 #define _BODENV_42 0x37FF // VBOR set to 4.2V.
1485 #define _VBOR_42 0x37FF // VBOR set to 4.2V.
1486 #define _BODENV_27 0x3BFF // VBOR set to 2.7V.
1487 #define _VBOR_27 0x3BFF // VBOR set to 2.7V.
1488 #define _BODENV_25 0x3FFF // VBOR set to 2.5V.
1489 #define _VBOR_25 0x3FFF // VBOR set to 2.5V.
1491 //==============================================================================
1493 #define _IDLOC0 0x2000
1494 #define _IDLOC1 0x2001
1495 #define _IDLOC2 0x2002
1496 #define _IDLOC3 0x2003
1498 //==============================================================================
1500 #ifndef NO_BIT_DEFINES
1502 #define ADON ADCON0bits.ADON // bit 0
1503 #define CHS3 ADCON0bits.CHS3 // bit 1
1504 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 2, shadows bit in ADCON0bits
1505 #define GO ADCON0bits.GO // bit 2, shadows bit in ADCON0bits
1506 #define NOT_DONE ADCON0bits.NOT_DONE // bit 2, shadows bit in ADCON0bits
1507 #define GO_DONE ADCON0bits.GO_DONE // bit 2, shadows bit in ADCON0bits
1508 #define CHS0 ADCON0bits.CHS0 // bit 3
1509 #define CHS1 ADCON0bits.CHS1 // bit 4
1510 #define CHS2 ADCON0bits.CHS2 // bit 5
1511 #define ADCS0 ADCON0bits.ADCS0 // bit 6
1512 #define ADCS1 ADCON0bits.ADCS1 // bit 7
1514 #define PCFG0 ADCON1bits.PCFG0 // bit 0
1515 #define PCFG1 ADCON1bits.PCFG1 // bit 1
1516 #define PCFG2 ADCON1bits.PCFG2 // bit 2
1517 #define PCFG3 ADCON1bits.PCFG3 // bit 3
1518 #define VCFG0 ADCON1bits.VCFG0 // bit 4
1519 #define VCFG1 ADCON1bits.VCFG1 // bit 5
1520 #define VCFG2 ADCON1bits.VCFG2 // bit 6
1521 #define ADFM ADCON1bits.ADFM // bit 7
1523 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
1524 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
1525 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
1526 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
1527 #define DC1B0 CCP1CONbits.DC1B0 // bit 4, shadows bit in CCP1CONbits
1528 #define CCP1Y CCP1CONbits.CCP1Y // bit 4, shadows bit in CCP1CONbits
1529 #define DC1B1 CCP1CONbits.DC1B1 // bit 5, shadows bit in CCP1CONbits
1530 #define CCP1X CCP1CONbits.CCP1X // bit 5, shadows bit in CCP1CONbits
1532 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
1533 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
1534 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
1535 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
1536 #define CCP2Y CCP2CONbits.CCP2Y // bit 4
1537 #define CCP2X CCP2CONbits.CCP2X // bit 5
1539 #define RBIF INTCONbits.RBIF // bit 0
1540 #define INTF INTCONbits.INTF // bit 1
1541 #define T0IF INTCONbits.T0IF // bit 2
1542 #define RBIE INTCONbits.RBIE // bit 3
1543 #define INTE INTCONbits.INTE // bit 4
1544 #define T0IE INTCONbits.T0IE // bit 5
1545 #define PEIE INTCONbits.PEIE // bit 6
1546 #define GIE INTCONbits.GIE // bit 7
1548 #define LV0 LVDCONbits.LV0 // bit 0
1549 #define LV1 LVDCONbits.LV1 // bit 1
1550 #define LV2 LVDCONbits.LV2 // bit 2
1551 #define LV3 LVDCONbits.LV3 // bit 3
1552 #define LVDEN LVDCONbits.LVDEN // bit 4
1553 #define BGST LVDCONbits.BGST // bit 5
1555 #define PS0 OPTION_REGbits.PS0 // bit 0
1556 #define PS1 OPTION_REGbits.PS1 // bit 1
1557 #define PS2 OPTION_REGbits.PS2 // bit 2
1558 #define PSA OPTION_REGbits.PSA // bit 3
1559 #define T0SE OPTION_REGbits.T0SE // bit 4
1560 #define T0CS OPTION_REGbits.T0CS // bit 5
1561 #define INTEDG OPTION_REGbits.INTEDG // bit 6
1562 #define NOT_RBPU OPTION_REGbits.NOT_RBPU // bit 7
1564 #define NOT_BOR PCONbits.NOT_BOR // bit 0, shadows bit in PCONbits
1565 #define NOT_BO PCONbits.NOT_BO // bit 0, shadows bit in PCONbits
1566 #define NOT_POR PCONbits.NOT_POR // bit 1
1568 #define TMR1IE PIE1bits.TMR1IE // bit 0
1569 #define TMR2IE PIE1bits.TMR2IE // bit 1
1570 #define CCP1IE PIE1bits.CCP1IE // bit 2
1571 #define SSPIE PIE1bits.SSPIE // bit 3
1572 #define TXIE PIE1bits.TXIE // bit 4
1573 #define RCIE PIE1bits.RCIE // bit 5
1574 #define ADIE PIE1bits.ADIE // bit 6
1575 #define PSPIE PIE1bits.PSPIE // bit 7
1577 #define CCP2IE PIE2bits.CCP2IE // bit 0
1578 #define BCLIE PIE2bits.BCLIE // bit 3
1579 #define LVDIE PIE2bits.LVDIE // bit 7
1581 #define TMR1IF PIR1bits.TMR1IF // bit 0
1582 #define TMR2IF PIR1bits.TMR2IF // bit 1
1583 #define CCP1IF PIR1bits.CCP1IF // bit 2
1584 #define SSPIF PIR1bits.SSPIF // bit 3
1585 #define TXIF PIR1bits.TXIF // bit 4
1586 #define RCIF PIR1bits.RCIF // bit 5
1587 #define ADIF PIR1bits.ADIF // bit 6
1588 #define PSPIF PIR1bits.PSPIF // bit 7
1590 #define CCP2IF PIR2bits.CCP2IF // bit 0
1591 #define BCLIF PIR2bits.BCLIF // bit 3
1592 #define LVDIF PIR2bits.LVDIF // bit 7
1594 #define RA0 PORTAbits.RA0 // bit 0
1595 #define RA1 PORTAbits.RA1 // bit 1
1596 #define RA2 PORTAbits.RA2 // bit 2
1597 #define RA3 PORTAbits.RA3 // bit 3
1598 #define RA4 PORTAbits.RA4 // bit 4
1599 #define RA5 PORTAbits.RA5 // bit 5
1601 #define RB0 PORTBbits.RB0 // bit 0
1602 #define RB1 PORTBbits.RB1 // bit 1
1603 #define RB2 PORTBbits.RB2 // bit 2
1604 #define RB3 PORTBbits.RB3 // bit 3
1605 #define RB4 PORTBbits.RB4 // bit 4
1606 #define RB5 PORTBbits.RB5 // bit 5
1607 #define RB6 PORTBbits.RB6 // bit 6
1608 #define RB7 PORTBbits.RB7 // bit 7
1610 #define RC0 PORTCbits.RC0 // bit 0
1611 #define RC1 PORTCbits.RC1 // bit 1
1612 #define RC2 PORTCbits.RC2 // bit 2
1613 #define RC3 PORTCbits.RC3 // bit 3
1614 #define RC4 PORTCbits.RC4 // bit 4
1615 #define RC5 PORTCbits.RC5 // bit 5
1616 #define RC6 PORTCbits.RC6 // bit 6
1617 #define RC7 PORTCbits.RC7 // bit 7
1619 #define RD0 PORTDbits.RD0 // bit 0
1620 #define RD1 PORTDbits.RD1 // bit 1
1621 #define RD2 PORTDbits.RD2 // bit 2
1622 #define RD3 PORTDbits.RD3 // bit 3
1623 #define RD4 PORTDbits.RD4 // bit 4
1624 #define RD5 PORTDbits.RD5 // bit 5
1625 #define RD6 PORTDbits.RD6 // bit 6
1626 #define RD7 PORTDbits.RD7 // bit 7
1628 #define RE0 PORTEbits.RE0 // bit 0
1629 #define RE1 PORTEbits.RE1 // bit 1
1630 #define RE2 PORTEbits.RE2 // bit 2
1632 #define RX9D RCSTAbits.RX9D // bit 0, shadows bit in RCSTAbits
1633 #define RCD8 RCSTAbits.RCD8 // bit 0, shadows bit in RCSTAbits
1634 #define OERR RCSTAbits.OERR // bit 1
1635 #define FERR RCSTAbits.FERR // bit 2
1636 #define ADDEN RCSTAbits.ADDEN // bit 3
1637 #define CREN RCSTAbits.CREN // bit 4
1638 #define SREN RCSTAbits.SREN // bit 5
1639 #define RX9 RCSTAbits.RX9 // bit 6, shadows bit in RCSTAbits
1640 #define RC9 RCSTAbits.RC9 // bit 6, shadows bit in RCSTAbits
1641 #define NOT_RC8 RCSTAbits.NOT_RC8 // bit 6, shadows bit in RCSTAbits
1642 #define RC8_9 RCSTAbits.RC8_9 // bit 6, shadows bit in RCSTAbits
1643 #define SPEN RCSTAbits.SPEN // bit 7
1645 #define VRLOEN REFCONbits.VRLOEN // bit 4
1646 #define VRHOEN REFCONbits.VRHOEN // bit 5
1647 #define VRLEN REFCONbits.VRLEN // bit 6
1648 #define VRHEN REFCONbits.VRHEN // bit 7
1650 #define SSPM0 SSPCONbits.SSPM0 // bit 0
1651 #define SSPM1 SSPCONbits.SSPM1 // bit 1
1652 #define SSPM2 SSPCONbits.SSPM2 // bit 2
1653 #define SSPM3 SSPCONbits.SSPM3 // bit 3
1654 #define CKP SSPCONbits.CKP // bit 4
1655 #define SSPEN SSPCONbits.SSPEN // bit 5
1656 #define SSPOV SSPCONbits.SSPOV // bit 6
1657 #define WCOL SSPCONbits.WCOL // bit 7
1659 #define SEN SSPCON2bits.SEN // bit 0
1660 #define RSEN SSPCON2bits.RSEN // bit 1
1661 #define PEN SSPCON2bits.PEN // bit 2
1662 #define RCEN SSPCON2bits.RCEN // bit 3
1663 #define ACKEN SSPCON2bits.ACKEN // bit 4
1664 #define ACKDT SSPCON2bits.ACKDT // bit 5
1665 #define ACKSTAT SSPCON2bits.ACKSTAT // bit 6
1666 #define GCEN SSPCON2bits.GCEN // bit 7
1668 #define BF SSPSTATbits.BF // bit 0
1669 #define UA SSPSTATbits.UA // bit 1
1670 #define R_NOT_W SSPSTATbits.R_NOT_W // bit 2, shadows bit in SSPSTATbits
1671 #define R SSPSTATbits.R // bit 2, shadows bit in SSPSTATbits
1672 #define I2C_READ SSPSTATbits.I2C_READ // bit 2, shadows bit in SSPSTATbits
1673 #define R_W SSPSTATbits.R_W // bit 2, shadows bit in SSPSTATbits
1674 #define READ_WRITE SSPSTATbits.READ_WRITE // bit 2, shadows bit in SSPSTATbits
1675 #define NOT_W SSPSTATbits.NOT_W // bit 2, shadows bit in SSPSTATbits
1676 #define NOT_WRITE SSPSTATbits.NOT_WRITE // bit 2, shadows bit in SSPSTATbits
1677 #define S SSPSTATbits.S // bit 3, shadows bit in SSPSTATbits
1678 #define I2C_START SSPSTATbits.I2C_START // bit 3, shadows bit in SSPSTATbits
1679 #define P SSPSTATbits.P // bit 4, shadows bit in SSPSTATbits
1680 #define I2C_STOP SSPSTATbits.I2C_STOP // bit 4, shadows bit in SSPSTATbits
1681 #define D_NOT_A SSPSTATbits.D_NOT_A // bit 5, shadows bit in SSPSTATbits
1682 #define D SSPSTATbits.D // bit 5, shadows bit in SSPSTATbits
1683 #define I2C_DATA SSPSTATbits.I2C_DATA // bit 5, shadows bit in SSPSTATbits
1684 #define D_A SSPSTATbits.D_A // bit 5, shadows bit in SSPSTATbits
1685 #define DATA_ADDRESS SSPSTATbits.DATA_ADDRESS // bit 5, shadows bit in SSPSTATbits
1686 #define NOT_A SSPSTATbits.NOT_A // bit 5, shadows bit in SSPSTATbits
1687 #define NOT_ADDRESS SSPSTATbits.NOT_ADDRESS // bit 5, shadows bit in SSPSTATbits
1688 #define CKE SSPSTATbits.CKE // bit 6
1689 #define SMP SSPSTATbits.SMP // bit 7
1691 #define C STATUSbits.C // bit 0
1692 #define DC STATUSbits.DC // bit 1
1693 #define Z STATUSbits.Z // bit 2
1694 #define NOT_PD STATUSbits.NOT_PD // bit 3
1695 #define NOT_TO STATUSbits.NOT_TO // bit 4
1696 #define RP0 STATUSbits.RP0 // bit 5
1697 #define RP1 STATUSbits.RP1 // bit 6
1698 #define IRP STATUSbits.IRP // bit 7
1700 #define TMR1ON T1CONbits.TMR1ON // bit 0
1701 #define TMR1CS T1CONbits.TMR1CS // bit 1
1702 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2, shadows bit in T1CONbits
1703 #define T1INSYNC T1CONbits.T1INSYNC // bit 2, shadows bit in T1CONbits
1704 #define T1SYNC T1CONbits.T1SYNC // bit 2, shadows bit in T1CONbits
1705 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
1706 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
1707 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
1709 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
1710 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
1711 #define TMR2ON T2CONbits.TMR2ON // bit 2
1712 #define TOUTPS0 T2CONbits.TOUTPS0 // bit 3
1713 #define TOUTPS1 T2CONbits.TOUTPS1 // bit 4
1714 #define TOUTPS2 T2CONbits.TOUTPS2 // bit 5
1715 #define TOUTPS3 T2CONbits.TOUTPS3 // bit 6
1717 #define TRISA0 TRISAbits.TRISA0 // bit 0
1718 #define TRISA1 TRISAbits.TRISA1 // bit 1
1719 #define TRISA2 TRISAbits.TRISA2 // bit 2
1720 #define TRISA3 TRISAbits.TRISA3 // bit 3
1721 #define TRISA4 TRISAbits.TRISA4 // bit 4
1722 #define TRISA5 TRISAbits.TRISA5 // bit 5
1724 #define TRISB0 TRISBbits.TRISB0 // bit 0
1725 #define TRISB1 TRISBbits.TRISB1 // bit 1
1726 #define TRISB2 TRISBbits.TRISB2 // bit 2
1727 #define TRISB3 TRISBbits.TRISB3 // bit 3
1728 #define TRISB4 TRISBbits.TRISB4 // bit 4
1729 #define TRISB5 TRISBbits.TRISB5 // bit 5
1730 #define TRISB6 TRISBbits.TRISB6 // bit 6
1731 #define TRISB7 TRISBbits.TRISB7 // bit 7
1733 #define TRISC0 TRISCbits.TRISC0 // bit 0
1734 #define TRISC1 TRISCbits.TRISC1 // bit 1
1735 #define TRISC2 TRISCbits.TRISC2 // bit 2
1736 #define TRISC3 TRISCbits.TRISC3 // bit 3
1737 #define TRISC4 TRISCbits.TRISC4 // bit 4
1738 #define TRISC5 TRISCbits.TRISC5 // bit 5
1739 #define TRISC6 TRISCbits.TRISC6 // bit 6
1740 #define TRISC7 TRISCbits.TRISC7 // bit 7
1742 #define TRISD0 TRISDbits.TRISD0 // bit 0
1743 #define TRISD1 TRISDbits.TRISD1 // bit 1
1744 #define TRISD2 TRISDbits.TRISD2 // bit 2
1745 #define TRISD3 TRISDbits.TRISD3 // bit 3
1746 #define TRISD4 TRISDbits.TRISD4 // bit 4
1747 #define TRISD5 TRISDbits.TRISD5 // bit 5
1748 #define TRISD6 TRISDbits.TRISD6 // bit 6
1749 #define TRISD7 TRISDbits.TRISD7 // bit 7
1751 #define TRISE0 TRISEbits.TRISE0 // bit 0
1752 #define TRISE1 TRISEbits.TRISE1 // bit 1
1753 #define TRISE2 TRISEbits.TRISE2 // bit 2
1754 #define PSPMODE TRISEbits.PSPMODE // bit 4
1755 #define IBOV TRISEbits.IBOV // bit 5
1756 #define OBF TRISEbits.OBF // bit 6
1757 #define IBF TRISEbits.IBF // bit 7
1759 #define TX9D TXSTAbits.TX9D // bit 0, shadows bit in TXSTAbits
1760 #define TXD8 TXSTAbits.TXD8 // bit 0, shadows bit in TXSTAbits
1761 #define TRMT TXSTAbits.TRMT // bit 1
1762 #define BRGH TXSTAbits.BRGH // bit 2
1763 #define SYNC TXSTAbits.SYNC // bit 4
1764 #define TXEN TXSTAbits.TXEN // bit 5
1765 #define TX9 TXSTAbits.TX9 // bit 6, shadows bit in TXSTAbits
1766 #define NOT_TX8 TXSTAbits.NOT_TX8 // bit 6, shadows bit in TXSTAbits
1767 #define TX8_9 TXSTAbits.TX8_9 // bit 6, shadows bit in TXSTAbits
1768 #define CSRC TXSTAbits.CSRC // bit 7
1770 #endif // #ifndef NO_BIT_DEFINES
1772 #endif // #ifndef __PIC16C774_H__