Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16f677.h
blob18811eb68b106bcc996831fdc5f5b39a4c2486e8
1 /*
2 * This declarations of the PIC16F677 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:22:57 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 __PIC16F677_H__
26 #define __PIC16F677_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 SSPBUF_ADDR 0x0013
53 #define SSPCON_ADDR 0x0014
54 #define ADRESH_ADDR 0x001E
55 #define ADCON0_ADDR 0x001F
56 #define OPTION_REG_ADDR 0x0081
57 #define TRISA_ADDR 0x0085
58 #define TRISB_ADDR 0x0086
59 #define TRISC_ADDR 0x0087
60 #define PIE1_ADDR 0x008C
61 #define PIE2_ADDR 0x008D
62 #define PCON_ADDR 0x008E
63 #define OSCCON_ADDR 0x008F
64 #define OSCTUNE_ADDR 0x0090
65 #define MSK_ADDR 0x0093
66 #define SSPADD_ADDR 0x0093
67 #define SSPMSK_ADDR 0x0093
68 #define SSPSTAT_ADDR 0x0094
69 #define WPU_ADDR 0x0095
70 #define WPUA_ADDR 0x0095
71 #define IOC_ADDR 0x0096
72 #define IOCA_ADDR 0x0096
73 #define WDTCON_ADDR 0x0097
74 #define ADRESL_ADDR 0x009E
75 #define ADCON1_ADDR 0x009F
76 #define EEDAT_ADDR 0x010C
77 #define EEDATA_ADDR 0x010C
78 #define EEADR_ADDR 0x010D
79 #define WPUB_ADDR 0x0115
80 #define IOCB_ADDR 0x0116
81 #define VRCON_ADDR 0x0118
82 #define CM1CON0_ADDR 0x0119
83 #define CM2CON0_ADDR 0x011A
84 #define CM2CON1_ADDR 0x011B
85 #define ANSEL_ADDR 0x011E
86 #define ANSELH_ADDR 0x011F
87 #define EECON1_ADDR 0x018C
88 #define EECON2_ADDR 0x018D
89 #define SRCON_ADDR 0x019E
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 : 1;
191 unsigned : 1;
192 unsigned : 1;
193 unsigned : 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 _RB4 0x10
203 #define _RB5 0x20
204 #define _RB6 0x40
205 #define _RB7 0x80
207 //==============================================================================
210 //==============================================================================
211 // PORTC Bits
213 extern __at(0x0007) __sfr PORTC;
215 typedef struct
217 unsigned RC0 : 1;
218 unsigned RC1 : 1;
219 unsigned RC2 : 1;
220 unsigned RC3 : 1;
221 unsigned RC4 : 1;
222 unsigned RC5 : 1;
223 unsigned RC6 : 1;
224 unsigned RC7 : 1;
225 } __PORTCbits_t;
227 extern __at(0x0007) volatile __PORTCbits_t PORTCbits;
229 #define _RC0 0x01
230 #define _RC1 0x02
231 #define _RC2 0x04
232 #define _RC3 0x08
233 #define _RC4 0x10
234 #define _RC5 0x20
235 #define _RC6 0x40
236 #define _RC7 0x80
238 //==============================================================================
240 extern __at(0x000A) __sfr PCLATH;
242 //==============================================================================
243 // INTCON Bits
245 extern __at(0x000B) __sfr INTCON;
247 typedef struct
249 unsigned RABIF : 1;
250 unsigned INTF : 1;
251 unsigned T0IF : 1;
252 unsigned RABIE : 1;
253 unsigned INTE : 1;
254 unsigned T0IE : 1;
255 unsigned PEIE : 1;
256 unsigned GIE : 1;
257 } __INTCONbits_t;
259 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
261 #define _RABIF 0x01
262 #define _INTF 0x02
263 #define _T0IF 0x04
264 #define _RABIE 0x08
265 #define _INTE 0x10
266 #define _T0IE 0x20
267 #define _PEIE 0x40
268 #define _GIE 0x80
270 //==============================================================================
273 //==============================================================================
274 // PIR1 Bits
276 extern __at(0x000C) __sfr PIR1;
278 typedef union
280 struct
282 unsigned TMR1IF : 1;
283 unsigned : 1;
284 unsigned : 1;
285 unsigned SSPIF : 1;
286 unsigned : 1;
287 unsigned : 1;
288 unsigned ADIF : 1;
289 unsigned : 1;
292 struct
294 unsigned T1IF : 1;
295 unsigned : 1;
296 unsigned : 1;
297 unsigned : 1;
298 unsigned : 1;
299 unsigned : 1;
300 unsigned : 1;
301 unsigned : 1;
303 } __PIR1bits_t;
305 extern __at(0x000C) volatile __PIR1bits_t PIR1bits;
307 #define _TMR1IF 0x01
308 #define _T1IF 0x01
309 #define _SSPIF 0x08
310 #define _ADIF 0x40
312 //==============================================================================
315 //==============================================================================
316 // PIR2 Bits
318 extern __at(0x000D) __sfr PIR2;
320 typedef struct
322 unsigned : 1;
323 unsigned : 1;
324 unsigned : 1;
325 unsigned : 1;
326 unsigned EEIF : 1;
327 unsigned C1IF : 1;
328 unsigned C2IF : 1;
329 unsigned OSFIF : 1;
330 } __PIR2bits_t;
332 extern __at(0x000D) volatile __PIR2bits_t PIR2bits;
334 #define _EEIF 0x10
335 #define _C1IF 0x20
336 #define _C2IF 0x40
337 #define _OSFIF 0x80
339 //==============================================================================
341 extern __at(0x000E) __sfr TMR1;
342 extern __at(0x000E) __sfr TMR1L;
343 extern __at(0x000F) __sfr TMR1H;
345 //==============================================================================
346 // T1CON Bits
348 extern __at(0x0010) __sfr T1CON;
350 typedef union
352 struct
354 unsigned TMR1ON : 1;
355 unsigned TMR1CS : 1;
356 unsigned NOT_T1SYNC : 1;
357 unsigned T1OSCEN : 1;
358 unsigned T1CKPS0 : 1;
359 unsigned T1CKPS1 : 1;
360 unsigned TMR1GE : 1;
361 unsigned T1GINV : 1;
364 struct
366 unsigned : 4;
367 unsigned T1CKPS : 2;
368 unsigned : 2;
370 } __T1CONbits_t;
372 extern __at(0x0010) volatile __T1CONbits_t T1CONbits;
374 #define _TMR1ON 0x01
375 #define _TMR1CS 0x02
376 #define _NOT_T1SYNC 0x04
377 #define _T1OSCEN 0x08
378 #define _T1CKPS0 0x10
379 #define _T1CKPS1 0x20
380 #define _TMR1GE 0x40
381 #define _T1GINV 0x80
383 //==============================================================================
385 extern __at(0x0013) __sfr SSPBUF;
387 //==============================================================================
388 // SSPCON Bits
390 extern __at(0x0014) __sfr SSPCON;
392 typedef union
394 struct
396 unsigned SSPM0 : 1;
397 unsigned SSPM1 : 1;
398 unsigned SSPM2 : 1;
399 unsigned SSPM3 : 1;
400 unsigned CKP : 1;
401 unsigned SSPEN : 1;
402 unsigned SSPOV : 1;
403 unsigned WCOL : 1;
406 struct
408 unsigned SSPM : 4;
409 unsigned : 4;
411 } __SSPCONbits_t;
413 extern __at(0x0014) volatile __SSPCONbits_t SSPCONbits;
415 #define _SSPM0 0x01
416 #define _SSPM1 0x02
417 #define _SSPM2 0x04
418 #define _SSPM3 0x08
419 #define _CKP 0x10
420 #define _SSPEN 0x20
421 #define _SSPOV 0x40
422 #define _WCOL 0x80
424 //==============================================================================
426 extern __at(0x001E) __sfr ADRESH;
428 //==============================================================================
429 // ADCON0 Bits
431 extern __at(0x001F) __sfr ADCON0;
433 typedef union
435 struct
437 unsigned ADON : 1;
438 unsigned GO_NOT_DONE : 1;
439 unsigned CHS0 : 1;
440 unsigned CHS1 : 1;
441 unsigned CHS2 : 1;
442 unsigned CHS3 : 1;
443 unsigned VCFG : 1;
444 unsigned ADFM : 1;
447 struct
449 unsigned : 1;
450 unsigned GO : 1;
451 unsigned : 1;
452 unsigned : 1;
453 unsigned : 1;
454 unsigned : 1;
455 unsigned : 1;
456 unsigned : 1;
459 struct
461 unsigned : 1;
462 unsigned NOT_DONE : 1;
463 unsigned : 1;
464 unsigned : 1;
465 unsigned : 1;
466 unsigned : 1;
467 unsigned : 1;
468 unsigned : 1;
471 struct
473 unsigned : 1;
474 unsigned GO_DONE : 1;
475 unsigned : 1;
476 unsigned : 1;
477 unsigned : 1;
478 unsigned : 1;
479 unsigned : 1;
480 unsigned : 1;
483 struct
485 unsigned : 2;
486 unsigned CHS : 4;
487 unsigned : 2;
489 } __ADCON0bits_t;
491 extern __at(0x001F) volatile __ADCON0bits_t ADCON0bits;
493 #define _ADON 0x01
494 #define _GO_NOT_DONE 0x02
495 #define _GO 0x02
496 #define _NOT_DONE 0x02
497 #define _GO_DONE 0x02
498 #define _CHS0 0x04
499 #define _CHS1 0x08
500 #define _CHS2 0x10
501 #define _CHS3 0x20
502 #define _VCFG 0x40
503 #define _ADFM 0x80
505 //==============================================================================
508 //==============================================================================
509 // OPTION_REG Bits
511 extern __at(0x0081) __sfr OPTION_REG;
513 typedef union
515 struct
517 unsigned PS0 : 1;
518 unsigned PS1 : 1;
519 unsigned PS2 : 1;
520 unsigned PSA : 1;
521 unsigned T0SE : 1;
522 unsigned T0CS : 1;
523 unsigned INTEDG : 1;
524 unsigned NOT_RABPU : 1;
527 struct
529 unsigned PS : 3;
530 unsigned : 5;
532 } __OPTION_REGbits_t;
534 extern __at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits;
536 #define _PS0 0x01
537 #define _PS1 0x02
538 #define _PS2 0x04
539 #define _PSA 0x08
540 #define _T0SE 0x10
541 #define _T0CS 0x20
542 #define _INTEDG 0x40
543 #define _NOT_RABPU 0x80
545 //==============================================================================
548 //==============================================================================
549 // TRISA Bits
551 extern __at(0x0085) __sfr TRISA;
553 typedef union
555 struct
557 unsigned TRISA0 : 1;
558 unsigned TRISA1 : 1;
559 unsigned TRISA2 : 1;
560 unsigned TRISA3 : 1;
561 unsigned TRISA4 : 1;
562 unsigned TRISA5 : 1;
563 unsigned : 1;
564 unsigned : 1;
567 struct
569 unsigned TRISA : 6;
570 unsigned : 2;
572 } __TRISAbits_t;
574 extern __at(0x0085) volatile __TRISAbits_t TRISAbits;
576 #define _TRISA0 0x01
577 #define _TRISA1 0x02
578 #define _TRISA2 0x04
579 #define _TRISA3 0x08
580 #define _TRISA4 0x10
581 #define _TRISA5 0x20
583 //==============================================================================
586 //==============================================================================
587 // TRISB Bits
589 extern __at(0x0086) __sfr TRISB;
591 typedef struct
593 unsigned : 1;
594 unsigned : 1;
595 unsigned : 1;
596 unsigned : 1;
597 unsigned TRISB4 : 1;
598 unsigned TRISB5 : 1;
599 unsigned TRISB6 : 1;
600 unsigned TRISB7 : 1;
601 } __TRISBbits_t;
603 extern __at(0x0086) volatile __TRISBbits_t TRISBbits;
605 #define _TRISB4 0x10
606 #define _TRISB5 0x20
607 #define _TRISB6 0x40
608 #define _TRISB7 0x80
610 //==============================================================================
613 //==============================================================================
614 // TRISC Bits
616 extern __at(0x0087) __sfr TRISC;
618 typedef struct
620 unsigned TRISC0 : 1;
621 unsigned TRISC1 : 1;
622 unsigned TRISC2 : 1;
623 unsigned TRISC3 : 1;
624 unsigned TRISC4 : 1;
625 unsigned TRISC5 : 1;
626 unsigned TRISC6 : 1;
627 unsigned TRISC7 : 1;
628 } __TRISCbits_t;
630 extern __at(0x0087) volatile __TRISCbits_t TRISCbits;
632 #define _TRISC0 0x01
633 #define _TRISC1 0x02
634 #define _TRISC2 0x04
635 #define _TRISC3 0x08
636 #define _TRISC4 0x10
637 #define _TRISC5 0x20
638 #define _TRISC6 0x40
639 #define _TRISC7 0x80
641 //==============================================================================
644 //==============================================================================
645 // PIE1 Bits
647 extern __at(0x008C) __sfr PIE1;
649 typedef union
651 struct
653 unsigned TMR1IE : 1;
654 unsigned : 1;
655 unsigned : 1;
656 unsigned SSPIE : 1;
657 unsigned : 1;
658 unsigned : 1;
659 unsigned ADIE : 1;
660 unsigned : 1;
663 struct
665 unsigned T1IE : 1;
666 unsigned : 1;
667 unsigned : 1;
668 unsigned : 1;
669 unsigned : 1;
670 unsigned : 1;
671 unsigned : 1;
672 unsigned : 1;
674 } __PIE1bits_t;
676 extern __at(0x008C) volatile __PIE1bits_t PIE1bits;
678 #define _TMR1IE 0x01
679 #define _T1IE 0x01
680 #define _SSPIE 0x08
681 #define _ADIE 0x40
683 //==============================================================================
686 //==============================================================================
687 // PIE2 Bits
689 extern __at(0x008D) __sfr PIE2;
691 typedef struct
693 unsigned : 1;
694 unsigned : 1;
695 unsigned : 1;
696 unsigned : 1;
697 unsigned EEIE : 1;
698 unsigned C1IE : 1;
699 unsigned C2IE : 1;
700 unsigned OSFIE : 1;
701 } __PIE2bits_t;
703 extern __at(0x008D) volatile __PIE2bits_t PIE2bits;
705 #define _EEIE 0x10
706 #define _C1IE 0x20
707 #define _C2IE 0x40
708 #define _OSFIE 0x80
710 //==============================================================================
713 //==============================================================================
714 // PCON Bits
716 extern __at(0x008E) __sfr PCON;
718 typedef union
720 struct
722 unsigned NOT_BOR : 1;
723 unsigned NOT_POR : 1;
724 unsigned : 1;
725 unsigned : 1;
726 unsigned SBOREN : 1;
727 unsigned ULPWUE : 1;
728 unsigned : 1;
729 unsigned : 1;
732 struct
734 unsigned BOR : 1;
735 unsigned POR : 1;
736 unsigned : 1;
737 unsigned : 1;
738 unsigned : 1;
739 unsigned : 1;
740 unsigned : 1;
741 unsigned : 1;
743 } __PCONbits_t;
745 extern __at(0x008E) volatile __PCONbits_t PCONbits;
747 #define _NOT_BOR 0x01
748 #define _BOR 0x01
749 #define _NOT_POR 0x02
750 #define _POR 0x02
751 #define _SBOREN 0x10
752 #define _ULPWUE 0x20
754 //==============================================================================
757 //==============================================================================
758 // OSCCON Bits
760 extern __at(0x008F) __sfr OSCCON;
762 typedef union
764 struct
766 unsigned SCS : 1;
767 unsigned LTS : 1;
768 unsigned HTS : 1;
769 unsigned OSTS : 1;
770 unsigned IRCF0 : 1;
771 unsigned IRCF1 : 1;
772 unsigned IRCF2 : 1;
773 unsigned : 1;
776 struct
778 unsigned : 4;
779 unsigned IRCF : 3;
780 unsigned : 1;
782 } __OSCCONbits_t;
784 extern __at(0x008F) volatile __OSCCONbits_t OSCCONbits;
786 #define _SCS 0x01
787 #define _LTS 0x02
788 #define _HTS 0x04
789 #define _OSTS 0x08
790 #define _IRCF0 0x10
791 #define _IRCF1 0x20
792 #define _IRCF2 0x40
794 //==============================================================================
797 //==============================================================================
798 // OSCTUNE Bits
800 extern __at(0x0090) __sfr OSCTUNE;
802 typedef union
804 struct
806 unsigned TUN0 : 1;
807 unsigned TUN1 : 1;
808 unsigned TUN2 : 1;
809 unsigned TUN3 : 1;
810 unsigned TUN4 : 1;
811 unsigned : 1;
812 unsigned : 1;
813 unsigned : 1;
816 struct
818 unsigned TUN : 5;
819 unsigned : 3;
821 } __OSCTUNEbits_t;
823 extern __at(0x0090) volatile __OSCTUNEbits_t OSCTUNEbits;
825 #define _TUN0 0x01
826 #define _TUN1 0x02
827 #define _TUN2 0x04
828 #define _TUN3 0x08
829 #define _TUN4 0x10
831 //==============================================================================
834 //==============================================================================
835 // MSK Bits
837 extern __at(0x0093) __sfr MSK;
839 typedef struct
841 unsigned MSK0 : 1;
842 unsigned MSK1 : 1;
843 unsigned MSK2 : 1;
844 unsigned MSK3 : 1;
845 unsigned MSK4 : 1;
846 unsigned MSK5 : 1;
847 unsigned MSK6 : 1;
848 unsigned MSK7 : 1;
849 } __MSKbits_t;
851 extern __at(0x0093) volatile __MSKbits_t MSKbits;
853 #define _MSK0 0x01
854 #define _MSK1 0x02
855 #define _MSK2 0x04
856 #define _MSK3 0x08
857 #define _MSK4 0x10
858 #define _MSK5 0x20
859 #define _MSK6 0x40
860 #define _MSK7 0x80
862 //==============================================================================
864 extern __at(0x0093) __sfr SSPADD;
866 //==============================================================================
867 // SSPMSK Bits
869 extern __at(0x0093) __sfr SSPMSK;
871 typedef struct
873 unsigned MSK0 : 1;
874 unsigned MSK1 : 1;
875 unsigned MSK2 : 1;
876 unsigned MSK3 : 1;
877 unsigned MSK4 : 1;
878 unsigned MSK5 : 1;
879 unsigned MSK6 : 1;
880 unsigned MSK7 : 1;
881 } __SSPMSKbits_t;
883 extern __at(0x0093) volatile __SSPMSKbits_t SSPMSKbits;
885 #define _SSPMSK_MSK0 0x01
886 #define _SSPMSK_MSK1 0x02
887 #define _SSPMSK_MSK2 0x04
888 #define _SSPMSK_MSK3 0x08
889 #define _SSPMSK_MSK4 0x10
890 #define _SSPMSK_MSK5 0x20
891 #define _SSPMSK_MSK6 0x40
892 #define _SSPMSK_MSK7 0x80
894 //==============================================================================
897 //==============================================================================
898 // SSPSTAT Bits
900 extern __at(0x0094) __sfr SSPSTAT;
902 typedef union
904 struct
906 unsigned BF : 1;
907 unsigned UA : 1;
908 unsigned R_NOT_W : 1;
909 unsigned S : 1;
910 unsigned P : 1;
911 unsigned D_NOT_A : 1;
912 unsigned CKE : 1;
913 unsigned SMP : 1;
916 struct
918 unsigned : 1;
919 unsigned : 1;
920 unsigned R : 1;
921 unsigned I2C_START : 1;
922 unsigned I2C_STOP : 1;
923 unsigned D : 1;
924 unsigned : 1;
925 unsigned : 1;
928 struct
930 unsigned : 1;
931 unsigned : 1;
932 unsigned I2C_READ : 1;
933 unsigned : 1;
934 unsigned : 1;
935 unsigned I2C_DATA : 1;
936 unsigned : 1;
937 unsigned : 1;
940 struct
942 unsigned : 1;
943 unsigned : 1;
944 unsigned NOT_W : 1;
945 unsigned : 1;
946 unsigned : 1;
947 unsigned NOT_A : 1;
948 unsigned : 1;
949 unsigned : 1;
952 struct
954 unsigned : 1;
955 unsigned : 1;
956 unsigned NOT_WRITE : 1;
957 unsigned : 1;
958 unsigned : 1;
959 unsigned NOT_ADDRESS : 1;
960 unsigned : 1;
961 unsigned : 1;
964 struct
966 unsigned : 1;
967 unsigned : 1;
968 unsigned R_W : 1;
969 unsigned : 1;
970 unsigned : 1;
971 unsigned D_A : 1;
972 unsigned : 1;
973 unsigned : 1;
976 struct
978 unsigned : 1;
979 unsigned : 1;
980 unsigned READ_WRITE : 1;
981 unsigned : 1;
982 unsigned : 1;
983 unsigned DATA_ADDRESS : 1;
984 unsigned : 1;
985 unsigned : 1;
987 } __SSPSTATbits_t;
989 extern __at(0x0094) volatile __SSPSTATbits_t SSPSTATbits;
991 #define _BF 0x01
992 #define _UA 0x02
993 #define _R_NOT_W 0x04
994 #define _R 0x04
995 #define _I2C_READ 0x04
996 #define _NOT_W 0x04
997 #define _NOT_WRITE 0x04
998 #define _R_W 0x04
999 #define _READ_WRITE 0x04
1000 #define _S 0x08
1001 #define _I2C_START 0x08
1002 #define _P 0x10
1003 #define _I2C_STOP 0x10
1004 #define _D_NOT_A 0x20
1005 #define _D 0x20
1006 #define _I2C_DATA 0x20
1007 #define _NOT_A 0x20
1008 #define _NOT_ADDRESS 0x20
1009 #define _D_A 0x20
1010 #define _DATA_ADDRESS 0x20
1011 #define _CKE 0x40
1012 #define _SMP 0x80
1014 //==============================================================================
1017 //==============================================================================
1018 // WPU Bits
1020 extern __at(0x0095) __sfr WPU;
1022 typedef union
1024 struct
1026 unsigned WPUA0 : 1;
1027 unsigned WPUA1 : 1;
1028 unsigned WPUA2 : 1;
1029 unsigned : 1;
1030 unsigned WPUA4 : 1;
1031 unsigned WPUA5 : 1;
1032 unsigned : 1;
1033 unsigned : 1;
1036 struct
1038 unsigned WPU0 : 1;
1039 unsigned WPU1 : 1;
1040 unsigned WPU2 : 1;
1041 unsigned : 1;
1042 unsigned WPU4 : 1;
1043 unsigned WPU5 : 1;
1044 unsigned : 1;
1045 unsigned : 1;
1047 } __WPUbits_t;
1049 extern __at(0x0095) volatile __WPUbits_t WPUbits;
1051 #define _WPUA0 0x01
1052 #define _WPU0 0x01
1053 #define _WPUA1 0x02
1054 #define _WPU1 0x02
1055 #define _WPUA2 0x04
1056 #define _WPU2 0x04
1057 #define _WPUA4 0x10
1058 #define _WPU4 0x10
1059 #define _WPUA5 0x20
1060 #define _WPU5 0x20
1062 //==============================================================================
1065 //==============================================================================
1066 // WPUA Bits
1068 extern __at(0x0095) __sfr WPUA;
1070 typedef union
1072 struct
1074 unsigned WPUA0 : 1;
1075 unsigned WPUA1 : 1;
1076 unsigned WPUA2 : 1;
1077 unsigned : 1;
1078 unsigned WPUA4 : 1;
1079 unsigned WPUA5 : 1;
1080 unsigned : 1;
1081 unsigned : 1;
1084 struct
1086 unsigned WPU0 : 1;
1087 unsigned WPU1 : 1;
1088 unsigned WPU2 : 1;
1089 unsigned : 1;
1090 unsigned WPU4 : 1;
1091 unsigned WPU5 : 1;
1092 unsigned : 1;
1093 unsigned : 1;
1095 } __WPUAbits_t;
1097 extern __at(0x0095) volatile __WPUAbits_t WPUAbits;
1099 #define _WPUA_WPUA0 0x01
1100 #define _WPUA_WPU0 0x01
1101 #define _WPUA_WPUA1 0x02
1102 #define _WPUA_WPU1 0x02
1103 #define _WPUA_WPUA2 0x04
1104 #define _WPUA_WPU2 0x04
1105 #define _WPUA_WPUA4 0x10
1106 #define _WPUA_WPU4 0x10
1107 #define _WPUA_WPUA5 0x20
1108 #define _WPUA_WPU5 0x20
1110 //==============================================================================
1113 //==============================================================================
1114 // IOC Bits
1116 extern __at(0x0096) __sfr IOC;
1118 typedef union
1120 struct
1122 unsigned IOCA0 : 1;
1123 unsigned IOCA1 : 1;
1124 unsigned IOCA2 : 1;
1125 unsigned IOCA3 : 1;
1126 unsigned IOCA4 : 1;
1127 unsigned IOCA5 : 1;
1128 unsigned : 1;
1129 unsigned : 1;
1132 struct
1134 unsigned IOC0 : 1;
1135 unsigned IOC1 : 1;
1136 unsigned IOC2 : 1;
1137 unsigned IOC3 : 1;
1138 unsigned IOC4 : 1;
1139 unsigned IOC5 : 1;
1140 unsigned : 1;
1141 unsigned : 1;
1144 struct
1146 unsigned IOCA : 6;
1147 unsigned : 2;
1150 struct
1152 unsigned IOC : 6;
1153 unsigned : 2;
1155 } __IOCbits_t;
1157 extern __at(0x0096) volatile __IOCbits_t IOCbits;
1159 #define _IOCA0 0x01
1160 #define _IOC0 0x01
1161 #define _IOCA1 0x02
1162 #define _IOC1 0x02
1163 #define _IOCA2 0x04
1164 #define _IOC2 0x04
1165 #define _IOCA3 0x08
1166 #define _IOC3 0x08
1167 #define _IOCA4 0x10
1168 #define _IOC4 0x10
1169 #define _IOCA5 0x20
1170 #define _IOC5 0x20
1172 //==============================================================================
1175 //==============================================================================
1176 // IOCA Bits
1178 extern __at(0x0096) __sfr IOCA;
1180 typedef union
1182 struct
1184 unsigned IOCA0 : 1;
1185 unsigned IOCA1 : 1;
1186 unsigned IOCA2 : 1;
1187 unsigned IOCA3 : 1;
1188 unsigned IOCA4 : 1;
1189 unsigned IOCA5 : 1;
1190 unsigned : 1;
1191 unsigned : 1;
1194 struct
1196 unsigned IOC0 : 1;
1197 unsigned IOC1 : 1;
1198 unsigned IOC2 : 1;
1199 unsigned IOC3 : 1;
1200 unsigned IOC4 : 1;
1201 unsigned IOC5 : 1;
1202 unsigned : 1;
1203 unsigned : 1;
1206 struct
1208 unsigned IOC : 6;
1209 unsigned : 2;
1212 struct
1214 unsigned IOCA : 6;
1215 unsigned : 2;
1217 } __IOCAbits_t;
1219 extern __at(0x0096) volatile __IOCAbits_t IOCAbits;
1221 #define _IOCA_IOCA0 0x01
1222 #define _IOCA_IOC0 0x01
1223 #define _IOCA_IOCA1 0x02
1224 #define _IOCA_IOC1 0x02
1225 #define _IOCA_IOCA2 0x04
1226 #define _IOCA_IOC2 0x04
1227 #define _IOCA_IOCA3 0x08
1228 #define _IOCA_IOC3 0x08
1229 #define _IOCA_IOCA4 0x10
1230 #define _IOCA_IOC4 0x10
1231 #define _IOCA_IOCA5 0x20
1232 #define _IOCA_IOC5 0x20
1234 //==============================================================================
1237 //==============================================================================
1238 // WDTCON Bits
1240 extern __at(0x0097) __sfr WDTCON;
1242 typedef union
1244 struct
1246 unsigned SWDTEN : 1;
1247 unsigned WDTPS0 : 1;
1248 unsigned WDTPS1 : 1;
1249 unsigned WDTPS2 : 1;
1250 unsigned WDTPS3 : 1;
1251 unsigned : 1;
1252 unsigned : 1;
1253 unsigned : 1;
1256 struct
1258 unsigned : 1;
1259 unsigned WDTPS : 4;
1260 unsigned : 3;
1262 } __WDTCONbits_t;
1264 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
1266 #define _SWDTEN 0x01
1267 #define _WDTPS0 0x02
1268 #define _WDTPS1 0x04
1269 #define _WDTPS2 0x08
1270 #define _WDTPS3 0x10
1272 //==============================================================================
1274 extern __at(0x009E) __sfr ADRESL;
1276 //==============================================================================
1277 // ADCON1 Bits
1279 extern __at(0x009F) __sfr ADCON1;
1281 typedef union
1283 struct
1285 unsigned : 1;
1286 unsigned : 1;
1287 unsigned : 1;
1288 unsigned : 1;
1289 unsigned ADCS0 : 1;
1290 unsigned ADCS1 : 1;
1291 unsigned ADCS2 : 1;
1292 unsigned : 1;
1295 struct
1297 unsigned : 4;
1298 unsigned ADCS : 3;
1299 unsigned : 1;
1301 } __ADCON1bits_t;
1303 extern __at(0x009F) volatile __ADCON1bits_t ADCON1bits;
1305 #define _ADCS0 0x10
1306 #define _ADCS1 0x20
1307 #define _ADCS2 0x40
1309 //==============================================================================
1311 extern __at(0x010C) __sfr EEDAT;
1312 extern __at(0x010C) __sfr EEDATA;
1313 extern __at(0x010D) __sfr EEADR;
1315 //==============================================================================
1316 // WPUB Bits
1318 extern __at(0x0115) __sfr WPUB;
1320 typedef struct
1322 unsigned : 1;
1323 unsigned : 1;
1324 unsigned : 1;
1325 unsigned : 1;
1326 unsigned WPUB4 : 1;
1327 unsigned WPUB5 : 1;
1328 unsigned WPUB6 : 1;
1329 unsigned WPUB7 : 1;
1330 } __WPUBbits_t;
1332 extern __at(0x0115) volatile __WPUBbits_t WPUBbits;
1334 #define _WPUB4 0x10
1335 #define _WPUB5 0x20
1336 #define _WPUB6 0x40
1337 #define _WPUB7 0x80
1339 //==============================================================================
1342 //==============================================================================
1343 // IOCB Bits
1345 extern __at(0x0116) __sfr IOCB;
1347 typedef struct
1349 unsigned : 1;
1350 unsigned : 1;
1351 unsigned : 1;
1352 unsigned : 1;
1353 unsigned IOCB4 : 1;
1354 unsigned IOCB5 : 1;
1355 unsigned IOCB6 : 1;
1356 unsigned IOCB7 : 1;
1357 } __IOCBbits_t;
1359 extern __at(0x0116) volatile __IOCBbits_t IOCBbits;
1361 #define _IOCB4 0x10
1362 #define _IOCB5 0x20
1363 #define _IOCB6 0x40
1364 #define _IOCB7 0x80
1366 //==============================================================================
1369 //==============================================================================
1370 // VRCON Bits
1372 extern __at(0x0118) __sfr VRCON;
1374 typedef union
1376 struct
1378 unsigned VR0 : 1;
1379 unsigned VR1 : 1;
1380 unsigned VR2 : 1;
1381 unsigned VR3 : 1;
1382 unsigned VP6EN : 1;
1383 unsigned VRR : 1;
1384 unsigned C2VREN : 1;
1385 unsigned C1VREN : 1;
1388 struct
1390 unsigned VR : 4;
1391 unsigned : 4;
1393 } __VRCONbits_t;
1395 extern __at(0x0118) volatile __VRCONbits_t VRCONbits;
1397 #define _VR0 0x01
1398 #define _VR1 0x02
1399 #define _VR2 0x04
1400 #define _VR3 0x08
1401 #define _VP6EN 0x10
1402 #define _VRR 0x20
1403 #define _C2VREN 0x40
1404 #define _C1VREN 0x80
1406 //==============================================================================
1409 //==============================================================================
1410 // CM1CON0 Bits
1412 extern __at(0x0119) __sfr CM1CON0;
1414 typedef union
1416 struct
1418 unsigned C1CH0 : 1;
1419 unsigned C1CH1 : 1;
1420 unsigned C1R : 1;
1421 unsigned : 1;
1422 unsigned C1POL : 1;
1423 unsigned C1OE : 1;
1424 unsigned C1OUT : 1;
1425 unsigned C1ON : 1;
1428 struct
1430 unsigned C1CH : 2;
1431 unsigned : 6;
1433 } __CM1CON0bits_t;
1435 extern __at(0x0119) volatile __CM1CON0bits_t CM1CON0bits;
1437 #define _C1CH0 0x01
1438 #define _C1CH1 0x02
1439 #define _C1R 0x04
1440 #define _C1POL 0x10
1441 #define _C1OE 0x20
1442 #define _C1OUT 0x40
1443 #define _C1ON 0x80
1445 //==============================================================================
1448 //==============================================================================
1449 // CM2CON0 Bits
1451 extern __at(0x011A) __sfr CM2CON0;
1453 typedef union
1455 struct
1457 unsigned C2CH0 : 1;
1458 unsigned C2CH1 : 1;
1459 unsigned C2R : 1;
1460 unsigned : 1;
1461 unsigned C2POL : 1;
1462 unsigned C2OE : 1;
1463 unsigned C2OUT : 1;
1464 unsigned C2ON : 1;
1467 struct
1469 unsigned C2CH : 2;
1470 unsigned : 6;
1472 } __CM2CON0bits_t;
1474 extern __at(0x011A) volatile __CM2CON0bits_t CM2CON0bits;
1476 #define _C2CH0 0x01
1477 #define _C2CH1 0x02
1478 #define _C2R 0x04
1479 #define _C2POL 0x10
1480 #define _C2OE 0x20
1481 #define _C2OUT 0x40
1482 #define _C2ON 0x80
1484 //==============================================================================
1487 //==============================================================================
1488 // CM2CON1 Bits
1490 extern __at(0x011B) __sfr CM2CON1;
1492 typedef struct
1494 unsigned C2SYNC : 1;
1495 unsigned T1GSS : 1;
1496 unsigned : 1;
1497 unsigned : 1;
1498 unsigned : 1;
1499 unsigned : 1;
1500 unsigned MC2OUT : 1;
1501 unsigned MC1OUT : 1;
1502 } __CM2CON1bits_t;
1504 extern __at(0x011B) volatile __CM2CON1bits_t CM2CON1bits;
1506 #define _C2SYNC 0x01
1507 #define _T1GSS 0x02
1508 #define _MC2OUT 0x40
1509 #define _MC1OUT 0x80
1511 //==============================================================================
1514 //==============================================================================
1515 // ANSEL Bits
1517 extern __at(0x011E) __sfr ANSEL;
1519 typedef struct
1521 unsigned ANS0 : 1;
1522 unsigned ANS1 : 1;
1523 unsigned ANS2 : 1;
1524 unsigned ANS3 : 1;
1525 unsigned ANS4 : 1;
1526 unsigned ANS5 : 1;
1527 unsigned ANS6 : 1;
1528 unsigned ANS7 : 1;
1529 } __ANSELbits_t;
1531 extern __at(0x011E) volatile __ANSELbits_t ANSELbits;
1533 #define _ANS0 0x01
1534 #define _ANS1 0x02
1535 #define _ANS2 0x04
1536 #define _ANS3 0x08
1537 #define _ANS4 0x10
1538 #define _ANS5 0x20
1539 #define _ANS6 0x40
1540 #define _ANS7 0x80
1542 //==============================================================================
1545 //==============================================================================
1546 // ANSELH Bits
1548 extern __at(0x011F) __sfr ANSELH;
1550 typedef struct
1552 unsigned ANS8 : 1;
1553 unsigned ANS9 : 1;
1554 unsigned ANS10 : 1;
1555 unsigned ANS11 : 1;
1556 unsigned : 1;
1557 unsigned : 1;
1558 unsigned : 1;
1559 unsigned : 1;
1560 } __ANSELHbits_t;
1562 extern __at(0x011F) volatile __ANSELHbits_t ANSELHbits;
1564 #define _ANS8 0x01
1565 #define _ANS9 0x02
1566 #define _ANS10 0x04
1567 #define _ANS11 0x08
1569 //==============================================================================
1572 //==============================================================================
1573 // EECON1 Bits
1575 extern __at(0x018C) __sfr EECON1;
1577 typedef struct
1579 unsigned RD : 1;
1580 unsigned WR : 1;
1581 unsigned WREN : 1;
1582 unsigned WRERR : 1;
1583 unsigned : 1;
1584 unsigned : 1;
1585 unsigned : 1;
1586 unsigned : 1;
1587 } __EECON1bits_t;
1589 extern __at(0x018C) volatile __EECON1bits_t EECON1bits;
1591 #define _RD 0x01
1592 #define _WR 0x02
1593 #define _WREN 0x04
1594 #define _WRERR 0x08
1596 //==============================================================================
1598 extern __at(0x018D) __sfr EECON2;
1600 //==============================================================================
1601 // SRCON Bits
1603 extern __at(0x019E) __sfr SRCON;
1605 typedef union
1607 struct
1609 unsigned : 1;
1610 unsigned : 1;
1611 unsigned PULSR : 1;
1612 unsigned PULSS : 1;
1613 unsigned C2REN : 1;
1614 unsigned C1SEN : 1;
1615 unsigned SR0 : 1;
1616 unsigned SR1 : 1;
1619 struct
1621 unsigned : 6;
1622 unsigned SR : 2;
1624 } __SRCONbits_t;
1626 extern __at(0x019E) volatile __SRCONbits_t SRCONbits;
1628 #define _PULSR 0x04
1629 #define _PULSS 0x08
1630 #define _C2REN 0x10
1631 #define _C1SEN 0x20
1632 #define _SR0 0x40
1633 #define _SR1 0x80
1635 //==============================================================================
1638 //==============================================================================
1640 // Configuration Bits
1642 //==============================================================================
1644 #define _CONFIG 0x2007
1646 //----------------------------- CONFIG Options -------------------------------
1648 #define _FOSC_LP 0x3FF8 // LP oscillator: Low-power crystal on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN.
1649 #define _LP_OSC 0x3FF8 // LP oscillator: Low-power crystal on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN.
1650 #define _FOSC_XT 0x3FF9 // XT oscillator: Crystal/resonator on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN.
1651 #define _XT_OSC 0x3FF9 // XT oscillator: Crystal/resonator on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN.
1652 #define _FOSC_HS 0x3FFA // HS oscillator: High-speed crystal/resonator on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN.
1653 #define _HS_OSC 0x3FFA // HS oscillator: High-speed crystal/resonator on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN.
1654 #define _FOSC_EC 0x3FFB // EC: I/O function on RA4/OSC2/CLKOUT pin, CLKIN on RA5/OSC1/CLKIN.
1655 #define _EC_OSC 0x3FFB // EC: I/O function on RA4/OSC2/CLKOUT pin, CLKIN on RA5/OSC1/CLKIN.
1656 #define _FOSC_INTRCIO 0x3FFC // INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN.
1657 #define _INTRC_OSC_NOCLKOUT 0x3FFC // INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN.
1658 #define _INTOSCIO 0x3FFC // INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN.
1659 #define _FOSC_INTRCCLK 0x3FFD // INTOSC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN.
1660 #define _INTRC_OSC_CLKOUT 0x3FFD // INTOSC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN.
1661 #define _INTOSC 0x3FFD // INTOSC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN.
1662 #define _FOSC_EXTRCIO 0x3FFE // RCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN.
1663 #define _EXTRC_OSC_NOCLKOUT 0x3FFE // RCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN.
1664 #define _EXTRCIO 0x3FFE // RCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN.
1665 #define _FOSC_EXTRCCLK 0x3FFF // RC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN.
1666 #define _EXTRC_OSC_CLKOUT 0x3FFF // RC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN.
1667 #define _EXTRC 0x3FFF // RC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN.
1668 #define _WDTE_OFF 0x3FF7 // WDT disabled and can be enabled by SWDTEN bit of the WDTCON register.
1669 #define _WDT_OFF 0x3FF7 // WDT disabled and can be enabled by SWDTEN bit of the WDTCON register.
1670 #define _WDTE_ON 0x3FFF // WDT enabled.
1671 #define _WDT_ON 0x3FFF // WDT enabled.
1672 #define _PWRTE_ON 0x3FEF // PWRT enabled.
1673 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
1674 #define _MCLRE_OFF 0x3FDF // MCLR pin function is digital input, MCLR internally tied to VDD.
1675 #define _MCLRE_ON 0x3FFF // MCLR pin function is MCLR.
1676 #define _CP_ON 0x3FBF // Program memory code protection is enabled.
1677 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
1678 #define _CPD_ON 0x3F7F // Data memory code protection is enabled.
1679 #define _CPD_OFF 0x3FFF // Data memory code protection is disabled.
1680 #define _BOREN_OFF 0x3CFF // BOR disabled.
1681 #define _BOD_OFF 0x3CFF // BOR disabled.
1682 #define _BOR_OFF 0x3CFF // BOR disabled.
1683 #define _BOREN_SBODEN 0x3DFF // BOR controlled by SBOREN bit of the PCON register.
1684 #define _BOD_SBODEN 0x3DFF // BOR controlled by SBOREN bit of the PCON register.
1685 #define _BOR_SBODEN 0x3DFF // BOR controlled by SBOREN bit of the PCON register.
1686 #define _BOREN_NSLEEP 0x3EFF // BOR enabled during operation and disabled in Sleep.
1687 #define _BOD_NSLEEP 0x3EFF // BOR enabled during operation and disabled in Sleep.
1688 #define _BOR_NSLEEP 0x3EFF // BOR enabled during operation and disabled in Sleep.
1689 #define _BOREN_ON 0x3FFF // BOR enabled.
1690 #define _BOD_ON 0x3FFF // BOR enabled.
1691 #define _BOR_ON 0x3FFF // BOR enabled.
1692 #define _IESO_OFF 0x3BFF // Internal External Switchover mode is disabled.
1693 #define _IESO_ON 0x3FFF // Internal External Switchover mode is enabled.
1694 #define _FCMEN_OFF 0x37FF // Fail-Safe Clock Monitor is disabled.
1695 #define _FCMEN_ON 0x3FFF // Fail-Safe Clock Monitor is enabled.
1697 //==============================================================================
1699 #define _DEVID1 0x2006
1701 #define _IDLOC0 0x2000
1702 #define _IDLOC1 0x2001
1703 #define _IDLOC2 0x2002
1704 #define _IDLOC3 0x2003
1706 //==============================================================================
1708 #ifndef NO_BIT_DEFINES
1710 #define ADON ADCON0bits.ADON // bit 0
1711 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1, shadows bit in ADCON0bits
1712 #define GO ADCON0bits.GO // bit 1, shadows bit in ADCON0bits
1713 #define NOT_DONE ADCON0bits.NOT_DONE // bit 1, shadows bit in ADCON0bits
1714 #define GO_DONE ADCON0bits.GO_DONE // bit 1, shadows bit in ADCON0bits
1715 #define CHS0 ADCON0bits.CHS0 // bit 2
1716 #define CHS1 ADCON0bits.CHS1 // bit 3
1717 #define CHS2 ADCON0bits.CHS2 // bit 4
1718 #define CHS3 ADCON0bits.CHS3 // bit 5
1719 #define VCFG ADCON0bits.VCFG // bit 6
1720 #define ADFM ADCON0bits.ADFM // bit 7
1722 #define ADCS0 ADCON1bits.ADCS0 // bit 4
1723 #define ADCS1 ADCON1bits.ADCS1 // bit 5
1724 #define ADCS2 ADCON1bits.ADCS2 // bit 6
1726 #define ANS0 ANSELbits.ANS0 // bit 0
1727 #define ANS1 ANSELbits.ANS1 // bit 1
1728 #define ANS2 ANSELbits.ANS2 // bit 2
1729 #define ANS3 ANSELbits.ANS3 // bit 3
1730 #define ANS4 ANSELbits.ANS4 // bit 4
1731 #define ANS5 ANSELbits.ANS5 // bit 5
1732 #define ANS6 ANSELbits.ANS6 // bit 6
1733 #define ANS7 ANSELbits.ANS7 // bit 7
1735 #define ANS8 ANSELHbits.ANS8 // bit 0
1736 #define ANS9 ANSELHbits.ANS9 // bit 1
1737 #define ANS10 ANSELHbits.ANS10 // bit 2
1738 #define ANS11 ANSELHbits.ANS11 // bit 3
1740 #define C1CH0 CM1CON0bits.C1CH0 // bit 0
1741 #define C1CH1 CM1CON0bits.C1CH1 // bit 1
1742 #define C1R CM1CON0bits.C1R // bit 2
1743 #define C1POL CM1CON0bits.C1POL // bit 4
1744 #define C1OE CM1CON0bits.C1OE // bit 5
1745 #define C1OUT CM1CON0bits.C1OUT // bit 6
1746 #define C1ON CM1CON0bits.C1ON // bit 7
1748 #define C2CH0 CM2CON0bits.C2CH0 // bit 0
1749 #define C2CH1 CM2CON0bits.C2CH1 // bit 1
1750 #define C2R CM2CON0bits.C2R // bit 2
1751 #define C2POL CM2CON0bits.C2POL // bit 4
1752 #define C2OE CM2CON0bits.C2OE // bit 5
1753 #define C2OUT CM2CON0bits.C2OUT // bit 6
1754 #define C2ON CM2CON0bits.C2ON // bit 7
1756 #define C2SYNC CM2CON1bits.C2SYNC // bit 0
1757 #define T1GSS CM2CON1bits.T1GSS // bit 1
1758 #define MC2OUT CM2CON1bits.MC2OUT // bit 6
1759 #define MC1OUT CM2CON1bits.MC1OUT // bit 7
1761 #define RD EECON1bits.RD // bit 0
1762 #define WR EECON1bits.WR // bit 1
1763 #define WREN EECON1bits.WREN // bit 2
1764 #define WRERR EECON1bits.WRERR // bit 3
1766 #define RABIF INTCONbits.RABIF // bit 0
1767 #define INTF INTCONbits.INTF // bit 1
1768 #define T0IF INTCONbits.T0IF // bit 2
1769 #define RABIE INTCONbits.RABIE // bit 3
1770 #define INTE INTCONbits.INTE // bit 4
1771 #define T0IE INTCONbits.T0IE // bit 5
1772 #define PEIE INTCONbits.PEIE // bit 6
1773 #define GIE INTCONbits.GIE // bit 7
1775 #define IOCA0 IOCbits.IOCA0 // bit 0, shadows bit in IOCbits
1776 #define IOC0 IOCbits.IOC0 // bit 0, shadows bit in IOCbits
1777 #define IOCA1 IOCbits.IOCA1 // bit 1, shadows bit in IOCbits
1778 #define IOC1 IOCbits.IOC1 // bit 1, shadows bit in IOCbits
1779 #define IOCA2 IOCbits.IOCA2 // bit 2, shadows bit in IOCbits
1780 #define IOC2 IOCbits.IOC2 // bit 2, shadows bit in IOCbits
1781 #define IOCA3 IOCbits.IOCA3 // bit 3, shadows bit in IOCbits
1782 #define IOC3 IOCbits.IOC3 // bit 3, shadows bit in IOCbits
1783 #define IOCA4 IOCbits.IOCA4 // bit 4, shadows bit in IOCbits
1784 #define IOC4 IOCbits.IOC4 // bit 4, shadows bit in IOCbits
1785 #define IOCA5 IOCbits.IOCA5 // bit 5, shadows bit in IOCbits
1786 #define IOC5 IOCbits.IOC5 // bit 5, shadows bit in IOCbits
1788 #define IOCB4 IOCBbits.IOCB4 // bit 4
1789 #define IOCB5 IOCBbits.IOCB5 // bit 5
1790 #define IOCB6 IOCBbits.IOCB6 // bit 6
1791 #define IOCB7 IOCBbits.IOCB7 // bit 7
1793 #define MSK0 MSKbits.MSK0 // bit 0
1794 #define MSK1 MSKbits.MSK1 // bit 1
1795 #define MSK2 MSKbits.MSK2 // bit 2
1796 #define MSK3 MSKbits.MSK3 // bit 3
1797 #define MSK4 MSKbits.MSK4 // bit 4
1798 #define MSK5 MSKbits.MSK5 // bit 5
1799 #define MSK6 MSKbits.MSK6 // bit 6
1800 #define MSK7 MSKbits.MSK7 // bit 7
1802 #define PS0 OPTION_REGbits.PS0 // bit 0
1803 #define PS1 OPTION_REGbits.PS1 // bit 1
1804 #define PS2 OPTION_REGbits.PS2 // bit 2
1805 #define PSA OPTION_REGbits.PSA // bit 3
1806 #define T0SE OPTION_REGbits.T0SE // bit 4
1807 #define T0CS OPTION_REGbits.T0CS // bit 5
1808 #define INTEDG OPTION_REGbits.INTEDG // bit 6
1809 #define NOT_RABPU OPTION_REGbits.NOT_RABPU // bit 7
1811 #define SCS OSCCONbits.SCS // bit 0
1812 #define LTS OSCCONbits.LTS // bit 1
1813 #define HTS OSCCONbits.HTS // bit 2
1814 #define OSTS OSCCONbits.OSTS // bit 3
1815 #define IRCF0 OSCCONbits.IRCF0 // bit 4
1816 #define IRCF1 OSCCONbits.IRCF1 // bit 5
1817 #define IRCF2 OSCCONbits.IRCF2 // bit 6
1819 #define TUN0 OSCTUNEbits.TUN0 // bit 0
1820 #define TUN1 OSCTUNEbits.TUN1 // bit 1
1821 #define TUN2 OSCTUNEbits.TUN2 // bit 2
1822 #define TUN3 OSCTUNEbits.TUN3 // bit 3
1823 #define TUN4 OSCTUNEbits.TUN4 // bit 4
1825 #define NOT_BOR PCONbits.NOT_BOR // bit 0, shadows bit in PCONbits
1826 #define BOR PCONbits.BOR // bit 0, shadows bit in PCONbits
1827 #define NOT_POR PCONbits.NOT_POR // bit 1, shadows bit in PCONbits
1828 #define POR PCONbits.POR // bit 1, shadows bit in PCONbits
1829 #define SBOREN PCONbits.SBOREN // bit 4
1830 #define ULPWUE PCONbits.ULPWUE // bit 5
1832 #define TMR1IE PIE1bits.TMR1IE // bit 0, shadows bit in PIE1bits
1833 #define T1IE PIE1bits.T1IE // bit 0, shadows bit in PIE1bits
1834 #define SSPIE PIE1bits.SSPIE // bit 3
1835 #define ADIE PIE1bits.ADIE // bit 6
1837 #define EEIE PIE2bits.EEIE // bit 4
1838 #define C1IE PIE2bits.C1IE // bit 5
1839 #define C2IE PIE2bits.C2IE // bit 6
1840 #define OSFIE PIE2bits.OSFIE // bit 7
1842 #define TMR1IF PIR1bits.TMR1IF // bit 0, shadows bit in PIR1bits
1843 #define T1IF PIR1bits.T1IF // bit 0, shadows bit in PIR1bits
1844 #define SSPIF PIR1bits.SSPIF // bit 3
1845 #define ADIF PIR1bits.ADIF // bit 6
1847 #define EEIF PIR2bits.EEIF // bit 4
1848 #define C1IF PIR2bits.C1IF // bit 5
1849 #define C2IF PIR2bits.C2IF // bit 6
1850 #define OSFIF PIR2bits.OSFIF // bit 7
1852 #define RA0 PORTAbits.RA0 // bit 0
1853 #define RA1 PORTAbits.RA1 // bit 1
1854 #define RA2 PORTAbits.RA2 // bit 2
1855 #define RA3 PORTAbits.RA3 // bit 3
1856 #define RA4 PORTAbits.RA4 // bit 4
1857 #define RA5 PORTAbits.RA5 // bit 5
1859 #define RB4 PORTBbits.RB4 // bit 4
1860 #define RB5 PORTBbits.RB5 // bit 5
1861 #define RB6 PORTBbits.RB6 // bit 6
1862 #define RB7 PORTBbits.RB7 // bit 7
1864 #define RC0 PORTCbits.RC0 // bit 0
1865 #define RC1 PORTCbits.RC1 // bit 1
1866 #define RC2 PORTCbits.RC2 // bit 2
1867 #define RC3 PORTCbits.RC3 // bit 3
1868 #define RC4 PORTCbits.RC4 // bit 4
1869 #define RC5 PORTCbits.RC5 // bit 5
1870 #define RC6 PORTCbits.RC6 // bit 6
1871 #define RC7 PORTCbits.RC7 // bit 7
1873 #define PULSR SRCONbits.PULSR // bit 2
1874 #define PULSS SRCONbits.PULSS // bit 3
1875 #define C2REN SRCONbits.C2REN // bit 4
1876 #define C1SEN SRCONbits.C1SEN // bit 5
1877 #define SR0 SRCONbits.SR0 // bit 6
1878 #define SR1 SRCONbits.SR1 // bit 7
1880 #define SSPM0 SSPCONbits.SSPM0 // bit 0
1881 #define SSPM1 SSPCONbits.SSPM1 // bit 1
1882 #define SSPM2 SSPCONbits.SSPM2 // bit 2
1883 #define SSPM3 SSPCONbits.SSPM3 // bit 3
1884 #define CKP SSPCONbits.CKP // bit 4
1885 #define SSPEN SSPCONbits.SSPEN // bit 5
1886 #define SSPOV SSPCONbits.SSPOV // bit 6
1887 #define WCOL SSPCONbits.WCOL // bit 7
1889 #define BF SSPSTATbits.BF // bit 0
1890 #define UA SSPSTATbits.UA // bit 1
1891 #define R_NOT_W SSPSTATbits.R_NOT_W // bit 2, shadows bit in SSPSTATbits
1892 #define R SSPSTATbits.R // bit 2, shadows bit in SSPSTATbits
1893 #define I2C_READ SSPSTATbits.I2C_READ // bit 2, shadows bit in SSPSTATbits
1894 #define NOT_W SSPSTATbits.NOT_W // bit 2, shadows bit in SSPSTATbits
1895 #define NOT_WRITE SSPSTATbits.NOT_WRITE // bit 2, shadows bit in SSPSTATbits
1896 #define R_W SSPSTATbits.R_W // bit 2, shadows bit in SSPSTATbits
1897 #define READ_WRITE SSPSTATbits.READ_WRITE // bit 2, shadows bit in SSPSTATbits
1898 #define S SSPSTATbits.S // bit 3, shadows bit in SSPSTATbits
1899 #define I2C_START SSPSTATbits.I2C_START // bit 3, shadows bit in SSPSTATbits
1900 #define P SSPSTATbits.P // bit 4, shadows bit in SSPSTATbits
1901 #define I2C_STOP SSPSTATbits.I2C_STOP // bit 4, shadows bit in SSPSTATbits
1902 #define D_NOT_A SSPSTATbits.D_NOT_A // bit 5, shadows bit in SSPSTATbits
1903 #define D SSPSTATbits.D // bit 5, shadows bit in SSPSTATbits
1904 #define I2C_DATA SSPSTATbits.I2C_DATA // bit 5, shadows bit in SSPSTATbits
1905 #define NOT_A SSPSTATbits.NOT_A // bit 5, shadows bit in SSPSTATbits
1906 #define NOT_ADDRESS SSPSTATbits.NOT_ADDRESS // bit 5, shadows bit in SSPSTATbits
1907 #define D_A SSPSTATbits.D_A // bit 5, shadows bit in SSPSTATbits
1908 #define DATA_ADDRESS SSPSTATbits.DATA_ADDRESS // bit 5, shadows bit in SSPSTATbits
1909 #define CKE SSPSTATbits.CKE // bit 6
1910 #define SMP SSPSTATbits.SMP // bit 7
1912 #define C STATUSbits.C // bit 0
1913 #define DC STATUSbits.DC // bit 1
1914 #define Z STATUSbits.Z // bit 2
1915 #define NOT_PD STATUSbits.NOT_PD // bit 3
1916 #define NOT_TO STATUSbits.NOT_TO // bit 4
1917 #define RP0 STATUSbits.RP0 // bit 5
1918 #define RP1 STATUSbits.RP1 // bit 6
1919 #define IRP STATUSbits.IRP // bit 7
1921 #define TMR1ON T1CONbits.TMR1ON // bit 0
1922 #define TMR1CS T1CONbits.TMR1CS // bit 1
1923 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2
1924 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
1925 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
1926 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
1927 #define TMR1GE T1CONbits.TMR1GE // bit 6
1928 #define T1GINV T1CONbits.T1GINV // bit 7
1930 #define TRISA0 TRISAbits.TRISA0 // bit 0
1931 #define TRISA1 TRISAbits.TRISA1 // bit 1
1932 #define TRISA2 TRISAbits.TRISA2 // bit 2
1933 #define TRISA3 TRISAbits.TRISA3 // bit 3
1934 #define TRISA4 TRISAbits.TRISA4 // bit 4
1935 #define TRISA5 TRISAbits.TRISA5 // bit 5
1937 #define TRISB4 TRISBbits.TRISB4 // bit 4
1938 #define TRISB5 TRISBbits.TRISB5 // bit 5
1939 #define TRISB6 TRISBbits.TRISB6 // bit 6
1940 #define TRISB7 TRISBbits.TRISB7 // bit 7
1942 #define TRISC0 TRISCbits.TRISC0 // bit 0
1943 #define TRISC1 TRISCbits.TRISC1 // bit 1
1944 #define TRISC2 TRISCbits.TRISC2 // bit 2
1945 #define TRISC3 TRISCbits.TRISC3 // bit 3
1946 #define TRISC4 TRISCbits.TRISC4 // bit 4
1947 #define TRISC5 TRISCbits.TRISC5 // bit 5
1948 #define TRISC6 TRISCbits.TRISC6 // bit 6
1949 #define TRISC7 TRISCbits.TRISC7 // bit 7
1951 #define VR0 VRCONbits.VR0 // bit 0
1952 #define VR1 VRCONbits.VR1 // bit 1
1953 #define VR2 VRCONbits.VR2 // bit 2
1954 #define VR3 VRCONbits.VR3 // bit 3
1955 #define VP6EN VRCONbits.VP6EN // bit 4
1956 #define VRR VRCONbits.VRR // bit 5
1957 #define C2VREN VRCONbits.C2VREN // bit 6
1958 #define C1VREN VRCONbits.C1VREN // bit 7
1960 #define SWDTEN WDTCONbits.SWDTEN // bit 0
1961 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
1962 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
1963 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
1964 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
1966 #define WPUA0 WPUbits.WPUA0 // bit 0, shadows bit in WPUbits
1967 #define WPU0 WPUbits.WPU0 // bit 0, shadows bit in WPUbits
1968 #define WPUA1 WPUbits.WPUA1 // bit 1, shadows bit in WPUbits
1969 #define WPU1 WPUbits.WPU1 // bit 1, shadows bit in WPUbits
1970 #define WPUA2 WPUbits.WPUA2 // bit 2, shadows bit in WPUbits
1971 #define WPU2 WPUbits.WPU2 // bit 2, shadows bit in WPUbits
1972 #define WPUA4 WPUbits.WPUA4 // bit 4, shadows bit in WPUbits
1973 #define WPU4 WPUbits.WPU4 // bit 4, shadows bit in WPUbits
1974 #define WPUA5 WPUbits.WPUA5 // bit 5, shadows bit in WPUbits
1975 #define WPU5 WPUbits.WPU5 // bit 5, shadows bit in WPUbits
1977 #define WPUB4 WPUBbits.WPUB4 // bit 4
1978 #define WPUB5 WPUBbits.WPUB5 // bit 5
1979 #define WPUB6 WPUBbits.WPUB6 // bit 6
1980 #define WPUB7 WPUBbits.WPUB7 // bit 7
1982 #endif // #ifndef NO_BIT_DEFINES
1984 #endif // #ifndef __PIC16F677_H__