Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic12lf1552.h
blobb16b2cfb1b8f7f9556731fac24f91ebf5922fa73
1 /*
2 * This declarations of the PIC12LF1552 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:07 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 __PIC12LF1552_H__
26 #define __PIC12LF1552_H__
28 //==============================================================================
30 // Register Addresses
32 //==============================================================================
34 #ifndef NO_ADDR_DEFINES
36 #define INDF0_ADDR 0x0000
37 #define INDF1_ADDR 0x0001
38 #define PCL_ADDR 0x0002
39 #define STATUS_ADDR 0x0003
40 #define FSR0_ADDR 0x0004
41 #define FSR0L_ADDR 0x0004
42 #define FSR0H_ADDR 0x0005
43 #define FSR1_ADDR 0x0006
44 #define FSR1L_ADDR 0x0006
45 #define FSR1H_ADDR 0x0007
46 #define BSR_ADDR 0x0008
47 #define WREG_ADDR 0x0009
48 #define PCLATH_ADDR 0x000A
49 #define INTCON_ADDR 0x000B
50 #define PORTA_ADDR 0x000C
51 #define PIR1_ADDR 0x0011
52 #define PIR2_ADDR 0x0012
53 #define TMR0_ADDR 0x0015
54 #define TRISA_ADDR 0x008C
55 #define PIE1_ADDR 0x0091
56 #define PIE2_ADDR 0x0092
57 #define OPTION_REG_ADDR 0x0095
58 #define PCON_ADDR 0x0096
59 #define WDTCON_ADDR 0x0097
60 #define OSCCON_ADDR 0x0099
61 #define OSCSTAT_ADDR 0x009A
62 #define ADRES_ADDR 0x009B
63 #define ADRESL_ADDR 0x009B
64 #define ADRESH_ADDR 0x009C
65 #define ADCON0_ADDR 0x009D
66 #define ADCON1_ADDR 0x009E
67 #define ADCON2_ADDR 0x009F
68 #define LATA_ADDR 0x010C
69 #define BORCON_ADDR 0x0116
70 #define FVRCON_ADDR 0x0117
71 #define APFCON_ADDR 0x011D
72 #define APFCON0_ADDR 0x011D
73 #define ANSELA_ADDR 0x018C
74 #define PMADR_ADDR 0x0191
75 #define PMADRL_ADDR 0x0191
76 #define PMADRH_ADDR 0x0192
77 #define PMDAT_ADDR 0x0193
78 #define PMDATL_ADDR 0x0193
79 #define PMDATH_ADDR 0x0194
80 #define PMCON1_ADDR 0x0195
81 #define PMCON2_ADDR 0x0196
82 #define WPUA_ADDR 0x020C
83 #define SSP1BUF_ADDR 0x0211
84 #define SSPBUF_ADDR 0x0211
85 #define SSP1ADD_ADDR 0x0212
86 #define SSPADD_ADDR 0x0212
87 #define SSP1MSK_ADDR 0x0213
88 #define SSPMSK_ADDR 0x0213
89 #define SSP1STAT_ADDR 0x0214
90 #define SSPSTAT_ADDR 0x0214
91 #define SSP1CON1_ADDR 0x0215
92 #define SSPCON_ADDR 0x0215
93 #define SSPCON1_ADDR 0x0215
94 #define SSP1CON2_ADDR 0x0216
95 #define SSPCON2_ADDR 0x0216
96 #define SSP1CON3_ADDR 0x0217
97 #define SSPCON3_ADDR 0x0217
98 #define IOCAP_ADDR 0x0391
99 #define IOCAN_ADDR 0x0392
100 #define IOCAF_ADDR 0x0393
101 #define AADCON0_ADDR 0x0711
102 #define AADCON1_ADDR 0x0712
103 #define AADCON2_ADDR 0x0713
104 #define AADCON3_ADDR 0x0714
105 #define AADSTAT_ADDR 0x0715
106 #define AADPRE_ADDR 0x0716
107 #define AADACQ_ADDR 0x0717
108 #define AADGRD_ADDR 0x0718
109 #define AADCAP_ADDR 0x0719
110 #define AADRES0_ADDR 0x071A
111 #define AADRES0L_ADDR 0x071A
112 #define AD1RES0_ADDR 0x071A
113 #define ADRES0_ADDR 0x071A
114 #define AADRES0H_ADDR 0x071B
115 #define AADRES1_ADDR 0x071C
116 #define AADRES1L_ADDR 0x071C
117 #define AD1RES1_ADDR 0x071C
118 #define ADRES1_ADDR 0x071C
119 #define AADRES1H_ADDR 0x071D
120 #define STATUS_SHAD_ADDR 0x0FE4
121 #define WREG_SHAD_ADDR 0x0FE5
122 #define BSR_SHAD_ADDR 0x0FE6
123 #define PCLATH_SHAD_ADDR 0x0FE7
124 #define FSR0L_SHAD_ADDR 0x0FE8
125 #define FSR0H_SHAD_ADDR 0x0FE9
126 #define FSR1L_SHAD_ADDR 0x0FEA
127 #define FSR1H_SHAD_ADDR 0x0FEB
128 #define STKPTR_ADDR 0x0FED
129 #define TOSL_ADDR 0x0FEE
130 #define TOSH_ADDR 0x0FEF
132 #endif // #ifndef NO_ADDR_DEFINES
134 //==============================================================================
136 // Register Definitions
138 //==============================================================================
140 extern __at(0x0000) __sfr INDF0;
141 extern __at(0x0001) __sfr INDF1;
142 extern __at(0x0002) __sfr PCL;
144 //==============================================================================
145 // STATUS Bits
147 extern __at(0x0003) __sfr STATUS;
149 typedef struct
151 unsigned C : 1;
152 unsigned DC : 1;
153 unsigned Z : 1;
154 unsigned NOT_PD : 1;
155 unsigned NOT_TO : 1;
156 unsigned : 1;
157 unsigned : 1;
158 unsigned : 1;
159 } __STATUSbits_t;
161 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
163 #define _C 0x01
164 #define _DC 0x02
165 #define _Z 0x04
166 #define _NOT_PD 0x08
167 #define _NOT_TO 0x10
169 //==============================================================================
171 extern __at(0x0004) __sfr FSR0;
172 extern __at(0x0004) __sfr FSR0L;
173 extern __at(0x0005) __sfr FSR0H;
174 extern __at(0x0006) __sfr FSR1;
175 extern __at(0x0006) __sfr FSR1L;
176 extern __at(0x0007) __sfr FSR1H;
178 //==============================================================================
179 // BSR Bits
181 extern __at(0x0008) __sfr BSR;
183 typedef union
185 struct
187 unsigned BSR0 : 1;
188 unsigned BSR1 : 1;
189 unsigned BSR2 : 1;
190 unsigned BSR3 : 1;
191 unsigned BSR4 : 1;
192 unsigned : 1;
193 unsigned : 1;
194 unsigned : 1;
197 struct
199 unsigned BSR : 5;
200 unsigned : 3;
202 } __BSRbits_t;
204 extern __at(0x0008) volatile __BSRbits_t BSRbits;
206 #define _BSR0 0x01
207 #define _BSR1 0x02
208 #define _BSR2 0x04
209 #define _BSR3 0x08
210 #define _BSR4 0x10
212 //==============================================================================
214 extern __at(0x0009) __sfr WREG;
215 extern __at(0x000A) __sfr PCLATH;
217 //==============================================================================
218 // INTCON Bits
220 extern __at(0x000B) __sfr INTCON;
222 typedef union
224 struct
226 unsigned IOCIF : 1;
227 unsigned INTF : 1;
228 unsigned TMR0IF : 1;
229 unsigned IOCIE : 1;
230 unsigned INTE : 1;
231 unsigned TMR0IE : 1;
232 unsigned PEIE : 1;
233 unsigned GIE : 1;
236 struct
238 unsigned : 1;
239 unsigned : 1;
240 unsigned T0IF : 1;
241 unsigned : 1;
242 unsigned : 1;
243 unsigned T0IE : 1;
244 unsigned : 1;
245 unsigned : 1;
247 } __INTCONbits_t;
249 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
251 #define _IOCIF 0x01
252 #define _INTF 0x02
253 #define _TMR0IF 0x04
254 #define _T0IF 0x04
255 #define _IOCIE 0x08
256 #define _INTE 0x10
257 #define _TMR0IE 0x20
258 #define _T0IE 0x20
259 #define _PEIE 0x40
260 #define _GIE 0x80
262 //==============================================================================
265 //==============================================================================
266 // PORTA Bits
268 extern __at(0x000C) __sfr PORTA;
270 typedef union
272 struct
274 unsigned RA0 : 1;
275 unsigned RA1 : 1;
276 unsigned RA2 : 1;
277 unsigned RA3 : 1;
278 unsigned RA4 : 1;
279 unsigned RA5 : 1;
280 unsigned : 1;
281 unsigned : 1;
284 struct
286 unsigned RA : 6;
287 unsigned : 2;
289 } __PORTAbits_t;
291 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
293 #define _RA0 0x01
294 #define _RA1 0x02
295 #define _RA2 0x04
296 #define _RA3 0x08
297 #define _RA4 0x10
298 #define _RA5 0x20
300 //==============================================================================
303 //==============================================================================
304 // PIR1 Bits
306 extern __at(0x0011) __sfr PIR1;
308 typedef struct
310 unsigned : 1;
311 unsigned : 1;
312 unsigned : 1;
313 unsigned SSP1IF : 1;
314 unsigned : 1;
315 unsigned : 1;
316 unsigned ADIF : 1;
317 unsigned : 1;
318 } __PIR1bits_t;
320 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
322 #define _SSP1IF 0x08
323 #define _ADIF 0x40
325 //==============================================================================
328 //==============================================================================
329 // PIR2 Bits
331 extern __at(0x0012) __sfr PIR2;
333 typedef struct
335 unsigned : 1;
336 unsigned : 1;
337 unsigned : 1;
338 unsigned BCL1IF : 1;
339 unsigned : 1;
340 unsigned : 1;
341 unsigned : 1;
342 unsigned : 1;
343 } __PIR2bits_t;
345 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
347 #define _BCL1IF 0x08
349 //==============================================================================
351 extern __at(0x0015) __sfr TMR0;
353 //==============================================================================
354 // TRISA Bits
356 extern __at(0x008C) __sfr TRISA;
358 typedef union
360 struct
362 unsigned TRISA0 : 1;
363 unsigned TRISA1 : 1;
364 unsigned TRISA2 : 1;
365 unsigned TRISA3 : 1;
366 unsigned TRISA4 : 1;
367 unsigned TRISA5 : 1;
368 unsigned : 1;
369 unsigned : 1;
372 struct
374 unsigned TRISA : 6;
375 unsigned : 2;
377 } __TRISAbits_t;
379 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
381 #define _TRISA0 0x01
382 #define _TRISA1 0x02
383 #define _TRISA2 0x04
384 #define _TRISA3 0x08
385 #define _TRISA4 0x10
386 #define _TRISA5 0x20
388 //==============================================================================
391 //==============================================================================
392 // PIE1 Bits
394 extern __at(0x0091) __sfr PIE1;
396 typedef struct
398 unsigned : 1;
399 unsigned : 1;
400 unsigned : 1;
401 unsigned SSP1IE : 1;
402 unsigned : 1;
403 unsigned : 1;
404 unsigned ADIE : 1;
405 unsigned : 1;
406 } __PIE1bits_t;
408 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
410 #define _SSP1IE 0x08
411 #define _ADIE 0x40
413 //==============================================================================
416 //==============================================================================
417 // PIE2 Bits
419 extern __at(0x0092) __sfr PIE2;
421 typedef struct
423 unsigned : 1;
424 unsigned : 1;
425 unsigned : 1;
426 unsigned BCL1IE : 1;
427 unsigned : 1;
428 unsigned : 1;
429 unsigned : 1;
430 unsigned : 1;
431 } __PIE2bits_t;
433 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
435 #define _BCL1IE 0x08
437 //==============================================================================
440 //==============================================================================
441 // OPTION_REG Bits
443 extern __at(0x0095) __sfr OPTION_REG;
445 typedef union
447 struct
449 unsigned PS0 : 1;
450 unsigned PS1 : 1;
451 unsigned PS2 : 1;
452 unsigned PSA : 1;
453 unsigned TMR0SE : 1;
454 unsigned TMR0CS : 1;
455 unsigned INTEDG : 1;
456 unsigned NOT_WPUEN : 1;
459 struct
461 unsigned : 1;
462 unsigned : 1;
463 unsigned : 1;
464 unsigned : 1;
465 unsigned T0SE : 1;
466 unsigned T0CS : 1;
467 unsigned : 1;
468 unsigned : 1;
471 struct
473 unsigned PS : 3;
474 unsigned : 5;
476 } __OPTION_REGbits_t;
478 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
480 #define _PS0 0x01
481 #define _PS1 0x02
482 #define _PS2 0x04
483 #define _PSA 0x08
484 #define _TMR0SE 0x10
485 #define _T0SE 0x10
486 #define _TMR0CS 0x20
487 #define _T0CS 0x20
488 #define _INTEDG 0x40
489 #define _NOT_WPUEN 0x80
491 //==============================================================================
494 //==============================================================================
495 // PCON Bits
497 extern __at(0x0096) __sfr PCON;
499 typedef struct
501 unsigned NOT_BOR : 1;
502 unsigned NOT_POR : 1;
503 unsigned NOT_RI : 1;
504 unsigned NOT_RMCLR : 1;
505 unsigned NOT_RWDT : 1;
506 unsigned : 1;
507 unsigned STKUNF : 1;
508 unsigned STKOVF : 1;
509 } __PCONbits_t;
511 extern __at(0x0096) volatile __PCONbits_t PCONbits;
513 #define _NOT_BOR 0x01
514 #define _NOT_POR 0x02
515 #define _NOT_RI 0x04
516 #define _NOT_RMCLR 0x08
517 #define _NOT_RWDT 0x10
518 #define _STKUNF 0x40
519 #define _STKOVF 0x80
521 //==============================================================================
524 //==============================================================================
525 // WDTCON Bits
527 extern __at(0x0097) __sfr WDTCON;
529 typedef union
531 struct
533 unsigned SWDTEN : 1;
534 unsigned WDTPS0 : 1;
535 unsigned WDTPS1 : 1;
536 unsigned WDTPS2 : 1;
537 unsigned WDTPS3 : 1;
538 unsigned WDTPS4 : 1;
539 unsigned : 1;
540 unsigned : 1;
543 struct
545 unsigned : 1;
546 unsigned WDTPS : 5;
547 unsigned : 2;
549 } __WDTCONbits_t;
551 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
553 #define _SWDTEN 0x01
554 #define _WDTPS0 0x02
555 #define _WDTPS1 0x04
556 #define _WDTPS2 0x08
557 #define _WDTPS3 0x10
558 #define _WDTPS4 0x20
560 //==============================================================================
563 //==============================================================================
564 // OSCCON Bits
566 extern __at(0x0099) __sfr OSCCON;
568 typedef union
570 struct
572 unsigned SCS0 : 1;
573 unsigned SCS1 : 1;
574 unsigned : 1;
575 unsigned IRCF0 : 1;
576 unsigned IRCF1 : 1;
577 unsigned IRCF2 : 1;
578 unsigned IRCF3 : 1;
579 unsigned SPLLEN : 1;
582 struct
584 unsigned SCS : 2;
585 unsigned : 6;
588 struct
590 unsigned : 3;
591 unsigned IRCF : 4;
592 unsigned : 1;
594 } __OSCCONbits_t;
596 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
598 #define _SCS0 0x01
599 #define _SCS1 0x02
600 #define _IRCF0 0x08
601 #define _IRCF1 0x10
602 #define _IRCF2 0x20
603 #define _IRCF3 0x40
604 #define _SPLLEN 0x80
606 //==============================================================================
609 //==============================================================================
610 // OSCSTAT Bits
612 extern __at(0x009A) __sfr OSCSTAT;
614 typedef struct
616 unsigned HFIOFS : 1;
617 unsigned LFIOFR : 1;
618 unsigned : 1;
619 unsigned : 1;
620 unsigned HFIOFR : 1;
621 unsigned OSTS : 1;
622 unsigned PLLR : 1;
623 unsigned : 1;
624 } __OSCSTATbits_t;
626 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
628 #define _HFIOFS 0x01
629 #define _LFIOFR 0x02
630 #define _HFIOFR 0x10
631 #define _OSTS 0x20
632 #define _PLLR 0x40
634 //==============================================================================
636 extern __at(0x009B) __sfr ADRES;
637 extern __at(0x009B) __sfr ADRESL;
638 extern __at(0x009C) __sfr ADRESH;
640 //==============================================================================
641 // ADCON0 Bits
643 extern __at(0x009D) __sfr ADCON0;
645 typedef union
647 struct
649 unsigned ADON : 1;
650 unsigned GO_NOT_DONE : 1;
651 unsigned CHS0 : 1;
652 unsigned CHS1 : 1;
653 unsigned CHS2 : 1;
654 unsigned CHS3 : 1;
655 unsigned CHS4 : 1;
656 unsigned : 1;
659 struct
661 unsigned : 1;
662 unsigned ADGO : 1;
663 unsigned : 1;
664 unsigned : 1;
665 unsigned : 1;
666 unsigned : 1;
667 unsigned : 1;
668 unsigned : 1;
671 struct
673 unsigned : 1;
674 unsigned GO : 1;
675 unsigned : 1;
676 unsigned : 1;
677 unsigned : 1;
678 unsigned : 1;
679 unsigned : 1;
680 unsigned : 1;
683 struct
685 unsigned : 2;
686 unsigned CHS : 5;
687 unsigned : 1;
689 } __ADCON0bits_t;
691 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
693 #define _ADCON0_ADON 0x01
694 #define _ADCON0_GO_NOT_DONE 0x02
695 #define _ADCON0_ADGO 0x02
696 #define _ADCON0_GO 0x02
697 #define _ADCON0_CHS0 0x04
698 #define _ADCON0_CHS1 0x08
699 #define _ADCON0_CHS2 0x10
700 #define _ADCON0_CHS3 0x20
701 #define _ADCON0_CHS4 0x40
703 //==============================================================================
706 //==============================================================================
707 // ADCON1 Bits
709 extern __at(0x009E) __sfr ADCON1;
711 typedef union
713 struct
715 unsigned ADPREF0 : 1;
716 unsigned ADPREF1 : 1;
717 unsigned : 1;
718 unsigned : 1;
719 unsigned ADCS0 : 1;
720 unsigned ADCS1 : 1;
721 unsigned ADCS2 : 1;
722 unsigned ADFM : 1;
725 struct
727 unsigned ADPREF : 2;
728 unsigned : 6;
731 struct
733 unsigned : 4;
734 unsigned ADCS : 3;
735 unsigned : 1;
737 } __ADCON1bits_t;
739 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
741 #define _ADCON1_ADPREF0 0x01
742 #define _ADCON1_ADPREF1 0x02
743 #define _ADCON1_ADCS0 0x10
744 #define _ADCON1_ADCS1 0x20
745 #define _ADCON1_ADCS2 0x40
746 #define _ADCON1_ADFM 0x80
748 //==============================================================================
751 //==============================================================================
752 // ADCON2 Bits
754 extern __at(0x009F) __sfr ADCON2;
756 typedef union
758 struct
760 unsigned : 1;
761 unsigned : 1;
762 unsigned : 1;
763 unsigned : 1;
764 unsigned TRIGSEL0 : 1;
765 unsigned TRIGSEL1 : 1;
766 unsigned TRIGSEL2 : 1;
767 unsigned : 1;
770 struct
772 unsigned : 4;
773 unsigned TRIGSEL : 3;
774 unsigned : 1;
776 } __ADCON2bits_t;
778 extern __at(0x009F) volatile __ADCON2bits_t ADCON2bits;
780 #define _ADCON2_TRIGSEL0 0x10
781 #define _ADCON2_TRIGSEL1 0x20
782 #define _ADCON2_TRIGSEL2 0x40
784 //==============================================================================
787 //==============================================================================
788 // LATA Bits
790 extern __at(0x010C) __sfr LATA;
792 typedef struct
794 unsigned LATA0 : 1;
795 unsigned LATA1 : 1;
796 unsigned LATA2 : 1;
797 unsigned : 1;
798 unsigned LATA4 : 1;
799 unsigned LATA5 : 1;
800 unsigned : 1;
801 unsigned : 1;
802 } __LATAbits_t;
804 extern __at(0x010C) volatile __LATAbits_t LATAbits;
806 #define _LATA0 0x01
807 #define _LATA1 0x02
808 #define _LATA2 0x04
809 #define _LATA4 0x10
810 #define _LATA5 0x20
812 //==============================================================================
815 //==============================================================================
816 // BORCON Bits
818 extern __at(0x0116) __sfr BORCON;
820 typedef struct
822 unsigned BORRDY : 1;
823 unsigned : 1;
824 unsigned : 1;
825 unsigned : 1;
826 unsigned : 1;
827 unsigned : 1;
828 unsigned BORFS : 1;
829 unsigned SBOREN : 1;
830 } __BORCONbits_t;
832 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
834 #define _BORRDY 0x01
835 #define _BORFS 0x40
836 #define _SBOREN 0x80
838 //==============================================================================
841 //==============================================================================
842 // FVRCON Bits
844 extern __at(0x0117) __sfr FVRCON;
846 typedef union
848 struct
850 unsigned ADFVR0 : 1;
851 unsigned ADFVR1 : 1;
852 unsigned : 1;
853 unsigned : 1;
854 unsigned TSRNG : 1;
855 unsigned TSEN : 1;
856 unsigned FVRRDY : 1;
857 unsigned FVREN : 1;
860 struct
862 unsigned ADFVR : 2;
863 unsigned : 6;
865 } __FVRCONbits_t;
867 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
869 #define _ADFVR0 0x01
870 #define _ADFVR1 0x02
871 #define _TSRNG 0x10
872 #define _TSEN 0x20
873 #define _FVRRDY 0x40
874 #define _FVREN 0x80
876 //==============================================================================
879 //==============================================================================
880 // APFCON Bits
882 extern __at(0x011D) __sfr APFCON;
884 typedef union
886 struct
888 unsigned : 1;
889 unsigned : 1;
890 unsigned : 1;
891 unsigned : 1;
892 unsigned SDSEL : 1;
893 unsigned SSSEL : 1;
894 unsigned SDOSEL : 1;
895 unsigned : 1;
898 struct
900 unsigned : 1;
901 unsigned : 1;
902 unsigned : 1;
903 unsigned : 1;
904 unsigned : 1;
905 unsigned SS1SEL : 1;
906 unsigned SDO1SEL : 1;
907 unsigned : 1;
909 } __APFCONbits_t;
911 extern __at(0x011D) volatile __APFCONbits_t APFCONbits;
913 #define _SDSEL 0x10
914 #define _SSSEL 0x20
915 #define _SS1SEL 0x20
916 #define _SDOSEL 0x40
917 #define _SDO1SEL 0x40
919 //==============================================================================
922 //==============================================================================
923 // APFCON0 Bits
925 extern __at(0x011D) __sfr APFCON0;
927 typedef union
929 struct
931 unsigned : 1;
932 unsigned : 1;
933 unsigned : 1;
934 unsigned : 1;
935 unsigned SDSEL : 1;
936 unsigned SSSEL : 1;
937 unsigned SDOSEL : 1;
938 unsigned : 1;
941 struct
943 unsigned : 1;
944 unsigned : 1;
945 unsigned : 1;
946 unsigned : 1;
947 unsigned : 1;
948 unsigned SS1SEL : 1;
949 unsigned SDO1SEL : 1;
950 unsigned : 1;
952 } __APFCON0bits_t;
954 extern __at(0x011D) volatile __APFCON0bits_t APFCON0bits;
956 #define _APFCON0_SDSEL 0x10
957 #define _APFCON0_SSSEL 0x20
958 #define _APFCON0_SS1SEL 0x20
959 #define _APFCON0_SDOSEL 0x40
960 #define _APFCON0_SDO1SEL 0x40
962 //==============================================================================
965 //==============================================================================
966 // ANSELA Bits
968 extern __at(0x018C) __sfr ANSELA;
970 typedef struct
972 unsigned ANSA0 : 1;
973 unsigned ANSA1 : 1;
974 unsigned ANSA2 : 1;
975 unsigned : 1;
976 unsigned ANSA4 : 1;
977 unsigned ANSA5 : 1;
978 unsigned : 1;
979 unsigned : 1;
980 } __ANSELAbits_t;
982 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
984 #define _ANSA0 0x01
985 #define _ANSA1 0x02
986 #define _ANSA2 0x04
987 #define _ANSA4 0x10
988 #define _ANSA5 0x20
990 //==============================================================================
992 extern __at(0x0191) __sfr PMADR;
993 extern __at(0x0191) __sfr PMADRL;
994 extern __at(0x0192) __sfr PMADRH;
995 extern __at(0x0193) __sfr PMDAT;
996 extern __at(0x0193) __sfr PMDATL;
997 extern __at(0x0194) __sfr PMDATH;
999 //==============================================================================
1000 // PMCON1 Bits
1002 extern __at(0x0195) __sfr PMCON1;
1004 typedef struct
1006 unsigned RD : 1;
1007 unsigned WR : 1;
1008 unsigned WREN : 1;
1009 unsigned WRERR : 1;
1010 unsigned FREE : 1;
1011 unsigned LWLO : 1;
1012 unsigned CFGS : 1;
1013 unsigned : 1;
1014 } __PMCON1bits_t;
1016 extern __at(0x0195) volatile __PMCON1bits_t PMCON1bits;
1018 #define _RD 0x01
1019 #define _WR 0x02
1020 #define _WREN 0x04
1021 #define _WRERR 0x08
1022 #define _FREE 0x10
1023 #define _LWLO 0x20
1024 #define _CFGS 0x40
1026 //==============================================================================
1028 extern __at(0x0196) __sfr PMCON2;
1030 //==============================================================================
1031 // WPUA Bits
1033 extern __at(0x020C) __sfr WPUA;
1035 typedef union
1037 struct
1039 unsigned WPUA0 : 1;
1040 unsigned WPUA1 : 1;
1041 unsigned WPUA2 : 1;
1042 unsigned WPUA3 : 1;
1043 unsigned WPUA4 : 1;
1044 unsigned WPUA5 : 1;
1045 unsigned : 1;
1046 unsigned : 1;
1049 struct
1051 unsigned WPUA : 6;
1052 unsigned : 2;
1054 } __WPUAbits_t;
1056 extern __at(0x020C) volatile __WPUAbits_t WPUAbits;
1058 #define _WPUA0 0x01
1059 #define _WPUA1 0x02
1060 #define _WPUA2 0x04
1061 #define _WPUA3 0x08
1062 #define _WPUA4 0x10
1063 #define _WPUA5 0x20
1065 //==============================================================================
1067 extern __at(0x0211) __sfr SSP1BUF;
1068 extern __at(0x0211) __sfr SSPBUF;
1069 extern __at(0x0212) __sfr SSP1ADD;
1070 extern __at(0x0212) __sfr SSPADD;
1071 extern __at(0x0213) __sfr SSP1MSK;
1072 extern __at(0x0213) __sfr SSPMSK;
1074 //==============================================================================
1075 // SSP1STAT Bits
1077 extern __at(0x0214) __sfr SSP1STAT;
1079 typedef struct
1081 unsigned BF : 1;
1082 unsigned UA : 1;
1083 unsigned R_NOT_W : 1;
1084 unsigned S : 1;
1085 unsigned P : 1;
1086 unsigned D_NOT_A : 1;
1087 unsigned CKE : 1;
1088 unsigned SMP : 1;
1089 } __SSP1STATbits_t;
1091 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
1093 #define _BF 0x01
1094 #define _UA 0x02
1095 #define _R_NOT_W 0x04
1096 #define _S 0x08
1097 #define _P 0x10
1098 #define _D_NOT_A 0x20
1099 #define _CKE 0x40
1100 #define _SMP 0x80
1102 //==============================================================================
1105 //==============================================================================
1106 // SSPSTAT Bits
1108 extern __at(0x0214) __sfr SSPSTAT;
1110 typedef struct
1112 unsigned BF : 1;
1113 unsigned UA : 1;
1114 unsigned R_NOT_W : 1;
1115 unsigned S : 1;
1116 unsigned P : 1;
1117 unsigned D_NOT_A : 1;
1118 unsigned CKE : 1;
1119 unsigned SMP : 1;
1120 } __SSPSTATbits_t;
1122 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
1124 #define _SSPSTAT_BF 0x01
1125 #define _SSPSTAT_UA 0x02
1126 #define _SSPSTAT_R_NOT_W 0x04
1127 #define _SSPSTAT_S 0x08
1128 #define _SSPSTAT_P 0x10
1129 #define _SSPSTAT_D_NOT_A 0x20
1130 #define _SSPSTAT_CKE 0x40
1131 #define _SSPSTAT_SMP 0x80
1133 //==============================================================================
1136 //==============================================================================
1137 // SSP1CON1 Bits
1139 extern __at(0x0215) __sfr SSP1CON1;
1141 typedef union
1143 struct
1145 unsigned SSPM0 : 1;
1146 unsigned SSPM1 : 1;
1147 unsigned SSPM2 : 1;
1148 unsigned SSPM3 : 1;
1149 unsigned CKP : 1;
1150 unsigned SSPEN : 1;
1151 unsigned SSPOV : 1;
1152 unsigned WCOL : 1;
1155 struct
1157 unsigned SSPM : 4;
1158 unsigned : 4;
1160 } __SSP1CON1bits_t;
1162 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
1164 #define _SSPM0 0x01
1165 #define _SSPM1 0x02
1166 #define _SSPM2 0x04
1167 #define _SSPM3 0x08
1168 #define _CKP 0x10
1169 #define _SSPEN 0x20
1170 #define _SSPOV 0x40
1171 #define _WCOL 0x80
1173 //==============================================================================
1176 //==============================================================================
1177 // SSPCON Bits
1179 extern __at(0x0215) __sfr SSPCON;
1181 typedef union
1183 struct
1185 unsigned SSPM0 : 1;
1186 unsigned SSPM1 : 1;
1187 unsigned SSPM2 : 1;
1188 unsigned SSPM3 : 1;
1189 unsigned CKP : 1;
1190 unsigned SSPEN : 1;
1191 unsigned SSPOV : 1;
1192 unsigned WCOL : 1;
1195 struct
1197 unsigned SSPM : 4;
1198 unsigned : 4;
1200 } __SSPCONbits_t;
1202 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
1204 #define _SSPCON_SSPM0 0x01
1205 #define _SSPCON_SSPM1 0x02
1206 #define _SSPCON_SSPM2 0x04
1207 #define _SSPCON_SSPM3 0x08
1208 #define _SSPCON_CKP 0x10
1209 #define _SSPCON_SSPEN 0x20
1210 #define _SSPCON_SSPOV 0x40
1211 #define _SSPCON_WCOL 0x80
1213 //==============================================================================
1216 //==============================================================================
1217 // SSPCON1 Bits
1219 extern __at(0x0215) __sfr SSPCON1;
1221 typedef union
1223 struct
1225 unsigned SSPM0 : 1;
1226 unsigned SSPM1 : 1;
1227 unsigned SSPM2 : 1;
1228 unsigned SSPM3 : 1;
1229 unsigned CKP : 1;
1230 unsigned SSPEN : 1;
1231 unsigned SSPOV : 1;
1232 unsigned WCOL : 1;
1235 struct
1237 unsigned SSPM : 4;
1238 unsigned : 4;
1240 } __SSPCON1bits_t;
1242 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
1244 #define _SSPCON1_SSPM0 0x01
1245 #define _SSPCON1_SSPM1 0x02
1246 #define _SSPCON1_SSPM2 0x04
1247 #define _SSPCON1_SSPM3 0x08
1248 #define _SSPCON1_CKP 0x10
1249 #define _SSPCON1_SSPEN 0x20
1250 #define _SSPCON1_SSPOV 0x40
1251 #define _SSPCON1_WCOL 0x80
1253 //==============================================================================
1256 //==============================================================================
1257 // SSP1CON2 Bits
1259 extern __at(0x0216) __sfr SSP1CON2;
1261 typedef struct
1263 unsigned SEN : 1;
1264 unsigned RSEN : 1;
1265 unsigned PEN : 1;
1266 unsigned RCEN : 1;
1267 unsigned ACKEN : 1;
1268 unsigned ACKDT : 1;
1269 unsigned ACKSTAT : 1;
1270 unsigned GCEN : 1;
1271 } __SSP1CON2bits_t;
1273 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
1275 #define _SEN 0x01
1276 #define _RSEN 0x02
1277 #define _PEN 0x04
1278 #define _RCEN 0x08
1279 #define _ACKEN 0x10
1280 #define _ACKDT 0x20
1281 #define _ACKSTAT 0x40
1282 #define _GCEN 0x80
1284 //==============================================================================
1287 //==============================================================================
1288 // SSPCON2 Bits
1290 extern __at(0x0216) __sfr SSPCON2;
1292 typedef struct
1294 unsigned SEN : 1;
1295 unsigned RSEN : 1;
1296 unsigned PEN : 1;
1297 unsigned RCEN : 1;
1298 unsigned ACKEN : 1;
1299 unsigned ACKDT : 1;
1300 unsigned ACKSTAT : 1;
1301 unsigned GCEN : 1;
1302 } __SSPCON2bits_t;
1304 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
1306 #define _SSPCON2_SEN 0x01
1307 #define _SSPCON2_RSEN 0x02
1308 #define _SSPCON2_PEN 0x04
1309 #define _SSPCON2_RCEN 0x08
1310 #define _SSPCON2_ACKEN 0x10
1311 #define _SSPCON2_ACKDT 0x20
1312 #define _SSPCON2_ACKSTAT 0x40
1313 #define _SSPCON2_GCEN 0x80
1315 //==============================================================================
1318 //==============================================================================
1319 // SSP1CON3 Bits
1321 extern __at(0x0217) __sfr SSP1CON3;
1323 typedef struct
1325 unsigned DHEN : 1;
1326 unsigned AHEN : 1;
1327 unsigned SBCDE : 1;
1328 unsigned SDAHT : 1;
1329 unsigned BOEN : 1;
1330 unsigned SCIE : 1;
1331 unsigned PCIE : 1;
1332 unsigned ACKTIM : 1;
1333 } __SSP1CON3bits_t;
1335 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
1337 #define _DHEN 0x01
1338 #define _AHEN 0x02
1339 #define _SBCDE 0x04
1340 #define _SDAHT 0x08
1341 #define _BOEN 0x10
1342 #define _SCIE 0x20
1343 #define _PCIE 0x40
1344 #define _ACKTIM 0x80
1346 //==============================================================================
1349 //==============================================================================
1350 // SSPCON3 Bits
1352 extern __at(0x0217) __sfr SSPCON3;
1354 typedef struct
1356 unsigned DHEN : 1;
1357 unsigned AHEN : 1;
1358 unsigned SBCDE : 1;
1359 unsigned SDAHT : 1;
1360 unsigned BOEN : 1;
1361 unsigned SCIE : 1;
1362 unsigned PCIE : 1;
1363 unsigned ACKTIM : 1;
1364 } __SSPCON3bits_t;
1366 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
1368 #define _SSPCON3_DHEN 0x01
1369 #define _SSPCON3_AHEN 0x02
1370 #define _SSPCON3_SBCDE 0x04
1371 #define _SSPCON3_SDAHT 0x08
1372 #define _SSPCON3_BOEN 0x10
1373 #define _SSPCON3_SCIE 0x20
1374 #define _SSPCON3_PCIE 0x40
1375 #define _SSPCON3_ACKTIM 0x80
1377 //==============================================================================
1380 //==============================================================================
1381 // IOCAP Bits
1383 extern __at(0x0391) __sfr IOCAP;
1385 typedef union
1387 struct
1389 unsigned IOCAP0 : 1;
1390 unsigned IOCAP1 : 1;
1391 unsigned IOCAP2 : 1;
1392 unsigned IOCAP3 : 1;
1393 unsigned IOCAP4 : 1;
1394 unsigned IOCAP5 : 1;
1395 unsigned : 1;
1396 unsigned : 1;
1399 struct
1401 unsigned IOCAP : 6;
1402 unsigned : 2;
1404 } __IOCAPbits_t;
1406 extern __at(0x0391) volatile __IOCAPbits_t IOCAPbits;
1408 #define _IOCAP0 0x01
1409 #define _IOCAP1 0x02
1410 #define _IOCAP2 0x04
1411 #define _IOCAP3 0x08
1412 #define _IOCAP4 0x10
1413 #define _IOCAP5 0x20
1415 //==============================================================================
1418 //==============================================================================
1419 // IOCAN Bits
1421 extern __at(0x0392) __sfr IOCAN;
1423 typedef union
1425 struct
1427 unsigned IOCAN0 : 1;
1428 unsigned IOCAN1 : 1;
1429 unsigned IOCAN2 : 1;
1430 unsigned IOCAN3 : 1;
1431 unsigned IOCAN4 : 1;
1432 unsigned IOCAN5 : 1;
1433 unsigned : 1;
1434 unsigned : 1;
1437 struct
1439 unsigned IOCAN : 6;
1440 unsigned : 2;
1442 } __IOCANbits_t;
1444 extern __at(0x0392) volatile __IOCANbits_t IOCANbits;
1446 #define _IOCAN0 0x01
1447 #define _IOCAN1 0x02
1448 #define _IOCAN2 0x04
1449 #define _IOCAN3 0x08
1450 #define _IOCAN4 0x10
1451 #define _IOCAN5 0x20
1453 //==============================================================================
1456 //==============================================================================
1457 // IOCAF Bits
1459 extern __at(0x0393) __sfr IOCAF;
1461 typedef union
1463 struct
1465 unsigned IOCAF0 : 1;
1466 unsigned IOCAF1 : 1;
1467 unsigned IOCAF2 : 1;
1468 unsigned IOCAF3 : 1;
1469 unsigned IOCAF4 : 1;
1470 unsigned IOCAF5 : 1;
1471 unsigned : 1;
1472 unsigned : 1;
1475 struct
1477 unsigned IOCAF : 6;
1478 unsigned : 2;
1480 } __IOCAFbits_t;
1482 extern __at(0x0393) volatile __IOCAFbits_t IOCAFbits;
1484 #define _IOCAF0 0x01
1485 #define _IOCAF1 0x02
1486 #define _IOCAF2 0x04
1487 #define _IOCAF3 0x08
1488 #define _IOCAF4 0x10
1489 #define _IOCAF5 0x20
1491 //==============================================================================
1494 //==============================================================================
1495 // AADCON0 Bits
1497 extern __at(0x0711) __sfr AADCON0;
1499 typedef union
1501 struct
1503 unsigned ADON : 1;
1504 unsigned GO_NOT_DONE : 1;
1505 unsigned CHS0 : 1;
1506 unsigned CHS1 : 1;
1507 unsigned CHS2 : 1;
1508 unsigned CHS3 : 1;
1509 unsigned CHS4 : 1;
1510 unsigned : 1;
1513 struct
1515 unsigned : 2;
1516 unsigned CHS : 5;
1517 unsigned : 1;
1519 } __AADCON0bits_t;
1521 extern __at(0x0711) volatile __AADCON0bits_t AADCON0bits;
1523 #define _ADON 0x01
1524 #define _GO_NOT_DONE 0x02
1525 #define _CHS0 0x04
1526 #define _CHS1 0x08
1527 #define _CHS2 0x10
1528 #define _CHS3 0x20
1529 #define _CHS4 0x40
1531 //==============================================================================
1534 //==============================================================================
1535 // AADCON1 Bits
1537 extern __at(0x0712) __sfr AADCON1;
1539 typedef union
1541 struct
1543 unsigned ADPREF0 : 1;
1544 unsigned ADPREF1 : 1;
1545 unsigned : 1;
1546 unsigned : 1;
1547 unsigned ADCS0 : 1;
1548 unsigned ADCS1 : 1;
1549 unsigned ADCS2 : 1;
1550 unsigned ADFM : 1;
1553 struct
1555 unsigned ADPREF : 2;
1556 unsigned : 6;
1559 struct
1561 unsigned : 4;
1562 unsigned ADCS : 3;
1563 unsigned : 1;
1565 } __AADCON1bits_t;
1567 extern __at(0x0712) volatile __AADCON1bits_t AADCON1bits;
1569 #define _ADPREF0 0x01
1570 #define _ADPREF1 0x02
1571 #define _ADCS0 0x10
1572 #define _ADCS1 0x20
1573 #define _ADCS2 0x40
1574 #define _ADFM 0x80
1576 //==============================================================================
1579 //==============================================================================
1580 // AADCON2 Bits
1582 extern __at(0x0713) __sfr AADCON2;
1584 typedef union
1586 struct
1588 unsigned : 1;
1589 unsigned : 1;
1590 unsigned : 1;
1591 unsigned : 1;
1592 unsigned TRIGSEL0 : 1;
1593 unsigned TRIGSEL1 : 1;
1594 unsigned TRIGSEL2 : 1;
1595 unsigned : 1;
1598 struct
1600 unsigned : 4;
1601 unsigned TRIGSEL : 3;
1602 unsigned : 1;
1604 } __AADCON2bits_t;
1606 extern __at(0x0713) volatile __AADCON2bits_t AADCON2bits;
1608 #define _TRIGSEL0 0x10
1609 #define _TRIGSEL1 0x20
1610 #define _TRIGSEL2 0x40
1612 //==============================================================================
1615 //==============================================================================
1616 // AADCON3 Bits
1618 extern __at(0x0714) __sfr AADCON3;
1620 typedef struct
1622 unsigned ADDSEN : 1;
1623 unsigned ADIPEN : 1;
1624 unsigned : 1;
1625 unsigned ADOOEN : 1;
1626 unsigned ADOEN : 1;
1627 unsigned : 1;
1628 unsigned ADIPPOL : 1;
1629 unsigned ADEPPOL : 1;
1630 } __AADCON3bits_t;
1632 extern __at(0x0714) volatile __AADCON3bits_t AADCON3bits;
1634 #define _ADDSEN 0x01
1635 #define _ADIPEN 0x02
1636 #define _ADOOEN 0x08
1637 #define _ADOEN 0x10
1638 #define _ADIPPOL 0x40
1639 #define _ADEPPOL 0x80
1641 //==============================================================================
1644 //==============================================================================
1645 // AADSTAT Bits
1647 extern __at(0x0715) __sfr AADSTAT;
1649 typedef union
1651 struct
1653 unsigned ADSTG0 : 1;
1654 unsigned ADSTG1 : 1;
1655 unsigned ADCONV : 1;
1656 unsigned : 1;
1657 unsigned : 1;
1658 unsigned : 1;
1659 unsigned : 1;
1660 unsigned : 1;
1663 struct
1665 unsigned ADSTG : 2;
1666 unsigned : 6;
1668 } __AADSTATbits_t;
1670 extern __at(0x0715) volatile __AADSTATbits_t AADSTATbits;
1672 #define _ADSTG0 0x01
1673 #define _ADSTG1 0x02
1674 #define _ADCONV 0x04
1676 //==============================================================================
1679 //==============================================================================
1680 // AADPRE Bits
1682 extern __at(0x0716) __sfr AADPRE;
1684 typedef union
1686 struct
1688 unsigned ADPRE0 : 1;
1689 unsigned ADPRE1 : 1;
1690 unsigned ADPRE2 : 1;
1691 unsigned ADPRE3 : 1;
1692 unsigned ADPRE4 : 1;
1693 unsigned ADPRE5 : 1;
1694 unsigned ADPRE6 : 1;
1695 unsigned : 1;
1698 struct
1700 unsigned ADPRE : 7;
1701 unsigned : 1;
1703 } __AADPREbits_t;
1705 extern __at(0x0716) volatile __AADPREbits_t AADPREbits;
1707 #define _ADPRE0 0x01
1708 #define _ADPRE1 0x02
1709 #define _ADPRE2 0x04
1710 #define _ADPRE3 0x08
1711 #define _ADPRE4 0x10
1712 #define _ADPRE5 0x20
1713 #define _ADPRE6 0x40
1715 //==============================================================================
1718 //==============================================================================
1719 // AADACQ Bits
1721 extern __at(0x0717) __sfr AADACQ;
1723 typedef union
1725 struct
1727 unsigned ADACQ0 : 1;
1728 unsigned ADACQ1 : 1;
1729 unsigned ADACQ2 : 1;
1730 unsigned ADACQ3 : 1;
1731 unsigned ADACQ4 : 1;
1732 unsigned ADACQ5 : 1;
1733 unsigned ADACQ6 : 1;
1734 unsigned : 1;
1737 struct
1739 unsigned ADACQ : 7;
1740 unsigned : 1;
1742 } __AADACQbits_t;
1744 extern __at(0x0717) volatile __AADACQbits_t AADACQbits;
1746 #define _ADACQ0 0x01
1747 #define _ADACQ1 0x02
1748 #define _ADACQ2 0x04
1749 #define _ADACQ3 0x08
1750 #define _ADACQ4 0x10
1751 #define _ADACQ5 0x20
1752 #define _ADACQ6 0x40
1754 //==============================================================================
1757 //==============================================================================
1758 // AADGRD Bits
1760 extern __at(0x0718) __sfr AADGRD;
1762 typedef struct
1764 unsigned : 1;
1765 unsigned : 1;
1766 unsigned : 1;
1767 unsigned : 1;
1768 unsigned : 1;
1769 unsigned GRDPOL : 1;
1770 unsigned GRDAOE : 1;
1771 unsigned GRDBOE : 1;
1772 } __AADGRDbits_t;
1774 extern __at(0x0718) volatile __AADGRDbits_t AADGRDbits;
1776 #define _GRDPOL 0x20
1777 #define _GRDAOE 0x40
1778 #define _GRDBOE 0x80
1780 //==============================================================================
1783 //==============================================================================
1784 // AADCAP Bits
1786 extern __at(0x0719) __sfr AADCAP;
1788 typedef union
1790 struct
1792 unsigned ADDCAP0 : 1;
1793 unsigned ADDCAP1 : 1;
1794 unsigned ADDCAP2 : 1;
1795 unsigned : 1;
1796 unsigned : 1;
1797 unsigned : 1;
1798 unsigned : 1;
1799 unsigned : 1;
1802 struct
1804 unsigned ADDCAP : 3;
1805 unsigned : 5;
1807 } __AADCAPbits_t;
1809 extern __at(0x0719) volatile __AADCAPbits_t AADCAPbits;
1811 #define _ADDCAP0 0x01
1812 #define _ADDCAP1 0x02
1813 #define _ADDCAP2 0x04
1815 //==============================================================================
1817 extern __at(0x071A) __sfr AADRES0;
1818 extern __at(0x071A) __sfr AADRES0L;
1819 extern __at(0x071A) __sfr AD1RES0;
1820 extern __at(0x071A) __sfr ADRES0;
1821 extern __at(0x071B) __sfr AADRES0H;
1822 extern __at(0x071C) __sfr AADRES1;
1823 extern __at(0x071C) __sfr AADRES1L;
1824 extern __at(0x071C) __sfr AD1RES1;
1825 extern __at(0x071C) __sfr ADRES1;
1826 extern __at(0x071D) __sfr AADRES1H;
1828 //==============================================================================
1829 // STATUS_SHAD Bits
1831 extern __at(0x0FE4) __sfr STATUS_SHAD;
1833 typedef struct
1835 unsigned C_SHAD : 1;
1836 unsigned DC_SHAD : 1;
1837 unsigned Z_SHAD : 1;
1838 unsigned : 1;
1839 unsigned : 1;
1840 unsigned : 1;
1841 unsigned : 1;
1842 unsigned : 1;
1843 } __STATUS_SHADbits_t;
1845 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
1847 #define _C_SHAD 0x01
1848 #define _DC_SHAD 0x02
1849 #define _Z_SHAD 0x04
1851 //==============================================================================
1853 extern __at(0x0FE5) __sfr WREG_SHAD;
1854 extern __at(0x0FE6) __sfr BSR_SHAD;
1855 extern __at(0x0FE7) __sfr PCLATH_SHAD;
1856 extern __at(0x0FE8) __sfr FSR0L_SHAD;
1857 extern __at(0x0FE9) __sfr FSR0H_SHAD;
1858 extern __at(0x0FEA) __sfr FSR1L_SHAD;
1859 extern __at(0x0FEB) __sfr FSR1H_SHAD;
1860 extern __at(0x0FED) __sfr STKPTR;
1861 extern __at(0x0FEE) __sfr TOSL;
1862 extern __at(0x0FEF) __sfr TOSH;
1864 //==============================================================================
1866 // Configuration Bits
1868 //==============================================================================
1870 #define _CONFIG1 0x8007
1871 #define _CONFIG2 0x8008
1873 //----------------------------- CONFIG1 Options -------------------------------
1875 #define _FOSC_INTOSC 0x3FFC // INTOSC oscillator: I/O function on CLKIN pin.
1876 #define _FOSC_ECL 0x3FFD // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin.
1877 #define _FOSC_ECM 0x3FFE // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin.
1878 #define _FOSC_ECH 0x3FFF // ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pin.
1879 #define _WDTE_OFF 0x3FE7 // WDT disabled.
1880 #define _WDTE_SWDTEN 0x3FEF // WDT controlled by the SWDTEN bit in the WDTCON register.
1881 #define _WDTE_NSLEEP 0x3FF7 // WDT enabled while running and disabled in Sleep.
1882 #define _WDTE_ON 0x3FFF // WDT enabled.
1883 #define _PWRTE_ON 0x3FDF // PWRT enabled.
1884 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
1885 #define _MCLRE_OFF 0x3FBF // MCLR/VPP pin function is digital input.
1886 #define _MCLRE_ON 0x3FFF // MCLR/VPP pin function is MCLR.
1887 #define _CP_ON 0x3F7F // Program memory code protection is enabled.
1888 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
1889 #define _BOREN_OFF 0x39FF // Brown-out Reset disabled.
1890 #define _BOREN_SBODEN 0x3BFF // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
1891 #define _BOREN_NSLEEP 0x3DFF // Brown-out Reset enabled while running and disabled in Sleep.
1892 #define _BOREN_ON 0x3FFF // Brown-out Reset enabled.
1893 #define _CLKOUTEN_ON 0x37FF // CLKOUT function is enabled on the CLKOUT pin.
1894 #define _CLKOUTEN_OFF 0x3FFF // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
1896 //----------------------------- CONFIG2 Options -------------------------------
1898 #define _WRT_ALL 0x3FFC // 000h to FFFh write protected, no addresses may be modified by PMCON control.
1899 #define _WRT_HALF 0x3FFD // 000h to 7FFh write protected, 800h to FFFh may be modified by PMCON control.
1900 #define _WRT_BOOT 0x3FFE // 000h to 1FFh write protected, 200h to FFFh may be modified by PMCON control.
1901 #define _WRT_OFF 0x3FFF // Write protection off.
1902 #define _STVREN_OFF 0x3DFF // Stack Overflow or Underflow will not cause a Reset.
1903 #define _STVREN_ON 0x3FFF // Stack Overflow or Underflow will cause a Reset.
1904 #define _BORV_HI 0x3BFF // Brown-out Reset Voltage (Vbor), high trip point selected.
1905 #define _BORV_LO 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
1906 #define _BORV_19 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
1907 #define _LPBOR_ON 0x37FF // Low-Power BOR is enabled.
1908 #define _LPBOR_OFF 0x3FFF // Low-Power BOR is disabled.
1909 #define _LVP_OFF 0x1FFF // High-voltage on MCLR/VPP must be used for programming.
1910 #define _LVP_ON 0x3FFF // Low-voltage programming enabled.
1912 //==============================================================================
1914 #define _DEVID1 0x8006
1916 #define _IDLOC0 0x8000
1917 #define _IDLOC1 0x8001
1918 #define _IDLOC2 0x8002
1919 #define _IDLOC3 0x8003
1921 //==============================================================================
1923 #ifndef NO_BIT_DEFINES
1925 #define ADACQ0 AADACQbits.ADACQ0 // bit 0
1926 #define ADACQ1 AADACQbits.ADACQ1 // bit 1
1927 #define ADACQ2 AADACQbits.ADACQ2 // bit 2
1928 #define ADACQ3 AADACQbits.ADACQ3 // bit 3
1929 #define ADACQ4 AADACQbits.ADACQ4 // bit 4
1930 #define ADACQ5 AADACQbits.ADACQ5 // bit 5
1931 #define ADACQ6 AADACQbits.ADACQ6 // bit 6
1933 #define ADDCAP0 AADCAPbits.ADDCAP0 // bit 0
1934 #define ADDCAP1 AADCAPbits.ADDCAP1 // bit 1
1935 #define ADDCAP2 AADCAPbits.ADDCAP2 // bit 2
1937 #define ADON AADCON0bits.ADON // bit 0
1938 #define GO_NOT_DONE AADCON0bits.GO_NOT_DONE // bit 1
1939 #define CHS0 AADCON0bits.CHS0 // bit 2
1940 #define CHS1 AADCON0bits.CHS1 // bit 3
1941 #define CHS2 AADCON0bits.CHS2 // bit 4
1942 #define CHS3 AADCON0bits.CHS3 // bit 5
1943 #define CHS4 AADCON0bits.CHS4 // bit 6
1945 #define ADPREF0 AADCON1bits.ADPREF0 // bit 0
1946 #define ADPREF1 AADCON1bits.ADPREF1 // bit 1
1947 #define ADCS0 AADCON1bits.ADCS0 // bit 4
1948 #define ADCS1 AADCON1bits.ADCS1 // bit 5
1949 #define ADCS2 AADCON1bits.ADCS2 // bit 6
1950 #define ADFM AADCON1bits.ADFM // bit 7
1952 #define TRIGSEL0 AADCON2bits.TRIGSEL0 // bit 4
1953 #define TRIGSEL1 AADCON2bits.TRIGSEL1 // bit 5
1954 #define TRIGSEL2 AADCON2bits.TRIGSEL2 // bit 6
1956 #define ADDSEN AADCON3bits.ADDSEN // bit 0
1957 #define ADIPEN AADCON3bits.ADIPEN // bit 1
1958 #define ADOOEN AADCON3bits.ADOOEN // bit 3
1959 #define ADOEN AADCON3bits.ADOEN // bit 4
1960 #define ADIPPOL AADCON3bits.ADIPPOL // bit 6
1961 #define ADEPPOL AADCON3bits.ADEPPOL // bit 7
1963 #define GRDPOL AADGRDbits.GRDPOL // bit 5
1964 #define GRDAOE AADGRDbits.GRDAOE // bit 6
1965 #define GRDBOE AADGRDbits.GRDBOE // bit 7
1967 #define ADPRE0 AADPREbits.ADPRE0 // bit 0
1968 #define ADPRE1 AADPREbits.ADPRE1 // bit 1
1969 #define ADPRE2 AADPREbits.ADPRE2 // bit 2
1970 #define ADPRE3 AADPREbits.ADPRE3 // bit 3
1971 #define ADPRE4 AADPREbits.ADPRE4 // bit 4
1972 #define ADPRE5 AADPREbits.ADPRE5 // bit 5
1973 #define ADPRE6 AADPREbits.ADPRE6 // bit 6
1975 #define ADSTG0 AADSTATbits.ADSTG0 // bit 0
1976 #define ADSTG1 AADSTATbits.ADSTG1 // bit 1
1977 #define ADCONV AADSTATbits.ADCONV // bit 2
1979 #define ANSA0 ANSELAbits.ANSA0 // bit 0
1980 #define ANSA1 ANSELAbits.ANSA1 // bit 1
1981 #define ANSA2 ANSELAbits.ANSA2 // bit 2
1982 #define ANSA4 ANSELAbits.ANSA4 // bit 4
1983 #define ANSA5 ANSELAbits.ANSA5 // bit 5
1985 #define SDSEL APFCONbits.SDSEL // bit 4
1986 #define SSSEL APFCONbits.SSSEL // bit 5, shadows bit in APFCONbits
1987 #define SS1SEL APFCONbits.SS1SEL // bit 5, shadows bit in APFCONbits
1988 #define SDOSEL APFCONbits.SDOSEL // bit 6, shadows bit in APFCONbits
1989 #define SDO1SEL APFCONbits.SDO1SEL // bit 6, shadows bit in APFCONbits
1991 #define BORRDY BORCONbits.BORRDY // bit 0
1992 #define BORFS BORCONbits.BORFS // bit 6
1993 #define SBOREN BORCONbits.SBOREN // bit 7
1995 #define BSR0 BSRbits.BSR0 // bit 0
1996 #define BSR1 BSRbits.BSR1 // bit 1
1997 #define BSR2 BSRbits.BSR2 // bit 2
1998 #define BSR3 BSRbits.BSR3 // bit 3
1999 #define BSR4 BSRbits.BSR4 // bit 4
2001 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0
2002 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1
2003 #define TSRNG FVRCONbits.TSRNG // bit 4
2004 #define TSEN FVRCONbits.TSEN // bit 5
2005 #define FVRRDY FVRCONbits.FVRRDY // bit 6
2006 #define FVREN FVRCONbits.FVREN // bit 7
2008 #define IOCIF INTCONbits.IOCIF // bit 0
2009 #define INTF INTCONbits.INTF // bit 1
2010 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
2011 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
2012 #define IOCIE INTCONbits.IOCIE // bit 3
2013 #define INTE INTCONbits.INTE // bit 4
2014 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
2015 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
2016 #define PEIE INTCONbits.PEIE // bit 6
2017 #define GIE INTCONbits.GIE // bit 7
2019 #define IOCAF0 IOCAFbits.IOCAF0 // bit 0
2020 #define IOCAF1 IOCAFbits.IOCAF1 // bit 1
2021 #define IOCAF2 IOCAFbits.IOCAF2 // bit 2
2022 #define IOCAF3 IOCAFbits.IOCAF3 // bit 3
2023 #define IOCAF4 IOCAFbits.IOCAF4 // bit 4
2024 #define IOCAF5 IOCAFbits.IOCAF5 // bit 5
2026 #define IOCAN0 IOCANbits.IOCAN0 // bit 0
2027 #define IOCAN1 IOCANbits.IOCAN1 // bit 1
2028 #define IOCAN2 IOCANbits.IOCAN2 // bit 2
2029 #define IOCAN3 IOCANbits.IOCAN3 // bit 3
2030 #define IOCAN4 IOCANbits.IOCAN4 // bit 4
2031 #define IOCAN5 IOCANbits.IOCAN5 // bit 5
2033 #define IOCAP0 IOCAPbits.IOCAP0 // bit 0
2034 #define IOCAP1 IOCAPbits.IOCAP1 // bit 1
2035 #define IOCAP2 IOCAPbits.IOCAP2 // bit 2
2036 #define IOCAP3 IOCAPbits.IOCAP3 // bit 3
2037 #define IOCAP4 IOCAPbits.IOCAP4 // bit 4
2038 #define IOCAP5 IOCAPbits.IOCAP5 // bit 5
2040 #define LATA0 LATAbits.LATA0 // bit 0
2041 #define LATA1 LATAbits.LATA1 // bit 1
2042 #define LATA2 LATAbits.LATA2 // bit 2
2043 #define LATA4 LATAbits.LATA4 // bit 4
2044 #define LATA5 LATAbits.LATA5 // bit 5
2046 #define PS0 OPTION_REGbits.PS0 // bit 0
2047 #define PS1 OPTION_REGbits.PS1 // bit 1
2048 #define PS2 OPTION_REGbits.PS2 // bit 2
2049 #define PSA OPTION_REGbits.PSA // bit 3
2050 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits
2051 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits
2052 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits
2053 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits
2054 #define INTEDG OPTION_REGbits.INTEDG // bit 6
2055 #define NOT_WPUEN OPTION_REGbits.NOT_WPUEN // bit 7
2057 #define SCS0 OSCCONbits.SCS0 // bit 0
2058 #define SCS1 OSCCONbits.SCS1 // bit 1
2059 #define IRCF0 OSCCONbits.IRCF0 // bit 3
2060 #define IRCF1 OSCCONbits.IRCF1 // bit 4
2061 #define IRCF2 OSCCONbits.IRCF2 // bit 5
2062 #define IRCF3 OSCCONbits.IRCF3 // bit 6
2063 #define SPLLEN OSCCONbits.SPLLEN // bit 7
2065 #define HFIOFS OSCSTATbits.HFIOFS // bit 0
2066 #define LFIOFR OSCSTATbits.LFIOFR // bit 1
2067 #define HFIOFR OSCSTATbits.HFIOFR // bit 4
2068 #define OSTS OSCSTATbits.OSTS // bit 5
2069 #define PLLR OSCSTATbits.PLLR // bit 6
2071 #define NOT_BOR PCONbits.NOT_BOR // bit 0
2072 #define NOT_POR PCONbits.NOT_POR // bit 1
2073 #define NOT_RI PCONbits.NOT_RI // bit 2
2074 #define NOT_RMCLR PCONbits.NOT_RMCLR // bit 3
2075 #define NOT_RWDT PCONbits.NOT_RWDT // bit 4
2076 #define STKUNF PCONbits.STKUNF // bit 6
2077 #define STKOVF PCONbits.STKOVF // bit 7
2079 #define SSP1IE PIE1bits.SSP1IE // bit 3
2080 #define ADIE PIE1bits.ADIE // bit 6
2082 #define BCL1IE PIE2bits.BCL1IE // bit 3
2084 #define SSP1IF PIR1bits.SSP1IF // bit 3
2085 #define ADIF PIR1bits.ADIF // bit 6
2087 #define BCL1IF PIR2bits.BCL1IF // bit 3
2089 #define RD PMCON1bits.RD // bit 0
2090 #define WR PMCON1bits.WR // bit 1
2091 #define WREN PMCON1bits.WREN // bit 2
2092 #define WRERR PMCON1bits.WRERR // bit 3
2093 #define FREE PMCON1bits.FREE // bit 4
2094 #define LWLO PMCON1bits.LWLO // bit 5
2095 #define CFGS PMCON1bits.CFGS // bit 6
2097 #define RA0 PORTAbits.RA0 // bit 0
2098 #define RA1 PORTAbits.RA1 // bit 1
2099 #define RA2 PORTAbits.RA2 // bit 2
2100 #define RA3 PORTAbits.RA3 // bit 3
2101 #define RA4 PORTAbits.RA4 // bit 4
2102 #define RA5 PORTAbits.RA5 // bit 5
2104 #define SSPM0 SSP1CON1bits.SSPM0 // bit 0
2105 #define SSPM1 SSP1CON1bits.SSPM1 // bit 1
2106 #define SSPM2 SSP1CON1bits.SSPM2 // bit 2
2107 #define SSPM3 SSP1CON1bits.SSPM3 // bit 3
2108 #define CKP SSP1CON1bits.CKP // bit 4
2109 #define SSPEN SSP1CON1bits.SSPEN // bit 5
2110 #define SSPOV SSP1CON1bits.SSPOV // bit 6
2111 #define WCOL SSP1CON1bits.WCOL // bit 7
2113 #define SEN SSP1CON2bits.SEN // bit 0
2114 #define RSEN SSP1CON2bits.RSEN // bit 1
2115 #define PEN SSP1CON2bits.PEN // bit 2
2116 #define RCEN SSP1CON2bits.RCEN // bit 3
2117 #define ACKEN SSP1CON2bits.ACKEN // bit 4
2118 #define ACKDT SSP1CON2bits.ACKDT // bit 5
2119 #define ACKSTAT SSP1CON2bits.ACKSTAT // bit 6
2120 #define GCEN SSP1CON2bits.GCEN // bit 7
2122 #define DHEN SSP1CON3bits.DHEN // bit 0
2123 #define AHEN SSP1CON3bits.AHEN // bit 1
2124 #define SBCDE SSP1CON3bits.SBCDE // bit 2
2125 #define SDAHT SSP1CON3bits.SDAHT // bit 3
2126 #define BOEN SSP1CON3bits.BOEN // bit 4
2127 #define SCIE SSP1CON3bits.SCIE // bit 5
2128 #define PCIE SSP1CON3bits.PCIE // bit 6
2129 #define ACKTIM SSP1CON3bits.ACKTIM // bit 7
2131 #define BF SSP1STATbits.BF // bit 0
2132 #define UA SSP1STATbits.UA // bit 1
2133 #define R_NOT_W SSP1STATbits.R_NOT_W // bit 2
2134 #define S SSP1STATbits.S // bit 3
2135 #define P SSP1STATbits.P // bit 4
2136 #define D_NOT_A SSP1STATbits.D_NOT_A // bit 5
2137 #define CKE SSP1STATbits.CKE // bit 6
2138 #define SMP SSP1STATbits.SMP // bit 7
2140 #define C STATUSbits.C // bit 0
2141 #define DC STATUSbits.DC // bit 1
2142 #define Z STATUSbits.Z // bit 2
2143 #define NOT_PD STATUSbits.NOT_PD // bit 3
2144 #define NOT_TO STATUSbits.NOT_TO // bit 4
2146 #define C_SHAD STATUS_SHADbits.C_SHAD // bit 0
2147 #define DC_SHAD STATUS_SHADbits.DC_SHAD // bit 1
2148 #define Z_SHAD STATUS_SHADbits.Z_SHAD // bit 2
2150 #define TRISA0 TRISAbits.TRISA0 // bit 0
2151 #define TRISA1 TRISAbits.TRISA1 // bit 1
2152 #define TRISA2 TRISAbits.TRISA2 // bit 2
2153 #define TRISA3 TRISAbits.TRISA3 // bit 3
2154 #define TRISA4 TRISAbits.TRISA4 // bit 4
2155 #define TRISA5 TRISAbits.TRISA5 // bit 5
2157 #define SWDTEN WDTCONbits.SWDTEN // bit 0
2158 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
2159 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
2160 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
2161 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
2162 #define WDTPS4 WDTCONbits.WDTPS4 // bit 5
2164 #define WPUA0 WPUAbits.WPUA0 // bit 0
2165 #define WPUA1 WPUAbits.WPUA1 // bit 1
2166 #define WPUA2 WPUAbits.WPUA2 // bit 2
2167 #define WPUA3 WPUAbits.WPUA3 // bit 3
2168 #define WPUA4 WPUAbits.WPUA4 // bit 4
2169 #define WPUA5 WPUAbits.WPUA5 // bit 5
2171 #endif // #ifndef NO_BIT_DEFINES
2173 #endif // #ifndef __PIC12LF1552_H__