Imported Upstream version 2.9.0
[debian/cc1111] / device / lib / pic16 / libdev / pic18f8680.c
1
2 /*
3  * pic18f8680.c - PIC18F8680 Device Library Source
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: pic18f8680.c 3765 2005-05-18 20:32:06Z tecodev $
12  *
13  */
14
15 #include <pic18f8680.h>
16
17 __sfr __at (0xf00) RXF0SIDH;
18 __sfr __at (0xf01) RXF0SIDL;
19 volatile __RXF0SIDLbits_t __at (0xf01) RXF0SIDLbits;
20
21 __sfr __at (0xf02) RXF0EIDH;
22 __sfr __at (0xf03) RXF0EIDL;
23 __sfr __at (0xf04) RXF1SIDH;
24 __sfr __at (0xf05) RXF1SIDL;
25 volatile __RXF1SIDLbits_t __at (0xf05) RXF1SIDLbits;
26
27 __sfr __at (0xf06) RXF1EIDH;
28 __sfr __at (0xf07) RXF1EIDL;
29 __sfr __at (0xf08) RXF2SIDH;
30 __sfr __at (0xf09) RXF2SIDL;
31 __sfr __at (0xf0a) RXF2EIDH;
32 __sfr __at (0xf0b) RXF2EIDL;
33 volatile __RXF2EIDLbits_t __at (0xf0b) RXF2EIDLbits;
34
35 __sfr __at (0xf0c) RXF3SIDH;
36 __sfr __at (0xf0d) RXF3SIDL;
37 volatile __RXF3SIDLbits_t __at (0xf0d) RXF3SIDLbits;
38
39 __sfr __at (0xf0e) RXF3EIDH;
40 __sfr __at (0xf0f) RXF3EIDL;
41 __sfr __at (0xf10) RXF4SIDH;
42 __sfr __at (0xf11) RXF4SIDL;
43 volatile __RXF4SIDLbits_t __at (0xf11) RXF4SIDLbits;
44
45 __sfr __at (0xf12) RXF4EIDH;
46 __sfr __at (0xf13) RXF4EIDL;
47 __sfr __at (0xf14) RXF5SIDH;
48 __sfr __at (0xf15) RXF5SIDL;
49 volatile __RXF5SIDLbits_t __at (0xf15) RXF5SIDLbits;
50
51 __sfr __at (0xf16) RXF5EIDH;
52 __sfr __at (0xf17) RXF5EIDL;
53 __sfr __at (0xf18) RXM0SIDH;
54 __sfr __at (0xf19) RXM0SIDL;
55 volatile __RXM0SIDLbits_t __at (0xf19) RXM0SIDLbits;
56
57 __sfr __at (0xf1a) RXM0EIDH;
58 __sfr __at (0xf1b) RXM0EIDL;
59 __sfr __at (0xf1c) RXM1SIDH;
60 __sfr __at (0xf1d) RXM1SIDL;
61 volatile __RXM1SIDLbits_t __at (0xf1d) RXM1SIDLbits;
62
63 __sfr __at (0xf1e) RXM1EIDH;
64 __sfr __at (0xf1f) RXM1EIDL;
65 __sfr __at (0xf20) TXB2CON;
66 volatile __TXB2CONbits_t __at (0xf20) TXB2CONbits;
67
68 __sfr __at (0xf21) TXB2SIDH;
69 __sfr __at (0xf22) TXB2SIDL;
70 volatile __TXB2SIDLbits_t __at (0xf22) TXB2SIDLbits;
71
72 __sfr __at (0xf23) TXB2EIDH;
73 __sfr __at (0xf24) TXB2EIDL;
74 __sfr __at (0xf25) TXB2DLC;
75 volatile __TXB2DLCbits_t __at (0xf25) TXB2DLCbits;
76
77 __sfr __at (0xf26) TXB2D0;
78 __sfr __at (0xf27) TXB2D1;
79 __sfr __at (0xf28) TXB2D2;
80 __sfr __at (0xf29) TXB2D3;
81 __sfr __at (0xf2a) TXB2D4;
82 __sfr __at (0xf2b) TXB2D5;
83 __sfr __at (0xf2c) TXB2D6;
84 __sfr __at (0xf2d) TXB2D7;
85 __sfr __at (0xf2e) CANSTATRO3;
86 __sfr __at (0xf30) TXB1CON;
87 volatile __TXB1CONbits_t __at (0xf30) TXB1CONbits;
88
89 __sfr __at (0xf31) TXB1SIDH;
90 __sfr __at (0xf32) TXB1SIDL;
91 volatile __TXB1SIDLbits_t __at (0xf32) TXB1SIDLbits;
92
93 __sfr __at (0xf33) TXB1EIDH;
94 __sfr __at (0xf34) TXB1EIDL;
95 __sfr __at (0xf35) TXB1DLC;
96 volatile __TXB1DLCbits_t __at (0xf35) TXB1DLCbits;
97
98 __sfr __at (0xf36) TXB1D0;
99 __sfr __at (0xf37) TXB1D1;
100 __sfr __at (0xf38) TXB1D2;
101 __sfr __at (0xf39) TXB1D3;
102 __sfr __at (0xf3a) TXB1D4;
103 __sfr __at (0xf3b) TXB1D5;
104 __sfr __at (0xf3c) TXB1D6;
105 __sfr __at (0xf3d) TXB1D7;
106 __sfr __at (0xf3e) CANSTATRO2;
107 __sfr __at (0xf40) TXB0CON;
108 volatile __TXB0CONbits_t __at (0xf40) TXB0CONbits;
109
110 __sfr __at (0xf41) TXB0SIDH;
111 __sfr __at (0xf42) TXB0SIDL;
112 __sfr __at (0xf43) TXB0EIDH;
113 __sfr __at (0xf44) TXB0EIDL;
114 __sfr __at (0xf45) TXB0DLC;
115 volatile __TXB0DLCbits_t __at (0xf45) TXB0DLCbits;
116
117 __sfr __at (0xf46) TXB0D0;
118 __sfr __at (0xf47) TXB0D1;
119 __sfr __at (0xf48) TXB0D2;
120 __sfr __at (0xf49) TXB0D3;
121 __sfr __at (0xf4a) TXB0D4;
122 __sfr __at (0xf4b) TXB0D5;
123 __sfr __at (0xf4c) TXB0D6;
124 __sfr __at (0xf4d) TXB0D7;
125 __sfr __at (0xf4e) CANSTATRO1;
126 __sfr __at (0xf50) RXB1CON;
127 volatile __RXB1CONbits_t __at (0xf50) RXB1CONbits;
128
129 __sfr __at (0xf51) RXB1SIDH;
130 __sfr __at (0xf52) RXB1SIDL;
131 volatile __RXB1SIDLbits_t __at (0xf52) RXB1SIDLbits;
132
133 __sfr __at (0xf53) RXB1EIDH;
134 __sfr __at (0xf54) RXB1EIDL;
135 __sfr __at (0xf55) RXB1DLC;
136 volatile __RXB1DLCbits_t __at (0xf55) RXB1DLCbits;
137
138 __sfr __at (0xf56) RXB1D0;
139 __sfr __at (0xf57) RXB1D1;
140 __sfr __at (0xf58) RXB1D2;
141 __sfr __at (0xf59) RXB1D3;
142 __sfr __at (0xf5a) RXB1D4;
143 __sfr __at (0xf5b) RXB1D5;
144 __sfr __at (0xf5c) RXB1D6;
145 __sfr __at (0xf5d) RXB1D7;
146 __sfr __at (0xf5e) CANSTATRO0;
147 __sfr __at (0xf60) RXB0CON;
148 volatile __RXB0CONbits_t __at (0xf60) RXB0CONbits;
149
150 __sfr __at (0xf61) RXB0SIDH;
151 __sfr __at (0xf62) RXB0SIDL;
152 volatile __RXB0SIDLbits_t __at (0xf62) RXB0SIDLbits;
153
154 __sfr __at (0xf63) RXB0EIDH;
155 __sfr __at (0xf64) RXB0EIDL;
156 __sfr __at (0xf65) RXB0DLC;
157 __sfr __at (0xf66) RXB0D0;
158 __sfr __at (0xf67) RXB0D1;
159 __sfr __at (0xf68) RXB0D2;
160 __sfr __at (0xf69) RXB0D3;
161 __sfr __at (0xf6a) RXB0D4;
162 __sfr __at (0xf6b) RXB0D5;
163 __sfr __at (0xf6c) RXB0D6;
164 __sfr __at (0xf6d) RXB0D7;
165 __sfr __at (0xf6e) CANSTAT;
166 volatile __CANSTATbits_t __at (0xf6e) CANSTATbits;
167
168 __sfr __at (0xf6f) CANCON;
169 volatile __CANCONbits_t __at (0xf6f) CANCONbits;
170
171 __sfr __at (0xf70) BRGCON1;
172 volatile __BRGCON1bits_t __at (0xf70) BRGCON1bits;
173
174 __sfr __at (0xf71) BRGCON2;
175 volatile __BRGCON2bits_t __at (0xf71) BRGCON2bits;
176
177 __sfr __at (0xf72) BRGCON3;
178 volatile __BRGCON3bits_t __at (0xf72) BRGCON3bits;
179
180 __sfr __at (0xf73) CIOCON;
181 volatile __CIOCONbits_t __at (0xf73) CIOCONbits;
182
183 __sfr __at (0xf74) COMSTAT;
184 volatile __COMSTATbits_t __at (0xf74) COMSTATbits;
185
186 __sfr __at (0xf75) RXERRCNT;
187 volatile __RXERRCNTbits_t __at (0xf75) RXERRCNTbits;
188
189 __sfr __at (0xf76) TXERRCNT;
190 volatile __TXERRCNTbits_t __at (0xf76) TXERRCNTbits;
191
192 __sfr __at (0xf80) PORTA;
193 volatile __PORTAbits_t __at (0xf80) PORTAbits;
194
195 __sfr __at (0xf81) PORTB;
196 volatile __PORTBbits_t __at (0xf81) PORTBbits;
197
198 __sfr __at (0xf82) PORTC;
199 volatile __PORTCbits_t __at (0xf82) PORTCbits;
200
201 __sfr __at (0xf83) PORTD;
202 volatile __PORTDbits_t __at (0xf83) PORTDbits;
203
204 __sfr __at (0xf84) PORTE;
205 volatile __PORTEbits_t __at (0xf84) PORTEbits;
206
207 __sfr __at (0xf85) PORTF;
208 volatile __PORTFbits_t __at (0xf85) PORTFbits;
209
210 __sfr __at (0xf86) PORTG;
211 volatile __PORTGbits_t __at (0xf86) PORTGbits;
212
213 __sfr __at (0xf87) PORTH;
214 volatile __PORTHbits_t __at (0xf87) PORTHbits;
215
216 __sfr __at (0xf88) PORTJ;
217 volatile __PORTJbits_t __at (0xf88) PORTJbits;
218
219 __sfr __at (0xf89) LATA;
220 volatile __LATAbits_t __at (0xf89) LATAbits;
221
222 __sfr __at (0xf8a) LATB;
223 volatile __LATBbits_t __at (0xf8a) LATBbits;
224
225 __sfr __at (0xf8b) LATC;
226 volatile __LATCbits_t __at (0xf8b) LATCbits;
227
228 __sfr __at (0xf8c) LATD;
229 volatile __LATDbits_t __at (0xf8c) LATDbits;
230
231 __sfr __at (0xf8d) LATE;
232 volatile __LATEbits_t __at (0xf8d) LATEbits;
233
234 __sfr __at (0xf8e) LATF;
235 volatile __LATFbits_t __at (0xf8e) LATFbits;
236
237 __sfr __at (0xf8f) LATG;
238 volatile __LATGbits_t __at (0xf8f) LATGbits;
239
240 __sfr __at (0xf90) LATH;
241 volatile __LATHbits_t __at (0xf90) LATHbits;
242
243 __sfr __at (0xf91) LATJ;
244 volatile __LATJbits_t __at (0xf91) LATJbits;
245
246 __sfr __at (0xf92) TRISA;
247 volatile __TRISAbits_t __at (0xf92) TRISAbits;
248
249 __sfr __at (0xf93) TRISB;
250 volatile __TRISBbits_t __at (0xf93) TRISBbits;
251
252 __sfr __at (0xf94) TRISC;
253 volatile __TRISCbits_t __at (0xf94) TRISCbits;
254
255 __sfr __at (0xf95) TRISD;
256 volatile __TRISDbits_t __at (0xf95) TRISDbits;
257
258 __sfr __at (0xf96) TRISE;
259 volatile __TRISEbits_t __at (0xf96) TRISEbits;
260
261 __sfr __at (0xf97) TRISF;
262 volatile __TRISFbits_t __at (0xf97) TRISFbits;
263
264 __sfr __at (0xf98) TRISG;
265 volatile __TRISGbits_t __at (0xf98) TRISGbits;
266
267 __sfr __at (0xf99) TRISH;
268 volatile __TRISHbits_t __at (0xf99) TRISHbits;
269
270 __sfr __at (0xf9a) TRISJ;
271 volatile __TRISJbits_t __at (0xf9a) TRISJbits;
272
273 __sfr __at (0xf9c) MEMCON;
274 volatile __MEMCONbits_t __at (0xf9c) MEMCONbits;
275
276 __sfr __at (0xf9d) PIE1;
277 volatile __PIE1bits_t __at (0xf9d) PIE1bits;
278
279 __sfr __at (0xf9e) PIR1;
280 volatile __PIR1bits_t __at (0xf9e) PIR1bits;
281
282 __sfr __at (0xf9f) IPR1;
283 volatile __IPR1bits_t __at (0xf9f) IPR1bits;
284
285 __sfr __at (0xfa0) PIE2;
286 volatile __PIE2bits_t __at (0xfa0) PIE2bits;
287
288 __sfr __at (0xfa1) PIR2;
289 volatile __PIR2bits_t __at (0xfa1) PIR2bits;
290
291 __sfr __at (0xfa2) IPR2;
292 volatile __IPR2bits_t __at (0xfa2) IPR2bits;
293
294 __sfr __at (0xfa3) PIE3;
295 volatile __PIE3bits_t __at (0xfa3) PIE3bits;
296
297 __sfr __at (0xfa4) PIR3;
298 volatile __PIR3bits_t __at (0xfa4) PIR3bits;
299
300 __sfr __at (0xfa5) IPR3;
301 volatile __IPR3bits_t __at (0xfa5) IPR3bits;
302
303 __sfr __at (0xfa6) EECON1;
304 volatile __EECON1bits_t __at (0xfa6) EECON1bits;
305
306 __sfr __at (0xfa7) EECON2;
307 __sfr __at (0xfa8) EEDATA;
308 __sfr __at (0xfa9) EEADR;
309 __sfr __at (0xfaa) EEADRH;
310 __sfr __at (0xfab) RCSTA;
311 volatile __RCSTAbits_t __at (0xfab) RCSTAbits;
312
313 __sfr __at (0xfac) TXSTA;
314 volatile __TXSTAbits_t __at (0xfac) TXSTAbits;
315
316 __sfr __at (0xfad) TXREG;
317 __sfr __at (0xfae) RCREG;
318 __sfr __at (0xfaf) SPBRG;
319 __sfr __at (0xfb0) PSPCON;
320 volatile __PSPCONbits_t __at (0xfb0) PSPCONbits;
321
322 __sfr __at (0xfb1) T3CON;
323 volatile __T3CONbits_t __at (0xfb1) T3CONbits;
324
325 __sfr __at (0xfb2) TMR3L;
326 __sfr __at (0xfb3) TMR3H;
327 __sfr __at (0xfb4) CMCON;
328 volatile __CMCONbits_t __at (0xfb4) CMCONbits;
329
330 __sfr __at (0xfb5) CVRCON;
331 volatile __CVRCONbits_t __at (0xfb5) CVRCONbits;
332
333 __sfr __at (0xfb6) ECCPAS;
334 volatile __ECCPASbits_t __at (0xfb6) ECCPASbits;
335
336 __sfr __at (0xfb7) ECCP1DEL;
337 volatile __ECCP1DELbits_t __at (0xfb7) ECCP1DELbits;
338
339 __sfr __at (0xfba) ECCP1CON;
340 volatile __ECCP1CONbits_t __at (0xfba) ECCP1CONbits;
341
342 __sfr __at (0xfba) CCP2CON;
343 volatile __CCP2CONbits_t __at (0xfba) CCP2CONbits;
344
345 __sfr __at (0xfbb) ECCPR1L;
346 __sfr __at (0xfbb) CCPR2L;
347 __sfr __at (0xfbc) ECCPR1H;
348 __sfr __at (0xfbc) CCPR2H;
349 __sfr __at (0xfc0) ADCON2;
350 volatile __ADCON2bits_t __at (0xfc0) ADCON2bits;
351
352 __sfr __at (0xfc1) ADCON1;
353 volatile __ADCON1bits_t __at (0xfc1) ADCON1bits;
354
355 __sfr __at (0xfc2) ADCON0;
356 volatile __ADCON0bits_t __at (0xfc2) ADCON0bits;
357
358 __sfr __at (0xfc3) ADRESL;
359 __sfr __at (0xfc4) ADRESH;
360 __sfr __at (0xfc5) SSPCON2;
361 volatile __SSPCON2bits_t __at (0xfc5) SSPCON2bits;
362
363 __sfr __at (0xfc6) SSPCON1;
364 volatile __SSPCON1bits_t __at (0xfc6) SSPCON1bits;
365
366 __sfr __at (0xfc7) SSPSTAT;
367 volatile __SSPSTATbits_t __at (0xfc7) SSPSTATbits;
368
369 __sfr __at (0xfc8) SSPADD;
370 __sfr __at (0xfc9) SSPBUF;
371 __sfr __at (0xfca) T2CON;
372 volatile __T2CONbits_t __at (0xfca) T2CONbits;
373
374 __sfr __at (0xfcb) PR2;
375 __sfr __at (0xfcc) TMR2;
376 __sfr __at (0xfcd) T1CON;
377 volatile __T1CONbits_t __at (0xfcd) T1CONbits;
378
379 __sfr __at (0xfce) TMR1L;
380 __sfr __at (0xfcf) TMR1H;
381 __sfr __at (0xfd0) RCON;
382 volatile __RCONbits_t __at (0xfd0) RCONbits;
383
384 __sfr __at (0xfd1) WDTCON;
385 volatile __WDTCONbits_t __at (0xfd1) WDTCONbits;
386
387 __sfr __at (0xfd2) LVDCON;
388 volatile __LVDCONbits_t __at (0xfd2) LVDCONbits;
389
390 __sfr __at (0xfd3) OSCCON;
391 volatile __OSCCONbits_t __at (0xfd3) OSCCONbits;
392
393 __sfr __at (0xfd5) T0CON;
394 __sfr __at (0xfd6) TMR0L;
395 __sfr __at (0xfd7) TMR0H;
396 __sfr __at (0xfd8) STATUS;
397 volatile __STATUSbits_t __at (0xfd8) STATUSbits;
398
399 __sfr __at (0xfd9) FSR2L;
400 __sfr __at (0xfda) FSR2H;
401 __sfr __at (0xfdb) PLUSW2;
402 __sfr __at (0xfdc) PREINC2;
403 __sfr __at (0xfdd) POSTDEC2;
404 __sfr __at (0xfde) POSTINC2;
405 __sfr __at (0xfdf) INDF2;
406 __sfr __at (0xfe0) BSR;
407 __sfr __at (0xfe1) FSR1L;
408 __sfr __at (0xfe2) FSR1H;
409 __sfr __at (0xfe3) PLUSW1;
410 __sfr __at (0xfe4) PREINC1;
411 __sfr __at (0xfe5) POSTDEC1;
412 __sfr __at (0xfe6) POSTINC1;
413 __sfr __at (0xfe7) INDF1;
414 __sfr __at (0xfe8) WREG;
415 __sfr __at (0xfe9) FSR0L;
416 __sfr __at (0xfea) FSR0H;
417 __sfr __at (0xfeb) PLUSW0;
418 __sfr __at (0xfec) PREINC0;
419 __sfr __at (0xfed) POSTDEC0;
420 __sfr __at (0xfee) POSTINC0;
421 __sfr __at (0xfef) INDF0;
422 __sfr __at (0xff0) INTCON3;
423 volatile __INTCON3bits_t __at (0xff0) INTCON3bits;
424
425 __sfr __at (0xff1) INTCON2;
426 volatile __INTCON2bits_t __at (0xff1) INTCON2bits;
427
428 __sfr __at (0xff2) INTCON;
429 volatile __INTCONbits_t __at (0xff2) INTCONbits;
430
431 __sfr __at (0xff3) PRODL;
432 __sfr __at (0xff4) PRODH;
433 __sfr __at (0xff5) TABLAT;
434 __sfr __at (0xff6) TBLPTRL;
435 __sfr __at (0xff7) TBLPTRH;
436 __sfr __at (0xff8) TBLPTRU;
437 __sfr __at (0xff9) PCL;
438 __sfr __at (0xffa) PCLATH;
439 __sfr __at (0xffb) PCLATU;
440 __sfr __at (0xffc) STKPTR;
441 volatile __STKPTRbits_t __at (0xffc) STKPTRbits;
442
443 __sfr __at (0xffd) TOSL;
444 __sfr __at (0xffe) TOSH;
445 __sfr __at (0xfff) TOSU;
446
447