* device/include/asm/pic16/features.h,
[fw/sdcc] / device / include / pic16 / pic18f242.h
1
2 /*
3  * pic18f242.h - PIC18F242 Device Library Header
4  *
5  * This file is part of the GNU PIC Library.
6  *
7  * January, 2004
8  * The GNU PIC Library is maintained by,
9  *      Vangelis Rokas <vrokas@otenet.gr>
10  *
11  * $Id$
12  *
13  */
14
15 #ifndef __PIC18F242_H__
16 #define __PIC18F242_H__
17
18 extern __sfr __at 0xf80 PORTA;
19 typedef union {
20         struct {
21                 unsigned RA0:1;
22                 unsigned RA1:1;
23                 unsigned RA2:1;
24                 unsigned RA3:1;
25                 unsigned RA4:1;
26                 unsigned RA5:1;
27                 unsigned RA6:1;
28                 unsigned :1;
29         };
30
31         struct {
32                 unsigned AN0:1;
33                 unsigned AN1:1;
34                 unsigned AN2:1;
35                 unsigned AN3:1;
36                 unsigned :1;
37                 unsigned AN4:1;
38                 unsigned OSC2:1;
39                 unsigned :1;
40         };
41
42         struct {
43                 unsigned :1;
44                 unsigned :1;
45                 unsigned VREFM:1;
46                 unsigned VREFP:1;
47                 unsigned T0CKI:1;
48                 unsigned SS:1;
49                 unsigned CLK0:1;
50                 unsigned :1;
51         };
52
53         struct {
54                 unsigned :1;
55                 unsigned :1;
56                 unsigned :1;
57                 unsigned :1;
58                 unsigned :1;
59                 unsigned LVDIN:1;
60                 unsigned :1;
61                 unsigned :1;
62         };
63 } __PORTAbits_t;
64
65 extern volatile __PORTAbits_t __at 0xf80 PORTAbits;
66
67 extern __sfr __at 0xf81 PORTB;
68 typedef union {
69         struct {
70                 unsigned RB0:1;
71                 unsigned RB1:1;
72                 unsigned RB2:1;
73                 unsigned RB3:1;
74                 unsigned RB4:1;
75                 unsigned RB5:1;
76                 unsigned RB6:1;
77                 unsigned RB7:1;
78         };
79
80         struct {
81                 unsigned INT0:1;
82                 unsigned INT1:1;
83                 unsigned INT2:1;
84                 unsigned INT3:1;
85                 unsigned :1;
86                 unsigned :1;
87                 unsigned :1;
88                 unsigned :1;
89         };
90 } __PORTBbits_t;
91
92 extern volatile __PORTBbits_t __at 0xf81 PORTBbits;
93
94 extern __sfr __at 0xf82 PORTC;
95 typedef union {
96         struct {
97                 unsigned RC0:1;
98                 unsigned RC1:1;
99                 unsigned RC2:1;
100                 unsigned RC3:1;
101                 unsigned RC4:1;
102                 unsigned RC5:1;
103                 unsigned RC6:1;
104                 unsigned RC7:1;
105         };
106
107         struct {
108                 unsigned T1OSO:1;
109                 unsigned T1OSI:1;
110                 unsigned :1;
111                 unsigned SCK:1;
112                 unsigned SDI:1;
113                 unsigned SDO:1;
114                 unsigned TX:1;
115                 unsigned RX:1;
116         };
117
118         struct {
119                 unsigned T1CKI:1;
120                 unsigned CCP2:1;
121                 unsigned CCP1:1;
122                 unsigned SCL:1;
123                 unsigned SDA:1;
124                 unsigned :1;
125                 unsigned CK:1;
126                 unsigned DT:1;
127         };
128 } __PORTCbits_t;
129
130 extern volatile __PORTCbits_t __at 0xf82 PORTCbits;
131
132 extern __sfr __at 0xf89 LATA;
133 typedef union {
134         struct {
135                 unsigned LATA0:1;
136                 unsigned LATA1:1;
137                 unsigned LATA2:1;
138                 unsigned LATA3:1;
139                 unsigned LATA4:1;
140                 unsigned LATA5:1;
141                 unsigned LATA6:1;
142                 unsigned :1;
143         };
144 } __LATAbits_t;
145
146 extern volatile __LATAbits_t __at 0xf89 LATAbits;
147
148 extern __sfr __at 0xf8a LATB;
149 typedef union {
150         struct {
151                 unsigned LATB0:1;
152                 unsigned LATB1:1;
153                 unsigned LATB2:1;
154                 unsigned LATB3:1;
155                 unsigned LATB4:1;
156                 unsigned LATB5:1;
157                 unsigned LATB6:1;
158                 unsigned LATB7:1;
159         };
160 } __LATBbits_t;
161
162 extern volatile __LATBbits_t __at 0xf8a LATBbits;
163
164 extern __sfr __at 0xf8b LATC;
165 typedef union {
166         struct {
167                 unsigned LATC0:1;
168                 unsigned LATC1:1;
169                 unsigned LATC2:1;
170                 unsigned LATC3:1;
171                 unsigned LATC4:1;
172                 unsigned LATC5:1;
173                 unsigned LATC6:1;
174                 unsigned LATC7:1;
175         };
176 } __LATCbits_t;
177
178 extern volatile __LATCbits_t __at 0xf8b LATCbits;
179
180 extern __sfr __at 0xf92 TRISA;
181 typedef union {
182         struct {
183                 unsigned TRISA0:1;
184                 unsigned TRISA1:1;
185                 unsigned TRISA2:1;
186                 unsigned TRISA3:1;
187                 unsigned TRISA4:1;
188                 unsigned TRISA5:1;
189                 unsigned TRISA6:1;
190                 unsigned :1;
191         };
192 } __TRISAbits_t;
193
194 extern volatile __TRISAbits_t __at 0xf92 TRISAbits;
195
196 extern __sfr __at 0xf93 TRISB;
197 typedef union {
198         struct {
199                 unsigned TRISB0:1;
200                 unsigned TRISB1:1;
201                 unsigned TRISB2:1;
202                 unsigned TRISB3:1;
203                 unsigned TRISB4:1;
204                 unsigned TRISB5:1;
205                 unsigned TRISB6:1;
206                 unsigned TRISB7:1;
207         };
208 } __TRISBbits_t;
209
210 extern volatile __TRISBbits_t __at 0xf93 TRISBbits;
211
212 extern __sfr __at 0xf94 TRISC;
213 typedef union {
214         struct {
215                 unsigned TRISC0:1;
216                 unsigned TRISC1:1;
217                 unsigned TRISC2:1;
218                 unsigned TRISC3:1;
219                 unsigned TRISC4:1;
220                 unsigned TRISC5:1;
221                 unsigned TRISC6:1;
222                 unsigned TRISC7:1;
223         };
224 } __TRISCbits_t;
225
226 extern volatile __TRISCbits_t __at 0xf94 TRISCbits;
227
228 extern __sfr __at 0xf9d PIE1;
229 typedef union {
230         struct {
231                 unsigned TMR1IE:1;
232                 unsigned TMR2IE:1;
233                 unsigned CCP1IE:1;
234                 unsigned SSPIE:1;
235                 unsigned TXIE:1;
236                 unsigned RCIE:1;
237                 unsigned ADIE:1;
238                 unsigned PSPIE:1;
239         };
240 } __PIE1bits_t;
241
242 extern volatile __PIE1bits_t __at 0xf9d PIE1bits;
243
244 extern __sfr __at 0xf9e PIR1;
245 typedef union {
246         struct {
247                 unsigned TMR1IF:1;
248                 unsigned TMR2IF:1;
249                 unsigned CCP1IF:1;
250                 unsigned SSPIF:1;
251                 unsigned TXIF:1;
252                 unsigned RCIF:1;
253                 unsigned ADIF:1;
254                 unsigned PSPIF:1;
255         };
256 } __PIR1bits_t;
257
258 extern volatile __PIR1bits_t __at 0xf9e PIR1bits;
259
260 extern __sfr __at 0xf9f IPR1;
261 typedef union {
262         struct {
263                 unsigned TMR1IP:1;
264                 unsigned TMR2IP:1;
265                 unsigned CCP1IP:1;
266                 unsigned SSPIP:1;
267                 unsigned TXIP:1;
268                 unsigned RCIP:1;
269                 unsigned ADIP:1;
270                 unsigned PSPIP:1;
271         };
272 } __IPR1bits_t;
273
274 extern volatile __IPR1bits_t __at 0xf9f IPR1bits;
275
276 extern __sfr __at 0xfa0 PIE2;
277 typedef union {
278         struct {
279                 unsigned CCP2IE:1;
280                 unsigned TMR3IE:1;
281                 unsigned LVDIE:1;
282                 unsigned BCLIE:1;
283                 unsigned EEIE:1;
284                 unsigned :1;
285                 unsigned :1;
286                 unsigned :1;
287         };
288 } __PIE2bits_t;
289
290 extern volatile __PIE2bits_t __at 0xfa0 PIE2bits;
291
292 extern __sfr __at 0xfa1 PIR2;
293 typedef union {
294         struct {
295                 unsigned CCP2IF:1;
296                 unsigned TMR3IF:1;
297                 unsigned LVDIF:1;
298                 unsigned BCLIF:1;
299                 unsigned EEIF:1;
300                 unsigned :1;
301                 unsigned :1;
302                 unsigned :1;
303         };
304 } __PIR2bits_t;
305
306 extern volatile __PIR2bits_t __at 0xfa1 PIR2bits;
307
308 extern __sfr __at 0xfa2 IPR2;
309 typedef union {
310         struct {
311                 unsigned CCP2IP:1;
312                 unsigned TMR3IP:1;
313                 unsigned LVDIP:1;
314                 unsigned BCLIP:1;
315                 unsigned EEIP:1;
316                 unsigned :1;
317                 unsigned :1;
318                 unsigned :1;
319         };
320 } __IPR2bits_t;
321
322 extern volatile __IPR2bits_t __at 0xfa2 IPR2bits;
323
324 extern __sfr __at 0xfa6 EECON1;
325 typedef union {
326         struct {
327                 unsigned RD:1;
328                 unsigned WR:1;
329                 unsigned WREN:1;
330                 unsigned WRERR:1;
331                 unsigned FREE:1;
332                 unsigned :1;
333                 unsigned CFGS:1;
334                 unsigned EEPGD:1;
335         };
336 } __EECON1bits_t;
337
338 extern volatile __EECON1bits_t __at 0xfa6 EECON1bits;
339
340 extern __sfr __at 0xfa7 EECON2;
341 extern __sfr __at 0xfa8 EEDATA;
342 extern __sfr __at 0xfa9 EEADR;
343 extern __sfr __at 0xfab RCSTA;
344 typedef union {
345         struct {
346                 unsigned RX9D:1;
347                 unsigned OERR:1;
348                 unsigned FERR:1;
349                 unsigned ADDEN:1;
350                 unsigned CREN:1;
351                 unsigned SREN:1;
352                 unsigned RX9:1;
353                 unsigned SPEN:1;
354         };
355 } __RCSTAbits_t;
356
357 extern volatile __RCSTAbits_t __at 0xfab RCSTAbits;
358
359 extern __sfr __at 0xfac TXSTA;
360 typedef union {
361         struct {
362                 unsigned TX9D:1;
363                 unsigned TRMT:1;
364                 unsigned BRGH:1;
365                 unsigned :1;
366                 unsigned SYNC:1;
367                 unsigned TXEN:1;
368                 unsigned TX9:1;
369                 unsigned CSRC:1;
370         };
371 } __TXSTAbits_t;
372
373 extern volatile __TXSTAbits_t __at 0xfac TXSTAbits;
374
375 extern __sfr __at 0xfad TXREG;
376 extern __sfr __at 0xfae RCREG;
377 extern __sfr __at 0xfaf SPBRG;
378 extern __sfr __at 0xfb1 T3CON;
379 typedef union {
380         struct {
381                 unsigned TMR3ON:1;
382                 unsigned TMR3CS:1;
383                 unsigned T3SYNC:1;
384                 unsigned T3CCP1:1;
385                 unsigned T3CKPS0:1;
386                 unsigned T3CKPS1:1;
387                 unsigned T3CCP2:1;
388                 unsigned RD16:1;
389         };
390 } __T3CONbits_t;
391
392 extern volatile __T3CONbits_t __at 0xfb1 T3CONbits;
393
394 extern __sfr __at 0xfb2 TMR3L;
395 extern __sfr __at 0xfb3 TMR3H;
396 extern __sfr __at 0xfba CCP2CON;
397 typedef union {
398         struct {
399                 unsigned CCP2M0:1;
400                 unsigned CCP2M1:1;
401                 unsigned CCP2M2:1;
402                 unsigned CCP2M3:1;
403                 unsigned DCCP2Y:1;
404                 unsigned DCCP2X:1;
405                 unsigned :1;
406                 unsigned :1;
407         };
408 } __CCP2CONbits_t;
409
410 extern volatile __CCP2CONbits_t __at 0xfba CCP2CONbits;
411
412 extern __sfr __at 0xfbb CCPR2L;
413 extern __sfr __at 0xfbc CCPR2H;
414 extern __sfr __at 0xfbd CCP1CON;
415 typedef union {
416         struct {
417                 unsigned CCP1M0:1;
418                 unsigned CCP1M1:1;
419                 unsigned CCP1M2:1;
420                 unsigned CCP1M3:1;
421                 unsigned DCCP1Y:1;
422                 unsigned DCCP1X:1;
423                 unsigned :1;
424                 unsigned :1;
425         };
426 } __CCP1CONbits_t;
427
428 extern volatile __CCP1CONbits_t __at 0xfbd CCP1CONbits;
429
430 extern __sfr __at 0xfbe CCPR1L;
431 extern __sfr __at 0xfbf CCPR1H;
432 extern __sfr __at 0xfc1 ADCON1;
433 typedef union {
434         struct {
435                 unsigned PCFG0:1;
436                 unsigned PCFG1:1;
437                 unsigned PCFG2:1;
438                 unsigned PCFG3:1;
439                 unsigned :1;
440                 unsigned :1;
441                 unsigned ADCS2:1;
442                 unsigned ADFM:1;
443         };
444 } __ADCON1bits_t;
445
446 extern volatile __ADCON1bits_t __at 0xfc1 ADCON1bits;
447
448 extern __sfr __at 0xfc2 ADCON0;
449 typedef union {
450         struct {
451                 unsigned ADON:1;
452                 unsigned :1;
453                 unsigned GO:1;
454                 unsigned CHS0:1;
455                 unsigned CHS1:1;
456                 unsigned CHS2:1;
457                 unsigned ADCS0:1;
458                 unsigned ADCS1:1;
459         };
460 } __ADCON0bits_t;
461
462 extern volatile __ADCON0bits_t __at 0xfc2 ADCON0bits;
463
464 extern __sfr __at 0xfc3 ADRESL;
465 extern __sfr __at 0xfc4 ADRESH;
466 extern __sfr __at 0xfc5 SSPCON2;
467 typedef union {
468         struct {
469                 unsigned SEN:1;
470                 unsigned RSEN:1;
471                 unsigned PEN:1;
472                 unsigned RCEN:1;
473                 unsigned ACKEN:1;
474                 unsigned ACKDT:1;
475                 unsigned ACKSTAT:1;
476                 unsigned GCEN:1;
477         };
478 } __SSPCON2bits_t;
479
480 extern volatile __SSPCON2bits_t __at 0xfc5 SSPCON2bits;
481
482 extern __sfr __at 0xfc6 SSPCON1;
483 typedef union {
484         struct {
485                 unsigned SSPM0:1;
486                 unsigned SSPM1:1;
487                 unsigned SSPM2:1;
488                 unsigned SSPM3:1;
489                 unsigned CKP:1;
490                 unsigned SSPEN:1;
491                 unsigned SSPOV:1;
492                 unsigned WCOL:1;
493         };
494 } __SSPCON1bits_t;
495
496 extern volatile __SSPCON1bits_t __at 0xfc6 SSPCON1bits;
497
498 extern __sfr __at 0xfc7 SSPSTAT;
499 typedef union {
500         struct {
501                 unsigned BF:1;
502                 unsigned UA:1;
503                 unsigned R_W:1;
504                 unsigned S:1;
505                 unsigned P:1;
506                 unsigned D_A:1;
507                 unsigned CKE:1;
508                 unsigned SMP:1;
509         };
510 } __SSPSTATbits_t;
511
512 extern volatile __SSPSTATbits_t __at 0xfc7 SSPSTATbits;
513
514 extern __sfr __at 0xfc8 SSPADD;
515 extern __sfr __at 0xfc9 SSPBUF;
516 extern __sfr __at 0xfca T2CON;
517 typedef union {
518         struct {
519                 unsigned T2CKPS0:1;
520                 unsigned T2CKPS1:1;
521                 unsigned TMR2ON:1;
522                 unsigned TOUTPS0:1;
523                 unsigned TOUTPS1:1;
524                 unsigned TOUTPS2:1;
525                 unsigned TOUTPS3:1;
526                 unsigned :1;
527         };
528 } __T2CONbits_t;
529
530 extern volatile __T2CONbits_t __at 0xfca T2CONbits;
531
532 extern __sfr __at 0xfcb PR2;
533 extern __sfr __at 0xfcc TMR2;
534 extern __sfr __at 0xfcd T1CON;
535 typedef union {
536         struct {
537                 unsigned TMR1ON:1;
538                 unsigned TMR1CS:1;
539                 unsigned NOT_T1SYNC:1;
540                 unsigned T1OSCEN:1;
541                 unsigned T1CKPS0:1;
542                 unsigned T1CKPS1:1;
543                 unsigned :1;
544                 unsigned RD16:1;
545         };
546 } __T1CONbits_t;
547
548 extern volatile __T1CONbits_t __at 0xfcd T1CONbits;
549
550 extern __sfr __at 0xfce TMR1L;
551 extern __sfr __at 0xfcf TMR1H;
552 extern __sfr __at 0xfd0 RCON;
553 typedef union {
554         struct {
555                 unsigned BOR:1;
556                 unsigned POR:1;
557                 unsigned PD:1;
558                 unsigned TO:1;
559                 unsigned RI:1;
560                 unsigned :1;
561                 unsigned :1;
562                 unsigned IPEN:1;
563         };
564 } __RCONbits_t;
565
566 extern volatile __RCONbits_t __at 0xfd0 RCONbits;
567
568 extern __sfr __at 0xfd1 WDTCON;
569 typedef union {
570         struct {
571                 unsigned SWDTEN:1;
572                 unsigned :1;
573                 unsigned :1;
574                 unsigned :1;
575                 unsigned :1;
576                 unsigned :1;
577                 unsigned :1;
578                 unsigned :1;
579         };
580
581         struct {
582                 unsigned SWDTE:1;
583                 unsigned :1;
584                 unsigned :1;
585                 unsigned :1;
586                 unsigned :1;
587                 unsigned :1;
588                 unsigned :1;
589                 unsigned :1;
590         };
591 } __WDTCONbits_t;
592
593 extern volatile __WDTCONbits_t __at 0xfd1 WDTCONbits;
594
595 extern __sfr __at 0xfd2 LVDCON;
596 typedef union {
597         struct {
598                 unsigned LVDL0:1;
599                 unsigned LVDL1:1;
600                 unsigned LVDL2:1;
601                 unsigned LVDL3:1;
602                 unsigned LVDEN:1;
603                 unsigned VRST:1;
604                 unsigned :1;
605                 unsigned :1;
606         };
607
608         struct {
609                 unsigned LVV0:1;
610                 unsigned LVV1:1;
611                 unsigned LVV2:1;
612                 unsigned LVV3:1;
613                 unsigned :1;
614                 unsigned BGST:1;
615                 unsigned :1;
616                 unsigned :1;
617         };
618 } __LVDCONbits_t;
619
620 extern volatile __LVDCONbits_t __at 0xfd2 LVDCONbits;
621
622 extern __sfr __at 0xfd3 OSCCON;
623 typedef union {
624         struct {
625                 unsigned SCS:1;
626                 unsigned :1;
627                 unsigned :1;
628                 unsigned :1;
629                 unsigned :1;
630                 unsigned :1;
631                 unsigned :1;
632                 unsigned :1;
633         };
634 } __OSCCONbits_t;
635
636 extern volatile __OSCCONbits_t __at 0xfd3 OSCCONbits;
637
638 extern __sfr __at 0xfd5 T0CON;
639 typedef union {
640         struct {
641                 unsigned T0PS0:1;
642                 unsigned T0PS1:1;
643                 unsigned T0PS2:1;
644                 unsigned PSA:1;
645                 unsigned T0SE:1;
646                 unsigned T0CS:1;
647                 unsigned T08BIT:1;
648                 unsigned TMR0ON:1;
649         };
650 } __T0CONbits_t;
651
652 extern volatile __T0CONbits_t __at 0xfd5 T0CONbits;
653
654 extern __sfr __at 0xfd6 TMR0L;
655 extern __sfr __at 0xfd7 TMR0H;
656 extern __sfr __at 0xfd8 STATUS;
657 typedef union {
658         struct {
659                 unsigned C:1;
660                 unsigned DC:1;
661                 unsigned Z:1;
662                 unsigned OV:1;
663                 unsigned N:1;
664                 unsigned :1;
665                 unsigned :1;
666                 unsigned :1;
667         };
668 } __STATUSbits_t;
669
670 extern volatile __STATUSbits_t __at 0xfd8 STATUSbits;
671
672 extern __sfr __at 0xfd9 FSR2L;
673 extern __sfr __at 0xfda FSR2H;
674 extern __sfr __at 0xfdb PLUSW2;
675 extern __sfr __at 0xfdc PREINC2;
676 extern __sfr __at 0xfdd POSTDEC2;
677 extern __sfr __at 0xfde POSTINC2;
678 extern __sfr __at 0xfdf INDF2;
679 extern __sfr __at 0xfe0 BSR;
680 extern __sfr __at 0xfe1 FSR1L;
681 extern __sfr __at 0xfe2 FSR1H;
682 extern __sfr __at 0xfe3 PLUSW1;
683 extern __sfr __at 0xfe4 PREINC1;
684 extern __sfr __at 0xfe5 POSTDEC1;
685 extern __sfr __at 0xfe6 POSTINC1;
686 extern __sfr __at 0xfe7 INDF1;
687 extern __sfr __at 0xfe8 WREG;
688 extern __sfr __at 0xfe9 FSR0L;
689 extern __sfr __at 0xfea FSR0H;
690 extern __sfr __at 0xfeb PLUSW0;
691 extern __sfr __at 0xfec PREINC0;
692 extern __sfr __at 0xfed POSTDEC0;
693 extern __sfr __at 0xfee POSTINC0;
694 extern __sfr __at 0xfef INDF0;
695 extern __sfr __at 0xff0 INTCON3;
696 typedef union {
697         struct {
698                 unsigned INT1F:1;
699                 unsigned INT2F:1;
700                 unsigned :1;
701                 unsigned INT1E:1;
702                 unsigned INT2E:1;
703                 unsigned :1;
704                 unsigned INT1P:1;
705                 unsigned INT2P:1;
706         };
707
708         struct {
709                 unsigned INT1IF:1;
710                 unsigned INT2IF:1;
711                 unsigned :1;
712                 unsigned INT1IE:1;
713                 unsigned INT2IE:1;
714                 unsigned :1;
715                 unsigned INT1IP:1;
716                 unsigned INT2IP:1;
717         };
718 } __INTCON3bits_t;
719
720 extern volatile __INTCON3bits_t __at 0xff0 INTCON3bits;
721
722 extern __sfr __at 0xff1 INTCON2;
723 typedef union {
724         struct {
725                 unsigned RBIP:1;
726                 unsigned :1;
727                 unsigned T0IP:1;
728                 unsigned :1;
729                 unsigned INTEDG2:1;
730                 unsigned INTEDG1:1;
731                 unsigned INTEDG0:1;
732                 unsigned RBPU:1;
733         };
734 } __INTCON2bits_t;
735
736 extern volatile __INTCON2bits_t __at 0xff1 INTCON2bits;
737
738 extern __sfr __at 0xff2 INTCON;
739 typedef union {
740         struct {
741                 unsigned RBIF:1;
742                 unsigned INT0F:1;
743                 unsigned T0IF:1;
744                 unsigned RBIE:1;
745                 unsigned INT0E:1;
746                 unsigned T0IE:1;
747                 unsigned PEIE:1;
748                 unsigned GIE:1;
749         };
750 } __INTCONbits_t;
751
752 extern volatile __INTCONbits_t __at 0xff2 INTCONbits;
753
754 extern __sfr __at 0xff3 PRODL;
755 extern __sfr __at 0xff4 PRODH;
756 extern __sfr __at 0xff5 TABLAT;
757 extern __sfr __at 0xff6 TBLPTRL;
758 extern __sfr __at 0xff7 TBLPTRH;
759 extern __sfr __at 0xff8 TBLPTRU;
760 extern __sfr __at 0xff9 PCL;
761 extern __sfr __at 0xffa PCLATH;
762 extern __sfr __at 0xffb PCLATU;
763 extern __sfr __at 0xffc STKPTR;
764 typedef union {
765         struct {
766                 unsigned STKPTR0:1;
767                 unsigned STKPTR1:1;
768                 unsigned STKPTR2:1;
769                 unsigned STKPTR3:1;
770                 unsigned STKPTR4:1;
771                 unsigned :1;
772                 unsigned STKUNF:1;
773                 unsigned STKFUL:1;
774         };
775 } __STKPTRbits_t;
776
777 extern volatile __STKPTRbits_t __at 0xffc STKPTRbits;
778
779 extern __sfr __at 0xffd TOSL;
780 extern __sfr __at 0xffe TOSH;
781 extern __sfr __at 0xfff TOSU;
782
783
784 /* Configuration registers locations */
785 #define __CONFIG1H      0x300001
786 #define __CONFIG2L      0x300002
787 #define __CONFIG2H      0x300003
788 #define __CONFIG3H      0x300005
789 #define __CONFIG4L      0x300006
790 #define __CONFIG5L      0x300008
791 #define __CONFIG5H      0x300009
792 #define __CONFIG6L      0x30000A
793 #define __CONFIG6H      0x30000B
794 #define __CONFIG7L      0x30000C
795 #define __CONFIG7H      0x30000D
796
797
798
799 /* Oscillator 1H options */
800 #define _OSC_RC_OSC2_1H 0xFF    /* RC-OSC2 as RA6 */
801 #define _OSC_HS_PLL_1H  0xFE    /* HS-PLL Enabled */
802 #define _OSC_EC_OSC2_RA6_1H     0xFD    /* EC-OSC2 as RA6 */
803 #define _OSC_EC_OSC2_Clock_Out_1H       0xFC    /* EC-OSC2 as Clock_Out */
804 #define _OSC_RC_1H      0xFB    /* RC */
805 #define _OSC_HS_1H      0xFA    /* HS */
806 #define _OSC_XT_1H      0xF9    /* XT */
807 #define _OSC_LP_1H      0xF8    /* LP */
808
809 /* Osc. Switch Enable 1H options */
810 #define _OSCS_OFF_1H    0xFF    /* Disabled */
811 #define _OSCS_ON_1H     0xDF    /* Enabled */
812
813 /* Power Up Timer 2L options */
814 #define _PUT_OFF_2L     0xFF    /* Disabled */
815 #define _PUT_ON_2L      0xFE    /* Enabled */
816
817 /* Brown Out Detect 2L options */
818 #define _BODEN_ON_2L    0xFF    /* Enabled */
819 #define _BODEN_OFF_2L   0xFD    /* Disabled */
820
821 /* Brown Out Voltage 2L options */
822 #define _BODENV_2_0V_2L 0xFF    /* 2.0V */
823 #define _BODENV_2_7V_2L 0xFB    /* 2.7V */
824 #define _BODENV_4_2V_2L 0xF7    /* 4.2V */
825 #define _BODENV_4_5V_2L 0xF3    /* 4.5V */
826
827 /* Watchdog Timer 2H options */
828 #define _WDT_ON_2H      0xFF    /* Enabled */
829 #define _WDT_OFF_2H     0xFE    /* Disabled */
830
831 /* Watchdog Postscaler 2H options */
832 #define _WDTPS_1_128_2H 0xFF    /* 1:128 */
833 #define _WDTPS_1_64_2H  0xFD    /* 1:64 */
834 #define _WDTPS_1_32_2H  0xFB    /* 1:32 */
835 #define _WDTPS_1_16_2H  0xF9    /* 1:16 */
836 #define _WDTPS_1_8_2H   0xF7    /* 1:8 */
837 #define _WDTPS_1_4_2H   0xF5    /* 1:4 */
838 #define _WDTPS_1_2_2H   0xF3    /* 1:2 */
839 #define _WDTPS_1_1_2H   0xF1    /* 1:1 */
840
841 /* CCP2 Mux 3H options */
842 #define _CCP2MUX_RC1_3H 0xFF    /* RC1 */
843 #define _CCP2MUX_RB3_3H 0xFE    /* RB3 */
844
845 /* Low Voltage Program 4L options */
846 #define _LVP_ON_4L      0xFF    /* Enabled */
847 #define _LVP_OFF_4L     0xFB    /* Disabled */
848
849 /* Background Debug 4L options */
850 #define _BACKBUG_OFF_4L 0xFF    /* Disabled */
851 #define _BACKBUG_ON_4L  0x7F    /* Enabled */
852
853 /* Stack Overflow Reset 4L options */
854 #define _STVR_ON_4L     0xFF    /* Enabled */
855 #define _STVR_OFF_4L    0xFE    /* Disabled */
856
857 /* Code Protect 00200-01FFF 5L options */
858 #define _CP_0_OFF_5L    0xFF    /* Disabled */
859 #define _CP_0_ON_5L     0xFE    /* Enabled */
860
861 /* Code Protect 02000-03FFF 5L options */
862 #define _CP_1_OFF_5L    0xFF    /* Disabled */
863 #define _CP_1_ON_5L     0xFD    /* Enabled */
864
865 /* Data EE Read Protect 5H options */
866 #define _CPD_OFF_5H     0xFF    /* Disabled */
867 #define _CPD_ON_5H      0x7F    /* Enabled */
868
869 /* Code Protect Boot 5H options */
870 #define _CPB_OFF_5H     0xFF    /* Disabled */
871 #define _CPB_ON_5H      0xBF    /* Enabled */
872
873 /* Table Write Protect 00200-01FFF 6L options */
874 #define _WRT_0_OFF_6L   0xFF    /* Disabled */
875 #define _WRT_0_ON_6L    0xFE    /* Enabled */
876
877 /* Table Write Protect 02000-03FFF 6L options */
878 #define _WRT_1_OFF_6L   0xFF    /* Disabled */
879 #define _WRT_1_ON_6L    0xFD    /* Enabled */
880
881 /* Data EE Write Protect 6H options */
882 #define _WRTD_OFF_6H    0xFF    /* Disabled */
883 #define _WRTD_ON_6H     0x7F    /* Enabled */
884
885 /* Table Write Protect Boot 6H options */
886 #define _WRTB_OFF_6H    0xFF    /* Disabled */
887 #define _WRTB_ON_6H     0xBF    /* Enabled */
888
889 /* Config. Write Protect 6H options */
890 #define _WRTC_OFF_6H    0xFF    /* Disabled */
891 #define _WRTC_ON_6H     0xDF    /* Enabled */
892
893 /* Table Read Protect 00200-01FFF 7L options */
894 #define _EBTR_0_OFF_7L  0xFF    /* Disabled */
895 #define _EBTR_0_ON_7L   0xFE    /* Enabled */
896
897 /* Table Read Protect 02000-03FFF 7L options */
898 #define _EBTR_1_OFF_7L  0xFF    /* Disabled */
899 #define _EBTR_1_ON_7L   0xFD    /* Enabled */
900
901 /* Table Read Protect Boot 7H options */
902 #define _EBTRB_OFF_7H   0xFF    /* Disabled */
903 #define _EBTRB_ON_7H    0xBF    /* Enabled */
904
905
906 /* Device ID locations */
907 #define __IDLOC0        0x200000
908 #define __IDLOC1        0x200001
909 #define __IDLOC2        0x200002
910 #define __IDLOC3        0x200003
911 #define __IDLOC4        0x200004
912 #define __IDLOC5        0x200005
913 #define __IDLOC6        0x200006
914 #define __IDLOC7        0x200007
915
916
917 #endif