Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16c72.h
blob07a0d16cc66bc00a2c303bc25a719e2525c13b8f
1 /*
2 * This declarations of the PIC16C72 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:02 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 __PIC16C72_H__
26 #define __PIC16C72_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 TMR1_ADDR 0x000E
48 #define TMR1L_ADDR 0x000E
49 #define TMR1H_ADDR 0x000F
50 #define T1CON_ADDR 0x0010
51 #define TMR2_ADDR 0x0011
52 #define T2CON_ADDR 0x0012
53 #define SSPBUF_ADDR 0x0013
54 #define SSPCON_ADDR 0x0014
55 #define CCPR1_ADDR 0x0015
56 #define CCPR1L_ADDR 0x0015
57 #define CCPR1H_ADDR 0x0016
58 #define CCP1CON_ADDR 0x0017
59 #define ADRES_ADDR 0x001E
60 #define ADCON0_ADDR 0x001F
61 #define OPTION_REG_ADDR 0x0081
62 #define TRISA_ADDR 0x0085
63 #define TRISB_ADDR 0x0086
64 #define TRISC_ADDR 0x0087
65 #define PIE1_ADDR 0x008C
66 #define PCON_ADDR 0x008E
67 #define PR2_ADDR 0x0092
68 #define SSPADD_ADDR 0x0093
69 #define SSPSTAT_ADDR 0x0094
70 #define ADCON1_ADDR 0x009F
72 #endif // #ifndef NO_ADDR_DEFINES
74 //==============================================================================
76 // Register Definitions
78 //==============================================================================
80 extern __at(0x0000) __sfr INDF;
81 extern __at(0x0001) __sfr TMR0;
82 extern __at(0x0002) __sfr PCL;
84 //==============================================================================
85 // STATUS Bits
87 extern __at(0x0003) __sfr STATUS;
89 typedef union
91 struct
93 unsigned C : 1;
94 unsigned DC : 1;
95 unsigned Z : 1;
96 unsigned NOT_PD : 1;
97 unsigned NOT_TO : 1;
98 unsigned RP0 : 1;
99 unsigned RP1 : 1;
100 unsigned IRP : 1;
103 struct
105 unsigned : 5;
106 unsigned RP : 2;
107 unsigned : 1;
109 } __STATUSbits_t;
111 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
113 #define _C 0x01
114 #define _DC 0x02
115 #define _Z 0x04
116 #define _NOT_PD 0x08
117 #define _NOT_TO 0x10
118 #define _RP0 0x20
119 #define _RP1 0x40
120 #define _IRP 0x80
122 //==============================================================================
124 extern __at(0x0004) __sfr FSR;
126 //==============================================================================
127 // PORTA Bits
129 extern __at(0x0005) __sfr PORTA;
131 typedef union
133 struct
135 unsigned RA0 : 1;
136 unsigned RA1 : 1;
137 unsigned RA2 : 1;
138 unsigned RA3 : 1;
139 unsigned RA4 : 1;
140 unsigned RA5 : 1;
141 unsigned : 1;
142 unsigned : 1;
145 struct
147 unsigned RA : 6;
148 unsigned : 2;
150 } __PORTAbits_t;
152 extern __at(0x0005) volatile __PORTAbits_t PORTAbits;
154 #define _RA0 0x01
155 #define _RA1 0x02
156 #define _RA2 0x04
157 #define _RA3 0x08
158 #define _RA4 0x10
159 #define _RA5 0x20
161 //==============================================================================
164 //==============================================================================
165 // PORTB Bits
167 extern __at(0x0006) __sfr PORTB;
169 typedef struct
171 unsigned RB0 : 1;
172 unsigned RB1 : 1;
173 unsigned RB2 : 1;
174 unsigned RB3 : 1;
175 unsigned RB4 : 1;
176 unsigned RB5 : 1;
177 unsigned RB6 : 1;
178 unsigned RB7 : 1;
179 } __PORTBbits_t;
181 extern __at(0x0006) volatile __PORTBbits_t PORTBbits;
183 #define _RB0 0x01
184 #define _RB1 0x02
185 #define _RB2 0x04
186 #define _RB3 0x08
187 #define _RB4 0x10
188 #define _RB5 0x20
189 #define _RB6 0x40
190 #define _RB7 0x80
192 //==============================================================================
195 //==============================================================================
196 // PORTC Bits
198 extern __at(0x0007) __sfr PORTC;
200 typedef struct
202 unsigned RC0 : 1;
203 unsigned RC1 : 1;
204 unsigned RC2 : 1;
205 unsigned RC3 : 1;
206 unsigned RC4 : 1;
207 unsigned RC5 : 1;
208 unsigned RC6 : 1;
209 unsigned RC7 : 1;
210 } __PORTCbits_t;
212 extern __at(0x0007) volatile __PORTCbits_t PORTCbits;
214 #define _RC0 0x01
215 #define _RC1 0x02
216 #define _RC2 0x04
217 #define _RC3 0x08
218 #define _RC4 0x10
219 #define _RC5 0x20
220 #define _RC6 0x40
221 #define _RC7 0x80
223 //==============================================================================
225 extern __at(0x000A) __sfr PCLATH;
227 //==============================================================================
228 // INTCON Bits
230 extern __at(0x000B) __sfr INTCON;
232 typedef union
234 struct
236 unsigned RBIF : 1;
237 unsigned INTF : 1;
238 unsigned T0IF : 1;
239 unsigned RBIE : 1;
240 unsigned INTE : 1;
241 unsigned T0IE : 1;
242 unsigned PEIE : 1;
243 unsigned GIE : 1;
246 struct
248 unsigned : 1;
249 unsigned : 1;
250 unsigned TMR0IF : 1;
251 unsigned : 1;
252 unsigned : 1;
253 unsigned TMR0IE : 1;
254 unsigned : 1;
255 unsigned : 1;
257 } __INTCONbits_t;
259 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
261 #define _RBIF 0x01
262 #define _INTF 0x02
263 #define _T0IF 0x04
264 #define _TMR0IF 0x04
265 #define _RBIE 0x08
266 #define _INTE 0x10
267 #define _T0IE 0x20
268 #define _TMR0IE 0x20
269 #define _PEIE 0x40
270 #define _GIE 0x80
272 //==============================================================================
275 //==============================================================================
276 // PIR1 Bits
278 extern __at(0x000C) __sfr PIR1;
280 typedef struct
282 unsigned TMR1IF : 1;
283 unsigned TMR2IF : 1;
284 unsigned CCP1IF : 1;
285 unsigned SSPIF : 1;
286 unsigned : 1;
287 unsigned : 1;
288 unsigned ADIF : 1;
289 unsigned : 1;
290 } __PIR1bits_t;
292 extern __at(0x000C) volatile __PIR1bits_t PIR1bits;
294 #define _TMR1IF 0x01
295 #define _TMR2IF 0x02
296 #define _CCP1IF 0x04
297 #define _SSPIF 0x08
298 #define _ADIF 0x40
300 //==============================================================================
302 extern __at(0x000E) __sfr TMR1;
303 extern __at(0x000E) __sfr TMR1L;
304 extern __at(0x000F) __sfr TMR1H;
306 //==============================================================================
307 // T1CON Bits
309 extern __at(0x0010) __sfr T1CON;
311 typedef union
313 struct
315 unsigned TMR1ON : 1;
316 unsigned TMR1CS : 1;
317 unsigned NOT_T1SYNC : 1;
318 unsigned T1OSCEN : 1;
319 unsigned T1CKPS0 : 1;
320 unsigned T1CKPS1 : 1;
321 unsigned : 1;
322 unsigned : 1;
325 struct
327 unsigned : 1;
328 unsigned : 1;
329 unsigned T1INSYNC : 1;
330 unsigned : 1;
331 unsigned : 1;
332 unsigned : 1;
333 unsigned : 1;
334 unsigned : 1;
337 struct
339 unsigned : 4;
340 unsigned T1CKPS : 2;
341 unsigned : 2;
343 } __T1CONbits_t;
345 extern __at(0x0010) volatile __T1CONbits_t T1CONbits;
347 #define _TMR1ON 0x01
348 #define _TMR1CS 0x02
349 #define _NOT_T1SYNC 0x04
350 #define _T1INSYNC 0x04
351 #define _T1OSCEN 0x08
352 #define _T1CKPS0 0x10
353 #define _T1CKPS1 0x20
355 //==============================================================================
357 extern __at(0x0011) __sfr TMR2;
359 //==============================================================================
360 // T2CON Bits
362 extern __at(0x0012) __sfr T2CON;
364 typedef union
366 struct
368 unsigned T2CKPS0 : 1;
369 unsigned T2CKPS1 : 1;
370 unsigned TMR2ON : 1;
371 unsigned TOUTPS0 : 1;
372 unsigned TOUTPS1 : 1;
373 unsigned TOUTPS2 : 1;
374 unsigned TOUTPS3 : 1;
375 unsigned : 1;
378 struct
380 unsigned T2CKPS : 2;
381 unsigned : 6;
384 struct
386 unsigned : 3;
387 unsigned TOUTPS : 4;
388 unsigned : 1;
390 } __T2CONbits_t;
392 extern __at(0x0012) volatile __T2CONbits_t T2CONbits;
394 #define _T2CKPS0 0x01
395 #define _T2CKPS1 0x02
396 #define _TMR2ON 0x04
397 #define _TOUTPS0 0x08
398 #define _TOUTPS1 0x10
399 #define _TOUTPS2 0x20
400 #define _TOUTPS3 0x40
402 //==============================================================================
404 extern __at(0x0013) __sfr SSPBUF;
406 //==============================================================================
407 // SSPCON Bits
409 extern __at(0x0014) __sfr SSPCON;
411 typedef union
413 struct
415 unsigned SSPM0 : 1;
416 unsigned SSPM1 : 1;
417 unsigned SSPM2 : 1;
418 unsigned SSPM3 : 1;
419 unsigned CKP : 1;
420 unsigned SSPEN : 1;
421 unsigned SSPOV : 1;
422 unsigned WCOL : 1;
425 struct
427 unsigned SSPM : 4;
428 unsigned : 4;
430 } __SSPCONbits_t;
432 extern __at(0x0014) volatile __SSPCONbits_t SSPCONbits;
434 #define _SSPM0 0x01
435 #define _SSPM1 0x02
436 #define _SSPM2 0x04
437 #define _SSPM3 0x08
438 #define _CKP 0x10
439 #define _SSPEN 0x20
440 #define _SSPOV 0x40
441 #define _WCOL 0x80
443 //==============================================================================
445 extern __at(0x0015) __sfr CCPR1;
446 extern __at(0x0015) __sfr CCPR1L;
447 extern __at(0x0016) __sfr CCPR1H;
449 //==============================================================================
450 // CCP1CON Bits
452 extern __at(0x0017) __sfr CCP1CON;
454 typedef union
456 struct
458 unsigned CCP1M0 : 1;
459 unsigned CCP1M1 : 1;
460 unsigned CCP1M2 : 1;
461 unsigned CCP1M3 : 1;
462 unsigned CCP1Y : 1;
463 unsigned CCP1X : 1;
464 unsigned : 1;
465 unsigned : 1;
468 struct
470 unsigned CCP1M : 4;
471 unsigned : 4;
473 } __CCP1CONbits_t;
475 extern __at(0x0017) volatile __CCP1CONbits_t CCP1CONbits;
477 #define _CCP1M0 0x01
478 #define _CCP1M1 0x02
479 #define _CCP1M2 0x04
480 #define _CCP1M3 0x08
481 #define _CCP1Y 0x10
482 #define _CCP1X 0x20
484 //==============================================================================
486 extern __at(0x001E) __sfr ADRES;
488 //==============================================================================
489 // ADCON0 Bits
491 extern __at(0x001F) __sfr ADCON0;
493 typedef union
495 struct
497 unsigned ADON : 1;
498 unsigned : 1;
499 unsigned GO_NOT_DONE : 1;
500 unsigned CHS0 : 1;
501 unsigned CHS1 : 1;
502 unsigned CHS2 : 1;
503 unsigned ADCS0 : 1;
504 unsigned ADCS1 : 1;
507 struct
509 unsigned : 1;
510 unsigned : 1;
511 unsigned GO : 1;
512 unsigned : 1;
513 unsigned : 1;
514 unsigned : 1;
515 unsigned : 1;
516 unsigned : 1;
519 struct
521 unsigned : 1;
522 unsigned : 1;
523 unsigned NOT_DONE : 1;
524 unsigned : 1;
525 unsigned : 1;
526 unsigned : 1;
527 unsigned : 1;
528 unsigned : 1;
531 struct
533 unsigned : 1;
534 unsigned : 1;
535 unsigned GO_DONE : 1;
536 unsigned : 1;
537 unsigned : 1;
538 unsigned : 1;
539 unsigned : 1;
540 unsigned : 1;
543 struct
545 unsigned : 3;
546 unsigned CHS : 3;
547 unsigned : 2;
550 struct
552 unsigned : 6;
553 unsigned ADCS : 2;
555 } __ADCON0bits_t;
557 extern __at(0x001F) volatile __ADCON0bits_t ADCON0bits;
559 #define _ADON 0x01
560 #define _GO_NOT_DONE 0x04
561 #define _GO 0x04
562 #define _NOT_DONE 0x04
563 #define _GO_DONE 0x04
564 #define _CHS0 0x08
565 #define _CHS1 0x10
566 #define _CHS2 0x20
567 #define _ADCS0 0x40
568 #define _ADCS1 0x80
570 //==============================================================================
573 //==============================================================================
574 // OPTION_REG Bits
576 extern __at(0x0081) __sfr OPTION_REG;
578 typedef union
580 struct
582 unsigned PS0 : 1;
583 unsigned PS1 : 1;
584 unsigned PS2 : 1;
585 unsigned PSA : 1;
586 unsigned T0SE : 1;
587 unsigned T0CS : 1;
588 unsigned INTEDG : 1;
589 unsigned NOT_RBPU : 1;
592 struct
594 unsigned PS : 3;
595 unsigned : 5;
597 } __OPTION_REGbits_t;
599 extern __at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits;
601 #define _PS0 0x01
602 #define _PS1 0x02
603 #define _PS2 0x04
604 #define _PSA 0x08
605 #define _T0SE 0x10
606 #define _T0CS 0x20
607 #define _INTEDG 0x40
608 #define _NOT_RBPU 0x80
610 //==============================================================================
613 //==============================================================================
614 // TRISA Bits
616 extern __at(0x0085) __sfr TRISA;
618 typedef union
620 struct
622 unsigned TRISA0 : 1;
623 unsigned TRISA1 : 1;
624 unsigned TRISA2 : 1;
625 unsigned TRISA3 : 1;
626 unsigned TRISA4 : 1;
627 unsigned TRISA5 : 1;
628 unsigned : 1;
629 unsigned : 1;
632 struct
634 unsigned TRISA : 6;
635 unsigned : 2;
637 } __TRISAbits_t;
639 extern __at(0x0085) volatile __TRISAbits_t TRISAbits;
641 #define _TRISA0 0x01
642 #define _TRISA1 0x02
643 #define _TRISA2 0x04
644 #define _TRISA3 0x08
645 #define _TRISA4 0x10
646 #define _TRISA5 0x20
648 //==============================================================================
651 //==============================================================================
652 // TRISB Bits
654 extern __at(0x0086) __sfr TRISB;
656 typedef struct
658 unsigned TRISB0 : 1;
659 unsigned TRISB1 : 1;
660 unsigned TRISB2 : 1;
661 unsigned TRISB3 : 1;
662 unsigned TRISB4 : 1;
663 unsigned TRISB5 : 1;
664 unsigned TRISB6 : 1;
665 unsigned TRISB7 : 1;
666 } __TRISBbits_t;
668 extern __at(0x0086) volatile __TRISBbits_t TRISBbits;
670 #define _TRISB0 0x01
671 #define _TRISB1 0x02
672 #define _TRISB2 0x04
673 #define _TRISB3 0x08
674 #define _TRISB4 0x10
675 #define _TRISB5 0x20
676 #define _TRISB6 0x40
677 #define _TRISB7 0x80
679 //==============================================================================
682 //==============================================================================
683 // TRISC Bits
685 extern __at(0x0087) __sfr TRISC;
687 typedef struct
689 unsigned TRISC0 : 1;
690 unsigned TRISC1 : 1;
691 unsigned TRISC2 : 1;
692 unsigned TRISC3 : 1;
693 unsigned TRISC4 : 1;
694 unsigned TRISC5 : 1;
695 unsigned TRISC6 : 1;
696 unsigned TRISC7 : 1;
697 } __TRISCbits_t;
699 extern __at(0x0087) volatile __TRISCbits_t TRISCbits;
701 #define _TRISC0 0x01
702 #define _TRISC1 0x02
703 #define _TRISC2 0x04
704 #define _TRISC3 0x08
705 #define _TRISC4 0x10
706 #define _TRISC5 0x20
707 #define _TRISC6 0x40
708 #define _TRISC7 0x80
710 //==============================================================================
713 //==============================================================================
714 // PIE1 Bits
716 extern __at(0x008C) __sfr PIE1;
718 typedef struct
720 unsigned TMR1IE : 1;
721 unsigned TMR2IE : 1;
722 unsigned CCP1IE : 1;
723 unsigned SSPIE : 1;
724 unsigned : 1;
725 unsigned : 1;
726 unsigned ADIE : 1;
727 unsigned : 1;
728 } __PIE1bits_t;
730 extern __at(0x008C) volatile __PIE1bits_t PIE1bits;
732 #define _TMR1IE 0x01
733 #define _TMR2IE 0x02
734 #define _CCP1IE 0x04
735 #define _SSPIE 0x08
736 #define _ADIE 0x40
738 //==============================================================================
741 //==============================================================================
742 // PCON Bits
744 extern __at(0x008E) __sfr PCON;
746 typedef union
748 struct
750 unsigned NOT_BOR : 1;
751 unsigned NOT_POR : 1;
752 unsigned : 1;
753 unsigned : 1;
754 unsigned : 1;
755 unsigned : 1;
756 unsigned : 1;
757 unsigned : 1;
760 struct
762 unsigned NOT_BO : 1;
763 unsigned : 1;
764 unsigned : 1;
765 unsigned : 1;
766 unsigned : 1;
767 unsigned : 1;
768 unsigned : 1;
769 unsigned : 1;
771 } __PCONbits_t;
773 extern __at(0x008E) volatile __PCONbits_t PCONbits;
775 #define _NOT_BOR 0x01
776 #define _NOT_BO 0x01
777 #define _NOT_POR 0x02
779 //==============================================================================
781 extern __at(0x0092) __sfr PR2;
782 extern __at(0x0093) __sfr SSPADD;
784 //==============================================================================
785 // SSPSTAT Bits
787 extern __at(0x0094) __sfr SSPSTAT;
789 typedef union
791 struct
793 unsigned BF : 1;
794 unsigned UA : 1;
795 unsigned R_NOT_W : 1;
796 unsigned S : 1;
797 unsigned P : 1;
798 unsigned D_NOT_A : 1;
799 unsigned : 1;
800 unsigned : 1;
803 struct
805 unsigned : 1;
806 unsigned : 1;
807 unsigned R : 1;
808 unsigned I2C_START : 1;
809 unsigned I2C_STOP : 1;
810 unsigned D : 1;
811 unsigned : 1;
812 unsigned : 1;
815 struct
817 unsigned : 1;
818 unsigned : 1;
819 unsigned I2C_READ : 1;
820 unsigned : 1;
821 unsigned : 1;
822 unsigned I2C_DATA : 1;
823 unsigned : 1;
824 unsigned : 1;
827 struct
829 unsigned : 1;
830 unsigned : 1;
831 unsigned R_W : 1;
832 unsigned : 1;
833 unsigned : 1;
834 unsigned D_A : 1;
835 unsigned : 1;
836 unsigned : 1;
839 struct
841 unsigned : 1;
842 unsigned : 1;
843 unsigned READ_WRITE : 1;
844 unsigned : 1;
845 unsigned : 1;
846 unsigned DATA_ADDRESS : 1;
847 unsigned : 1;
848 unsigned : 1;
851 struct
853 unsigned : 1;
854 unsigned : 1;
855 unsigned NOT_W : 1;
856 unsigned : 1;
857 unsigned : 1;
858 unsigned NOT_A : 1;
859 unsigned : 1;
860 unsigned : 1;
863 struct
865 unsigned : 1;
866 unsigned : 1;
867 unsigned NOT_WRITE : 1;
868 unsigned : 1;
869 unsigned : 1;
870 unsigned NOT_ADDRESS : 1;
871 unsigned : 1;
872 unsigned : 1;
874 } __SSPSTATbits_t;
876 extern __at(0x0094) volatile __SSPSTATbits_t SSPSTATbits;
878 #define _BF 0x01
879 #define _UA 0x02
880 #define _R_NOT_W 0x04
881 #define _R 0x04
882 #define _I2C_READ 0x04
883 #define _R_W 0x04
884 #define _READ_WRITE 0x04
885 #define _NOT_W 0x04
886 #define _NOT_WRITE 0x04
887 #define _S 0x08
888 #define _I2C_START 0x08
889 #define _P 0x10
890 #define _I2C_STOP 0x10
891 #define _D_NOT_A 0x20
892 #define _D 0x20
893 #define _I2C_DATA 0x20
894 #define _D_A 0x20
895 #define _DATA_ADDRESS 0x20
896 #define _NOT_A 0x20
897 #define _NOT_ADDRESS 0x20
899 //==============================================================================
902 //==============================================================================
903 // ADCON1 Bits
905 extern __at(0x009F) __sfr ADCON1;
907 typedef union
909 struct
911 unsigned PCFG0 : 1;
912 unsigned PCFG1 : 1;
913 unsigned PCFG2 : 1;
914 unsigned : 1;
915 unsigned : 1;
916 unsigned : 1;
917 unsigned : 1;
918 unsigned : 1;
921 struct
923 unsigned PCFG : 3;
924 unsigned : 5;
926 } __ADCON1bits_t;
928 extern __at(0x009F) volatile __ADCON1bits_t ADCON1bits;
930 #define _PCFG0 0x01
931 #define _PCFG1 0x02
932 #define _PCFG2 0x04
934 //==============================================================================
937 //==============================================================================
939 // Configuration Bits
941 //==============================================================================
943 #define _CONFIG1 0x2007
945 //----------------------------- CONFIG1 Options -------------------------------
947 #define _FOSC_LP 0x3FFC // LP oscillator.
948 #define _LP_OSC 0x3FFC // LP oscillator.
949 #define _FOSC_XT 0x3FFD // XT oscillator.
950 #define _XT_OSC 0x3FFD // XT oscillator.
951 #define _FOSC_HS 0x3FFE // HS oscillator.
952 #define _HS_OSC 0x3FFE // HS oscillator.
953 #define _FOSC_RC 0x3FFF // RC oscillator.
954 #define _RC_OSC 0x3FFF // RC oscillator.
955 #define _WDTE_OFF 0x3FFB // WDT disabled.
956 #define _WDT_OFF 0x3FFB // WDT disabled.
957 #define _WDTE_ON 0x3FFF // WDT enabled.
958 #define _WDT_ON 0x3FFF // WDT enabled.
959 #define _PWRTE_ON 0x3FF7 // PWRT enabled.
960 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
961 #define _CP_ALL 0x00CF // All memory is code protected.
962 #define _CP_75 0x15DF // 0200h-07FFh code protected.
963 #define _CP_50 0x2AEF // 0400h-07FFh code protected.
964 #define _CP_OFF 0x3FFF // Code protection off.
965 #define _BOREN_OFF 0x3FBF // BOR disabled.
966 #define _BODEN_OFF 0x3FBF // BOR disabled.
967 #define _BOREN_ON 0x3FFF // BOR enabled.
968 #define _BODEN_ON 0x3FFF // BOR enabled.
970 //==============================================================================
972 #define _IDLOC0 0x2000
973 #define _IDLOC1 0x2001
974 #define _IDLOC2 0x2002
975 #define _IDLOC3 0x2003
977 //==============================================================================
979 #ifndef NO_BIT_DEFINES
981 #define ADON ADCON0bits.ADON // bit 0
982 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 2, shadows bit in ADCON0bits
983 #define GO ADCON0bits.GO // bit 2, shadows bit in ADCON0bits
984 #define NOT_DONE ADCON0bits.NOT_DONE // bit 2, shadows bit in ADCON0bits
985 #define GO_DONE ADCON0bits.GO_DONE // bit 2, shadows bit in ADCON0bits
986 #define CHS0 ADCON0bits.CHS0 // bit 3
987 #define CHS1 ADCON0bits.CHS1 // bit 4
988 #define CHS2 ADCON0bits.CHS2 // bit 5
989 #define ADCS0 ADCON0bits.ADCS0 // bit 6
990 #define ADCS1 ADCON0bits.ADCS1 // bit 7
992 #define PCFG0 ADCON1bits.PCFG0 // bit 0
993 #define PCFG1 ADCON1bits.PCFG1 // bit 1
994 #define PCFG2 ADCON1bits.PCFG2 // bit 2
996 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
997 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
998 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
999 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
1000 #define CCP1Y CCP1CONbits.CCP1Y // bit 4
1001 #define CCP1X CCP1CONbits.CCP1X // bit 5
1003 #define RBIF INTCONbits.RBIF // bit 0
1004 #define INTF INTCONbits.INTF // bit 1
1005 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
1006 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
1007 #define RBIE INTCONbits.RBIE // bit 3
1008 #define INTE INTCONbits.INTE // bit 4
1009 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
1010 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
1011 #define PEIE INTCONbits.PEIE // bit 6
1012 #define GIE INTCONbits.GIE // bit 7
1014 #define PS0 OPTION_REGbits.PS0 // bit 0
1015 #define PS1 OPTION_REGbits.PS1 // bit 1
1016 #define PS2 OPTION_REGbits.PS2 // bit 2
1017 #define PSA OPTION_REGbits.PSA // bit 3
1018 #define T0SE OPTION_REGbits.T0SE // bit 4
1019 #define T0CS OPTION_REGbits.T0CS // bit 5
1020 #define INTEDG OPTION_REGbits.INTEDG // bit 6
1021 #define NOT_RBPU OPTION_REGbits.NOT_RBPU // bit 7
1023 #define NOT_BOR PCONbits.NOT_BOR // bit 0, shadows bit in PCONbits
1024 #define NOT_BO PCONbits.NOT_BO // bit 0, shadows bit in PCONbits
1025 #define NOT_POR PCONbits.NOT_POR // bit 1
1027 #define TMR1IE PIE1bits.TMR1IE // bit 0
1028 #define TMR2IE PIE1bits.TMR2IE // bit 1
1029 #define CCP1IE PIE1bits.CCP1IE // bit 2
1030 #define SSPIE PIE1bits.SSPIE // bit 3
1031 #define ADIE PIE1bits.ADIE // bit 6
1033 #define TMR1IF PIR1bits.TMR1IF // bit 0
1034 #define TMR2IF PIR1bits.TMR2IF // bit 1
1035 #define CCP1IF PIR1bits.CCP1IF // bit 2
1036 #define SSPIF PIR1bits.SSPIF // bit 3
1037 #define ADIF PIR1bits.ADIF // bit 6
1039 #define RA0 PORTAbits.RA0 // bit 0
1040 #define RA1 PORTAbits.RA1 // bit 1
1041 #define RA2 PORTAbits.RA2 // bit 2
1042 #define RA3 PORTAbits.RA3 // bit 3
1043 #define RA4 PORTAbits.RA4 // bit 4
1044 #define RA5 PORTAbits.RA5 // bit 5
1046 #define RB0 PORTBbits.RB0 // bit 0
1047 #define RB1 PORTBbits.RB1 // bit 1
1048 #define RB2 PORTBbits.RB2 // bit 2
1049 #define RB3 PORTBbits.RB3 // bit 3
1050 #define RB4 PORTBbits.RB4 // bit 4
1051 #define RB5 PORTBbits.RB5 // bit 5
1052 #define RB6 PORTBbits.RB6 // bit 6
1053 #define RB7 PORTBbits.RB7 // bit 7
1055 #define RC0 PORTCbits.RC0 // bit 0
1056 #define RC1 PORTCbits.RC1 // bit 1
1057 #define RC2 PORTCbits.RC2 // bit 2
1058 #define RC3 PORTCbits.RC3 // bit 3
1059 #define RC4 PORTCbits.RC4 // bit 4
1060 #define RC5 PORTCbits.RC5 // bit 5
1061 #define RC6 PORTCbits.RC6 // bit 6
1062 #define RC7 PORTCbits.RC7 // bit 7
1064 #define SSPM0 SSPCONbits.SSPM0 // bit 0
1065 #define SSPM1 SSPCONbits.SSPM1 // bit 1
1066 #define SSPM2 SSPCONbits.SSPM2 // bit 2
1067 #define SSPM3 SSPCONbits.SSPM3 // bit 3
1068 #define CKP SSPCONbits.CKP // bit 4
1069 #define SSPEN SSPCONbits.SSPEN // bit 5
1070 #define SSPOV SSPCONbits.SSPOV // bit 6
1071 #define WCOL SSPCONbits.WCOL // bit 7
1073 #define BF SSPSTATbits.BF // bit 0
1074 #define UA SSPSTATbits.UA // bit 1
1075 #define R_NOT_W SSPSTATbits.R_NOT_W // bit 2, shadows bit in SSPSTATbits
1076 #define R SSPSTATbits.R // bit 2, shadows bit in SSPSTATbits
1077 #define I2C_READ SSPSTATbits.I2C_READ // bit 2, shadows bit in SSPSTATbits
1078 #define R_W SSPSTATbits.R_W // bit 2, shadows bit in SSPSTATbits
1079 #define READ_WRITE SSPSTATbits.READ_WRITE // bit 2, shadows bit in SSPSTATbits
1080 #define NOT_W SSPSTATbits.NOT_W // bit 2, shadows bit in SSPSTATbits
1081 #define NOT_WRITE SSPSTATbits.NOT_WRITE // bit 2, shadows bit in SSPSTATbits
1082 #define S SSPSTATbits.S // bit 3, shadows bit in SSPSTATbits
1083 #define I2C_START SSPSTATbits.I2C_START // bit 3, shadows bit in SSPSTATbits
1084 #define P SSPSTATbits.P // bit 4, shadows bit in SSPSTATbits
1085 #define I2C_STOP SSPSTATbits.I2C_STOP // bit 4, shadows bit in SSPSTATbits
1086 #define D_NOT_A SSPSTATbits.D_NOT_A // bit 5, shadows bit in SSPSTATbits
1087 #define D SSPSTATbits.D // bit 5, shadows bit in SSPSTATbits
1088 #define I2C_DATA SSPSTATbits.I2C_DATA // bit 5, shadows bit in SSPSTATbits
1089 #define D_A SSPSTATbits.D_A // bit 5, shadows bit in SSPSTATbits
1090 #define DATA_ADDRESS SSPSTATbits.DATA_ADDRESS // bit 5, shadows bit in SSPSTATbits
1091 #define NOT_A SSPSTATbits.NOT_A // bit 5, shadows bit in SSPSTATbits
1092 #define NOT_ADDRESS SSPSTATbits.NOT_ADDRESS // bit 5, shadows bit in SSPSTATbits
1094 #define C STATUSbits.C // bit 0
1095 #define DC STATUSbits.DC // bit 1
1096 #define Z STATUSbits.Z // bit 2
1097 #define NOT_PD STATUSbits.NOT_PD // bit 3
1098 #define NOT_TO STATUSbits.NOT_TO // bit 4
1099 #define RP0 STATUSbits.RP0 // bit 5
1100 #define RP1 STATUSbits.RP1 // bit 6
1101 #define IRP STATUSbits.IRP // bit 7
1103 #define TMR1ON T1CONbits.TMR1ON // bit 0
1104 #define TMR1CS T1CONbits.TMR1CS // bit 1
1105 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2, shadows bit in T1CONbits
1106 #define T1INSYNC T1CONbits.T1INSYNC // bit 2, shadows bit in T1CONbits
1107 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
1108 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
1109 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
1111 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
1112 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
1113 #define TMR2ON T2CONbits.TMR2ON // bit 2
1114 #define TOUTPS0 T2CONbits.TOUTPS0 // bit 3
1115 #define TOUTPS1 T2CONbits.TOUTPS1 // bit 4
1116 #define TOUTPS2 T2CONbits.TOUTPS2 // bit 5
1117 #define TOUTPS3 T2CONbits.TOUTPS3 // bit 6
1119 #define TRISA0 TRISAbits.TRISA0 // bit 0
1120 #define TRISA1 TRISAbits.TRISA1 // bit 1
1121 #define TRISA2 TRISAbits.TRISA2 // bit 2
1122 #define TRISA3 TRISAbits.TRISA3 // bit 3
1123 #define TRISA4 TRISAbits.TRISA4 // bit 4
1124 #define TRISA5 TRISAbits.TRISA5 // bit 5
1126 #define TRISB0 TRISBbits.TRISB0 // bit 0
1127 #define TRISB1 TRISBbits.TRISB1 // bit 1
1128 #define TRISB2 TRISBbits.TRISB2 // bit 2
1129 #define TRISB3 TRISBbits.TRISB3 // bit 3
1130 #define TRISB4 TRISBbits.TRISB4 // bit 4
1131 #define TRISB5 TRISBbits.TRISB5 // bit 5
1132 #define TRISB6 TRISBbits.TRISB6 // bit 6
1133 #define TRISB7 TRISBbits.TRISB7 // bit 7
1135 #define TRISC0 TRISCbits.TRISC0 // bit 0
1136 #define TRISC1 TRISCbits.TRISC1 // bit 1
1137 #define TRISC2 TRISCbits.TRISC2 // bit 2
1138 #define TRISC3 TRISCbits.TRISC3 // bit 3
1139 #define TRISC4 TRISCbits.TRISC4 // bit 4
1140 #define TRISC5 TRISCbits.TRISC5 // bit 5
1141 #define TRISC6 TRISCbits.TRISC6 // bit 6
1142 #define TRISC7 TRISCbits.TRISC7 // bit 7
1144 #endif // #ifndef NO_BIT_DEFINES
1146 #endif // #ifndef __PIC16C72_H__