1 /* 2 * This declarations of the PIC16F1458 MCU. 3 * 4 * This file is part of the GNU PIC library for SDCC, originally 5 * created by Molnar Karoly <molnarkaroly@users.sf.net> 2016. 6 * 7 * This file is generated automatically by the cinc2h.pl, 2016-04-13 17:23:04 UTC. 8 * 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. 12 * 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. 21 * 22 * See http://sdcc.sourceforge.net/ for the latest information on sdcc. 23 */ 24 25 #ifndef __PIC16F1458_H__ 26 #define __PIC16F1458_H__ 27 28 //============================================================================== 29 // 30 // Register Addresses 31 // 32 //============================================================================== 33 34 #ifndef NO_ADDR_DEFINES 35 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 PORTB_ADDR 0x000D 52 #define PORTC_ADDR 0x000E 53 #define PIR1_ADDR 0x0011 54 #define PIR2_ADDR 0x0012 55 #define TMR0_ADDR 0x0015 56 #define TMR1_ADDR 0x0016 57 #define TMR1L_ADDR 0x0016 58 #define TMR1H_ADDR 0x0017 59 #define T1CON_ADDR 0x0018 60 #define T1GCON_ADDR 0x0019 61 #define TMR2_ADDR 0x001A 62 #define PR2_ADDR 0x001B 63 #define T2CON_ADDR 0x001C 64 #define TRISA_ADDR 0x008C 65 #define TRISB_ADDR 0x008D 66 #define TRISC_ADDR 0x008E 67 #define PIE1_ADDR 0x0091 68 #define PIE2_ADDR 0x0092 69 #define OPTION_REG_ADDR 0x0095 70 #define PCON_ADDR 0x0096 71 #define WDTCON_ADDR 0x0097 72 #define OSCTUNE_ADDR 0x0098 73 #define OSCCON_ADDR 0x0099 74 #define OSCSTAT_ADDR 0x009A 75 #define ADRES_ADDR 0x009B 76 #define ADRESL_ADDR 0x009B 77 #define ADRESH_ADDR 0x009C 78 #define ADCON0_ADDR 0x009D 79 #define ADCON1_ADDR 0x009E 80 #define ADCON2_ADDR 0x009F 81 #define LATA_ADDR 0x010C 82 #define LATB_ADDR 0x010D 83 #define LATC_ADDR 0x010E 84 #define CM1CON0_ADDR 0x0111 85 #define CM1CON1_ADDR 0x0112 86 #define CM2CON0_ADDR 0x0113 87 #define CM2CON1_ADDR 0x0114 88 #define CMOUT_ADDR 0x0115 89 #define BORCON_ADDR 0x0116 90 #define FVRCON_ADDR 0x0117 91 #define DACCON0_ADDR 0x0118 92 #define DACCON1_ADDR 0x0119 93 #define APFCON_ADDR 0x011D 94 #define ANSELA_ADDR 0x018C 95 #define ANSELB_ADDR 0x018D 96 #define ANSELC_ADDR 0x018E 97 #define PMADR_ADDR 0x0191 98 #define PMADRL_ADDR 0x0191 99 #define PMADRH_ADDR 0x0192 100 #define PMDAT_ADDR 0x0193 101 #define PMDATL_ADDR 0x0193 102 #define PMDATH_ADDR 0x0194 103 #define PMCON1_ADDR 0x0195 104 #define PMCON2_ADDR 0x0196 105 #define VREGCON_ADDR 0x0197 106 #define RCREG_ADDR 0x0199 107 #define TXREG_ADDR 0x019A 108 #define SPBRGL_ADDR 0x019B 109 #define SPBRGH_ADDR 0x019C 110 #define RCSTA_ADDR 0x019D 111 #define TXSTA_ADDR 0x019E 112 #define BAUDCON_ADDR 0x019F 113 #define WPUA_ADDR 0x020C 114 #define WPUB_ADDR 0x020D 115 #define SSP1BUF_ADDR 0x0211 116 #define SSPBUF_ADDR 0x0211 117 #define SSP1ADD_ADDR 0x0212 118 #define SSPADD_ADDR 0x0212 119 #define SSP1MSK_ADDR 0x0213 120 #define SSPMSK_ADDR 0x0213 121 #define SSP1STAT_ADDR 0x0214 122 #define SSPSTAT_ADDR 0x0214 123 #define SSP1CON1_ADDR 0x0215 124 #define SSPCON_ADDR 0x0215 125 #define SSPCON1_ADDR 0x0215 126 #define SSP1CON2_ADDR 0x0216 127 #define SSPCON2_ADDR 0x0216 128 #define SSP1CON3_ADDR 0x0217 129 #define SSPCON3_ADDR 0x0217 130 #define IOCAP_ADDR 0x0391 131 #define IOCAN_ADDR 0x0392 132 #define IOCAF_ADDR 0x0393 133 #define IOCBP_ADDR 0x0394 134 #define IOCBN_ADDR 0x0395 135 #define IOCBF_ADDR 0x0396 136 #define CLKRCON_ADDR 0x039A 137 #define CRCON_ADDR 0x039B 138 #define PWM1DCL_ADDR 0x0611 139 #define PWM1DCH_ADDR 0x0612 140 #define PWM1CON_ADDR 0x0613 141 #define PWM1CON0_ADDR 0x0613 142 #define PWM2DCL_ADDR 0x0614 143 #define PWM2DCH_ADDR 0x0615 144 #define PWM2CON_ADDR 0x0616 145 #define CWG1DBR_ADDR 0x0691 146 #define CWG1DBF_ADDR 0x0692 147 #define CWG1CON0_ADDR 0x0693 148 #define CWG1CON1_ADDR 0x0694 149 #define CWG1CON2_ADDR 0x0695 150 #define CRRC_ADDR 0x0E10 151 #define TST_CRRCL_ADDR 0x0E10 152 #define TST_CRRCH_ADDR 0x0E11 153 #define TST_CRLT_ADDR 0x0E12 154 #define UCON_ADDR 0x0E8E 155 #define USTAT_ADDR 0x0E8F 156 #define UIR_ADDR 0x0E90 157 #define UCFG_ADDR 0x0E91 158 #define UIE_ADDR 0x0E92 159 #define UEIR_ADDR 0x0E93 160 #define UFRM_ADDR 0x0E94 161 #define UFRMH_ADDR 0x0E94 162 #define UFRML_ADDR 0x0E95 163 #define UADDR_ADDR 0x0E96 164 #define UEIE_ADDR 0x0E97 165 #define UEP0_ADDR 0x0E98 166 #define UEP1_ADDR 0x0E99 167 #define UEP2_ADDR 0x0E9A 168 #define UEP3_ADDR 0x0E9B 169 #define UEP4_ADDR 0x0E9C 170 #define UEP5_ADDR 0x0E9D 171 #define UEP6_ADDR 0x0E9E 172 #define UEP7_ADDR 0x0E9F 173 #define ICDIO_ADDR 0x0F8C 174 #define ICDCON0_ADDR 0x0F8D 175 #define ICDSTAT_ADDR 0x0F91 176 #define DEVSEL_ADDR 0x0F95 177 #define ICDINSTL_ADDR 0x0F96 178 #define ICDINSTH_ADDR 0x0F97 179 #define ICDBK0CON_ADDR 0x0F9C 180 #define ICDBK0L_ADDR 0x0F9D 181 #define ICDBK0H_ADDR 0x0F9E 182 #define BSRICDSHAD_ADDR 0x0FE3 183 #define STATUS_SHAD_ADDR 0x0FE4 184 #define WREG_SHAD_ADDR 0x0FE5 185 #define BSR_SHAD_ADDR 0x0FE6 186 #define PCLATH_SHAD_ADDR 0x0FE7 187 #define FSR0L_SHAD_ADDR 0x0FE8 188 #define FSR0H_SHAD_ADDR 0x0FE9 189 #define FSR1L_SHAD_ADDR 0x0FEA 190 #define FSR1H_SHAD_ADDR 0x0FEB 191 #define STKPTR_ADDR 0x0FED 192 #define TOSL_ADDR 0x0FEE 193 #define TOSH_ADDR 0x0FEF 194 195 #endif // #ifndef NO_ADDR_DEFINES 196 197 //============================================================================== 198 // 199 // Register Definitions 200 // 201 //============================================================================== 202 203 extern __at(0x0000) __sfr INDF0; 204 extern __at(0x0001) __sfr INDF1; 205 extern __at(0x0002) __sfr PCL; 206 207 //============================================================================== 208 // STATUS Bits 209 210 extern __at(0x0003) __sfr STATUS; 211 212 typedef struct 213 { 214 unsigned C : 1; 215 unsigned DC : 1; 216 unsigned Z : 1; 217 unsigned NOT_PD : 1; 218 unsigned NOT_TO : 1; 219 unsigned : 1; 220 unsigned : 1; 221 unsigned : 1; 222 } __STATUSbits_t; 223 224 extern __at(0x0003) volatile __STATUSbits_t STATUSbits; 225 226 #define _C 0x01 227 #define _DC 0x02 228 #define _Z 0x04 229 #define _NOT_PD 0x08 230 #define _NOT_TO 0x10 231 232 //============================================================================== 233 234 extern __at(0x0004) __sfr FSR0; 235 extern __at(0x0004) __sfr FSR0L; 236 extern __at(0x0005) __sfr FSR0H; 237 extern __at(0x0006) __sfr FSR1; 238 extern __at(0x0006) __sfr FSR1L; 239 extern __at(0x0007) __sfr FSR1H; 240 241 //============================================================================== 242 // BSR Bits 243 244 extern __at(0x0008) __sfr BSR; 245 246 typedef union 247 { 248 struct 249 { 250 unsigned BSR0 : 1; 251 unsigned BSR1 : 1; 252 unsigned BSR2 : 1; 253 unsigned BSR3 : 1; 254 unsigned BSR4 : 1; 255 unsigned : 1; 256 unsigned : 1; 257 unsigned : 1; 258 }; 259 260 struct 261 { 262 unsigned BSR : 5; 263 unsigned : 3; 264 }; 265 } __BSRbits_t; 266 267 extern __at(0x0008) volatile __BSRbits_t BSRbits; 268 269 #define _BSR0 0x01 270 #define _BSR1 0x02 271 #define _BSR2 0x04 272 #define _BSR3 0x08 273 #define _BSR4 0x10 274 275 //============================================================================== 276 277 extern __at(0x0009) __sfr WREG; 278 extern __at(0x000A) __sfr PCLATH; 279 280 //============================================================================== 281 // INTCON Bits 282 283 extern __at(0x000B) __sfr INTCON; 284 285 typedef union 286 { 287 struct 288 { 289 unsigned IOCIF : 1; 290 unsigned INTF : 1; 291 unsigned TMR0IF : 1; 292 unsigned IOCIE : 1; 293 unsigned INTE : 1; 294 unsigned TMR0IE : 1; 295 unsigned PEIE : 1; 296 unsigned GIE : 1; 297 }; 298 299 struct 300 { 301 unsigned : 1; 302 unsigned : 1; 303 unsigned T0IF : 1; 304 unsigned : 1; 305 unsigned : 1; 306 unsigned T0IE : 1; 307 unsigned : 1; 308 unsigned : 1; 309 }; 310 } __INTCONbits_t; 311 312 extern __at(0x000B) volatile __INTCONbits_t INTCONbits; 313 314 #define _IOCIF 0x01 315 #define _INTF 0x02 316 #define _TMR0IF 0x04 317 #define _T0IF 0x04 318 #define _IOCIE 0x08 319 #define _INTE 0x10 320 #define _TMR0IE 0x20 321 #define _T0IE 0x20 322 #define _PEIE 0x40 323 #define _GIE 0x80 324 325 //============================================================================== 326 327 328 //============================================================================== 329 // PORTA Bits 330 331 extern __at(0x000C) __sfr PORTA; 332 333 typedef struct 334 { 335 unsigned RA0 : 1; 336 unsigned RA1 : 1; 337 unsigned : 1; 338 unsigned RA3 : 1; 339 unsigned RA4 : 1; 340 unsigned RA5 : 1; 341 unsigned : 1; 342 unsigned : 1; 343 } __PORTAbits_t; 344 345 extern __at(0x000C) volatile __PORTAbits_t PORTAbits; 346 347 #define _RA0 0x01 348 #define _RA1 0x02 349 #define _RA3 0x08 350 #define _RA4 0x10 351 #define _RA5 0x20 352 353 //============================================================================== 354 355 356 //============================================================================== 357 // PORTB Bits 358 359 extern __at(0x000D) __sfr PORTB; 360 361 typedef struct 362 { 363 unsigned : 1; 364 unsigned : 1; 365 unsigned : 1; 366 unsigned : 1; 367 unsigned RB4 : 1; 368 unsigned RB5 : 1; 369 unsigned RB6 : 1; 370 unsigned RB7 : 1; 371 } __PORTBbits_t; 372 373 extern __at(0x000D) volatile __PORTBbits_t PORTBbits; 374 375 #define _RB4 0x10 376 #define _RB5 0x20 377 #define _RB6 0x40 378 #define _RB7 0x80 379 380 //============================================================================== 381 382 383 //============================================================================== 384 // PORTC Bits 385 386 extern __at(0x000E) __sfr PORTC; 387 388 typedef struct 389 { 390 unsigned RC0 : 1; 391 unsigned RC1 : 1; 392 unsigned RC2 : 1; 393 unsigned RC3 : 1; 394 unsigned RC4 : 1; 395 unsigned RC5 : 1; 396 unsigned RC6 : 1; 397 unsigned RC7 : 1; 398 } __PORTCbits_t; 399 400 extern __at(0x000E) volatile __PORTCbits_t PORTCbits; 401 402 #define _RC0 0x01 403 #define _RC1 0x02 404 #define _RC2 0x04 405 #define _RC3 0x08 406 #define _RC4 0x10 407 #define _RC5 0x20 408 #define _RC6 0x40 409 #define _RC7 0x80 410 411 //============================================================================== 412 413 414 //============================================================================== 415 // PIR1 Bits 416 417 extern __at(0x0011) __sfr PIR1; 418 419 typedef struct 420 { 421 unsigned TMR1IF : 1; 422 unsigned TMR2IF : 1; 423 unsigned : 1; 424 unsigned SSP1IF : 1; 425 unsigned TXIF : 1; 426 unsigned RCIF : 1; 427 unsigned ADIF : 1; 428 unsigned TMR1GIF : 1; 429 } __PIR1bits_t; 430 431 extern __at(0x0011) volatile __PIR1bits_t PIR1bits; 432 433 #define _TMR1IF 0x01 434 #define _TMR2IF 0x02 435 #define _SSP1IF 0x08 436 #define _TXIF 0x10 437 #define _RCIF 0x20 438 #define _ADIF 0x40 439 #define _TMR1GIF 0x80 440 441 //============================================================================== 442 443 444 //============================================================================== 445 // PIR2 Bits 446 447 extern __at(0x0012) __sfr PIR2; 448 449 typedef struct 450 { 451 unsigned : 1; 452 unsigned CRIF : 1; 453 unsigned USBIF : 1; 454 unsigned BCL1IF : 1; 455 unsigned : 1; 456 unsigned C1IF : 1; 457 unsigned C2IF : 1; 458 unsigned OSFIF : 1; 459 } __PIR2bits_t; 460 461 extern __at(0x0012) volatile __PIR2bits_t PIR2bits; 462 463 #define _CRIF 0x02 464 #define _USBIF 0x04 465 #define _BCL1IF 0x08 466 #define _C1IF 0x20 467 #define _C2IF 0x40 468 #define _OSFIF 0x80 469 470 //============================================================================== 471 472 extern __at(0x0015) __sfr TMR0; 473 extern __at(0x0016) __sfr TMR1; 474 extern __at(0x0016) __sfr TMR1L; 475 extern __at(0x0017) __sfr TMR1H; 476 477 //============================================================================== 478 // T1CON Bits 479 480 extern __at(0x0018) __sfr T1CON; 481 482 typedef union 483 { 484 struct 485 { 486 unsigned TMR1ON : 1; 487 unsigned : 1; 488 unsigned NOT_T1SYNC : 1; 489 unsigned T1OSCEN : 1; 490 unsigned T1CKPS0 : 1; 491 unsigned T1CKPS1 : 1; 492 unsigned TMR1CS0 : 1; 493 unsigned TMR1CS1 : 1; 494 }; 495 496 struct 497 { 498 unsigned : 4; 499 unsigned T1CKPS : 2; 500 unsigned : 2; 501 }; 502 503 struct 504 { 505 unsigned : 6; 506 unsigned TMR1CS : 2; 507 }; 508 } __T1CONbits_t; 509 510 extern __at(0x0018) volatile __T1CONbits_t T1CONbits; 511 512 #define _TMR1ON 0x01 513 #define _NOT_T1SYNC 0x04 514 #define _T1OSCEN 0x08 515 #define _T1CKPS0 0x10 516 #define _T1CKPS1 0x20 517 #define _TMR1CS0 0x40 518 #define _TMR1CS1 0x80 519 520 //============================================================================== 521 522 523 //============================================================================== 524 // T1GCON Bits 525 526 extern __at(0x0019) __sfr T1GCON; 527 528 typedef union 529 { 530 struct 531 { 532 unsigned T1GSS0 : 1; 533 unsigned T1GSS1 : 1; 534 unsigned T1GVAL : 1; 535 unsigned T1GGO_NOT_DONE : 1; 536 unsigned T1GSPM : 1; 537 unsigned T1GTM : 1; 538 unsigned T1GPOL : 1; 539 unsigned TMR1GE : 1; 540 }; 541 542 struct 543 { 544 unsigned T1GSS : 2; 545 unsigned : 6; 546 }; 547 } __T1GCONbits_t; 548 549 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits; 550 551 #define _T1GSS0 0x01 552 #define _T1GSS1 0x02 553 #define _T1GVAL 0x04 554 #define _T1GGO_NOT_DONE 0x08 555 #define _T1GSPM 0x10 556 #define _T1GTM 0x20 557 #define _T1GPOL 0x40 558 #define _TMR1GE 0x80 559 560 //============================================================================== 561 562 extern __at(0x001A) __sfr TMR2; 563 extern __at(0x001B) __sfr PR2; 564 565 //============================================================================== 566 // T2CON Bits 567 568 extern __at(0x001C) __sfr T2CON; 569 570 typedef union 571 { 572 struct 573 { 574 unsigned T2CKPS0 : 1; 575 unsigned T2CKPS1 : 1; 576 unsigned TMR2ON : 1; 577 unsigned TOUTPS0 : 1; 578 unsigned TOUTPS1 : 1; 579 unsigned TOUTPS2 : 1; 580 unsigned TOUTPS3 : 1; 581 unsigned : 1; 582 }; 583 584 struct 585 { 586 unsigned T2CKPS : 2; 587 unsigned : 6; 588 }; 589 590 struct 591 { 592 unsigned : 3; 593 unsigned TOUTPS : 4; 594 unsigned : 1; 595 }; 596 } __T2CONbits_t; 597 598 extern __at(0x001C) volatile __T2CONbits_t T2CONbits; 599 600 #define _T2CKPS0 0x01 601 #define _T2CKPS1 0x02 602 #define _TMR2ON 0x04 603 #define _TOUTPS0 0x08 604 #define _TOUTPS1 0x10 605 #define _TOUTPS2 0x20 606 #define _TOUTPS3 0x40 607 608 //============================================================================== 609 610 611 //============================================================================== 612 // TRISA Bits 613 614 extern __at(0x008C) __sfr TRISA; 615 616 typedef struct 617 { 618 unsigned : 1; 619 unsigned : 1; 620 unsigned : 1; 621 unsigned : 1; 622 unsigned TRISA4 : 1; 623 unsigned TRISA5 : 1; 624 unsigned : 1; 625 unsigned : 1; 626 } __TRISAbits_t; 627 628 extern __at(0x008C) volatile __TRISAbits_t TRISAbits; 629 630 #define _TRISA4 0x10 631 #define _TRISA5 0x20 632 633 //============================================================================== 634 635 636 //============================================================================== 637 // TRISB Bits 638 639 extern __at(0x008D) __sfr TRISB; 640 641 typedef struct 642 { 643 unsigned : 1; 644 unsigned : 1; 645 unsigned : 1; 646 unsigned : 1; 647 unsigned TRISB4 : 1; 648 unsigned TRISB5 : 1; 649 unsigned TRISB6 : 1; 650 unsigned TRISB7 : 1; 651 } __TRISBbits_t; 652 653 extern __at(0x008D) volatile __TRISBbits_t TRISBbits; 654 655 #define _TRISB4 0x10 656 #define _TRISB5 0x20 657 #define _TRISB6 0x40 658 #define _TRISB7 0x80 659 660 //============================================================================== 661 662 663 //============================================================================== 664 // TRISC Bits 665 666 extern __at(0x008E) __sfr TRISC; 667 668 typedef struct 669 { 670 unsigned TRISC0 : 1; 671 unsigned TRISC1 : 1; 672 unsigned TRISC2 : 1; 673 unsigned TRISC3 : 1; 674 unsigned TRISC4 : 1; 675 unsigned TRISC5 : 1; 676 unsigned TRISC6 : 1; 677 unsigned TRISC7 : 1; 678 } __TRISCbits_t; 679 680 extern __at(0x008E) volatile __TRISCbits_t TRISCbits; 681 682 #define _TRISC0 0x01 683 #define _TRISC1 0x02 684 #define _TRISC2 0x04 685 #define _TRISC3 0x08 686 #define _TRISC4 0x10 687 #define _TRISC5 0x20 688 #define _TRISC6 0x40 689 #define _TRISC7 0x80 690 691 //============================================================================== 692 693 694 //============================================================================== 695 // PIE1 Bits 696 697 extern __at(0x0091) __sfr PIE1; 698 699 typedef struct 700 { 701 unsigned TMR1IE : 1; 702 unsigned TMR2IE : 1; 703 unsigned : 1; 704 unsigned SSP1IE : 1; 705 unsigned TXIE : 1; 706 unsigned RCIE : 1; 707 unsigned ADIE : 1; 708 unsigned TMR1GIE : 1; 709 } __PIE1bits_t; 710 711 extern __at(0x0091) volatile __PIE1bits_t PIE1bits; 712 713 #define _TMR1IE 0x01 714 #define _TMR2IE 0x02 715 #define _SSP1IE 0x08 716 #define _TXIE 0x10 717 #define _RCIE 0x20 718 #define _ADIE 0x40 719 #define _TMR1GIE 0x80 720 721 //============================================================================== 722 723 724 //============================================================================== 725 // PIE2 Bits 726 727 extern __at(0x0092) __sfr PIE2; 728 729 typedef struct 730 { 731 unsigned : 1; 732 unsigned CRIE : 1; 733 unsigned USBIE : 1; 734 unsigned BCL1IE : 1; 735 unsigned : 1; 736 unsigned C1IE : 1; 737 unsigned C2IE : 1; 738 unsigned OSFIE : 1; 739 } __PIE2bits_t; 740 741 extern __at(0x0092) volatile __PIE2bits_t PIE2bits; 742 743 #define _CRIE 0x02 744 #define _USBIE 0x04 745 #define _BCL1IE 0x08 746 #define _C1IE 0x20 747 #define _C2IE 0x40 748 #define _OSFIE 0x80 749 750 //============================================================================== 751 752 753 //============================================================================== 754 // OPTION_REG Bits 755 756 extern __at(0x0095) __sfr OPTION_REG; 757 758 typedef union 759 { 760 struct 761 { 762 unsigned PS0 : 1; 763 unsigned PS1 : 1; 764 unsigned PS2 : 1; 765 unsigned PSA : 1; 766 unsigned TMR0SE : 1; 767 unsigned TMR0CS : 1; 768 unsigned INTEDG : 1; 769 unsigned NOT_WPUEN : 1; 770 }; 771 772 struct 773 { 774 unsigned : 1; 775 unsigned : 1; 776 unsigned : 1; 777 unsigned : 1; 778 unsigned T0SE : 1; 779 unsigned T0CS : 1; 780 unsigned : 1; 781 unsigned : 1; 782 }; 783 784 struct 785 { 786 unsigned PS : 3; 787 unsigned : 5; 788 }; 789 } __OPTION_REGbits_t; 790 791 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits; 792 793 #define _PS0 0x01 794 #define _PS1 0x02 795 #define _PS2 0x04 796 #define _PSA 0x08 797 #define _TMR0SE 0x10 798 #define _T0SE 0x10 799 #define _TMR0CS 0x20 800 #define _T0CS 0x20 801 #define _INTEDG 0x40 802 #define _NOT_WPUEN 0x80 803 804 //============================================================================== 805 806 807 //============================================================================== 808 // PCON Bits 809 810 extern __at(0x0096) __sfr PCON; 811 812 typedef struct 813 { 814 unsigned NOT_BOR : 1; 815 unsigned NOT_POR : 1; 816 unsigned NOT_RI : 1; 817 unsigned NOT_RMCLR : 1; 818 unsigned NOT_RWDT : 1; 819 unsigned : 1; 820 unsigned STKUNF : 1; 821 unsigned STKOVF : 1; 822 } __PCONbits_t; 823 824 extern __at(0x0096) volatile __PCONbits_t PCONbits; 825 826 #define _NOT_BOR 0x01 827 #define _NOT_POR 0x02 828 #define _NOT_RI 0x04 829 #define _NOT_RMCLR 0x08 830 #define _NOT_RWDT 0x10 831 #define _STKUNF 0x40 832 #define _STKOVF 0x80 833 834 //============================================================================== 835 836 837 //============================================================================== 838 // WDTCON Bits 839 840 extern __at(0x0097) __sfr WDTCON; 841 842 typedef union 843 { 844 struct 845 { 846 unsigned SWDTEN : 1; 847 unsigned WDTPS0 : 1; 848 unsigned WDTPS1 : 1; 849 unsigned WDTPS2 : 1; 850 unsigned WDTPS3 : 1; 851 unsigned WDTPS4 : 1; 852 unsigned : 1; 853 unsigned : 1; 854 }; 855 856 struct 857 { 858 unsigned : 1; 859 unsigned WDTPS : 5; 860 unsigned : 2; 861 }; 862 } __WDTCONbits_t; 863 864 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits; 865 866 #define _SWDTEN 0x01 867 #define _WDTPS0 0x02 868 #define _WDTPS1 0x04 869 #define _WDTPS2 0x08 870 #define _WDTPS3 0x10 871 #define _WDTPS4 0x20 872 873 //============================================================================== 874 875 876 //============================================================================== 877 // OSCTUNE Bits 878 879 extern __at(0x0098) __sfr OSCTUNE; 880 881 typedef union 882 { 883 struct 884 { 885 unsigned TUN0 : 1; 886 unsigned TUN1 : 1; 887 unsigned TUN2 : 1; 888 unsigned TUN3 : 1; 889 unsigned TUN4 : 1; 890 unsigned TUN5 : 1; 891 unsigned TUN6 : 1; 892 unsigned : 1; 893 }; 894 895 struct 896 { 897 unsigned TUN : 7; 898 unsigned : 1; 899 }; 900 } __OSCTUNEbits_t; 901 902 extern __at(0x0098) volatile __OSCTUNEbits_t OSCTUNEbits; 903 904 #define _TUN0 0x01 905 #define _TUN1 0x02 906 #define _TUN2 0x04 907 #define _TUN3 0x08 908 #define _TUN4 0x10 909 #define _TUN5 0x20 910 #define _TUN6 0x40 911 912 //============================================================================== 913 914 915 //============================================================================== 916 // OSCCON Bits 917 918 extern __at(0x0099) __sfr OSCCON; 919 920 typedef union 921 { 922 struct 923 { 924 unsigned SCS0 : 1; 925 unsigned SCS1 : 1; 926 unsigned IRCF0 : 1; 927 unsigned IRCF1 : 1; 928 unsigned IRCF2 : 1; 929 unsigned IRCF3 : 1; 930 unsigned SPLLMULT : 1; 931 unsigned SPLLEN : 1; 932 }; 933 934 struct 935 { 936 unsigned SCS : 2; 937 unsigned : 6; 938 }; 939 940 struct 941 { 942 unsigned : 2; 943 unsigned IRCF : 4; 944 unsigned : 2; 945 }; 946 } __OSCCONbits_t; 947 948 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits; 949 950 #define _SCS0 0x01 951 #define _SCS1 0x02 952 #define _IRCF0 0x04 953 #define _IRCF1 0x08 954 #define _IRCF2 0x10 955 #define _IRCF3 0x20 956 #define _SPLLMULT 0x40 957 #define _SPLLEN 0x80 958 959 //============================================================================== 960 961 962 //============================================================================== 963 // OSCSTAT Bits 964 965 extern __at(0x009A) __sfr OSCSTAT; 966 967 typedef struct 968 { 969 unsigned HFIOFS : 1; 970 unsigned LFIOFR : 1; 971 unsigned : 1; 972 unsigned : 1; 973 unsigned HFIOFR : 1; 974 unsigned OSTS : 1; 975 unsigned PLLRDY : 1; 976 unsigned SOSCR : 1; 977 } __OSCSTATbits_t; 978 979 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits; 980 981 #define _HFIOFS 0x01 982 #define _LFIOFR 0x02 983 #define _HFIOFR 0x10 984 #define _OSTS 0x20 985 #define _PLLRDY 0x40 986 #define _SOSCR 0x80 987 988 //============================================================================== 989 990 extern __at(0x009B) __sfr ADRES; 991 extern __at(0x009B) __sfr ADRESL; 992 extern __at(0x009C) __sfr ADRESH; 993 994 //============================================================================== 995 // ADCON0 Bits 996 997 extern __at(0x009D) __sfr ADCON0; 998 999 typedef union 1000 { 1001 struct 1002 { 1003 unsigned ADON : 1; 1004 unsigned GO_NOT_DONE : 1; 1005 unsigned CHS0 : 1; 1006 unsigned CHS1 : 1; 1007 unsigned CHS2 : 1; 1008 unsigned CHS3 : 1; 1009 unsigned CHS4 : 1; 1010 unsigned : 1; 1011 }; 1012 1013 struct 1014 { 1015 unsigned : 1; 1016 unsigned ADGO : 1; 1017 unsigned : 1; 1018 unsigned : 1; 1019 unsigned : 1; 1020 unsigned : 1; 1021 unsigned : 1; 1022 unsigned : 1; 1023 }; 1024 1025 struct 1026 { 1027 unsigned : 1; 1028 unsigned GO : 1; 1029 unsigned : 1; 1030 unsigned : 1; 1031 unsigned : 1; 1032 unsigned : 1; 1033 unsigned : 1; 1034 unsigned : 1; 1035 }; 1036 1037 struct 1038 { 1039 unsigned : 2; 1040 unsigned CHS : 5; 1041 unsigned : 1; 1042 }; 1043 } __ADCON0bits_t; 1044 1045 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits; 1046 1047 #define _ADON 0x01 1048 #define _GO_NOT_DONE 0x02 1049 #define _ADGO 0x02 1050 #define _GO 0x02 1051 #define _CHS0 0x04 1052 #define _CHS1 0x08 1053 #define _CHS2 0x10 1054 #define _CHS3 0x20 1055 #define _CHS4 0x40 1056 1057 //============================================================================== 1058 1059 1060 //============================================================================== 1061 // ADCON1 Bits 1062 1063 extern __at(0x009E) __sfr ADCON1; 1064 1065 typedef union 1066 { 1067 struct 1068 { 1069 unsigned ADPREF0 : 1; 1070 unsigned ADPREF1 : 1; 1071 unsigned : 1; 1072 unsigned : 1; 1073 unsigned ADCS0 : 1; 1074 unsigned ADCS1 : 1; 1075 unsigned ADCS2 : 1; 1076 unsigned ADFM : 1; 1077 }; 1078 1079 struct 1080 { 1081 unsigned ADPREF : 2; 1082 unsigned : 6; 1083 }; 1084 1085 struct 1086 { 1087 unsigned : 4; 1088 unsigned ADCS : 3; 1089 unsigned : 1; 1090 }; 1091 } __ADCON1bits_t; 1092 1093 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits; 1094 1095 #define _ADPREF0 0x01 1096 #define _ADPREF1 0x02 1097 #define _ADCS0 0x10 1098 #define _ADCS1 0x20 1099 #define _ADCS2 0x40 1100 #define _ADFM 0x80 1101 1102 //============================================================================== 1103 1104 1105 //============================================================================== 1106 // ADCON2 Bits 1107 1108 extern __at(0x009F) __sfr ADCON2; 1109 1110 typedef union 1111 { 1112 struct 1113 { 1114 unsigned : 1; 1115 unsigned : 1; 1116 unsigned : 1; 1117 unsigned : 1; 1118 unsigned TRIGSEL0 : 1; 1119 unsigned TRIGSEL1 : 1; 1120 unsigned TRIGSEL2 : 1; 1121 unsigned : 1; 1122 }; 1123 1124 struct 1125 { 1126 unsigned : 4; 1127 unsigned TRIGSEL : 3; 1128 unsigned : 1; 1129 }; 1130 } __ADCON2bits_t; 1131 1132 extern __at(0x009F) volatile __ADCON2bits_t ADCON2bits; 1133 1134 #define _TRIGSEL0 0x10 1135 #define _TRIGSEL1 0x20 1136 #define _TRIGSEL2 0x40 1137 1138 //============================================================================== 1139 1140 1141 //============================================================================== 1142 // LATA Bits 1143 1144 extern __at(0x010C) __sfr LATA; 1145 1146 typedef struct 1147 { 1148 unsigned : 1; 1149 unsigned : 1; 1150 unsigned : 1; 1151 unsigned : 1; 1152 unsigned LATA4 : 1; 1153 unsigned LATA5 : 1; 1154 unsigned : 1; 1155 unsigned : 1; 1156 } __LATAbits_t; 1157 1158 extern __at(0x010C) volatile __LATAbits_t LATAbits; 1159 1160 #define _LATA4 0x10 1161 #define _LATA5 0x20 1162 1163 //============================================================================== 1164 1165 1166 //============================================================================== 1167 // LATB Bits 1168 1169 extern __at(0x010D) __sfr LATB; 1170 1171 typedef struct 1172 { 1173 unsigned : 1; 1174 unsigned : 1; 1175 unsigned : 1; 1176 unsigned : 1; 1177 unsigned LATB4 : 1; 1178 unsigned LATB5 : 1; 1179 unsigned LATB6 : 1; 1180 unsigned LATB7 : 1; 1181 } __LATBbits_t; 1182 1183 extern __at(0x010D) volatile __LATBbits_t LATBbits; 1184 1185 #define _LATB4 0x10 1186 #define _LATB5 0x20 1187 #define _LATB6 0x40 1188 #define _LATB7 0x80 1189 1190 //============================================================================== 1191 1192 1193 //============================================================================== 1194 // LATC Bits 1195 1196 extern __at(0x010E) __sfr LATC; 1197 1198 typedef struct 1199 { 1200 unsigned LATC0 : 1; 1201 unsigned LATC1 : 1; 1202 unsigned LATC2 : 1; 1203 unsigned LATC3 : 1; 1204 unsigned LATC4 : 1; 1205 unsigned LATC5 : 1; 1206 unsigned LATC6 : 1; 1207 unsigned LATC7 : 1; 1208 } __LATCbits_t; 1209 1210 extern __at(0x010E) volatile __LATCbits_t LATCbits; 1211 1212 #define _LATC0 0x01 1213 #define _LATC1 0x02 1214 #define _LATC2 0x04 1215 #define _LATC3 0x08 1216 #define _LATC4 0x10 1217 #define _LATC5 0x20 1218 #define _LATC6 0x40 1219 #define _LATC7 0x80 1220 1221 //============================================================================== 1222 1223 1224 //============================================================================== 1225 // CM1CON0 Bits 1226 1227 extern __at(0x0111) __sfr CM1CON0; 1228 1229 typedef struct 1230 { 1231 unsigned C1SYNC : 1; 1232 unsigned C1HYS : 1; 1233 unsigned C1SP : 1; 1234 unsigned : 1; 1235 unsigned C1POL : 1; 1236 unsigned C1OE : 1; 1237 unsigned C1OUT : 1; 1238 unsigned C1ON : 1; 1239 } __CM1CON0bits_t; 1240 1241 extern __at(0x0111) volatile __CM1CON0bits_t CM1CON0bits; 1242 1243 #define _C1SYNC 0x01 1244 #define _C1HYS 0x02 1245 #define _C1SP 0x04 1246 #define _C1POL 0x10 1247 #define _C1OE 0x20 1248 #define _C1OUT 0x40 1249 #define _C1ON 0x80 1250 1251 //============================================================================== 1252 1253 1254 //============================================================================== 1255 // CM1CON1 Bits 1256 1257 extern __at(0x0112) __sfr CM1CON1; 1258 1259 typedef union 1260 { 1261 struct 1262 { 1263 unsigned C1NCH0 : 1; 1264 unsigned C1NCH1 : 1; 1265 unsigned C1NCH2 : 1; 1266 unsigned : 1; 1267 unsigned C1PCH0 : 1; 1268 unsigned C1PCH1 : 1; 1269 unsigned C1INTN : 1; 1270 unsigned C1INTP : 1; 1271 }; 1272 1273 struct 1274 { 1275 unsigned C1NCH : 3; 1276 unsigned : 5; 1277 }; 1278 1279 struct 1280 { 1281 unsigned : 4; 1282 unsigned C1PCH : 2; 1283 unsigned : 2; 1284 }; 1285 } __CM1CON1bits_t; 1286 1287 extern __at(0x0112) volatile __CM1CON1bits_t CM1CON1bits; 1288 1289 #define _C1NCH0 0x01 1290 #define _C1NCH1 0x02 1291 #define _C1NCH2 0x04 1292 #define _C1PCH0 0x10 1293 #define _C1PCH1 0x20 1294 #define _C1INTN 0x40 1295 #define _C1INTP 0x80 1296 1297 //============================================================================== 1298 1299 1300 //============================================================================== 1301 // CM2CON0 Bits 1302 1303 extern __at(0x0113) __sfr CM2CON0; 1304 1305 typedef struct 1306 { 1307 unsigned C2SYNC : 1; 1308 unsigned C2HYS : 1; 1309 unsigned C2SP : 1; 1310 unsigned : 1; 1311 unsigned C2POL : 1; 1312 unsigned C2OE : 1; 1313 unsigned C2OUT : 1; 1314 unsigned C2ON : 1; 1315 } __CM2CON0bits_t; 1316 1317 extern __at(0x0113) volatile __CM2CON0bits_t CM2CON0bits; 1318 1319 #define _C2SYNC 0x01 1320 #define _C2HYS 0x02 1321 #define _C2SP 0x04 1322 #define _C2POL 0x10 1323 #define _C2OE 0x20 1324 #define _C2OUT 0x40 1325 #define _C2ON 0x80 1326 1327 //============================================================================== 1328 1329 1330 //============================================================================== 1331 // CM2CON1 Bits 1332 1333 extern __at(0x0114) __sfr CM2CON1; 1334 1335 typedef union 1336 { 1337 struct 1338 { 1339 unsigned C2NCH0 : 1; 1340 unsigned C2NCH1 : 1; 1341 unsigned C2NCH2 : 1; 1342 unsigned : 1; 1343 unsigned C2PCH0 : 1; 1344 unsigned C2PCH1 : 1; 1345 unsigned C2INTN : 1; 1346 unsigned C2INTP : 1; 1347 }; 1348 1349 struct 1350 { 1351 unsigned C2NCH : 3; 1352 unsigned : 5; 1353 }; 1354 1355 struct 1356 { 1357 unsigned : 4; 1358 unsigned C2PCH : 2; 1359 unsigned : 2; 1360 }; 1361 } __CM2CON1bits_t; 1362 1363 extern __at(0x0114) volatile __CM2CON1bits_t CM2CON1bits; 1364 1365 #define _C2NCH0 0x01 1366 #define _C2NCH1 0x02 1367 #define _C2NCH2 0x04 1368 #define _C2PCH0 0x10 1369 #define _C2PCH1 0x20 1370 #define _C2INTN 0x40 1371 #define _C2INTP 0x80 1372 1373 //============================================================================== 1374 1375 1376 //============================================================================== 1377 // CMOUT Bits 1378 1379 extern __at(0x0115) __sfr CMOUT; 1380 1381 typedef struct 1382 { 1383 unsigned MC1OUT : 1; 1384 unsigned MC2OUT : 1; 1385 unsigned : 1; 1386 unsigned : 1; 1387 unsigned : 1; 1388 unsigned : 1; 1389 unsigned : 1; 1390 unsigned : 1; 1391 } __CMOUTbits_t; 1392 1393 extern __at(0x0115) volatile __CMOUTbits_t CMOUTbits; 1394 1395 #define _MC1OUT 0x01 1396 #define _MC2OUT 0x02 1397 1398 //============================================================================== 1399 1400 1401 //============================================================================== 1402 // BORCON Bits 1403 1404 extern __at(0x0116) __sfr BORCON; 1405 1406 typedef struct 1407 { 1408 unsigned BORRDY : 1; 1409 unsigned : 1; 1410 unsigned : 1; 1411 unsigned : 1; 1412 unsigned : 1; 1413 unsigned : 1; 1414 unsigned BORFS : 1; 1415 unsigned SBOREN : 1; 1416 } __BORCONbits_t; 1417 1418 extern __at(0x0116) volatile __BORCONbits_t BORCONbits; 1419 1420 #define _BORRDY 0x01 1421 #define _BORFS 0x40 1422 #define _SBOREN 0x80 1423 1424 //============================================================================== 1425 1426 1427 //============================================================================== 1428 // FVRCON Bits 1429 1430 extern __at(0x0117) __sfr FVRCON; 1431 1432 typedef union 1433 { 1434 struct 1435 { 1436 unsigned ADFVR0 : 1; 1437 unsigned ADFVR1 : 1; 1438 unsigned CDAFVR0 : 1; 1439 unsigned CDAFVR1 : 1; 1440 unsigned : 1; 1441 unsigned : 1; 1442 unsigned FVRRDY : 1; 1443 unsigned FVREN : 1; 1444 }; 1445 1446 struct 1447 { 1448 unsigned ADFVR : 2; 1449 unsigned : 6; 1450 }; 1451 1452 struct 1453 { 1454 unsigned : 2; 1455 unsigned CDAFVR : 2; 1456 unsigned : 4; 1457 }; 1458 } __FVRCONbits_t; 1459 1460 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits; 1461 1462 #define _ADFVR0 0x01 1463 #define _ADFVR1 0x02 1464 #define _CDAFVR0 0x04 1465 #define _CDAFVR1 0x08 1466 #define _FVRRDY 0x40 1467 #define _FVREN 0x80 1468 1469 //============================================================================== 1470 1471 1472 //============================================================================== 1473 // DACCON0 Bits 1474 1475 extern __at(0x0118) __sfr DACCON0; 1476 1477 typedef union 1478 { 1479 struct 1480 { 1481 unsigned : 1; 1482 unsigned : 1; 1483 unsigned D1PSS0 : 1; 1484 unsigned D1PSS1 : 1; 1485 unsigned DACOE2 : 1; 1486 unsigned DACOE1 : 1; 1487 unsigned : 1; 1488 unsigned DACEN : 1; 1489 }; 1490 1491 struct 1492 { 1493 unsigned : 2; 1494 unsigned D1PSS : 2; 1495 unsigned : 4; 1496 }; 1497 } __DACCON0bits_t; 1498 1499 extern __at(0x0118) volatile __DACCON0bits_t DACCON0bits; 1500 1501 #define _D1PSS0 0x04 1502 #define _D1PSS1 0x08 1503 #define _DACOE2 0x10 1504 #define _DACOE1 0x20 1505 #define _DACEN 0x80 1506 1507 //============================================================================== 1508 1509 1510 //============================================================================== 1511 // DACCON1 Bits 1512 1513 extern __at(0x0119) __sfr DACCON1; 1514 1515 typedef union 1516 { 1517 struct 1518 { 1519 unsigned DACR0 : 1; 1520 unsigned DACR1 : 1; 1521 unsigned DACR2 : 1; 1522 unsigned DACR3 : 1; 1523 unsigned DACR4 : 1; 1524 unsigned : 1; 1525 unsigned : 1; 1526 unsigned : 1; 1527 }; 1528 1529 struct 1530 { 1531 unsigned DACR : 5; 1532 unsigned : 3; 1533 }; 1534 } __DACCON1bits_t; 1535 1536 extern __at(0x0119) volatile __DACCON1bits_t DACCON1bits; 1537 1538 #define _DACR0 0x01 1539 #define _DACR1 0x02 1540 #define _DACR2 0x04 1541 #define _DACR3 0x08 1542 #define _DACR4 0x10 1543 1544 //============================================================================== 1545 1546 1547 //============================================================================== 1548 // APFCON Bits 1549 1550 extern __at(0x011D) __sfr APFCON; 1551 1552 typedef struct 1553 { 1554 unsigned : 1; 1555 unsigned : 1; 1556 unsigned : 1; 1557 unsigned T1GSEL : 1; 1558 unsigned : 1; 1559 unsigned SSSEL : 1; 1560 unsigned : 1; 1561 unsigned CLKRSEL : 1; 1562 } __APFCONbits_t; 1563 1564 extern __at(0x011D) volatile __APFCONbits_t APFCONbits; 1565 1566 #define _T1GSEL 0x08 1567 #define _SSSEL 0x20 1568 #define _CLKRSEL 0x80 1569 1570 //============================================================================== 1571 1572 1573 //============================================================================== 1574 // ANSELA Bits 1575 1576 extern __at(0x018C) __sfr ANSELA; 1577 1578 typedef struct 1579 { 1580 unsigned : 1; 1581 unsigned : 1; 1582 unsigned : 1; 1583 unsigned : 1; 1584 unsigned ANSA4 : 1; 1585 unsigned : 1; 1586 unsigned : 1; 1587 unsigned : 1; 1588 } __ANSELAbits_t; 1589 1590 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits; 1591 1592 #define _ANSA4 0x10 1593 1594 //============================================================================== 1595 1596 1597 //============================================================================== 1598 // ANSELB Bits 1599 1600 extern __at(0x018D) __sfr ANSELB; 1601 1602 typedef struct 1603 { 1604 unsigned : 1; 1605 unsigned : 1; 1606 unsigned : 1; 1607 unsigned : 1; 1608 unsigned ANSB4 : 1; 1609 unsigned ANSB5 : 1; 1610 unsigned : 1; 1611 unsigned : 1; 1612 } __ANSELBbits_t; 1613 1614 extern __at(0x018D) volatile __ANSELBbits_t ANSELBbits; 1615 1616 #define _ANSB4 0x10 1617 #define _ANSB5 0x20 1618 1619 //============================================================================== 1620 1621 1622 //============================================================================== 1623 // ANSELC Bits 1624 1625 extern __at(0x018E) __sfr ANSELC; 1626 1627 typedef struct 1628 { 1629 unsigned ANSC0 : 1; 1630 unsigned ANSC1 : 1; 1631 unsigned ANSC2 : 1; 1632 unsigned ANSC3 : 1; 1633 unsigned : 1; 1634 unsigned : 1; 1635 unsigned ANSC6 : 1; 1636 unsigned ANSC7 : 1; 1637 } __ANSELCbits_t; 1638 1639 extern __at(0x018E) volatile __ANSELCbits_t ANSELCbits; 1640 1641 #define _ANSC0 0x01 1642 #define _ANSC1 0x02 1643 #define _ANSC2 0x04 1644 #define _ANSC3 0x08 1645 #define _ANSC6 0x40 1646 #define _ANSC7 0x80 1647 1648 //============================================================================== 1649 1650 extern __at(0x0191) __sfr PMADR; 1651 extern __at(0x0191) __sfr PMADRL; 1652 extern __at(0x0192) __sfr PMADRH; 1653 extern __at(0x0193) __sfr PMDAT; 1654 extern __at(0x0193) __sfr PMDATL; 1655 extern __at(0x0194) __sfr PMDATH; 1656 1657 //============================================================================== 1658 // PMCON1 Bits 1659 1660 extern __at(0x0195) __sfr PMCON1; 1661 1662 typedef struct 1663 { 1664 unsigned RD : 1; 1665 unsigned WR : 1; 1666 unsigned WREN : 1; 1667 unsigned WRERR : 1; 1668 unsigned FREE : 1; 1669 unsigned LWLO : 1; 1670 unsigned CFGS : 1; 1671 unsigned : 1; 1672 } __PMCON1bits_t; 1673 1674 extern __at(0x0195) volatile __PMCON1bits_t PMCON1bits; 1675 1676 #define _RD 0x01 1677 #define _WR 0x02 1678 #define _WREN 0x04 1679 #define _WRERR 0x08 1680 #define _FREE 0x10 1681 #define _LWLO 0x20 1682 #define _CFGS 0x40 1683 1684 //============================================================================== 1685 1686 extern __at(0x0196) __sfr PMCON2; 1687 1688 //============================================================================== 1689 // VREGCON Bits 1690 1691 extern __at(0x0197) __sfr VREGCON; 1692 1693 typedef union 1694 { 1695 struct 1696 { 1697 unsigned VREGPM0 : 1; 1698 unsigned VREGPM1 : 1; 1699 unsigned : 1; 1700 unsigned : 1; 1701 unsigned : 1; 1702 unsigned : 1; 1703 unsigned : 1; 1704 unsigned : 1; 1705 }; 1706 1707 struct 1708 { 1709 unsigned VREGPM : 2; 1710 unsigned : 6; 1711 }; 1712 } __VREGCONbits_t; 1713 1714 extern __at(0x0197) volatile __VREGCONbits_t VREGCONbits; 1715 1716 #define _VREGPM0 0x01 1717 #define _VREGPM1 0x02 1718 1719 //============================================================================== 1720 1721 extern __at(0x0199) __sfr RCREG; 1722 extern __at(0x019A) __sfr TXREG; 1723 extern __at(0x019B) __sfr SPBRGL; 1724 extern __at(0x019C) __sfr SPBRGH; 1725 1726 //============================================================================== 1727 // RCSTA Bits 1728 1729 extern __at(0x019D) __sfr RCSTA; 1730 1731 typedef struct 1732 { 1733 unsigned RX9D : 1; 1734 unsigned OERR : 1; 1735 unsigned FERR : 1; 1736 unsigned ADDEN : 1; 1737 unsigned CREN : 1; 1738 unsigned SREN : 1; 1739 unsigned RX9 : 1; 1740 unsigned SPEN : 1; 1741 } __RCSTAbits_t; 1742 1743 extern __at(0x019D) volatile __RCSTAbits_t RCSTAbits; 1744 1745 #define _RX9D 0x01 1746 #define _OERR 0x02 1747 #define _FERR 0x04 1748 #define _ADDEN 0x08 1749 #define _CREN 0x10 1750 #define _SREN 0x20 1751 #define _RX9 0x40 1752 #define _SPEN 0x80 1753 1754 //============================================================================== 1755 1756 1757 //============================================================================== 1758 // TXSTA Bits 1759 1760 extern __at(0x019E) __sfr TXSTA; 1761 1762 typedef struct 1763 { 1764 unsigned TX9D : 1; 1765 unsigned TRMT : 1; 1766 unsigned BRGH : 1; 1767 unsigned SENDB : 1; 1768 unsigned SYNC : 1; 1769 unsigned TXEN : 1; 1770 unsigned TX9 : 1; 1771 unsigned CSRC : 1; 1772 } __TXSTAbits_t; 1773 1774 extern __at(0x019E) volatile __TXSTAbits_t TXSTAbits; 1775 1776 #define _TX9D 0x01 1777 #define _TRMT 0x02 1778 #define _BRGH 0x04 1779 #define _SENDB 0x08 1780 #define _SYNC 0x10 1781 #define _TXEN 0x20 1782 #define _TX9 0x40 1783 #define _CSRC 0x80 1784 1785 //============================================================================== 1786 1787 1788 //============================================================================== 1789 // BAUDCON Bits 1790 1791 extern __at(0x019F) __sfr BAUDCON; 1792 1793 typedef struct 1794 { 1795 unsigned ABDEN : 1; 1796 unsigned WUE : 1; 1797 unsigned : 1; 1798 unsigned BRG16 : 1; 1799 unsigned SCKP : 1; 1800 unsigned : 1; 1801 unsigned RCIDL : 1; 1802 unsigned ABDOVF : 1; 1803 } __BAUDCONbits_t; 1804 1805 extern __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits; 1806 1807 #define _ABDEN 0x01 1808 #define _WUE 0x02 1809 #define _BRG16 0x08 1810 #define _SCKP 0x10 1811 #define _RCIDL 0x40 1812 #define _ABDOVF 0x80 1813 1814 //============================================================================== 1815 1816 1817 //============================================================================== 1818 // WPUA Bits 1819 1820 extern __at(0x020C) __sfr WPUA; 1821 1822 typedef struct 1823 { 1824 unsigned : 1; 1825 unsigned : 1; 1826 unsigned : 1; 1827 unsigned WPUA3 : 1; 1828 unsigned WPUA4 : 1; 1829 unsigned WPUA5 : 1; 1830 unsigned : 1; 1831 unsigned : 1; 1832 } __WPUAbits_t; 1833 1834 extern __at(0x020C) volatile __WPUAbits_t WPUAbits; 1835 1836 #define _WPUA3 0x08 1837 #define _WPUA4 0x10 1838 #define _WPUA5 0x20 1839 1840 //============================================================================== 1841 1842 1843 //============================================================================== 1844 // WPUB Bits 1845 1846 extern __at(0x020D) __sfr WPUB; 1847 1848 typedef struct 1849 { 1850 unsigned : 1; 1851 unsigned : 1; 1852 unsigned : 1; 1853 unsigned : 1; 1854 unsigned WPUB4 : 1; 1855 unsigned WPUB5 : 1; 1856 unsigned WPUB6 : 1; 1857 unsigned WPUB7 : 1; 1858 } __WPUBbits_t; 1859 1860 extern __at(0x020D) volatile __WPUBbits_t WPUBbits; 1861 1862 #define _WPUB4 0x10 1863 #define _WPUB5 0x20 1864 #define _WPUB6 0x40 1865 #define _WPUB7 0x80 1866 1867 //============================================================================== 1868 1869 extern __at(0x0211) __sfr SSP1BUF; 1870 extern __at(0x0211) __sfr SSPBUF; 1871 extern __at(0x0212) __sfr SSP1ADD; 1872 extern __at(0x0212) __sfr SSPADD; 1873 extern __at(0x0213) __sfr SSP1MSK; 1874 extern __at(0x0213) __sfr SSPMSK; 1875 1876 //============================================================================== 1877 // SSP1STAT Bits 1878 1879 extern __at(0x0214) __sfr SSP1STAT; 1880 1881 typedef struct 1882 { 1883 unsigned BF : 1; 1884 unsigned UA : 1; 1885 unsigned R_NOT_W : 1; 1886 unsigned S : 1; 1887 unsigned P : 1; 1888 unsigned D_NOT_A : 1; 1889 unsigned CKE : 1; 1890 unsigned SMP : 1; 1891 } __SSP1STATbits_t; 1892 1893 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits; 1894 1895 #define _BF 0x01 1896 #define _UA 0x02 1897 #define _R_NOT_W 0x04 1898 #define _S 0x08 1899 #define _P 0x10 1900 #define _D_NOT_A 0x20 1901 #define _CKE 0x40 1902 #define _SMP 0x80 1903 1904 //============================================================================== 1905 1906 1907 //============================================================================== 1908 // SSPSTAT Bits 1909 1910 extern __at(0x0214) __sfr SSPSTAT; 1911 1912 typedef struct 1913 { 1914 unsigned BF : 1; 1915 unsigned UA : 1; 1916 unsigned R_NOT_W : 1; 1917 unsigned S : 1; 1918 unsigned P : 1; 1919 unsigned D_NOT_A : 1; 1920 unsigned CKE : 1; 1921 unsigned SMP : 1; 1922 } __SSPSTATbits_t; 1923 1924 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits; 1925 1926 #define _SSPSTAT_BF 0x01 1927 #define _SSPSTAT_UA 0x02 1928 #define _SSPSTAT_R_NOT_W 0x04 1929 #define _SSPSTAT_S 0x08 1930 #define _SSPSTAT_P 0x10 1931 #define _SSPSTAT_D_NOT_A 0x20 1932 #define _SSPSTAT_CKE 0x40 1933 #define _SSPSTAT_SMP 0x80 1934 1935 //============================================================================== 1936 1937 1938 //============================================================================== 1939 // SSP1CON1 Bits 1940 1941 extern __at(0x0215) __sfr SSP1CON1; 1942 1943 typedef union 1944 { 1945 struct 1946 { 1947 unsigned SSP1M0 : 1; 1948 unsigned SSP1M1 : 1; 1949 unsigned SSP1M2 : 1; 1950 unsigned SSP1M3 : 1; 1951 unsigned CKP : 1; 1952 unsigned SSP1EN : 1; 1953 unsigned SSP1OV : 1; 1954 unsigned WCOL : 1; 1955 }; 1956 1957 struct 1958 { 1959 unsigned SSP1M : 4; 1960 unsigned : 4; 1961 }; 1962 } __SSP1CON1bits_t; 1963 1964 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits; 1965 1966 #define _SSP1M0 0x01 1967 #define _SSP1M1 0x02 1968 #define _SSP1M2 0x04 1969 #define _SSP1M3 0x08 1970 #define _CKP 0x10 1971 #define _SSP1EN 0x20 1972 #define _SSP1OV 0x40 1973 #define _WCOL 0x80 1974 1975 //============================================================================== 1976 1977 1978 //============================================================================== 1979 // SSPCON Bits 1980 1981 extern __at(0x0215) __sfr SSPCON; 1982 1983 typedef union 1984 { 1985 struct 1986 { 1987 unsigned SSP1M0 : 1; 1988 unsigned SSP1M1 : 1; 1989 unsigned SSP1M2 : 1; 1990 unsigned SSP1M3 : 1; 1991 unsigned CKP : 1; 1992 unsigned SSP1EN : 1; 1993 unsigned SSP1OV : 1; 1994 unsigned WCOL : 1; 1995 }; 1996 1997 struct 1998 { 1999 unsigned SSP1M : 4; 2000 unsigned : 4; 2001 }; 2002 } __SSPCONbits_t; 2003 2004 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits; 2005 2006 #define _SSPCON_SSP1M0 0x01 2007 #define _SSPCON_SSP1M1 0x02 2008 #define _SSPCON_SSP1M2 0x04 2009 #define _SSPCON_SSP1M3 0x08 2010 #define _SSPCON_CKP 0x10 2011 #define _SSPCON_SSP1EN 0x20 2012 #define _SSPCON_SSP1OV 0x40 2013 #define _SSPCON_WCOL 0x80 2014 2015 //============================================================================== 2016 2017 2018 //============================================================================== 2019 // SSPCON1 Bits 2020 2021 extern __at(0x0215) __sfr SSPCON1; 2022 2023 typedef union 2024 { 2025 struct 2026 { 2027 unsigned SSP1M0 : 1; 2028 unsigned SSP1M1 : 1; 2029 unsigned SSP1M2 : 1; 2030 unsigned SSP1M3 : 1; 2031 unsigned CKP : 1; 2032 unsigned SSP1EN : 1; 2033 unsigned SSP1OV : 1; 2034 unsigned WCOL : 1; 2035 }; 2036 2037 struct 2038 { 2039 unsigned SSP1M : 4; 2040 unsigned : 4; 2041 }; 2042 } __SSPCON1bits_t; 2043 2044 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits; 2045 2046 #define _SSPCON1_SSP1M0 0x01 2047 #define _SSPCON1_SSP1M1 0x02 2048 #define _SSPCON1_SSP1M2 0x04 2049 #define _SSPCON1_SSP1M3 0x08 2050 #define _SSPCON1_CKP 0x10 2051 #define _SSPCON1_SSP1EN 0x20 2052 #define _SSPCON1_SSP1OV 0x40 2053 #define _SSPCON1_WCOL 0x80 2054 2055 //============================================================================== 2056 2057 2058 //============================================================================== 2059 // SSP1CON2 Bits 2060 2061 extern __at(0x0216) __sfr SSP1CON2; 2062 2063 typedef struct 2064 { 2065 unsigned SEN : 1; 2066 unsigned RSEN : 1; 2067 unsigned PEN : 1; 2068 unsigned RCEN : 1; 2069 unsigned ACKEN : 1; 2070 unsigned ACKDT : 1; 2071 unsigned ACKSTAT : 1; 2072 unsigned GCEN : 1; 2073 } __SSP1CON2bits_t; 2074 2075 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits; 2076 2077 #define _SEN 0x01 2078 #define _RSEN 0x02 2079 #define _PEN 0x04 2080 #define _RCEN 0x08 2081 #define _ACKEN 0x10 2082 #define _ACKDT 0x20 2083 #define _ACKSTAT 0x40 2084 #define _GCEN 0x80 2085 2086 //============================================================================== 2087 2088 2089 //============================================================================== 2090 // SSPCON2 Bits 2091 2092 extern __at(0x0216) __sfr SSPCON2; 2093 2094 typedef struct 2095 { 2096 unsigned SEN : 1; 2097 unsigned RSEN : 1; 2098 unsigned PEN : 1; 2099 unsigned RCEN : 1; 2100 unsigned ACKEN : 1; 2101 unsigned ACKDT : 1; 2102 unsigned ACKSTAT : 1; 2103 unsigned GCEN : 1; 2104 } __SSPCON2bits_t; 2105 2106 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits; 2107 2108 #define _SSPCON2_SEN 0x01 2109 #define _SSPCON2_RSEN 0x02 2110 #define _SSPCON2_PEN 0x04 2111 #define _SSPCON2_RCEN 0x08 2112 #define _SSPCON2_ACKEN 0x10 2113 #define _SSPCON2_ACKDT 0x20 2114 #define _SSPCON2_ACKSTAT 0x40 2115 #define _SSPCON2_GCEN 0x80 2116 2117 //============================================================================== 2118 2119 2120 //============================================================================== 2121 // SSP1CON3 Bits 2122 2123 extern __at(0x0217) __sfr SSP1CON3; 2124 2125 typedef struct 2126 { 2127 unsigned DHEN : 1; 2128 unsigned AHEN : 1; 2129 unsigned SBCDE : 1; 2130 unsigned SDAHT : 1; 2131 unsigned BOEN : 1; 2132 unsigned SCIE : 1; 2133 unsigned PCIE : 1; 2134 unsigned ACKTIM : 1; 2135 } __SSP1CON3bits_t; 2136 2137 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits; 2138 2139 #define _DHEN 0x01 2140 #define _AHEN 0x02 2141 #define _SBCDE 0x04 2142 #define _SDAHT 0x08 2143 #define _BOEN 0x10 2144 #define _SCIE 0x20 2145 #define _PCIE 0x40 2146 #define _ACKTIM 0x80 2147 2148 //============================================================================== 2149 2150 2151 //============================================================================== 2152 // SSPCON3 Bits 2153 2154 extern __at(0x0217) __sfr SSPCON3; 2155 2156 typedef struct 2157 { 2158 unsigned DHEN : 1; 2159 unsigned AHEN : 1; 2160 unsigned SBCDE : 1; 2161 unsigned SDAHT : 1; 2162 unsigned BOEN : 1; 2163 unsigned SCIE : 1; 2164 unsigned PCIE : 1; 2165 unsigned ACKTIM : 1; 2166 } __SSPCON3bits_t; 2167 2168 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits; 2169 2170 #define _SSPCON3_DHEN 0x01 2171 #define _SSPCON3_AHEN 0x02 2172 #define _SSPCON3_SBCDE 0x04 2173 #define _SSPCON3_SDAHT 0x08 2174 #define _SSPCON3_BOEN 0x10 2175 #define _SSPCON3_SCIE 0x20 2176 #define _SSPCON3_PCIE 0x40 2177 #define _SSPCON3_ACKTIM 0x80 2178 2179 //============================================================================== 2180 2181 2182 //============================================================================== 2183 // IOCAP Bits 2184 2185 extern __at(0x0391) __sfr IOCAP; 2186 2187 typedef struct 2188 { 2189 unsigned IOCAP0 : 1; 2190 unsigned IOCAP1 : 1; 2191 unsigned : 1; 2192 unsigned IOCAP3 : 1; 2193 unsigned IOCAP4 : 1; 2194 unsigned IOCAP5 : 1; 2195 unsigned : 1; 2196 unsigned : 1; 2197 } __IOCAPbits_t; 2198 2199 extern __at(0x0391) volatile __IOCAPbits_t IOCAPbits; 2200 2201 #define _IOCAP0 0x01 2202 #define _IOCAP1 0x02 2203 #define _IOCAP3 0x08 2204 #define _IOCAP4 0x10 2205 #define _IOCAP5 0x20 2206 2207 //============================================================================== 2208 2209 2210 //============================================================================== 2211 // IOCAN Bits 2212 2213 extern __at(0x0392) __sfr IOCAN; 2214 2215 typedef struct 2216 { 2217 unsigned IOCAN0 : 1; 2218 unsigned IOCAN1 : 1; 2219 unsigned : 1; 2220 unsigned IOCAN3 : 1; 2221 unsigned IOCAN4 : 1; 2222 unsigned IOCAN5 : 1; 2223 unsigned : 1; 2224 unsigned : 1; 2225 } __IOCANbits_t; 2226 2227 extern __at(0x0392) volatile __IOCANbits_t IOCANbits; 2228 2229 #define _IOCAN0 0x01 2230 #define _IOCAN1 0x02 2231 #define _IOCAN3 0x08 2232 #define _IOCAN4 0x10 2233 #define _IOCAN5 0x20 2234 2235 //============================================================================== 2236 2237 2238 //============================================================================== 2239 // IOCAF Bits 2240 2241 extern __at(0x0393) __sfr IOCAF; 2242 2243 typedef struct 2244 { 2245 unsigned IOCAF0 : 1; 2246 unsigned IOCAF1 : 1; 2247 unsigned : 1; 2248 unsigned IOCAF3 : 1; 2249 unsigned IOCAF4 : 1; 2250 unsigned IOCAF5 : 1; 2251 unsigned : 1; 2252 unsigned : 1; 2253 } __IOCAFbits_t; 2254 2255 extern __at(0x0393) volatile __IOCAFbits_t IOCAFbits; 2256 2257 #define _IOCAF0 0x01 2258 #define _IOCAF1 0x02 2259 #define _IOCAF3 0x08 2260 #define _IOCAF4 0x10 2261 #define _IOCAF5 0x20 2262 2263 //============================================================================== 2264 2265 2266 //============================================================================== 2267 // IOCBP Bits 2268 2269 extern __at(0x0394) __sfr IOCBP; 2270 2271 typedef struct 2272 { 2273 unsigned : 1; 2274 unsigned : 1; 2275 unsigned : 1; 2276 unsigned : 1; 2277 unsigned IOCBP4 : 1; 2278 unsigned IOCBP5 : 1; 2279 unsigned IOCBP6 : 1; 2280 unsigned IOCBP7 : 1; 2281 } __IOCBPbits_t; 2282 2283 extern __at(0x0394) volatile __IOCBPbits_t IOCBPbits; 2284 2285 #define _IOCBP4 0x10 2286 #define _IOCBP5 0x20 2287 #define _IOCBP6 0x40 2288 #define _IOCBP7 0x80 2289 2290 //============================================================================== 2291 2292 2293 //============================================================================== 2294 // IOCBN Bits 2295 2296 extern __at(0x0395) __sfr IOCBN; 2297 2298 typedef struct 2299 { 2300 unsigned : 1; 2301 unsigned : 1; 2302 unsigned : 1; 2303 unsigned : 1; 2304 unsigned IOCBN4 : 1; 2305 unsigned IOCBN5 : 1; 2306 unsigned IOCBN6 : 1; 2307 unsigned IOCBN7 : 1; 2308 } __IOCBNbits_t; 2309 2310 extern __at(0x0395) volatile __IOCBNbits_t IOCBNbits; 2311 2312 #define _IOCBN4 0x10 2313 #define _IOCBN5 0x20 2314 #define _IOCBN6 0x40 2315 #define _IOCBN7 0x80 2316 2317 //============================================================================== 2318 2319 2320 //============================================================================== 2321 // IOCBF Bits 2322 2323 extern __at(0x0396) __sfr IOCBF; 2324 2325 typedef struct 2326 { 2327 unsigned : 1; 2328 unsigned : 1; 2329 unsigned : 1; 2330 unsigned : 1; 2331 unsigned IOCBF4 : 1; 2332 unsigned IOCBF5 : 1; 2333 unsigned IOCBF6 : 1; 2334 unsigned IOCBF7 : 1; 2335 } __IOCBFbits_t; 2336 2337 extern __at(0x0396) volatile __IOCBFbits_t IOCBFbits; 2338 2339 #define _IOCBF4 0x10 2340 #define _IOCBF5 0x20 2341 #define _IOCBF6 0x40 2342 #define _IOCBF7 0x80 2343 2344 //============================================================================== 2345 2346 2347 //============================================================================== 2348 // CLKRCON Bits 2349 2350 extern __at(0x039A) __sfr CLKRCON; 2351 2352 typedef union 2353 { 2354 struct 2355 { 2356 unsigned CLKRDIV0 : 1; 2357 unsigned CLKRDIV1 : 1; 2358 unsigned CLKRDIV2 : 1; 2359 unsigned CLKRCD0 : 1; 2360 unsigned CLKRCD1 : 1; 2361 unsigned CLKRSLR : 1; 2362 unsigned CLKROE : 1; 2363 unsigned CLKREN : 1; 2364 }; 2365 2366 struct 2367 { 2368 unsigned CLKRDIV : 3; 2369 unsigned : 5; 2370 }; 2371 2372 struct 2373 { 2374 unsigned : 3; 2375 unsigned CLKRCD : 2; 2376 unsigned : 3; 2377 }; 2378 } __CLKRCONbits_t; 2379 2380 extern __at(0x039A) volatile __CLKRCONbits_t CLKRCONbits; 2381 2382 #define _CLKRDIV0 0x01 2383 #define _CLKRDIV1 0x02 2384 #define _CLKRDIV2 0x04 2385 #define _CLKRCD0 0x08 2386 #define _CLKRCD1 0x10 2387 #define _CLKRSLR 0x20 2388 #define _CLKROE 0x40 2389 #define _CLKREN 0x80 2390 2391 //============================================================================== 2392 2393 2394 //============================================================================== 2395 // CRCON Bits 2396 2397 extern __at(0x039B) __sfr CRCON; 2398 2399 typedef struct 2400 { 2401 unsigned : 1; 2402 unsigned CPFAIL : 1; 2403 unsigned : 1; 2404 unsigned CRLOCK : 1; 2405 unsigned CRSRC : 1; 2406 unsigned : 1; 2407 unsigned CRUPDIS : 1; 2408 unsigned CRON : 1; 2409 } __CRCONbits_t; 2410 2411 extern __at(0x039B) volatile __CRCONbits_t CRCONbits; 2412 2413 #define _CPFAIL 0x02 2414 #define _CRLOCK 0x08 2415 #define _CRSRC 0x10 2416 #define _CRUPDIS 0x40 2417 #define _CRON 0x80 2418 2419 //============================================================================== 2420 2421 2422 //============================================================================== 2423 // PWM1DCL Bits 2424 2425 extern __at(0x0611) __sfr PWM1DCL; 2426 2427 typedef union 2428 { 2429 struct 2430 { 2431 unsigned : 1; 2432 unsigned : 1; 2433 unsigned : 1; 2434 unsigned : 1; 2435 unsigned : 1; 2436 unsigned : 1; 2437 unsigned PWM1DCL0 : 1; 2438 unsigned PWM1DCL1 : 1; 2439 }; 2440 2441 struct 2442 { 2443 unsigned : 6; 2444 unsigned PWM1DCL : 2; 2445 }; 2446 } __PWM1DCLbits_t; 2447 2448 extern __at(0x0611) volatile __PWM1DCLbits_t PWM1DCLbits; 2449 2450 #define _PWM1DCL0 0x40 2451 #define _PWM1DCL1 0x80 2452 2453 //============================================================================== 2454 2455 2456 //============================================================================== 2457 // PWM1DCH Bits 2458 2459 extern __at(0x0612) __sfr PWM1DCH; 2460 2461 typedef struct 2462 { 2463 unsigned PWM1DCH0 : 1; 2464 unsigned PWM1DCH1 : 1; 2465 unsigned PWM1DCH2 : 1; 2466 unsigned PWM1DCH3 : 1; 2467 unsigned PWM1DCH4 : 1; 2468 unsigned PWM1DCH5 : 1; 2469 unsigned PWM1DCH6 : 1; 2470 unsigned PWM1DCH7 : 1; 2471 } __PWM1DCHbits_t; 2472 2473 extern __at(0x0612) volatile __PWM1DCHbits_t PWM1DCHbits; 2474 2475 #define _PWM1DCH0 0x01 2476 #define _PWM1DCH1 0x02 2477 #define _PWM1DCH2 0x04 2478 #define _PWM1DCH3 0x08 2479 #define _PWM1DCH4 0x10 2480 #define _PWM1DCH5 0x20 2481 #define _PWM1DCH6 0x40 2482 #define _PWM1DCH7 0x80 2483 2484 //============================================================================== 2485 2486 2487 //============================================================================== 2488 // PWM1CON Bits 2489 2490 extern __at(0x0613) __sfr PWM1CON; 2491 2492 typedef struct 2493 { 2494 unsigned : 1; 2495 unsigned : 1; 2496 unsigned : 1; 2497 unsigned : 1; 2498 unsigned PWM1POL : 1; 2499 unsigned PWM1OUT : 1; 2500 unsigned PWM1OE : 1; 2501 unsigned PWM1EN : 1; 2502 } __PWM1CONbits_t; 2503 2504 extern __at(0x0613) volatile __PWM1CONbits_t PWM1CONbits; 2505 2506 #define _PWM1POL 0x10 2507 #define _PWM1OUT 0x20 2508 #define _PWM1OE 0x40 2509 #define _PWM1EN 0x80 2510 2511 //============================================================================== 2512 2513 2514 //============================================================================== 2515 // PWM1CON0 Bits 2516 2517 extern __at(0x0613) __sfr PWM1CON0; 2518 2519 typedef struct 2520 { 2521 unsigned : 1; 2522 unsigned : 1; 2523 unsigned : 1; 2524 unsigned : 1; 2525 unsigned PWM1POL : 1; 2526 unsigned PWM1OUT : 1; 2527 unsigned PWM1OE : 1; 2528 unsigned PWM1EN : 1; 2529 } __PWM1CON0bits_t; 2530 2531 extern __at(0x0613) volatile __PWM1CON0bits_t PWM1CON0bits; 2532 2533 #define _PWM1CON0_PWM1POL 0x10 2534 #define _PWM1CON0_PWM1OUT 0x20 2535 #define _PWM1CON0_PWM1OE 0x40 2536 #define _PWM1CON0_PWM1EN 0x80 2537 2538 //============================================================================== 2539 2540 2541 //============================================================================== 2542 // PWM2DCL Bits 2543 2544 extern __at(0x0614) __sfr PWM2DCL; 2545 2546 typedef union 2547 { 2548 struct 2549 { 2550 unsigned : 1; 2551 unsigned : 1; 2552 unsigned : 1; 2553 unsigned : 1; 2554 unsigned : 1; 2555 unsigned : 1; 2556 unsigned PWM2DCL0 : 1; 2557 unsigned PWM2DCL1 : 1; 2558 }; 2559 2560 struct 2561 { 2562 unsigned : 6; 2563 unsigned PWM2DCL : 2; 2564 }; 2565 } __PWM2DCLbits_t; 2566 2567 extern __at(0x0614) volatile __PWM2DCLbits_t PWM2DCLbits; 2568 2569 #define _PWM2DCL0 0x40 2570 #define _PWM2DCL1 0x80 2571 2572 //============================================================================== 2573 2574 2575 //============================================================================== 2576 // PWM2DCH Bits 2577 2578 extern __at(0x0615) __sfr PWM2DCH; 2579 2580 typedef struct 2581 { 2582 unsigned PWM2DCH0 : 1; 2583 unsigned PWM2DCH1 : 1; 2584 unsigned PWM2DCH2 : 1; 2585 unsigned PWM2DCH3 : 1; 2586 unsigned PWM2DCH4 : 1; 2587 unsigned PWM2DCH5 : 1; 2588 unsigned PWM2DCH6 : 1; 2589 unsigned PWM2DCH7 : 1; 2590 } __PWM2DCHbits_t; 2591 2592 extern __at(0x0615) volatile __PWM2DCHbits_t PWM2DCHbits; 2593 2594 #define _PWM2DCH0 0x01 2595 #define _PWM2DCH1 0x02 2596 #define _PWM2DCH2 0x04 2597 #define _PWM2DCH3 0x08 2598 #define _PWM2DCH4 0x10 2599 #define _PWM2DCH5 0x20 2600 #define _PWM2DCH6 0x40 2601 #define _PWM2DCH7 0x80 2602 2603 //============================================================================== 2604 2605 2606 //============================================================================== 2607 // PWM2CON Bits 2608 2609 extern __at(0x0616) __sfr PWM2CON; 2610 2611 typedef struct 2612 { 2613 unsigned : 1; 2614 unsigned : 1; 2615 unsigned : 1; 2616 unsigned : 1; 2617 unsigned PWM2POL : 1; 2618 unsigned PWM2OUT : 1; 2619 unsigned PWM2OE : 1; 2620 unsigned PWM2EN : 1; 2621 } __PWM2CONbits_t; 2622 2623 extern __at(0x0616) volatile __PWM2CONbits_t PWM2CONbits; 2624 2625 #define _PWM2POL 0x10 2626 #define _PWM2OUT 0x20 2627 #define _PWM2OE 0x40 2628 #define _PWM2EN 0x80 2629 2630 //============================================================================== 2631 2632 2633 //============================================================================== 2634 // CWG1DBR Bits 2635 2636 extern __at(0x0691) __sfr CWG1DBR; 2637 2638 typedef union 2639 { 2640 struct 2641 { 2642 unsigned CWG1DBR0 : 1; 2643 unsigned CWG1DBR1 : 1; 2644 unsigned CWG1DBR2 : 1; 2645 unsigned CWG1DBR3 : 1; 2646 unsigned CWG1DBR4 : 1; 2647 unsigned CWG1DBR5 : 1; 2648 unsigned : 1; 2649 unsigned : 1; 2650 }; 2651 2652 struct 2653 { 2654 unsigned CWG1DBR : 6; 2655 unsigned : 2; 2656 }; 2657 } __CWG1DBRbits_t; 2658 2659 extern __at(0x0691) volatile __CWG1DBRbits_t CWG1DBRbits; 2660 2661 #define _CWG1DBR0 0x01 2662 #define _CWG1DBR1 0x02 2663 #define _CWG1DBR2 0x04 2664 #define _CWG1DBR3 0x08 2665 #define _CWG1DBR4 0x10 2666 #define _CWG1DBR5 0x20 2667 2668 //============================================================================== 2669 2670 2671 //============================================================================== 2672 // CWG1DBF Bits 2673 2674 extern __at(0x0692) __sfr CWG1DBF; 2675 2676 typedef union 2677 { 2678 struct 2679 { 2680 unsigned CWG1DBF0 : 1; 2681 unsigned CWG1DBF1 : 1; 2682 unsigned CWG1DBF2 : 1; 2683 unsigned CWG1DBF3 : 1; 2684 unsigned CWG1DBF4 : 1; 2685 unsigned CWG1DBF5 : 1; 2686 unsigned : 1; 2687 unsigned : 1; 2688 }; 2689 2690 struct 2691 { 2692 unsigned CWG1DBF : 6; 2693 unsigned : 2; 2694 }; 2695 } __CWG1DBFbits_t; 2696 2697 extern __at(0x0692) volatile __CWG1DBFbits_t CWG1DBFbits; 2698 2699 #define _CWG1DBF0 0x01 2700 #define _CWG1DBF1 0x02 2701 #define _CWG1DBF2 0x04 2702 #define _CWG1DBF3 0x08 2703 #define _CWG1DBF4 0x10 2704 #define _CWG1DBF5 0x20 2705 2706 //============================================================================== 2707 2708 2709 //============================================================================== 2710 // CWG1CON0 Bits 2711 2712 extern __at(0x0693) __sfr CWG1CON0; 2713 2714 typedef struct 2715 { 2716 unsigned G1CS0 : 1; 2717 unsigned : 1; 2718 unsigned : 1; 2719 unsigned G1POLA : 1; 2720 unsigned G1POLB : 1; 2721 unsigned G1OEA : 1; 2722 unsigned G1OEB : 1; 2723 unsigned G1EN : 1; 2724 } __CWG1CON0bits_t; 2725 2726 extern __at(0x0693) volatile __CWG1CON0bits_t CWG1CON0bits; 2727 2728 #define _G1CS0 0x01 2729 #define _G1POLA 0x08 2730 #define _G1POLB 0x10 2731 #define _G1OEA 0x20 2732 #define _G1OEB 0x40 2733 #define _G1EN 0x80 2734 2735 //============================================================================== 2736 2737 2738 //============================================================================== 2739 // CWG1CON1 Bits 2740 2741 extern __at(0x0694) __sfr CWG1CON1; 2742 2743 typedef union 2744 { 2745 struct 2746 { 2747 unsigned G1IS0 : 1; 2748 unsigned G1IS1 : 1; 2749 unsigned : 1; 2750 unsigned : 1; 2751 unsigned G1ASDLA0 : 1; 2752 unsigned G1ASDLA1 : 1; 2753 unsigned G1ASDLB0 : 1; 2754 unsigned G1ASDLB1 : 1; 2755 }; 2756 2757 struct 2758 { 2759 unsigned G1IS : 2; 2760 unsigned : 6; 2761 }; 2762 2763 struct 2764 { 2765 unsigned : 4; 2766 unsigned G1ASDLA : 2; 2767 unsigned : 2; 2768 }; 2769 2770 struct 2771 { 2772 unsigned : 6; 2773 unsigned G1ASDLB : 2; 2774 }; 2775 } __CWG1CON1bits_t; 2776 2777 extern __at(0x0694) volatile __CWG1CON1bits_t CWG1CON1bits; 2778 2779 #define _G1IS0 0x01 2780 #define _G1IS1 0x02 2781 #define _G1ASDLA0 0x10 2782 #define _G1ASDLA1 0x20 2783 #define _G1ASDLB0 0x40 2784 #define _G1ASDLB1 0x80 2785 2786 //============================================================================== 2787 2788 2789 //============================================================================== 2790 // CWG1CON2 Bits 2791 2792 extern __at(0x0695) __sfr CWG1CON2; 2793 2794 typedef struct 2795 { 2796 unsigned : 1; 2797 unsigned G1ASDSFLT : 1; 2798 unsigned G1ASDSC1 : 1; 2799 unsigned G1ASDSC2 : 1; 2800 unsigned : 1; 2801 unsigned : 1; 2802 unsigned G1ARSEN : 1; 2803 unsigned G1ASE : 1; 2804 } __CWG1CON2bits_t; 2805 2806 extern __at(0x0695) volatile __CWG1CON2bits_t CWG1CON2bits; 2807 2808 #define _G1ASDSFLT 0x02 2809 #define _G1ASDSC1 0x04 2810 #define _G1ASDSC2 0x08 2811 #define _G1ARSEN 0x40 2812 #define _G1ASE 0x80 2813 2814 //============================================================================== 2815 2816 extern __at(0x0E10) __sfr CRRC; 2817 extern __at(0x0E10) __sfr TST_CRRCL; 2818 extern __at(0x0E11) __sfr TST_CRRCH; 2819 extern __at(0x0E12) __sfr TST_CRLT; 2820 2821 //============================================================================== 2822 // UCON Bits 2823 2824 extern __at(0x0E8E) __sfr UCON; 2825 2826 typedef struct 2827 { 2828 unsigned : 1; 2829 unsigned SUSPND : 1; 2830 unsigned RESUME : 1; 2831 unsigned USBEN : 1; 2832 unsigned PKTDIS : 1; 2833 unsigned SE0 : 1; 2834 unsigned PPBRST : 1; 2835 unsigned : 1; 2836 } __UCONbits_t; 2837 2838 extern __at(0x0E8E) volatile __UCONbits_t UCONbits; 2839 2840 #define _SUSPND 0x02 2841 #define _RESUME 0x04 2842 #define _USBEN 0x08 2843 #define _PKTDIS 0x10 2844 #define _SE0 0x20 2845 #define _PPBRST 0x40 2846 2847 //============================================================================== 2848 2849 2850 //============================================================================== 2851 // USTAT Bits 2852 2853 extern __at(0x0E8F) __sfr USTAT; 2854 2855 typedef union 2856 { 2857 struct 2858 { 2859 unsigned : 1; 2860 unsigned PPBI : 1; 2861 unsigned DIR : 1; 2862 unsigned ENDP0 : 1; 2863 unsigned ENDP1 : 1; 2864 unsigned ENDP2 : 1; 2865 unsigned ENDP3 : 1; 2866 unsigned : 1; 2867 }; 2868 2869 struct 2870 { 2871 unsigned : 3; 2872 unsigned ENDP : 4; 2873 unsigned : 1; 2874 }; 2875 } __USTATbits_t; 2876 2877 extern __at(0x0E8F) volatile __USTATbits_t USTATbits; 2878 2879 #define _PPBI 0x02 2880 #define _DIR 0x04 2881 #define _ENDP0 0x08 2882 #define _ENDP1 0x10 2883 #define _ENDP2 0x20 2884 #define _ENDP3 0x40 2885 2886 //============================================================================== 2887 2888 2889 //============================================================================== 2890 // UIR Bits 2891 2892 extern __at(0x0E90) __sfr UIR; 2893 2894 typedef struct 2895 { 2896 unsigned URSTIF : 1; 2897 unsigned UERRIF : 1; 2898 unsigned ACTVIF : 1; 2899 unsigned TRNIF : 1; 2900 unsigned IDLEIF : 1; 2901 unsigned STALLIF : 1; 2902 unsigned SOFIF : 1; 2903 unsigned : 1; 2904 } __UIRbits_t; 2905 2906 extern __at(0x0E90) volatile __UIRbits_t UIRbits; 2907 2908 #define _URSTIF 0x01 2909 #define _UERRIF 0x02 2910 #define _ACTVIF 0x04 2911 #define _TRNIF 0x08 2912 #define _IDLEIF 0x10 2913 #define _STALLIF 0x20 2914 #define _SOFIF 0x40 2915 2916 //============================================================================== 2917 2918 2919 //============================================================================== 2920 // UCFG Bits 2921 2922 extern __at(0x0E91) __sfr UCFG; 2923 2924 typedef union 2925 { 2926 struct 2927 { 2928 unsigned PPB0 : 1; 2929 unsigned PPB1 : 1; 2930 unsigned FSEN : 1; 2931 unsigned : 1; 2932 unsigned UPUEN : 1; 2933 unsigned : 1; 2934 unsigned : 1; 2935 unsigned UTEYE : 1; 2936 }; 2937 2938 struct 2939 { 2940 unsigned PPB : 2; 2941 unsigned : 6; 2942 }; 2943 } __UCFGbits_t; 2944 2945 extern __at(0x0E91) volatile __UCFGbits_t UCFGbits; 2946 2947 #define _PPB0 0x01 2948 #define _PPB1 0x02 2949 #define _FSEN 0x04 2950 #define _UPUEN 0x10 2951 #define _UTEYE 0x80 2952 2953 //============================================================================== 2954 2955 2956 //============================================================================== 2957 // UIE Bits 2958 2959 extern __at(0x0E92) __sfr UIE; 2960 2961 typedef struct 2962 { 2963 unsigned URSTIE : 1; 2964 unsigned UERRIE : 1; 2965 unsigned ACTVIE : 1; 2966 unsigned TRNIE : 1; 2967 unsigned IDLEIE : 1; 2968 unsigned STALLIE : 1; 2969 unsigned SOFIE : 1; 2970 unsigned : 1; 2971 } __UIEbits_t; 2972 2973 extern __at(0x0E92) volatile __UIEbits_t UIEbits; 2974 2975 #define _URSTIE 0x01 2976 #define _UERRIE 0x02 2977 #define _ACTVIE 0x04 2978 #define _TRNIE 0x08 2979 #define _IDLEIE 0x10 2980 #define _STALLIE 0x20 2981 #define _SOFIE 0x40 2982 2983 //============================================================================== 2984 2985 2986 //============================================================================== 2987 // UEIR Bits 2988 2989 extern __at(0x0E93) __sfr UEIR; 2990 2991 typedef struct 2992 { 2993 unsigned PIDEF : 1; 2994 unsigned CRC5EF : 1; 2995 unsigned CRC16EF : 1; 2996 unsigned DFN8EF : 1; 2997 unsigned BTOEF : 1; 2998 unsigned : 1; 2999 unsigned : 1; 3000 unsigned BTSEF : 1; 3001 } __UEIRbits_t; 3002 3003 extern __at(0x0E93) volatile __UEIRbits_t UEIRbits; 3004 3005 #define _PIDEF 0x01 3006 #define _CRC5EF 0x02 3007 #define _CRC16EF 0x04 3008 #define _DFN8EF 0x08 3009 #define _BTOEF 0x10 3010 #define _BTSEF 0x80 3011 3012 //============================================================================== 3013 3014 extern __at(0x0E94) __sfr UFRM; 3015 3016 //============================================================================== 3017 // UFRMH Bits 3018 3019 extern __at(0x0E94) __sfr UFRMH; 3020 3021 typedef struct 3022 { 3023 unsigned FRM8 : 1; 3024 unsigned FRM9 : 1; 3025 unsigned FRM10 : 1; 3026 unsigned : 1; 3027 unsigned : 1; 3028 unsigned : 1; 3029 unsigned : 1; 3030 unsigned : 1; 3031 } __UFRMHbits_t; 3032 3033 extern __at(0x0E94) volatile __UFRMHbits_t UFRMHbits; 3034 3035 #define _FRM8 0x01 3036 #define _FRM9 0x02 3037 #define _FRM10 0x04 3038 3039 //============================================================================== 3040 3041 3042 //============================================================================== 3043 // UFRML Bits 3044 3045 extern __at(0x0E95) __sfr UFRML; 3046 3047 typedef struct 3048 { 3049 unsigned FRM0 : 1; 3050 unsigned FRM1 : 1; 3051 unsigned FRM2 : 1; 3052 unsigned FRM3 : 1; 3053 unsigned FRM4 : 1; 3054 unsigned FRM5 : 1; 3055 unsigned FRM6 : 1; 3056 unsigned FRM7 : 1; 3057 } __UFRMLbits_t; 3058 3059 extern __at(0x0E95) volatile __UFRMLbits_t UFRMLbits; 3060 3061 #define _FRM0 0x01 3062 #define _FRM1 0x02 3063 #define _FRM2 0x04 3064 #define _FRM3 0x08 3065 #define _FRM4 0x10 3066 #define _FRM5 0x20 3067 #define _FRM6 0x40 3068 #define _FRM7 0x80 3069 3070 //============================================================================== 3071 3072 3073 //============================================================================== 3074 // UADDR Bits 3075 3076 extern __at(0x0E96) __sfr UADDR; 3077 3078 typedef union 3079 { 3080 struct 3081 { 3082 unsigned ADDR0 : 1; 3083 unsigned ADDR1 : 1; 3084 unsigned ADDR2 : 1; 3085 unsigned ADDR3 : 1; 3086 unsigned ADDR4 : 1; 3087 unsigned ADDR5 : 1; 3088 unsigned ADDR6 : 1; 3089 unsigned : 1; 3090 }; 3091 3092 struct 3093 { 3094 unsigned ADDR : 7; 3095 unsigned : 1; 3096 }; 3097 } __UADDRbits_t; 3098 3099 extern __at(0x0E96) volatile __UADDRbits_t UADDRbits; 3100 3101 #define _ADDR0 0x01 3102 #define _ADDR1 0x02 3103 #define _ADDR2 0x04 3104 #define _ADDR3 0x08 3105 #define _ADDR4 0x10 3106 #define _ADDR5 0x20 3107 #define _ADDR6 0x40 3108 3109 //============================================================================== 3110 3111 3112 //============================================================================== 3113 // UEIE Bits 3114 3115 extern __at(0x0E97) __sfr UEIE; 3116 3117 typedef struct 3118 { 3119 unsigned PIDEE : 1; 3120 unsigned CRC5EE : 1; 3121 unsigned CRC16EE : 1; 3122 unsigned DFN8EE : 1; 3123 unsigned BTOEE : 1; 3124 unsigned : 1; 3125 unsigned : 1; 3126 unsigned BTSEE : 1; 3127 } __UEIEbits_t; 3128 3129 extern __at(0x0E97) volatile __UEIEbits_t UEIEbits; 3130 3131 #define _PIDEE 0x01 3132 #define _CRC5EE 0x02 3133 #define _CRC16EE 0x04 3134 #define _DFN8EE 0x08 3135 #define _BTOEE 0x10 3136 #define _BTSEE 0x80 3137 3138 //============================================================================== 3139 3140 3141 //============================================================================== 3142 // UEP0 Bits 3143 3144 extern __at(0x0E98) __sfr UEP0; 3145 3146 typedef struct 3147 { 3148 unsigned EPSTALL : 1; 3149 unsigned EPINEN : 1; 3150 unsigned EPOUTEN : 1; 3151 unsigned EPCONDIS : 1; 3152 unsigned EPHSHK : 1; 3153 unsigned : 1; 3154 unsigned : 1; 3155 unsigned : 1; 3156 } __UEP0bits_t; 3157 3158 extern __at(0x0E98) volatile __UEP0bits_t UEP0bits; 3159 3160 #define _EPSTALL 0x01 3161 #define _EPINEN 0x02 3162 #define _EPOUTEN 0x04 3163 #define _EPCONDIS 0x08 3164 #define _EPHSHK 0x10 3165 3166 //============================================================================== 3167 3168 3169 //============================================================================== 3170 // UEP1 Bits 3171 3172 extern __at(0x0E99) __sfr UEP1; 3173 3174 typedef struct 3175 { 3176 unsigned EPSTALL : 1; 3177 unsigned EPINEN : 1; 3178 unsigned EPOUTEN : 1; 3179 unsigned EPCONDIS : 1; 3180 unsigned EPHSHK : 1; 3181 unsigned : 1; 3182 unsigned : 1; 3183 unsigned : 1; 3184 } __UEP1bits_t; 3185 3186 extern __at(0x0E99) volatile __UEP1bits_t UEP1bits; 3187 3188 #define _UEP1_EPSTALL 0x01 3189 #define _UEP1_EPINEN 0x02 3190 #define _UEP1_EPOUTEN 0x04 3191 #define _UEP1_EPCONDIS 0x08 3192 #define _UEP1_EPHSHK 0x10 3193 3194 //============================================================================== 3195 3196 3197 //============================================================================== 3198 // UEP2 Bits 3199 3200 extern __at(0x0E9A) __sfr UEP2; 3201 3202 typedef struct 3203 { 3204 unsigned EPSTALL : 1; 3205 unsigned EPINEN : 1; 3206 unsigned EPOUTEN : 1; 3207 unsigned EPCONDIS : 1; 3208 unsigned EPHSHK : 1; 3209 unsigned : 1; 3210 unsigned : 1; 3211 unsigned : 1; 3212 } __UEP2bits_t; 3213 3214 extern __at(0x0E9A) volatile __UEP2bits_t UEP2bits; 3215 3216 #define _UEP2_EPSTALL 0x01 3217 #define _UEP2_EPINEN 0x02 3218 #define _UEP2_EPOUTEN 0x04 3219 #define _UEP2_EPCONDIS 0x08 3220 #define _UEP2_EPHSHK 0x10 3221 3222 //============================================================================== 3223 3224 3225 //============================================================================== 3226 // UEP3 Bits 3227 3228 extern __at(0x0E9B) __sfr UEP3; 3229 3230 typedef struct 3231 { 3232 unsigned EPSTALL : 1; 3233 unsigned EPINEN : 1; 3234 unsigned EPOUTEN : 1; 3235 unsigned EPCONDIS : 1; 3236 unsigned EPHSHK : 1; 3237 unsigned : 1; 3238 unsigned : 1; 3239 unsigned : 1; 3240 } __UEP3bits_t; 3241 3242 extern __at(0x0E9B) volatile __UEP3bits_t UEP3bits; 3243 3244 #define _UEP3_EPSTALL 0x01 3245 #define _UEP3_EPINEN 0x02 3246 #define _UEP3_EPOUTEN 0x04 3247 #define _UEP3_EPCONDIS 0x08 3248 #define _UEP3_EPHSHK 0x10 3249 3250 //============================================================================== 3251 3252 3253 //============================================================================== 3254 // UEP4 Bits 3255 3256 extern __at(0x0E9C) __sfr UEP4; 3257 3258 typedef struct 3259 { 3260 unsigned EPSTALL : 1; 3261 unsigned EPINEN : 1; 3262 unsigned EPOUTEN : 1; 3263 unsigned EPCONDIS : 1; 3264 unsigned EPHSHK : 1; 3265 unsigned : 1; 3266 unsigned : 1; 3267 unsigned : 1; 3268 } __UEP4bits_t; 3269 3270 extern __at(0x0E9C) volatile __UEP4bits_t UEP4bits; 3271 3272 #define _UEP4_EPSTALL 0x01 3273 #define _UEP4_EPINEN 0x02 3274 #define _UEP4_EPOUTEN 0x04 3275 #define _UEP4_EPCONDIS 0x08 3276 #define _UEP4_EPHSHK 0x10 3277 3278 //============================================================================== 3279 3280 3281 //============================================================================== 3282 // UEP5 Bits 3283 3284 extern __at(0x0E9D) __sfr UEP5; 3285 3286 typedef struct 3287 { 3288 unsigned EPSTALL : 1; 3289 unsigned EPINEN : 1; 3290 unsigned EPOUTEN : 1; 3291 unsigned EPCONDIS : 1; 3292 unsigned EPHSHK : 1; 3293 unsigned : 1; 3294 unsigned : 1; 3295 unsigned : 1; 3296 } __UEP5bits_t; 3297 3298 extern __at(0x0E9D) volatile __UEP5bits_t UEP5bits; 3299 3300 #define _UEP5_EPSTALL 0x01 3301 #define _UEP5_EPINEN 0x02 3302 #define _UEP5_EPOUTEN 0x04 3303 #define _UEP5_EPCONDIS 0x08 3304 #define _UEP5_EPHSHK 0x10 3305 3306 //============================================================================== 3307 3308 3309 //============================================================================== 3310 // UEP6 Bits 3311 3312 extern __at(0x0E9E) __sfr UEP6; 3313 3314 typedef struct 3315 { 3316 unsigned EPSTALL : 1; 3317 unsigned EPINEN : 1; 3318 unsigned EPOUTEN : 1; 3319 unsigned EPCONDIS : 1; 3320 unsigned EPHSHK : 1; 3321 unsigned : 1; 3322 unsigned : 1; 3323 unsigned : 1; 3324 } __UEP6bits_t; 3325 3326 extern __at(0x0E9E) volatile __UEP6bits_t UEP6bits; 3327 3328 #define _UEP6_EPSTALL 0x01 3329 #define _UEP6_EPINEN 0x02 3330 #define _UEP6_EPOUTEN 0x04 3331 #define _UEP6_EPCONDIS 0x08 3332 #define _UEP6_EPHSHK 0x10 3333 3334 //============================================================================== 3335 3336 3337 //============================================================================== 3338 // UEP7 Bits 3339 3340 extern __at(0x0E9F) __sfr UEP7; 3341 3342 typedef struct 3343 { 3344 unsigned EPSTALL : 1; 3345 unsigned EPINEN : 1; 3346 unsigned EPOUTEN : 1; 3347 unsigned EPCONDIS : 1; 3348 unsigned EPHSHK : 1; 3349 unsigned : 1; 3350 unsigned : 1; 3351 unsigned : 1; 3352 } __UEP7bits_t; 3353 3354 extern __at(0x0E9F) volatile __UEP7bits_t UEP7bits; 3355 3356 #define _UEP7_EPSTALL 0x01 3357 #define _UEP7_EPINEN 0x02 3358 #define _UEP7_EPOUTEN 0x04 3359 #define _UEP7_EPCONDIS 0x08 3360 #define _UEP7_EPHSHK 0x10 3361 3362 //============================================================================== 3363 3364 3365 //============================================================================== 3366 // ICDIO Bits 3367 3368 extern __at(0x0F8C) __sfr ICDIO; 3369 3370 typedef struct 3371 { 3372 unsigned : 1; 3373 unsigned : 1; 3374 unsigned TRIS_ICDCLK : 1; 3375 unsigned TRIS_ICDDAT : 1; 3376 unsigned LAT_ICDCLK : 1; 3377 unsigned LAT_ICDDAT : 1; 3378 unsigned PORT_ICDCLK : 1; 3379 unsigned PORT_ICDDAT : 1; 3380 } __ICDIObits_t; 3381 3382 extern __at(0x0F8C) volatile __ICDIObits_t ICDIObits; 3383 3384 #define _TRIS_ICDCLK 0x04 3385 #define _TRIS_ICDDAT 0x08 3386 #define _LAT_ICDCLK 0x10 3387 #define _LAT_ICDDAT 0x20 3388 #define _PORT_ICDCLK 0x40 3389 #define _PORT_ICDDAT 0x80 3390 3391 //============================================================================== 3392 3393 3394 //============================================================================== 3395 // ICDCON0 Bits 3396 3397 extern __at(0x0F8D) __sfr ICDCON0; 3398 3399 typedef struct 3400 { 3401 unsigned RSTVEC : 1; 3402 unsigned : 1; 3403 unsigned : 1; 3404 unsigned DBGINEX : 1; 3405 unsigned : 1; 3406 unsigned SSTEP : 1; 3407 unsigned FREEZ : 1; 3408 unsigned INBUG : 1; 3409 } __ICDCON0bits_t; 3410 3411 extern __at(0x0F8D) volatile __ICDCON0bits_t ICDCON0bits; 3412 3413 #define _RSTVEC 0x01 3414 #define _DBGINEX 0x08 3415 #define _SSTEP 0x20 3416 #define _FREEZ 0x40 3417 #define _INBUG 0x80 3418 3419 //============================================================================== 3420 3421 3422 //============================================================================== 3423 // ICDSTAT Bits 3424 3425 extern __at(0x0F91) __sfr ICDSTAT; 3426 3427 typedef struct 3428 { 3429 unsigned : 1; 3430 unsigned USRHLTF : 1; 3431 unsigned : 1; 3432 unsigned : 1; 3433 unsigned : 1; 3434 unsigned : 1; 3435 unsigned TRP0HLTF : 1; 3436 unsigned TRP1HLTF : 1; 3437 } __ICDSTATbits_t; 3438 3439 extern __at(0x0F91) volatile __ICDSTATbits_t ICDSTATbits; 3440 3441 #define _USRHLTF 0x02 3442 #define _TRP0HLTF 0x40 3443 #define _TRP1HLTF 0x80 3444 3445 //============================================================================== 3446 3447 3448 //============================================================================== 3449 // DEVSEL Bits 3450 3451 extern __at(0x0F95) __sfr DEVSEL; 3452 3453 typedef union 3454 { 3455 struct 3456 { 3457 unsigned DEVSEL0 : 1; 3458 unsigned DEVSEL1 : 1; 3459 unsigned DEVSEL2 : 1; 3460 unsigned : 1; 3461 unsigned : 1; 3462 unsigned : 1; 3463 unsigned : 1; 3464 unsigned : 1; 3465 }; 3466 3467 struct 3468 { 3469 unsigned DEVSEL : 3; 3470 unsigned : 5; 3471 }; 3472 } __DEVSELbits_t; 3473 3474 extern __at(0x0F95) volatile __DEVSELbits_t DEVSELbits; 3475 3476 #define _DEVSEL0 0x01 3477 #define _DEVSEL1 0x02 3478 #define _DEVSEL2 0x04 3479 3480 //============================================================================== 3481 3482 3483 //============================================================================== 3484 // ICDINSTL Bits 3485 3486 extern __at(0x0F96) __sfr ICDINSTL; 3487 3488 typedef struct 3489 { 3490 unsigned DBGIN0 : 1; 3491 unsigned DBGIN1 : 1; 3492 unsigned DBGIN2 : 1; 3493 unsigned DBGIN3 : 1; 3494 unsigned DBGIN4 : 1; 3495 unsigned DBGIN5 : 1; 3496 unsigned DBGIN6 : 1; 3497 unsigned DBGIN7 : 1; 3498 } __ICDINSTLbits_t; 3499 3500 extern __at(0x0F96) volatile __ICDINSTLbits_t ICDINSTLbits; 3501 3502 #define _DBGIN0 0x01 3503 #define _DBGIN1 0x02 3504 #define _DBGIN2 0x04 3505 #define _DBGIN3 0x08 3506 #define _DBGIN4 0x10 3507 #define _DBGIN5 0x20 3508 #define _DBGIN6 0x40 3509 #define _DBGIN7 0x80 3510 3511 //============================================================================== 3512 3513 3514 //============================================================================== 3515 // ICDINSTH Bits 3516 3517 extern __at(0x0F97) __sfr ICDINSTH; 3518 3519 typedef struct 3520 { 3521 unsigned DBGIN8 : 1; 3522 unsigned DBGIN9 : 1; 3523 unsigned DBGIN10 : 1; 3524 unsigned DBGIN11 : 1; 3525 unsigned DBGIN12 : 1; 3526 unsigned DBGIN13 : 1; 3527 unsigned : 1; 3528 unsigned : 1; 3529 } __ICDINSTHbits_t; 3530 3531 extern __at(0x0F97) volatile __ICDINSTHbits_t ICDINSTHbits; 3532 3533 #define _DBGIN8 0x01 3534 #define _DBGIN9 0x02 3535 #define _DBGIN10 0x04 3536 #define _DBGIN11 0x08 3537 #define _DBGIN12 0x10 3538 #define _DBGIN13 0x20 3539 3540 //============================================================================== 3541 3542 3543 //============================================================================== 3544 // ICDBK0CON Bits 3545 3546 extern __at(0x0F9C) __sfr ICDBK0CON; 3547 3548 typedef struct 3549 { 3550 unsigned BKHLT : 1; 3551 unsigned : 1; 3552 unsigned : 1; 3553 unsigned : 1; 3554 unsigned : 1; 3555 unsigned : 1; 3556 unsigned : 1; 3557 unsigned BKEN : 1; 3558 } __ICDBK0CONbits_t; 3559 3560 extern __at(0x0F9C) volatile __ICDBK0CONbits_t ICDBK0CONbits; 3561 3562 #define _BKHLT 0x01 3563 #define _BKEN 0x80 3564 3565 //============================================================================== 3566 3567 3568 //============================================================================== 3569 // ICDBK0L Bits 3570 3571 extern __at(0x0F9D) __sfr ICDBK0L; 3572 3573 typedef struct 3574 { 3575 unsigned BKA0 : 1; 3576 unsigned BKA1 : 1; 3577 unsigned BKA2 : 1; 3578 unsigned BKA3 : 1; 3579 unsigned BKA4 : 1; 3580 unsigned BKA5 : 1; 3581 unsigned BKA6 : 1; 3582 unsigned BKA7 : 1; 3583 } __ICDBK0Lbits_t; 3584 3585 extern __at(0x0F9D) volatile __ICDBK0Lbits_t ICDBK0Lbits; 3586 3587 #define _BKA0 0x01 3588 #define _BKA1 0x02 3589 #define _BKA2 0x04 3590 #define _BKA3 0x08 3591 #define _BKA4 0x10 3592 #define _BKA5 0x20 3593 #define _BKA6 0x40 3594 #define _BKA7 0x80 3595 3596 //============================================================================== 3597 3598 3599 //============================================================================== 3600 // ICDBK0H Bits 3601 3602 extern __at(0x0F9E) __sfr ICDBK0H; 3603 3604 typedef struct 3605 { 3606 unsigned BKA8 : 1; 3607 unsigned BKA9 : 1; 3608 unsigned BKA10 : 1; 3609 unsigned BKA11 : 1; 3610 unsigned BKA12 : 1; 3611 unsigned BKA13 : 1; 3612 unsigned BKA14 : 1; 3613 unsigned : 1; 3614 } __ICDBK0Hbits_t; 3615 3616 extern __at(0x0F9E) volatile __ICDBK0Hbits_t ICDBK0Hbits; 3617 3618 #define _BKA8 0x01 3619 #define _BKA9 0x02 3620 #define _BKA10 0x04 3621 #define _BKA11 0x08 3622 #define _BKA12 0x10 3623 #define _BKA13 0x20 3624 #define _BKA14 0x40 3625 3626 //============================================================================== 3627 3628 extern __at(0x0FE3) __sfr BSRICDSHAD; 3629 3630 //============================================================================== 3631 // STATUS_SHAD Bits 3632 3633 extern __at(0x0FE4) __sfr STATUS_SHAD; 3634 3635 typedef struct 3636 { 3637 unsigned C : 1; 3638 unsigned DC : 1; 3639 unsigned Z : 1; 3640 unsigned : 1; 3641 unsigned : 1; 3642 unsigned : 1; 3643 unsigned : 1; 3644 unsigned : 1; 3645 } __STATUS_SHADbits_t; 3646 3647 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits; 3648 3649 #define _STATUS_SHAD_C 0x01 3650 #define _STATUS_SHAD_DC 0x02 3651 #define _STATUS_SHAD_Z 0x04 3652 3653 //============================================================================== 3654 3655 extern __at(0x0FE5) __sfr WREG_SHAD; 3656 extern __at(0x0FE6) __sfr BSR_SHAD; 3657 extern __at(0x0FE7) __sfr PCLATH_SHAD; 3658 extern __at(0x0FE8) __sfr FSR0L_SHAD; 3659 extern __at(0x0FE9) __sfr FSR0H_SHAD; 3660 extern __at(0x0FEA) __sfr FSR1L_SHAD; 3661 extern __at(0x0FEB) __sfr FSR1H_SHAD; 3662 extern __at(0x0FED) __sfr STKPTR; 3663 extern __at(0x0FEE) __sfr TOSL; 3664 extern __at(0x0FEF) __sfr TOSH; 3665 3666 //============================================================================== 3667 // 3668 // Configuration Bits 3669 // 3670 //============================================================================== 3671 3672 #define _CONFIG1 0x8007 3673 #define _CONFIG2 0x8008 3674 3675 //----------------------------- CONFIG1 Options ------------------------------- 3676 3677 #define _FOSC_LP 0xFFF8 // LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins. 3678 #define _FOSC_XT 0xFFF9 // XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins. 3679 #define _FOSC_HS 0xFFFA // HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins. 3680 #define _FOSC_EXTRC 0xFFFB // EXTRC oscillator: External RC circuit connected to CLKIN pin. 3681 #define _FOSC_INTOSC 0xFFFC // INTOSC oscillator: I/O function on CLKIN pin. 3682 #define _FOSC_ECL 0xFFFD // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pins. 3683 #define _FOSC_ECM 0xFFFE // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pins. 3684 #define _FOSC_ECH 0xFFFF // ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pins. 3685 #define _WDTE_OFF 0xFFE7 // WDT disabled. 3686 #define _WDTE_SWDTEN 0xFFEF // WDT controlled by the SWDTEN bit in the WDTCON register. 3687 #define _WDTE_NSLEEP 0xFFF7 // WDT enabled while running and disabled in Sleep. 3688 #define _WDTE_ON 0xFFFF // WDT enabled. 3689 #define _PWRTE_ON 0xFFDF // PWRT enabled. 3690 #define _PWRTE_OFF 0xFFFF // PWRT disabled. 3691 #define _MCLRE_OFF 0xFFBF // MCLR/VPP pin function is digital input. 3692 #define _MCLRE_ON 0xFFFF // MCLR/VPP pin function is MCLR. 3693 #define _CP_ON 0xFF7F // Program memory code protection is enabled. 3694 #define _CP_OFF 0xFFFF // Program memory code protection is disabled. 3695 #define _BOREN_OFF 0xF9FF // Brown-out Reset disabled. 3696 #define _BOREN_SBODEN 0xFBFF // Brown-out Reset controlled by the SBOREN bit in the BORCON register. 3697 #define _BOREN_NSLEEP 0xFDFF // Brown-out Reset enabled while running and disabled in Sleep. 3698 #define _BOREN_ON 0xFFFF // Brown-out Reset enabled. 3699 #define _CLKOUTEN_ON 0xF7FF // CLKOUT function is enabled on the CLKOUT pin. 3700 #define _CLKOUTEN_OFF 0xFFFF // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin. 3701 #define _IESO_OFF 0xEFFF // Internal/External Switchover Mode is disabled. 3702 #define _IESO_ON 0xFFFF // Internal/External Switchover Mode is enabled. 3703 #define _FCMEN_OFF 0xDFFF // Fail-Safe Clock Monitor is disabled. 3704 #define _FCMEN_ON 0xFFFF // Fail-Safe Clock Monitor is enabled. 3705 3706 //----------------------------- CONFIG2 Options ------------------------------- 3707 3708 #define _WRT_ALL 0xFFFC // 000h to 1FFFh write protected, no addresses may be modified by PMCON control. 3709 #define _WRT_HALF 0xFFFD // 000h to 0FFFh write protected, 1000h to 1FFFh may be modified by PMCON control. 3710 #define _WRT_BOOT 0xFFFE // 000h to 1FFh write protected, 200h to 1FFFh may be modified by PMCON control. 3711 #define _WRT_OFF 0xFFFF // Write protection off. 3712 #define _CPUDIV_NOCLKDIV 0xFFCF // NO CPU system divide. 3713 #define _CPUDIV_CLKDIV2 0xFFDF // CPU system clock divided by 2. 3714 #define _CPUDIV_CLKDIV3 0xFFEF // CPU system clock divided by 3. 3715 #define _CPUDIV_CLKDIV6 0xFFFF // CPU system clock divided by 6. 3716 #define _USBLSCLK_24MHz 0xFFBF // System clock expects 24 MHz, FS/LS USB CLKENs divide-by is set to 4. 3717 #define _USBLSCLK_48MHz 0xFFFF // System clock expects 48 MHz, FS/LS USB CLKENs divide-by is set to 8. 3718 #define _PLLMULT_4x 0xFF7F // 4x Output Frequency Selected. 3719 #define _PLLMULT_3x 0xFFFF // 3x Output Frequency Selected. 3720 #define _PLLEN_DISABLED 0xFEFF // 3x or 4x PLL Disabled. 3721 #define _PLLEN_ENABLED 0xFFFF // 3x or 4x PLL Enabled. 3722 #define _STVREN_OFF 0xFDFF // Stack Overflow or Underflow will not cause a Reset. 3723 #define _STVREN_ON 0xFFFF // Stack Overflow or Underflow will cause a Reset. 3724 #define _BORV_HI 0xFBFF // Brown-out Reset Voltage (Vbor), high trip point selected. 3725 #define _BORV_LO 0xFFFF // Brown-out Reset Voltage (Vbor), low trip point selected. 3726 #define _LPBOR_ON 0xF7FF // Low-Power BOR is enabled. 3727 #define _LPBOR_OFF 0xFFFF // Low-Power BOR is disabled. 3728 #define _DEBUG_ON 0x2FFF // In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger. 3729 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins. 3730 #define _LVP_OFF 0xDFFF // High-voltage on MCLR/VPP must be used for programming. 3731 #define _LVP_ON 0xFFFF // Low-voltage programming enabled. 3732 3733 //============================================================================== 3734 3735 #define _DEVID1 0x8006 3736 3737 #define _IDLOC0 0x8000 3738 #define _IDLOC1 0x8001 3739 #define _IDLOC2 0x8002 3740 #define _IDLOC3 0x8003 3741 3742 //============================================================================== 3743 3744 #ifndef NO_BIT_DEFINES 3745 3746 #define ADON ADCON0bits.ADON // bit 0 3747 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1, shadows bit in ADCON0bits 3748 #define ADGO ADCON0bits.ADGO // bit 1, shadows bit in ADCON0bits 3749 #define GO ADCON0bits.GO // bit 1, shadows bit in ADCON0bits 3750 #define CHS0 ADCON0bits.CHS0 // bit 2 3751 #define CHS1 ADCON0bits.CHS1 // bit 3 3752 #define CHS2 ADCON0bits.CHS2 // bit 4 3753 #define CHS3 ADCON0bits.CHS3 // bit 5 3754 #define CHS4 ADCON0bits.CHS4 // bit 6 3755 3756 #define ADPREF0 ADCON1bits.ADPREF0 // bit 0 3757 #define ADPREF1 ADCON1bits.ADPREF1 // bit 1 3758 #define ADCS0 ADCON1bits.ADCS0 // bit 4 3759 #define ADCS1 ADCON1bits.ADCS1 // bit 5 3760 #define ADCS2 ADCON1bits.ADCS2 // bit 6 3761 #define ADFM ADCON1bits.ADFM // bit 7 3762 3763 #define TRIGSEL0 ADCON2bits.TRIGSEL0 // bit 4 3764 #define TRIGSEL1 ADCON2bits.TRIGSEL1 // bit 5 3765 #define TRIGSEL2 ADCON2bits.TRIGSEL2 // bit 6 3766 3767 #define ANSA4 ANSELAbits.ANSA4 // bit 4 3768 3769 #define ANSB4 ANSELBbits.ANSB4 // bit 4 3770 #define ANSB5 ANSELBbits.ANSB5 // bit 5 3771 3772 #define ANSC0 ANSELCbits.ANSC0 // bit 0 3773 #define ANSC1 ANSELCbits.ANSC1 // bit 1 3774 #define ANSC2 ANSELCbits.ANSC2 // bit 2 3775 #define ANSC3 ANSELCbits.ANSC3 // bit 3 3776 #define ANSC6 ANSELCbits.ANSC6 // bit 6 3777 #define ANSC7 ANSELCbits.ANSC7 // bit 7 3778 3779 #define T1GSEL APFCONbits.T1GSEL // bit 3 3780 #define SSSEL APFCONbits.SSSEL // bit 5 3781 #define CLKRSEL APFCONbits.CLKRSEL // bit 7 3782 3783 #define ABDEN BAUDCONbits.ABDEN // bit 0 3784 #define WUE BAUDCONbits.WUE // bit 1 3785 #define BRG16 BAUDCONbits.BRG16 // bit 3 3786 #define SCKP BAUDCONbits.SCKP // bit 4 3787 #define RCIDL BAUDCONbits.RCIDL // bit 6 3788 #define ABDOVF BAUDCONbits.ABDOVF // bit 7 3789 3790 #define BORRDY BORCONbits.BORRDY // bit 0 3791 #define BORFS BORCONbits.BORFS // bit 6 3792 #define SBOREN BORCONbits.SBOREN // bit 7 3793 3794 #define BSR0 BSRbits.BSR0 // bit 0 3795 #define BSR1 BSRbits.BSR1 // bit 1 3796 #define BSR2 BSRbits.BSR2 // bit 2 3797 #define BSR3 BSRbits.BSR3 // bit 3 3798 #define BSR4 BSRbits.BSR4 // bit 4 3799 3800 #define CLKRDIV0 CLKRCONbits.CLKRDIV0 // bit 0 3801 #define CLKRDIV1 CLKRCONbits.CLKRDIV1 // bit 1 3802 #define CLKRDIV2 CLKRCONbits.CLKRDIV2 // bit 2 3803 #define CLKRCD0 CLKRCONbits.CLKRCD0 // bit 3 3804 #define CLKRCD1 CLKRCONbits.CLKRCD1 // bit 4 3805 #define CLKRSLR CLKRCONbits.CLKRSLR // bit 5 3806 #define CLKROE CLKRCONbits.CLKROE // bit 6 3807 #define CLKREN CLKRCONbits.CLKREN // bit 7 3808 3809 #define C1SYNC CM1CON0bits.C1SYNC // bit 0 3810 #define C1HYS CM1CON0bits.C1HYS // bit 1 3811 #define C1SP CM1CON0bits.C1SP // bit 2 3812 #define C1POL CM1CON0bits.C1POL // bit 4 3813 #define C1OE CM1CON0bits.C1OE // bit 5 3814 #define C1OUT CM1CON0bits.C1OUT // bit 6 3815 #define C1ON CM1CON0bits.C1ON // bit 7 3816 3817 #define C1NCH0 CM1CON1bits.C1NCH0 // bit 0 3818 #define C1NCH1 CM1CON1bits.C1NCH1 // bit 1 3819 #define C1NCH2 CM1CON1bits.C1NCH2 // bit 2 3820 #define C1PCH0 CM1CON1bits.C1PCH0 // bit 4 3821 #define C1PCH1 CM1CON1bits.C1PCH1 // bit 5 3822 #define C1INTN CM1CON1bits.C1INTN // bit 6 3823 #define C1INTP CM1CON1bits.C1INTP // bit 7 3824 3825 #define C2SYNC CM2CON0bits.C2SYNC // bit 0 3826 #define C2HYS CM2CON0bits.C2HYS // bit 1 3827 #define C2SP CM2CON0bits.C2SP // bit 2 3828 #define C2POL CM2CON0bits.C2POL // bit 4 3829 #define C2OE CM2CON0bits.C2OE // bit 5 3830 #define C2OUT CM2CON0bits.C2OUT // bit 6 3831 #define C2ON CM2CON0bits.C2ON // bit 7 3832 3833 #define C2NCH0 CM2CON1bits.C2NCH0 // bit 0 3834 #define C2NCH1 CM2CON1bits.C2NCH1 // bit 1 3835 #define C2NCH2 CM2CON1bits.C2NCH2 // bit 2 3836 #define C2PCH0 CM2CON1bits.C2PCH0 // bit 4 3837 #define C2PCH1 CM2CON1bits.C2PCH1 // bit 5 3838 #define C2INTN CM2CON1bits.C2INTN // bit 6 3839 #define C2INTP CM2CON1bits.C2INTP // bit 7 3840 3841 #define MC1OUT CMOUTbits.MC1OUT // bit 0 3842 #define MC2OUT CMOUTbits.MC2OUT // bit 1 3843 3844 #define CPFAIL CRCONbits.CPFAIL // bit 1 3845 #define CRLOCK CRCONbits.CRLOCK // bit 3 3846 #define CRSRC CRCONbits.CRSRC // bit 4 3847 #define CRUPDIS CRCONbits.CRUPDIS // bit 6 3848 #define CRON CRCONbits.CRON // bit 7 3849 3850 #define G1CS0 CWG1CON0bits.G1CS0 // bit 0 3851 #define G1POLA CWG1CON0bits.G1POLA // bit 3 3852 #define G1POLB CWG1CON0bits.G1POLB // bit 4 3853 #define G1OEA CWG1CON0bits.G1OEA // bit 5 3854 #define G1OEB CWG1CON0bits.G1OEB // bit 6 3855 #define G1EN CWG1CON0bits.G1EN // bit 7 3856 3857 #define G1IS0 CWG1CON1bits.G1IS0 // bit 0 3858 #define G1IS1 CWG1CON1bits.G1IS1 // bit 1 3859 #define G1ASDLA0 CWG1CON1bits.G1ASDLA0 // bit 4 3860 #define G1ASDLA1 CWG1CON1bits.G1ASDLA1 // bit 5 3861 #define G1ASDLB0 CWG1CON1bits.G1ASDLB0 // bit 6 3862 #define G1ASDLB1 CWG1CON1bits.G1ASDLB1 // bit 7 3863 3864 #define G1ASDSFLT CWG1CON2bits.G1ASDSFLT // bit 1 3865 #define G1ASDSC1 CWG1CON2bits.G1ASDSC1 // bit 2 3866 #define G1ASDSC2 CWG1CON2bits.G1ASDSC2 // bit 3 3867 #define G1ARSEN CWG1CON2bits.G1ARSEN // bit 6 3868 #define G1ASE CWG1CON2bits.G1ASE // bit 7 3869 3870 #define CWG1DBF0 CWG1DBFbits.CWG1DBF0 // bit 0 3871 #define CWG1DBF1 CWG1DBFbits.CWG1DBF1 // bit 1 3872 #define CWG1DBF2 CWG1DBFbits.CWG1DBF2 // bit 2 3873 #define CWG1DBF3 CWG1DBFbits.CWG1DBF3 // bit 3 3874 #define CWG1DBF4 CWG1DBFbits.CWG1DBF4 // bit 4 3875 #define CWG1DBF5 CWG1DBFbits.CWG1DBF5 // bit 5 3876 3877 #define CWG1DBR0 CWG1DBRbits.CWG1DBR0 // bit 0 3878 #define CWG1DBR1 CWG1DBRbits.CWG1DBR1 // bit 1 3879 #define CWG1DBR2 CWG1DBRbits.CWG1DBR2 // bit 2 3880 #define CWG1DBR3 CWG1DBRbits.CWG1DBR3 // bit 3 3881 #define CWG1DBR4 CWG1DBRbits.CWG1DBR4 // bit 4 3882 #define CWG1DBR5 CWG1DBRbits.CWG1DBR5 // bit 5 3883 3884 #define D1PSS0 DACCON0bits.D1PSS0 // bit 2 3885 #define D1PSS1 DACCON0bits.D1PSS1 // bit 3 3886 #define DACOE2 DACCON0bits.DACOE2 // bit 4 3887 #define DACOE1 DACCON0bits.DACOE1 // bit 5 3888 #define DACEN DACCON0bits.DACEN // bit 7 3889 3890 #define DACR0 DACCON1bits.DACR0 // bit 0 3891 #define DACR1 DACCON1bits.DACR1 // bit 1 3892 #define DACR2 DACCON1bits.DACR2 // bit 2 3893 #define DACR3 DACCON1bits.DACR3 // bit 3 3894 #define DACR4 DACCON1bits.DACR4 // bit 4 3895 3896 #define DEVSEL0 DEVSELbits.DEVSEL0 // bit 0 3897 #define DEVSEL1 DEVSELbits.DEVSEL1 // bit 1 3898 #define DEVSEL2 DEVSELbits.DEVSEL2 // bit 2 3899 3900 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0 3901 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1 3902 #define CDAFVR0 FVRCONbits.CDAFVR0 // bit 2 3903 #define CDAFVR1 FVRCONbits.CDAFVR1 // bit 3 3904 #define FVRRDY FVRCONbits.FVRRDY // bit 6 3905 #define FVREN FVRCONbits.FVREN // bit 7 3906 3907 #define BKHLT ICDBK0CONbits.BKHLT // bit 0 3908 #define BKEN ICDBK0CONbits.BKEN // bit 7 3909 3910 #define BKA8 ICDBK0Hbits.BKA8 // bit 0 3911 #define BKA9 ICDBK0Hbits.BKA9 // bit 1 3912 #define BKA10 ICDBK0Hbits.BKA10 // bit 2 3913 #define BKA11 ICDBK0Hbits.BKA11 // bit 3 3914 #define BKA12 ICDBK0Hbits.BKA12 // bit 4 3915 #define BKA13 ICDBK0Hbits.BKA13 // bit 5 3916 #define BKA14 ICDBK0Hbits.BKA14 // bit 6 3917 3918 #define BKA0 ICDBK0Lbits.BKA0 // bit 0 3919 #define BKA1 ICDBK0Lbits.BKA1 // bit 1 3920 #define BKA2 ICDBK0Lbits.BKA2 // bit 2 3921 #define BKA3 ICDBK0Lbits.BKA3 // bit 3 3922 #define BKA4 ICDBK0Lbits.BKA4 // bit 4 3923 #define BKA5 ICDBK0Lbits.BKA5 // bit 5 3924 #define BKA6 ICDBK0Lbits.BKA6 // bit 6 3925 #define BKA7 ICDBK0Lbits.BKA7 // bit 7 3926 3927 #define RSTVEC ICDCON0bits.RSTVEC // bit 0 3928 #define DBGINEX ICDCON0bits.DBGINEX // bit 3 3929 #define SSTEP ICDCON0bits.SSTEP // bit 5 3930 #define FREEZ ICDCON0bits.FREEZ // bit 6 3931 #define INBUG ICDCON0bits.INBUG // bit 7 3932 3933 #define DBGIN8 ICDINSTHbits.DBGIN8 // bit 0 3934 #define DBGIN9 ICDINSTHbits.DBGIN9 // bit 1 3935 #define DBGIN10 ICDINSTHbits.DBGIN10 // bit 2 3936 #define DBGIN11 ICDINSTHbits.DBGIN11 // bit 3 3937 #define DBGIN12 ICDINSTHbits.DBGIN12 // bit 4 3938 #define DBGIN13 ICDINSTHbits.DBGIN13 // bit 5 3939 3940 #define DBGIN0 ICDINSTLbits.DBGIN0 // bit 0 3941 #define DBGIN1 ICDINSTLbits.DBGIN1 // bit 1 3942 #define DBGIN2 ICDINSTLbits.DBGIN2 // bit 2 3943 #define DBGIN3 ICDINSTLbits.DBGIN3 // bit 3 3944 #define DBGIN4 ICDINSTLbits.DBGIN4 // bit 4 3945 #define DBGIN5 ICDINSTLbits.DBGIN5 // bit 5 3946 #define DBGIN6 ICDINSTLbits.DBGIN6 // bit 6 3947 #define DBGIN7 ICDINSTLbits.DBGIN7 // bit 7 3948 3949 #define TRIS_ICDCLK ICDIObits.TRIS_ICDCLK // bit 2 3950 #define TRIS_ICDDAT ICDIObits.TRIS_ICDDAT // bit 3 3951 #define LAT_ICDCLK ICDIObits.LAT_ICDCLK // bit 4 3952 #define LAT_ICDDAT ICDIObits.LAT_ICDDAT // bit 5 3953 #define PORT_ICDCLK ICDIObits.PORT_ICDCLK // bit 6 3954 #define PORT_ICDDAT ICDIObits.PORT_ICDDAT // bit 7 3955 3956 #define USRHLTF ICDSTATbits.USRHLTF // bit 1 3957 #define TRP0HLTF ICDSTATbits.TRP0HLTF // bit 6 3958 #define TRP1HLTF ICDSTATbits.TRP1HLTF // bit 7 3959 3960 #define IOCIF INTCONbits.IOCIF // bit 0 3961 #define INTF INTCONbits.INTF // bit 1 3962 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits 3963 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits 3964 #define IOCIE INTCONbits.IOCIE // bit 3 3965 #define INTE INTCONbits.INTE // bit 4 3966 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits 3967 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits 3968 #define PEIE INTCONbits.PEIE // bit 6 3969 #define GIE INTCONbits.GIE // bit 7 3970 3971 #define IOCAF0 IOCAFbits.IOCAF0 // bit 0 3972 #define IOCAF1 IOCAFbits.IOCAF1 // bit 1 3973 #define IOCAF3 IOCAFbits.IOCAF3 // bit 3 3974 #define IOCAF4 IOCAFbits.IOCAF4 // bit 4 3975 #define IOCAF5 IOCAFbits.IOCAF5 // bit 5 3976 3977 #define IOCAN0 IOCANbits.IOCAN0 // bit 0 3978 #define IOCAN1 IOCANbits.IOCAN1 // bit 1 3979 #define IOCAN3 IOCANbits.IOCAN3 // bit 3 3980 #define IOCAN4 IOCANbits.IOCAN4 // bit 4 3981 #define IOCAN5 IOCANbits.IOCAN5 // bit 5 3982 3983 #define IOCAP0 IOCAPbits.IOCAP0 // bit 0 3984 #define IOCAP1 IOCAPbits.IOCAP1 // bit 1 3985 #define IOCAP3 IOCAPbits.IOCAP3 // bit 3 3986 #define IOCAP4 IOCAPbits.IOCAP4 // bit 4 3987 #define IOCAP5 IOCAPbits.IOCAP5 // bit 5 3988 3989 #define IOCBF4 IOCBFbits.IOCBF4 // bit 4 3990 #define IOCBF5 IOCBFbits.IOCBF5 // bit 5 3991 #define IOCBF6 IOCBFbits.IOCBF6 // bit 6 3992 #define IOCBF7 IOCBFbits.IOCBF7 // bit 7 3993 3994 #define IOCBN4 IOCBNbits.IOCBN4 // bit 4 3995 #define IOCBN5 IOCBNbits.IOCBN5 // bit 5 3996 #define IOCBN6 IOCBNbits.IOCBN6 // bit 6 3997 #define IOCBN7 IOCBNbits.IOCBN7 // bit 7 3998 3999 #define IOCBP4 IOCBPbits.IOCBP4 // bit 4 4000 #define IOCBP5 IOCBPbits.IOCBP5 // bit 5 4001 #define IOCBP6 IOCBPbits.IOCBP6 // bit 6 4002 #define IOCBP7 IOCBPbits.IOCBP7 // bit 7 4003 4004 #define LATA4 LATAbits.LATA4 // bit 4 4005 #define LATA5 LATAbits.LATA5 // bit 5 4006 4007 #define LATB4 LATBbits.LATB4 // bit 4 4008 #define LATB5 LATBbits.LATB5 // bit 5 4009 #define LATB6 LATBbits.LATB6 // bit 6 4010 #define LATB7 LATBbits.LATB7 // bit 7 4011 4012 #define LATC0 LATCbits.LATC0 // bit 0 4013 #define LATC1 LATCbits.LATC1 // bit 1 4014 #define LATC2 LATCbits.LATC2 // bit 2 4015 #define LATC3 LATCbits.LATC3 // bit 3 4016 #define LATC4 LATCbits.LATC4 // bit 4 4017 #define LATC5 LATCbits.LATC5 // bit 5 4018 #define LATC6 LATCbits.LATC6 // bit 6 4019 #define LATC7 LATCbits.LATC7 // bit 7 4020 4021 #define PS0 OPTION_REGbits.PS0 // bit 0 4022 #define PS1 OPTION_REGbits.PS1 // bit 1 4023 #define PS2 OPTION_REGbits.PS2 // bit 2 4024 #define PSA OPTION_REGbits.PSA // bit 3 4025 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits 4026 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits 4027 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits 4028 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits 4029 #define INTEDG OPTION_REGbits.INTEDG // bit 6 4030 #define NOT_WPUEN OPTION_REGbits.NOT_WPUEN // bit 7 4031 4032 #define SCS0 OSCCONbits.SCS0 // bit 0 4033 #define SCS1 OSCCONbits.SCS1 // bit 1 4034 #define IRCF0 OSCCONbits.IRCF0 // bit 2 4035 #define IRCF1 OSCCONbits.IRCF1 // bit 3 4036 #define IRCF2 OSCCONbits.IRCF2 // bit 4 4037 #define IRCF3 OSCCONbits.IRCF3 // bit 5 4038 #define SPLLMULT OSCCONbits.SPLLMULT // bit 6 4039 #define SPLLEN OSCCONbits.SPLLEN // bit 7 4040 4041 #define HFIOFS OSCSTATbits.HFIOFS // bit 0 4042 #define LFIOFR OSCSTATbits.LFIOFR // bit 1 4043 #define HFIOFR OSCSTATbits.HFIOFR // bit 4 4044 #define OSTS OSCSTATbits.OSTS // bit 5 4045 #define PLLRDY OSCSTATbits.PLLRDY // bit 6 4046 #define SOSCR OSCSTATbits.SOSCR // bit 7 4047 4048 #define TUN0 OSCTUNEbits.TUN0 // bit 0 4049 #define TUN1 OSCTUNEbits.TUN1 // bit 1 4050 #define TUN2 OSCTUNEbits.TUN2 // bit 2 4051 #define TUN3 OSCTUNEbits.TUN3 // bit 3 4052 #define TUN4 OSCTUNEbits.TUN4 // bit 4 4053 #define TUN5 OSCTUNEbits.TUN5 // bit 5 4054 #define TUN6 OSCTUNEbits.TUN6 // bit 6 4055 4056 #define NOT_BOR PCONbits.NOT_BOR // bit 0 4057 #define NOT_POR PCONbits.NOT_POR // bit 1 4058 #define NOT_RI PCONbits.NOT_RI // bit 2 4059 #define NOT_RMCLR PCONbits.NOT_RMCLR // bit 3 4060 #define NOT_RWDT PCONbits.NOT_RWDT // bit 4 4061 #define STKUNF PCONbits.STKUNF // bit 6 4062 #define STKOVF PCONbits.STKOVF // bit 7 4063 4064 #define TMR1IE PIE1bits.TMR1IE // bit 0 4065 #define TMR2IE PIE1bits.TMR2IE // bit 1 4066 #define SSP1IE PIE1bits.SSP1IE // bit 3 4067 #define TXIE PIE1bits.TXIE // bit 4 4068 #define RCIE PIE1bits.RCIE // bit 5 4069 #define ADIE PIE1bits.ADIE // bit 6 4070 #define TMR1GIE PIE1bits.TMR1GIE // bit 7 4071 4072 #define CRIE PIE2bits.CRIE // bit 1 4073 #define USBIE PIE2bits.USBIE // bit 2 4074 #define BCL1IE PIE2bits.BCL1IE // bit 3 4075 #define C1IE PIE2bits.C1IE // bit 5 4076 #define C2IE PIE2bits.C2IE // bit 6 4077 #define OSFIE PIE2bits.OSFIE // bit 7 4078 4079 #define TMR1IF PIR1bits.TMR1IF // bit 0 4080 #define TMR2IF PIR1bits.TMR2IF // bit 1 4081 #define SSP1IF PIR1bits.SSP1IF // bit 3 4082 #define TXIF PIR1bits.TXIF // bit 4 4083 #define RCIF PIR1bits.RCIF // bit 5 4084 #define ADIF PIR1bits.ADIF // bit 6 4085 #define TMR1GIF PIR1bits.TMR1GIF // bit 7 4086 4087 #define CRIF PIR2bits.CRIF // bit 1 4088 #define USBIF PIR2bits.USBIF // bit 2 4089 #define BCL1IF PIR2bits.BCL1IF // bit 3 4090 #define C1IF PIR2bits.C1IF // bit 5 4091 #define C2IF PIR2bits.C2IF // bit 6 4092 #define OSFIF PIR2bits.OSFIF // bit 7 4093 4094 #define RD PMCON1bits.RD // bit 0 4095 #define WR PMCON1bits.WR // bit 1 4096 #define WREN PMCON1bits.WREN // bit 2 4097 #define WRERR PMCON1bits.WRERR // bit 3 4098 #define FREE PMCON1bits.FREE // bit 4 4099 #define LWLO PMCON1bits.LWLO // bit 5 4100 #define CFGS PMCON1bits.CFGS // bit 6 4101 4102 #define RA0 PORTAbits.RA0 // bit 0 4103 #define RA1 PORTAbits.RA1 // bit 1 4104 #define RA3 PORTAbits.RA3 // bit 3 4105 #define RA4 PORTAbits.RA4 // bit 4 4106 #define RA5 PORTAbits.RA5 // bit 5 4107 4108 #define RB4 PORTBbits.RB4 // bit 4 4109 #define RB5 PORTBbits.RB5 // bit 5 4110 #define RB6 PORTBbits.RB6 // bit 6 4111 #define RB7 PORTBbits.RB7 // bit 7 4112 4113 #define RC0 PORTCbits.RC0 // bit 0 4114 #define RC1 PORTCbits.RC1 // bit 1 4115 #define RC2 PORTCbits.RC2 // bit 2 4116 #define RC3 PORTCbits.RC3 // bit 3 4117 #define RC4 PORTCbits.RC4 // bit 4 4118 #define RC5 PORTCbits.RC5 // bit 5 4119 #define RC6 PORTCbits.RC6 // bit 6 4120 #define RC7 PORTCbits.RC7 // bit 7 4121 4122 #define PWM1POL PWM1CONbits.PWM1POL // bit 4 4123 #define PWM1OUT PWM1CONbits.PWM1OUT // bit 5 4124 #define PWM1OE PWM1CONbits.PWM1OE // bit 6 4125 #define PWM1EN PWM1CONbits.PWM1EN // bit 7 4126 4127 #define PWM1DCH0 PWM1DCHbits.PWM1DCH0 // bit 0 4128 #define PWM1DCH1 PWM1DCHbits.PWM1DCH1 // bit 1 4129 #define PWM1DCH2 PWM1DCHbits.PWM1DCH2 // bit 2 4130 #define PWM1DCH3 PWM1DCHbits.PWM1DCH3 // bit 3 4131 #define PWM1DCH4 PWM1DCHbits.PWM1DCH4 // bit 4 4132 #define PWM1DCH5 PWM1DCHbits.PWM1DCH5 // bit 5 4133 #define PWM1DCH6 PWM1DCHbits.PWM1DCH6 // bit 6 4134 #define PWM1DCH7 PWM1DCHbits.PWM1DCH7 // bit 7 4135 4136 #define PWM1DCL0 PWM1DCLbits.PWM1DCL0 // bit 6 4137 #define PWM1DCL1 PWM1DCLbits.PWM1DCL1 // bit 7 4138 4139 #define PWM2POL PWM2CONbits.PWM2POL // bit 4 4140 #define PWM2OUT PWM2CONbits.PWM2OUT // bit 5 4141 #define PWM2OE PWM2CONbits.PWM2OE // bit 6 4142 #define PWM2EN PWM2CONbits.PWM2EN // bit 7 4143 4144 #define PWM2DCH0 PWM2DCHbits.PWM2DCH0 // bit 0 4145 #define PWM2DCH1 PWM2DCHbits.PWM2DCH1 // bit 1 4146 #define PWM2DCH2 PWM2DCHbits.PWM2DCH2 // bit 2 4147 #define PWM2DCH3 PWM2DCHbits.PWM2DCH3 // bit 3 4148 #define PWM2DCH4 PWM2DCHbits.PWM2DCH4 // bit 4 4149 #define PWM2DCH5 PWM2DCHbits.PWM2DCH5 // bit 5 4150 #define PWM2DCH6 PWM2DCHbits.PWM2DCH6 // bit 6 4151 #define PWM2DCH7 PWM2DCHbits.PWM2DCH7 // bit 7 4152 4153 #define PWM2DCL0 PWM2DCLbits.PWM2DCL0 // bit 6 4154 #define PWM2DCL1 PWM2DCLbits.PWM2DCL1 // bit 7 4155 4156 #define RX9D RCSTAbits.RX9D // bit 0 4157 #define OERR RCSTAbits.OERR // bit 1 4158 #define FERR RCSTAbits.FERR // bit 2 4159 #define ADDEN RCSTAbits.ADDEN // bit 3 4160 #define CREN RCSTAbits.CREN // bit 4 4161 #define SREN RCSTAbits.SREN // bit 5 4162 #define RX9 RCSTAbits.RX9 // bit 6 4163 #define SPEN RCSTAbits.SPEN // bit 7 4164 4165 #define SSP1M0 SSP1CON1bits.SSP1M0 // bit 0 4166 #define SSP1M1 SSP1CON1bits.SSP1M1 // bit 1 4167 #define SSP1M2 SSP1CON1bits.SSP1M2 // bit 2 4168 #define SSP1M3 SSP1CON1bits.SSP1M3 // bit 3 4169 #define CKP SSP1CON1bits.CKP // bit 4 4170 #define SSP1EN SSP1CON1bits.SSP1EN // bit 5 4171 #define SSP1OV SSP1CON1bits.SSP1OV // bit 6 4172 #define WCOL SSP1CON1bits.WCOL // bit 7 4173 4174 #define SEN SSP1CON2bits.SEN // bit 0 4175 #define RSEN SSP1CON2bits.RSEN // bit 1 4176 #define PEN SSP1CON2bits.PEN // bit 2 4177 #define RCEN SSP1CON2bits.RCEN // bit 3 4178 #define ACKEN SSP1CON2bits.ACKEN // bit 4 4179 #define ACKDT SSP1CON2bits.ACKDT // bit 5 4180 #define ACKSTAT SSP1CON2bits.ACKSTAT // bit 6 4181 #define GCEN SSP1CON2bits.GCEN // bit 7 4182 4183 #define DHEN SSP1CON3bits.DHEN // bit 0 4184 #define AHEN SSP1CON3bits.AHEN // bit 1 4185 #define SBCDE SSP1CON3bits.SBCDE // bit 2 4186 #define SDAHT SSP1CON3bits.SDAHT // bit 3 4187 #define BOEN SSP1CON3bits.BOEN // bit 4 4188 #define SCIE SSP1CON3bits.SCIE // bit 5 4189 #define PCIE SSP1CON3bits.PCIE // bit 6 4190 #define ACKTIM SSP1CON3bits.ACKTIM // bit 7 4191 4192 #define BF SSP1STATbits.BF // bit 0 4193 #define UA SSP1STATbits.UA // bit 1 4194 #define R_NOT_W SSP1STATbits.R_NOT_W // bit 2 4195 #define S SSP1STATbits.S // bit 3 4196 #define P SSP1STATbits.P // bit 4 4197 #define D_NOT_A SSP1STATbits.D_NOT_A // bit 5 4198 #define CKE SSP1STATbits.CKE // bit 6 4199 #define SMP SSP1STATbits.SMP // bit 7 4200 4201 #define C STATUSbits.C // bit 0 4202 #define DC STATUSbits.DC // bit 1 4203 #define Z STATUSbits.Z // bit 2 4204 #define NOT_PD STATUSbits.NOT_PD // bit 3 4205 #define NOT_TO STATUSbits.NOT_TO // bit 4 4206 4207 #define TMR1ON T1CONbits.TMR1ON // bit 0 4208 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2 4209 #define T1OSCEN T1CONbits.T1OSCEN // bit 3 4210 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4 4211 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5 4212 #define TMR1CS0 T1CONbits.TMR1CS0 // bit 6 4213 #define TMR1CS1 T1CONbits.TMR1CS1 // bit 7 4214 4215 #define T1GSS0 T1GCONbits.T1GSS0 // bit 0 4216 #define T1GSS1 T1GCONbits.T1GSS1 // bit 1 4217 #define T1GVAL T1GCONbits.T1GVAL // bit 2 4218 #define T1GGO_NOT_DONE T1GCONbits.T1GGO_NOT_DONE // bit 3 4219 #define T1GSPM T1GCONbits.T1GSPM // bit 4 4220 #define T1GTM T1GCONbits.T1GTM // bit 5 4221 #define T1GPOL T1GCONbits.T1GPOL // bit 6 4222 #define TMR1GE T1GCONbits.TMR1GE // bit 7 4223 4224 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0 4225 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1 4226 #define TMR2ON T2CONbits.TMR2ON // bit 2 4227 #define TOUTPS0 T2CONbits.TOUTPS0 // bit 3 4228 #define TOUTPS1 T2CONbits.TOUTPS1 // bit 4 4229 #define TOUTPS2 T2CONbits.TOUTPS2 // bit 5 4230 #define TOUTPS3 T2CONbits.TOUTPS3 // bit 6 4231 4232 #define TRISA4 TRISAbits.TRISA4 // bit 4 4233 #define TRISA5 TRISAbits.TRISA5 // bit 5 4234 4235 #define TRISB4 TRISBbits.TRISB4 // bit 4 4236 #define TRISB5 TRISBbits.TRISB5 // bit 5 4237 #define TRISB6 TRISBbits.TRISB6 // bit 6 4238 #define TRISB7 TRISBbits.TRISB7 // bit 7 4239 4240 #define TRISC0 TRISCbits.TRISC0 // bit 0 4241 #define TRISC1 TRISCbits.TRISC1 // bit 1 4242 #define TRISC2 TRISCbits.TRISC2 // bit 2 4243 #define TRISC3 TRISCbits.TRISC3 // bit 3 4244 #define TRISC4 TRISCbits.TRISC4 // bit 4 4245 #define TRISC5 TRISCbits.TRISC5 // bit 5 4246 #define TRISC6 TRISCbits.TRISC6 // bit 6 4247 #define TRISC7 TRISCbits.TRISC7 // bit 7 4248 4249 #define TX9D TXSTAbits.TX9D // bit 0 4250 #define TRMT TXSTAbits.TRMT // bit 1 4251 #define BRGH TXSTAbits.BRGH // bit 2 4252 #define SENDB TXSTAbits.SENDB // bit 3 4253 #define SYNC TXSTAbits.SYNC // bit 4 4254 #define TXEN TXSTAbits.TXEN // bit 5 4255 #define TX9 TXSTAbits.TX9 // bit 6 4256 #define CSRC TXSTAbits.CSRC // bit 7 4257 4258 #define ADDR0 UADDRbits.ADDR0 // bit 0 4259 #define ADDR1 UADDRbits.ADDR1 // bit 1 4260 #define ADDR2 UADDRbits.ADDR2 // bit 2 4261 #define ADDR3 UADDRbits.ADDR3 // bit 3 4262 #define ADDR4 UADDRbits.ADDR4 // bit 4 4263 #define ADDR5 UADDRbits.ADDR5 // bit 5 4264 #define ADDR6 UADDRbits.ADDR6 // bit 6 4265 4266 #define PPB0 UCFGbits.PPB0 // bit 0 4267 #define PPB1 UCFGbits.PPB1 // bit 1 4268 #define FSEN UCFGbits.FSEN // bit 2 4269 #define UPUEN UCFGbits.UPUEN // bit 4 4270 #define UTEYE UCFGbits.UTEYE // bit 7 4271 4272 #define SUSPND UCONbits.SUSPND // bit 1 4273 #define RESUME UCONbits.RESUME // bit 2 4274 #define USBEN UCONbits.USBEN // bit 3 4275 #define PKTDIS UCONbits.PKTDIS // bit 4 4276 #define SE0 UCONbits.SE0 // bit 5 4277 #define PPBRST UCONbits.PPBRST // bit 6 4278 4279 #define PIDEE UEIEbits.PIDEE // bit 0 4280 #define CRC5EE UEIEbits.CRC5EE // bit 1 4281 #define CRC16EE UEIEbits.CRC16EE // bit 2 4282 #define DFN8EE UEIEbits.DFN8EE // bit 3 4283 #define BTOEE UEIEbits.BTOEE // bit 4 4284 #define BTSEE UEIEbits.BTSEE // bit 7 4285 4286 #define PIDEF UEIRbits.PIDEF // bit 0 4287 #define CRC5EF UEIRbits.CRC5EF // bit 1 4288 #define CRC16EF UEIRbits.CRC16EF // bit 2 4289 #define DFN8EF UEIRbits.DFN8EF // bit 3 4290 #define BTOEF UEIRbits.BTOEF // bit 4 4291 #define BTSEF UEIRbits.BTSEF // bit 7 4292 4293 #define EPSTALL UEP0bits.EPSTALL // bit 0 4294 #define EPINEN UEP0bits.EPINEN // bit 1 4295 #define EPOUTEN UEP0bits.EPOUTEN // bit 2 4296 #define EPCONDIS UEP0bits.EPCONDIS // bit 3 4297 #define EPHSHK UEP0bits.EPHSHK // bit 4 4298 4299 #define FRM8 UFRMHbits.FRM8 // bit 0 4300 #define FRM9 UFRMHbits.FRM9 // bit 1 4301 #define FRM10 UFRMHbits.FRM10 // bit 2 4302 4303 #define FRM0 UFRMLbits.FRM0 // bit 0 4304 #define FRM1 UFRMLbits.FRM1 // bit 1 4305 #define FRM2 UFRMLbits.FRM2 // bit 2 4306 #define FRM3 UFRMLbits.FRM3 // bit 3 4307 #define FRM4 UFRMLbits.FRM4 // bit 4 4308 #define FRM5 UFRMLbits.FRM5 // bit 5 4309 #define FRM6 UFRMLbits.FRM6 // bit 6 4310 #define FRM7 UFRMLbits.FRM7 // bit 7 4311 4312 #define URSTIE UIEbits.URSTIE // bit 0 4313 #define UERRIE UIEbits.UERRIE // bit 1 4314 #define ACTVIE UIEbits.ACTVIE // bit 2 4315 #define TRNIE UIEbits.TRNIE // bit 3 4316 #define IDLEIE UIEbits.IDLEIE // bit 4 4317 #define STALLIE UIEbits.STALLIE // bit 5 4318 #define SOFIE UIEbits.SOFIE // bit 6 4319 4320 #define URSTIF UIRbits.URSTIF // bit 0 4321 #define UERRIF UIRbits.UERRIF // bit 1 4322 #define ACTVIF UIRbits.ACTVIF // bit 2 4323 #define TRNIF UIRbits.TRNIF // bit 3 4324 #define IDLEIF UIRbits.IDLEIF // bit 4 4325 #define STALLIF UIRbits.STALLIF // bit 5 4326 #define SOFIF UIRbits.SOFIF // bit 6 4327 4328 #define PPBI USTATbits.PPBI // bit 1 4329 #define DIR USTATbits.DIR // bit 2 4330 #define ENDP0 USTATbits.ENDP0 // bit 3 4331 #define ENDP1 USTATbits.ENDP1 // bit 4 4332 #define ENDP2 USTATbits.ENDP2 // bit 5 4333 #define ENDP3 USTATbits.ENDP3 // bit 6 4334 4335 #define VREGPM0 VREGCONbits.VREGPM0 // bit 0 4336 #define VREGPM1 VREGCONbits.VREGPM1 // bit 1 4337 4338 #define SWDTEN WDTCONbits.SWDTEN // bit 0 4339 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1 4340 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2 4341 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3 4342 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4 4343 #define WDTPS4 WDTCONbits.WDTPS4 // bit 5 4344 4345 #define WPUA3 WPUAbits.WPUA3 // bit 3 4346 #define WPUA4 WPUAbits.WPUA4 // bit 4 4347 #define WPUA5 WPUAbits.WPUA5 // bit 5 4348 4349 #define WPUB4 WPUBbits.WPUB4 // bit 4 4350 #define WPUB5 WPUBbits.WPUB5 // bit 5 4351 #define WPUB6 WPUBbits.WPUB6 // bit 6 4352 #define WPUB7 WPUBbits.WPUB7 // bit 7 4353 4354 #endif // #ifndef NO_BIT_DEFINES 4355 4356 #endif // #ifndef __PIC16F1458_H__ 4357