Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16f72.h
blobefa4e4e4c27c2493ec554185de6c230978a18c08
1 /*
2 * This declarations of the PIC16F72 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:55 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 __PIC16F72_H__
26 #define __PIC16F72_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
71 #define PMDATL_ADDR 0x010C
72 #define PMADRL_ADDR 0x010D
73 #define PMDATH_ADDR 0x010E
74 #define PMADRH_ADDR 0x010F
75 #define PMCON1_ADDR 0x018C
77 #endif // #ifndef NO_ADDR_DEFINES
79 //==============================================================================
81 // Register Definitions
83 //==============================================================================
85 extern __at(0x0000) __sfr INDF;
86 extern __at(0x0001) __sfr TMR0;
87 extern __at(0x0002) __sfr PCL;
89 //==============================================================================
90 // STATUS Bits
92 extern __at(0x0003) __sfr STATUS;
94 typedef union
96 struct
98 unsigned C : 1;
99 unsigned DC : 1;
100 unsigned Z : 1;
101 unsigned NOT_PD : 1;
102 unsigned NOT_TO : 1;
103 unsigned RP0 : 1;
104 unsigned RP1 : 1;
105 unsigned IRP : 1;
108 struct
110 unsigned : 5;
111 unsigned RP : 2;
112 unsigned : 1;
114 } __STATUSbits_t;
116 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
118 #define _C 0x01
119 #define _DC 0x02
120 #define _Z 0x04
121 #define _NOT_PD 0x08
122 #define _NOT_TO 0x10
123 #define _RP0 0x20
124 #define _RP1 0x40
125 #define _IRP 0x80
127 //==============================================================================
129 extern __at(0x0004) __sfr FSR;
131 //==============================================================================
132 // PORTA Bits
134 extern __at(0x0005) __sfr PORTA;
136 typedef union
138 struct
140 unsigned RA0 : 1;
141 unsigned RA1 : 1;
142 unsigned RA2 : 1;
143 unsigned RA3 : 1;
144 unsigned RA4 : 1;
145 unsigned RA5 : 1;
146 unsigned : 1;
147 unsigned : 1;
150 struct
152 unsigned RA : 6;
153 unsigned : 2;
155 } __PORTAbits_t;
157 extern __at(0x0005) volatile __PORTAbits_t PORTAbits;
159 #define _RA0 0x01
160 #define _RA1 0x02
161 #define _RA2 0x04
162 #define _RA3 0x08
163 #define _RA4 0x10
164 #define _RA5 0x20
166 //==============================================================================
169 //==============================================================================
170 // PORTB Bits
172 extern __at(0x0006) __sfr PORTB;
174 typedef struct
176 unsigned RB0 : 1;
177 unsigned RB1 : 1;
178 unsigned RB2 : 1;
179 unsigned RB3 : 1;
180 unsigned RB4 : 1;
181 unsigned RB5 : 1;
182 unsigned RB6 : 1;
183 unsigned RB7 : 1;
184 } __PORTBbits_t;
186 extern __at(0x0006) volatile __PORTBbits_t PORTBbits;
188 #define _RB0 0x01
189 #define _RB1 0x02
190 #define _RB2 0x04
191 #define _RB3 0x08
192 #define _RB4 0x10
193 #define _RB5 0x20
194 #define _RB6 0x40
195 #define _RB7 0x80
197 //==============================================================================
200 //==============================================================================
201 // PORTC Bits
203 extern __at(0x0007) __sfr PORTC;
205 typedef struct
207 unsigned RC0 : 1;
208 unsigned RC1 : 1;
209 unsigned RC2 : 1;
210 unsigned RC3 : 1;
211 unsigned RC4 : 1;
212 unsigned RC5 : 1;
213 unsigned RC6 : 1;
214 unsigned RC7 : 1;
215 } __PORTCbits_t;
217 extern __at(0x0007) volatile __PORTCbits_t PORTCbits;
219 #define _RC0 0x01
220 #define _RC1 0x02
221 #define _RC2 0x04
222 #define _RC3 0x08
223 #define _RC4 0x10
224 #define _RC5 0x20
225 #define _RC6 0x40
226 #define _RC7 0x80
228 //==============================================================================
230 extern __at(0x000A) __sfr PCLATH;
232 //==============================================================================
233 // INTCON Bits
235 extern __at(0x000B) __sfr INTCON;
237 typedef union
239 struct
241 unsigned RBIF : 1;
242 unsigned INTF : 1;
243 unsigned TMR0IF : 1;
244 unsigned RBIE : 1;
245 unsigned INTE : 1;
246 unsigned TMR0IE : 1;
247 unsigned PEIE : 1;
248 unsigned GIE : 1;
251 struct
253 unsigned : 1;
254 unsigned : 1;
255 unsigned T0IF : 1;
256 unsigned : 1;
257 unsigned : 1;
258 unsigned T0IE : 1;
259 unsigned : 1;
260 unsigned : 1;
262 } __INTCONbits_t;
264 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
266 #define _RBIF 0x01
267 #define _INTF 0x02
268 #define _TMR0IF 0x04
269 #define _T0IF 0x04
270 #define _RBIE 0x08
271 #define _INTE 0x10
272 #define _TMR0IE 0x20
273 #define _T0IE 0x20
274 #define _PEIE 0x40
275 #define _GIE 0x80
277 //==============================================================================
280 //==============================================================================
281 // PIR1 Bits
283 extern __at(0x000C) __sfr PIR1;
285 typedef struct
287 unsigned TMR1IF : 1;
288 unsigned TMR2IF : 1;
289 unsigned CCP1IF : 1;
290 unsigned SSPIF : 1;
291 unsigned : 1;
292 unsigned : 1;
293 unsigned ADIF : 1;
294 unsigned : 1;
295 } __PIR1bits_t;
297 extern __at(0x000C) volatile __PIR1bits_t PIR1bits;
299 #define _TMR1IF 0x01
300 #define _TMR2IF 0x02
301 #define _CCP1IF 0x04
302 #define _SSPIF 0x08
303 #define _ADIF 0x40
305 //==============================================================================
307 extern __at(0x000E) __sfr TMR1;
308 extern __at(0x000E) __sfr TMR1L;
309 extern __at(0x000F) __sfr TMR1H;
311 //==============================================================================
312 // T1CON Bits
314 extern __at(0x0010) __sfr T1CON;
316 typedef union
318 struct
320 unsigned TMR1ON : 1;
321 unsigned TMR1CS : 1;
322 unsigned NOT_T1SYNC : 1;
323 unsigned T1OSCEN : 1;
324 unsigned T1CKPS0 : 1;
325 unsigned T1CKPS1 : 1;
326 unsigned : 1;
327 unsigned : 1;
330 struct
332 unsigned : 1;
333 unsigned : 1;
334 unsigned T1INSYNC : 1;
335 unsigned : 1;
336 unsigned : 1;
337 unsigned : 1;
338 unsigned : 1;
339 unsigned : 1;
342 struct
344 unsigned : 4;
345 unsigned T1CKPS : 2;
346 unsigned : 2;
348 } __T1CONbits_t;
350 extern __at(0x0010) volatile __T1CONbits_t T1CONbits;
352 #define _TMR1ON 0x01
353 #define _TMR1CS 0x02
354 #define _NOT_T1SYNC 0x04
355 #define _T1INSYNC 0x04
356 #define _T1OSCEN 0x08
357 #define _T1CKPS0 0x10
358 #define _T1CKPS1 0x20
360 //==============================================================================
362 extern __at(0x0011) __sfr TMR2;
364 //==============================================================================
365 // T2CON Bits
367 extern __at(0x0012) __sfr T2CON;
369 typedef union
371 struct
373 unsigned T2CKPS0 : 1;
374 unsigned T2CKPS1 : 1;
375 unsigned TMR2ON : 1;
376 unsigned TOUTPS0 : 1;
377 unsigned TOUTPS1 : 1;
378 unsigned TOUTPS2 : 1;
379 unsigned TOUTPS3 : 1;
380 unsigned : 1;
383 struct
385 unsigned T2CKPS : 2;
386 unsigned : 6;
389 struct
391 unsigned : 3;
392 unsigned TOUTPS : 4;
393 unsigned : 1;
395 } __T2CONbits_t;
397 extern __at(0x0012) volatile __T2CONbits_t T2CONbits;
399 #define _T2CKPS0 0x01
400 #define _T2CKPS1 0x02
401 #define _TMR2ON 0x04
402 #define _TOUTPS0 0x08
403 #define _TOUTPS1 0x10
404 #define _TOUTPS2 0x20
405 #define _TOUTPS3 0x40
407 //==============================================================================
409 extern __at(0x0013) __sfr SSPBUF;
411 //==============================================================================
412 // SSPCON Bits
414 extern __at(0x0014) __sfr SSPCON;
416 typedef union
418 struct
420 unsigned SSPM0 : 1;
421 unsigned SSPM1 : 1;
422 unsigned SSPM2 : 1;
423 unsigned SSPM3 : 1;
424 unsigned CKP : 1;
425 unsigned SSPEN : 1;
426 unsigned SSPOV : 1;
427 unsigned WCOL : 1;
430 struct
432 unsigned SSPM : 4;
433 unsigned : 4;
435 } __SSPCONbits_t;
437 extern __at(0x0014) volatile __SSPCONbits_t SSPCONbits;
439 #define _SSPM0 0x01
440 #define _SSPM1 0x02
441 #define _SSPM2 0x04
442 #define _SSPM3 0x08
443 #define _CKP 0x10
444 #define _SSPEN 0x20
445 #define _SSPOV 0x40
446 #define _WCOL 0x80
448 //==============================================================================
450 extern __at(0x0015) __sfr CCPR1;
451 extern __at(0x0015) __sfr CCPR1L;
452 extern __at(0x0016) __sfr CCPR1H;
454 //==============================================================================
455 // CCP1CON Bits
457 extern __at(0x0017) __sfr CCP1CON;
459 typedef union
461 struct
463 unsigned CCP1M0 : 1;
464 unsigned CCP1M1 : 1;
465 unsigned CCP1M2 : 1;
466 unsigned CCP1M3 : 1;
467 unsigned CCP1Y : 1;
468 unsigned CCP1X : 1;
469 unsigned : 1;
470 unsigned : 1;
473 struct
475 unsigned CCP1M : 4;
476 unsigned : 4;
478 } __CCP1CONbits_t;
480 extern __at(0x0017) volatile __CCP1CONbits_t CCP1CONbits;
482 #define _CCP1M0 0x01
483 #define _CCP1M1 0x02
484 #define _CCP1M2 0x04
485 #define _CCP1M3 0x08
486 #define _CCP1Y 0x10
487 #define _CCP1X 0x20
489 //==============================================================================
491 extern __at(0x001E) __sfr ADRES;
493 //==============================================================================
494 // ADCON0 Bits
496 extern __at(0x001F) __sfr ADCON0;
498 typedef union
500 struct
502 unsigned ADON : 1;
503 unsigned : 1;
504 unsigned GO_NOT_DONE : 1;
505 unsigned CHS0 : 1;
506 unsigned CHS1 : 1;
507 unsigned CHS2 : 1;
508 unsigned ADCS0 : 1;
509 unsigned ADCS1 : 1;
512 struct
514 unsigned : 1;
515 unsigned : 1;
516 unsigned GO : 1;
517 unsigned : 1;
518 unsigned : 1;
519 unsigned : 1;
520 unsigned : 1;
521 unsigned : 1;
524 struct
526 unsigned : 1;
527 unsigned : 1;
528 unsigned NOT_DONE : 1;
529 unsigned : 1;
530 unsigned : 1;
531 unsigned : 1;
532 unsigned : 1;
533 unsigned : 1;
536 struct
538 unsigned : 1;
539 unsigned : 1;
540 unsigned GO_DONE : 1;
541 unsigned : 1;
542 unsigned : 1;
543 unsigned : 1;
544 unsigned : 1;
545 unsigned : 1;
548 struct
550 unsigned : 3;
551 unsigned CHS : 3;
552 unsigned : 2;
555 struct
557 unsigned : 6;
558 unsigned ADCS : 2;
560 } __ADCON0bits_t;
562 extern __at(0x001F) volatile __ADCON0bits_t ADCON0bits;
564 #define _ADON 0x01
565 #define _GO_NOT_DONE 0x04
566 #define _GO 0x04
567 #define _NOT_DONE 0x04
568 #define _GO_DONE 0x04
569 #define _CHS0 0x08
570 #define _CHS1 0x10
571 #define _CHS2 0x20
572 #define _ADCS0 0x40
573 #define _ADCS1 0x80
575 //==============================================================================
578 //==============================================================================
579 // OPTION_REG Bits
581 extern __at(0x0081) __sfr OPTION_REG;
583 typedef union
585 struct
587 unsigned PS0 : 1;
588 unsigned PS1 : 1;
589 unsigned PS2 : 1;
590 unsigned PSA : 1;
591 unsigned T0SE : 1;
592 unsigned T0CS : 1;
593 unsigned INTEDG : 1;
594 unsigned NOT_RBPU : 1;
597 struct
599 unsigned PS : 3;
600 unsigned : 5;
602 } __OPTION_REGbits_t;
604 extern __at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits;
606 #define _PS0 0x01
607 #define _PS1 0x02
608 #define _PS2 0x04
609 #define _PSA 0x08
610 #define _T0SE 0x10
611 #define _T0CS 0x20
612 #define _INTEDG 0x40
613 #define _NOT_RBPU 0x80
615 //==============================================================================
618 //==============================================================================
619 // TRISA Bits
621 extern __at(0x0085) __sfr TRISA;
623 typedef union
625 struct
627 unsigned TRISA0 : 1;
628 unsigned TRISA1 : 1;
629 unsigned TRISA2 : 1;
630 unsigned TRISA3 : 1;
631 unsigned TRISA4 : 1;
632 unsigned TRISA5 : 1;
633 unsigned : 1;
634 unsigned : 1;
637 struct
639 unsigned TRISA : 6;
640 unsigned : 2;
642 } __TRISAbits_t;
644 extern __at(0x0085) volatile __TRISAbits_t TRISAbits;
646 #define _TRISA0 0x01
647 #define _TRISA1 0x02
648 #define _TRISA2 0x04
649 #define _TRISA3 0x08
650 #define _TRISA4 0x10
651 #define _TRISA5 0x20
653 //==============================================================================
656 //==============================================================================
657 // TRISB Bits
659 extern __at(0x0086) __sfr TRISB;
661 typedef struct
663 unsigned TRISB0 : 1;
664 unsigned TRISB1 : 1;
665 unsigned TRISB2 : 1;
666 unsigned TRISB3 : 1;
667 unsigned TRISB4 : 1;
668 unsigned TRISB5 : 1;
669 unsigned TRISB6 : 1;
670 unsigned TRISB7 : 1;
671 } __TRISBbits_t;
673 extern __at(0x0086) volatile __TRISBbits_t TRISBbits;
675 #define _TRISB0 0x01
676 #define _TRISB1 0x02
677 #define _TRISB2 0x04
678 #define _TRISB3 0x08
679 #define _TRISB4 0x10
680 #define _TRISB5 0x20
681 #define _TRISB6 0x40
682 #define _TRISB7 0x80
684 //==============================================================================
687 //==============================================================================
688 // TRISC Bits
690 extern __at(0x0087) __sfr TRISC;
692 typedef struct
694 unsigned TRISC0 : 1;
695 unsigned TRISC1 : 1;
696 unsigned TRISC2 : 1;
697 unsigned TRISC3 : 1;
698 unsigned TRISC4 : 1;
699 unsigned TRISC5 : 1;
700 unsigned TRISC6 : 1;
701 unsigned TRISC7 : 1;
702 } __TRISCbits_t;
704 extern __at(0x0087) volatile __TRISCbits_t TRISCbits;
706 #define _TRISC0 0x01
707 #define _TRISC1 0x02
708 #define _TRISC2 0x04
709 #define _TRISC3 0x08
710 #define _TRISC4 0x10
711 #define _TRISC5 0x20
712 #define _TRISC6 0x40
713 #define _TRISC7 0x80
715 //==============================================================================
718 //==============================================================================
719 // PIE1 Bits
721 extern __at(0x008C) __sfr PIE1;
723 typedef struct
725 unsigned TMR1IE : 1;
726 unsigned TMR2IE : 1;
727 unsigned CCP1IE : 1;
728 unsigned SSPIE : 1;
729 unsigned : 1;
730 unsigned : 1;
731 unsigned ADIE : 1;
732 unsigned : 1;
733 } __PIE1bits_t;
735 extern __at(0x008C) volatile __PIE1bits_t PIE1bits;
737 #define _TMR1IE 0x01
738 #define _TMR2IE 0x02
739 #define _CCP1IE 0x04
740 #define _SSPIE 0x08
741 #define _ADIE 0x40
743 //==============================================================================
746 //==============================================================================
747 // PCON Bits
749 extern __at(0x008E) __sfr PCON;
751 typedef union
753 struct
755 unsigned NOT_BOR : 1;
756 unsigned NOT_POR : 1;
757 unsigned : 1;
758 unsigned : 1;
759 unsigned : 1;
760 unsigned : 1;
761 unsigned : 1;
762 unsigned : 1;
765 struct
767 unsigned NOT_BO : 1;
768 unsigned : 1;
769 unsigned : 1;
770 unsigned : 1;
771 unsigned : 1;
772 unsigned : 1;
773 unsigned : 1;
774 unsigned : 1;
776 } __PCONbits_t;
778 extern __at(0x008E) volatile __PCONbits_t PCONbits;
780 #define _NOT_BOR 0x01
781 #define _NOT_BO 0x01
782 #define _NOT_POR 0x02
784 //==============================================================================
786 extern __at(0x0092) __sfr PR2;
787 extern __at(0x0093) __sfr SSPADD;
789 //==============================================================================
790 // SSPSTAT Bits
792 extern __at(0x0094) __sfr SSPSTAT;
794 typedef union
796 struct
798 unsigned BF : 1;
799 unsigned UA : 1;
800 unsigned R_NOT_W : 1;
801 unsigned S : 1;
802 unsigned P : 1;
803 unsigned D_NOT_A : 1;
804 unsigned CKE : 1;
805 unsigned SMP : 1;
808 struct
810 unsigned : 1;
811 unsigned : 1;
812 unsigned R : 1;
813 unsigned I2C_START : 1;
814 unsigned I2C_STOP : 1;
815 unsigned D : 1;
816 unsigned : 1;
817 unsigned : 1;
820 struct
822 unsigned : 1;
823 unsigned : 1;
824 unsigned I2C_READ : 1;
825 unsigned : 1;
826 unsigned : 1;
827 unsigned I2C_DATA : 1;
828 unsigned : 1;
829 unsigned : 1;
832 struct
834 unsigned : 1;
835 unsigned : 1;
836 unsigned NOT_W : 1;
837 unsigned : 1;
838 unsigned : 1;
839 unsigned NOT_A : 1;
840 unsigned : 1;
841 unsigned : 1;
844 struct
846 unsigned : 1;
847 unsigned : 1;
848 unsigned NOT_WRITE : 1;
849 unsigned : 1;
850 unsigned : 1;
851 unsigned NOT_ADDRESS : 1;
852 unsigned : 1;
853 unsigned : 1;
856 struct
858 unsigned : 1;
859 unsigned : 1;
860 unsigned R_W : 1;
861 unsigned : 1;
862 unsigned : 1;
863 unsigned D_A : 1;
864 unsigned : 1;
865 unsigned : 1;
868 struct
870 unsigned : 1;
871 unsigned : 1;
872 unsigned READ_WRITE : 1;
873 unsigned : 1;
874 unsigned : 1;
875 unsigned DATA_ADDRESS : 1;
876 unsigned : 1;
877 unsigned : 1;
879 } __SSPSTATbits_t;
881 extern __at(0x0094) volatile __SSPSTATbits_t SSPSTATbits;
883 #define _BF 0x01
884 #define _UA 0x02
885 #define _R_NOT_W 0x04
886 #define _R 0x04
887 #define _I2C_READ 0x04
888 #define _NOT_W 0x04
889 #define _NOT_WRITE 0x04
890 #define _R_W 0x04
891 #define _READ_WRITE 0x04
892 #define _S 0x08
893 #define _I2C_START 0x08
894 #define _P 0x10
895 #define _I2C_STOP 0x10
896 #define _D_NOT_A 0x20
897 #define _D 0x20
898 #define _I2C_DATA 0x20
899 #define _NOT_A 0x20
900 #define _NOT_ADDRESS 0x20
901 #define _D_A 0x20
902 #define _DATA_ADDRESS 0x20
903 #define _CKE 0x40
904 #define _SMP 0x80
906 //==============================================================================
909 //==============================================================================
910 // ADCON1 Bits
912 extern __at(0x009F) __sfr ADCON1;
914 typedef union
916 struct
918 unsigned PCFG0 : 1;
919 unsigned PCFG1 : 1;
920 unsigned PCFG2 : 1;
921 unsigned : 1;
922 unsigned : 1;
923 unsigned : 1;
924 unsigned : 1;
925 unsigned : 1;
928 struct
930 unsigned PCFG : 3;
931 unsigned : 5;
933 } __ADCON1bits_t;
935 extern __at(0x009F) volatile __ADCON1bits_t ADCON1bits;
937 #define _PCFG0 0x01
938 #define _PCFG1 0x02
939 #define _PCFG2 0x04
941 //==============================================================================
943 extern __at(0x010C) __sfr PMDATL;
944 extern __at(0x010D) __sfr PMADRL;
945 extern __at(0x010E) __sfr PMDATH;
946 extern __at(0x010F) __sfr PMADRH;
948 //==============================================================================
949 // PMCON1 Bits
951 extern __at(0x018C) __sfr PMCON1;
953 typedef struct
955 unsigned RD : 1;
956 unsigned : 1;
957 unsigned : 1;
958 unsigned : 1;
959 unsigned : 1;
960 unsigned : 1;
961 unsigned : 1;
962 unsigned : 1;
963 } __PMCON1bits_t;
965 extern __at(0x018C) volatile __PMCON1bits_t PMCON1bits;
967 #define _RD 0x01
969 //==============================================================================
972 //==============================================================================
974 // Configuration Bits
976 //==============================================================================
978 #define _CONFIG 0x2007
980 //----------------------------- CONFIG Options -------------------------------
982 #define _FOSC_LP 0x3FFC // LP oscillator.
983 #define _LP_OSC 0x3FFC // LP oscillator.
984 #define _FOSC_XT 0x3FFD // XT oscillator.
985 #define _XT_OSC 0x3FFD // XT oscillator.
986 #define _FOSC_HS 0x3FFE // HS oscillator.
987 #define _HS_OSC 0x3FFE // HS oscillator.
988 #define _FOSC_RC 0x3FFF // RC oscillator.
989 #define _RC_OSC 0x3FFF // RC oscillator.
990 #define _WDTE_OFF 0x3FFB // WDT disabled.
991 #define _WDT_OFF 0x3FFB // WDT disabled.
992 #define _WDTEN_OFF 0x3FFB // WDT disabled.
993 #define _WDTE_ON 0x3FFF // WDT enabled.
994 #define _WDT_ON 0x3FFF // WDT enabled.
995 #define _WDTEN_ON 0x3FFF // WDT enabled.
996 #define _PWRTE_ON 0x3FF7 // PWRT enabled.
997 #define _PWRTE_ON 0x3FF7 // PWRT enabled.
998 #define _PWRTEN_ON 0x3FF7 // PWRT enabled.
999 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
1000 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
1001 #define _PWRTEN_OFF 0x3FFF // PWRT disabled.
1002 #define _CP_ON 0x3FEF // All Memory locations code protected.
1003 #define _CP_ALL 0x3FEF // All Memory locations code protected.
1004 #define _CP_OFF 0x3FFF // Code protection off.
1005 #define _BOREN_OFF 0x3FBF // BOR disabled.
1006 #define _BOREN_OFF 0x3FBF // BOR disabled.
1007 #define _BODEN_OFF 0x3FBF // BOR disabled.
1008 #define _BOREN_ON 0x3FFF // BOR enabled.
1009 #define _BOREN_ON 0x3FFF // BOR enabled.
1010 #define _BODEN_ON 0x3FFF // BOR enabled.
1012 //==============================================================================
1014 #define _DEVID1 0x2006
1016 #define _IDLOC0 0x2000
1017 #define _IDLOC1 0x2001
1018 #define _IDLOC2 0x2002
1019 #define _IDLOC3 0x2003
1021 //==============================================================================
1023 #ifndef NO_BIT_DEFINES
1025 #define ADON ADCON0bits.ADON // bit 0
1026 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 2, shadows bit in ADCON0bits
1027 #define GO ADCON0bits.GO // bit 2, shadows bit in ADCON0bits
1028 #define NOT_DONE ADCON0bits.NOT_DONE // bit 2, shadows bit in ADCON0bits
1029 #define GO_DONE ADCON0bits.GO_DONE // bit 2, shadows bit in ADCON0bits
1030 #define CHS0 ADCON0bits.CHS0 // bit 3
1031 #define CHS1 ADCON0bits.CHS1 // bit 4
1032 #define CHS2 ADCON0bits.CHS2 // bit 5
1033 #define ADCS0 ADCON0bits.ADCS0 // bit 6
1034 #define ADCS1 ADCON0bits.ADCS1 // bit 7
1036 #define PCFG0 ADCON1bits.PCFG0 // bit 0
1037 #define PCFG1 ADCON1bits.PCFG1 // bit 1
1038 #define PCFG2 ADCON1bits.PCFG2 // bit 2
1040 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
1041 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
1042 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
1043 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
1044 #define CCP1Y CCP1CONbits.CCP1Y // bit 4
1045 #define CCP1X CCP1CONbits.CCP1X // bit 5
1047 #define RBIF INTCONbits.RBIF // bit 0
1048 #define INTF INTCONbits.INTF // bit 1
1049 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
1050 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
1051 #define RBIE INTCONbits.RBIE // bit 3
1052 #define INTE INTCONbits.INTE // bit 4
1053 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
1054 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
1055 #define PEIE INTCONbits.PEIE // bit 6
1056 #define GIE INTCONbits.GIE // bit 7
1058 #define PS0 OPTION_REGbits.PS0 // bit 0
1059 #define PS1 OPTION_REGbits.PS1 // bit 1
1060 #define PS2 OPTION_REGbits.PS2 // bit 2
1061 #define PSA OPTION_REGbits.PSA // bit 3
1062 #define T0SE OPTION_REGbits.T0SE // bit 4
1063 #define T0CS OPTION_REGbits.T0CS // bit 5
1064 #define INTEDG OPTION_REGbits.INTEDG // bit 6
1065 #define NOT_RBPU OPTION_REGbits.NOT_RBPU // bit 7
1067 #define NOT_BOR PCONbits.NOT_BOR // bit 0, shadows bit in PCONbits
1068 #define NOT_BO PCONbits.NOT_BO // bit 0, shadows bit in PCONbits
1069 #define NOT_POR PCONbits.NOT_POR // bit 1
1071 #define TMR1IE PIE1bits.TMR1IE // bit 0
1072 #define TMR2IE PIE1bits.TMR2IE // bit 1
1073 #define CCP1IE PIE1bits.CCP1IE // bit 2
1074 #define SSPIE PIE1bits.SSPIE // bit 3
1075 #define ADIE PIE1bits.ADIE // bit 6
1077 #define TMR1IF PIR1bits.TMR1IF // bit 0
1078 #define TMR2IF PIR1bits.TMR2IF // bit 1
1079 #define CCP1IF PIR1bits.CCP1IF // bit 2
1080 #define SSPIF PIR1bits.SSPIF // bit 3
1081 #define ADIF PIR1bits.ADIF // bit 6
1083 #define RD PMCON1bits.RD // bit 0
1085 #define RA0 PORTAbits.RA0 // bit 0
1086 #define RA1 PORTAbits.RA1 // bit 1
1087 #define RA2 PORTAbits.RA2 // bit 2
1088 #define RA3 PORTAbits.RA3 // bit 3
1089 #define RA4 PORTAbits.RA4 // bit 4
1090 #define RA5 PORTAbits.RA5 // bit 5
1092 #define RB0 PORTBbits.RB0 // bit 0
1093 #define RB1 PORTBbits.RB1 // bit 1
1094 #define RB2 PORTBbits.RB2 // bit 2
1095 #define RB3 PORTBbits.RB3 // bit 3
1096 #define RB4 PORTBbits.RB4 // bit 4
1097 #define RB5 PORTBbits.RB5 // bit 5
1098 #define RB6 PORTBbits.RB6 // bit 6
1099 #define RB7 PORTBbits.RB7 // bit 7
1101 #define RC0 PORTCbits.RC0 // bit 0
1102 #define RC1 PORTCbits.RC1 // bit 1
1103 #define RC2 PORTCbits.RC2 // bit 2
1104 #define RC3 PORTCbits.RC3 // bit 3
1105 #define RC4 PORTCbits.RC4 // bit 4
1106 #define RC5 PORTCbits.RC5 // bit 5
1107 #define RC6 PORTCbits.RC6 // bit 6
1108 #define RC7 PORTCbits.RC7 // bit 7
1110 #define SSPM0 SSPCONbits.SSPM0 // bit 0
1111 #define SSPM1 SSPCONbits.SSPM1 // bit 1
1112 #define SSPM2 SSPCONbits.SSPM2 // bit 2
1113 #define SSPM3 SSPCONbits.SSPM3 // bit 3
1114 #define CKP SSPCONbits.CKP // bit 4
1115 #define SSPEN SSPCONbits.SSPEN // bit 5
1116 #define SSPOV SSPCONbits.SSPOV // bit 6
1117 #define WCOL SSPCONbits.WCOL // bit 7
1119 #define BF SSPSTATbits.BF // bit 0
1120 #define UA SSPSTATbits.UA // bit 1
1121 #define R_NOT_W SSPSTATbits.R_NOT_W // bit 2, shadows bit in SSPSTATbits
1122 #define R SSPSTATbits.R // bit 2, shadows bit in SSPSTATbits
1123 #define I2C_READ SSPSTATbits.I2C_READ // bit 2, shadows bit in SSPSTATbits
1124 #define NOT_W SSPSTATbits.NOT_W // bit 2, shadows bit in SSPSTATbits
1125 #define NOT_WRITE SSPSTATbits.NOT_WRITE // bit 2, shadows bit in SSPSTATbits
1126 #define R_W SSPSTATbits.R_W // bit 2, shadows bit in SSPSTATbits
1127 #define READ_WRITE SSPSTATbits.READ_WRITE // bit 2, shadows bit in SSPSTATbits
1128 #define S SSPSTATbits.S // bit 3, shadows bit in SSPSTATbits
1129 #define I2C_START SSPSTATbits.I2C_START // bit 3, shadows bit in SSPSTATbits
1130 #define P SSPSTATbits.P // bit 4, shadows bit in SSPSTATbits
1131 #define I2C_STOP SSPSTATbits.I2C_STOP // bit 4, shadows bit in SSPSTATbits
1132 #define D_NOT_A SSPSTATbits.D_NOT_A // bit 5, shadows bit in SSPSTATbits
1133 #define D SSPSTATbits.D // bit 5, shadows bit in SSPSTATbits
1134 #define I2C_DATA SSPSTATbits.I2C_DATA // bit 5, shadows bit in SSPSTATbits
1135 #define NOT_A SSPSTATbits.NOT_A // bit 5, shadows bit in SSPSTATbits
1136 #define NOT_ADDRESS SSPSTATbits.NOT_ADDRESS // bit 5, shadows bit in SSPSTATbits
1137 #define D_A SSPSTATbits.D_A // bit 5, shadows bit in SSPSTATbits
1138 #define DATA_ADDRESS SSPSTATbits.DATA_ADDRESS // bit 5, shadows bit in SSPSTATbits
1139 #define CKE SSPSTATbits.CKE // bit 6
1140 #define SMP SSPSTATbits.SMP // bit 7
1142 #define C STATUSbits.C // bit 0
1143 #define DC STATUSbits.DC // bit 1
1144 #define Z STATUSbits.Z // bit 2
1145 #define NOT_PD STATUSbits.NOT_PD // bit 3
1146 #define NOT_TO STATUSbits.NOT_TO // bit 4
1147 #define RP0 STATUSbits.RP0 // bit 5
1148 #define RP1 STATUSbits.RP1 // bit 6
1149 #define IRP STATUSbits.IRP // bit 7
1151 #define TMR1ON T1CONbits.TMR1ON // bit 0
1152 #define TMR1CS T1CONbits.TMR1CS // bit 1
1153 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2, shadows bit in T1CONbits
1154 #define T1INSYNC T1CONbits.T1INSYNC // bit 2, shadows bit in T1CONbits
1155 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
1156 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
1157 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
1159 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
1160 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
1161 #define TMR2ON T2CONbits.TMR2ON // bit 2
1162 #define TOUTPS0 T2CONbits.TOUTPS0 // bit 3
1163 #define TOUTPS1 T2CONbits.TOUTPS1 // bit 4
1164 #define TOUTPS2 T2CONbits.TOUTPS2 // bit 5
1165 #define TOUTPS3 T2CONbits.TOUTPS3 // bit 6
1167 #define TRISA0 TRISAbits.TRISA0 // bit 0
1168 #define TRISA1 TRISAbits.TRISA1 // bit 1
1169 #define TRISA2 TRISAbits.TRISA2 // bit 2
1170 #define TRISA3 TRISAbits.TRISA3 // bit 3
1171 #define TRISA4 TRISAbits.TRISA4 // bit 4
1172 #define TRISA5 TRISAbits.TRISA5 // bit 5
1174 #define TRISB0 TRISBbits.TRISB0 // bit 0
1175 #define TRISB1 TRISBbits.TRISB1 // bit 1
1176 #define TRISB2 TRISBbits.TRISB2 // bit 2
1177 #define TRISB3 TRISBbits.TRISB3 // bit 3
1178 #define TRISB4 TRISBbits.TRISB4 // bit 4
1179 #define TRISB5 TRISBbits.TRISB5 // bit 5
1180 #define TRISB6 TRISBbits.TRISB6 // bit 6
1181 #define TRISB7 TRISBbits.TRISB7 // bit 7
1183 #define TRISC0 TRISCbits.TRISC0 // bit 0
1184 #define TRISC1 TRISCbits.TRISC1 // bit 1
1185 #define TRISC2 TRISCbits.TRISC2 // bit 2
1186 #define TRISC3 TRISCbits.TRISC3 // bit 3
1187 #define TRISC4 TRISCbits.TRISC4 // bit 4
1188 #define TRISC5 TRISCbits.TRISC5 // bit 5
1189 #define TRISC6 TRISCbits.TRISC6 // bit 6
1190 #define TRISC7 TRISCbits.TRISC7 // bit 7
1192 #endif // #ifndef NO_BIT_DEFINES
1194 #endif // #ifndef __PIC16F72_H__