1 /* 2 * This declarations of the PIC18LF24K50 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:54 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 __PIC18LF24K50_H__ 26 #define __PIC18LF24K50_H__ 27 28 //============================================================================== 29 30 //============================================================================== 31 // 32 // Register Definitions 33 // 34 //============================================================================== 35 36 37 //============================================================================== 38 // SRCON1 Bits 39 40 extern __at(0x0F57) __sfr SRCON1; 41 42 typedef struct 43 { 44 unsigned SRRC1E : 1; 45 unsigned SRRC2E : 1; 46 unsigned SRRCKE : 1; 47 unsigned SRRPE : 1; 48 unsigned SRSC1E : 1; 49 unsigned SRSC2E : 1; 50 unsigned SRSCKE : 1; 51 unsigned SRSPE : 1; 52 } __SRCON1bits_t; 53 54 extern __at(0x0F57) volatile __SRCON1bits_t SRCON1bits; 55 56 #define _SRRC1E 0x01 57 #define _SRRC2E 0x02 58 #define _SRRCKE 0x04 59 #define _SRRPE 0x08 60 #define _SRSC1E 0x10 61 #define _SRSC2E 0x20 62 #define _SRSCKE 0x40 63 #define _SRSPE 0x80 64 65 //============================================================================== 66 67 68 //============================================================================== 69 // SRCON0 Bits 70 71 extern __at(0x0F58) __sfr SRCON0; 72 73 typedef union 74 { 75 struct 76 { 77 unsigned SRPR : 1; 78 unsigned SRPS : 1; 79 unsigned SRNQEN : 1; 80 unsigned SRQEN : 1; 81 unsigned SRCLK0 : 1; 82 unsigned SRCLK1 : 1; 83 unsigned SRCLK2 : 1; 84 unsigned SRLEN : 1; 85 }; 86 87 struct 88 { 89 unsigned : 4; 90 unsigned SRCLK : 3; 91 unsigned : 1; 92 }; 93 } __SRCON0bits_t; 94 95 extern __at(0x0F58) volatile __SRCON0bits_t SRCON0bits; 96 97 #define _SRPR 0x01 98 #define _SRPS 0x02 99 #define _SRNQEN 0x04 100 #define _SRQEN 0x08 101 #define _SRCLK0 0x10 102 #define _SRCLK1 0x20 103 #define _SRCLK2 0x40 104 #define _SRLEN 0x80 105 106 //============================================================================== 107 108 109 //============================================================================== 110 // CCPTMRS Bits 111 112 extern __at(0x0F59) __sfr CCPTMRS; 113 114 typedef struct 115 { 116 unsigned C1TSEL : 1; 117 unsigned : 1; 118 unsigned : 1; 119 unsigned C2TSEL : 1; 120 unsigned : 1; 121 unsigned : 1; 122 unsigned : 1; 123 unsigned : 1; 124 } __CCPTMRSbits_t; 125 126 extern __at(0x0F59) volatile __CCPTMRSbits_t CCPTMRSbits; 127 128 #define _C1TSEL 0x01 129 #define _C2TSEL 0x08 130 131 //============================================================================== 132 133 134 //============================================================================== 135 // ANSELA Bits 136 137 extern __at(0x0F5B) __sfr ANSELA; 138 139 typedef struct 140 { 141 unsigned ANSA0 : 1; 142 unsigned ANSA1 : 1; 143 unsigned ANSA2 : 1; 144 unsigned ANSA3 : 1; 145 unsigned : 1; 146 unsigned ANSA5 : 1; 147 unsigned : 1; 148 unsigned : 1; 149 } __ANSELAbits_t; 150 151 extern __at(0x0F5B) volatile __ANSELAbits_t ANSELAbits; 152 153 #define _ANSA0 0x01 154 #define _ANSA1 0x02 155 #define _ANSA2 0x04 156 #define _ANSA3 0x08 157 #define _ANSA5 0x20 158 159 //============================================================================== 160 161 162 //============================================================================== 163 // ANSELB Bits 164 165 extern __at(0x0F5C) __sfr ANSELB; 166 167 typedef union 168 { 169 struct 170 { 171 unsigned ANSB0 : 1; 172 unsigned ANSB1 : 1; 173 unsigned ANSB2 : 1; 174 unsigned ANSB3 : 1; 175 unsigned ANSB4 : 1; 176 unsigned ANSB5 : 1; 177 unsigned : 1; 178 unsigned : 1; 179 }; 180 181 struct 182 { 183 unsigned ANSB : 6; 184 unsigned : 2; 185 }; 186 } __ANSELBbits_t; 187 188 extern __at(0x0F5C) volatile __ANSELBbits_t ANSELBbits; 189 190 #define _ANSB0 0x01 191 #define _ANSB1 0x02 192 #define _ANSB2 0x04 193 #define _ANSB3 0x08 194 #define _ANSB4 0x10 195 #define _ANSB5 0x20 196 197 //============================================================================== 198 199 200 //============================================================================== 201 // ANSELC Bits 202 203 extern __at(0x0F5D) __sfr ANSELC; 204 205 typedef struct 206 { 207 unsigned : 1; 208 unsigned : 1; 209 unsigned ANSC2 : 1; 210 unsigned : 1; 211 unsigned : 1; 212 unsigned : 1; 213 unsigned ANSC6 : 1; 214 unsigned ANSC7 : 1; 215 } __ANSELCbits_t; 216 217 extern __at(0x0F5D) volatile __ANSELCbits_t ANSELCbits; 218 219 #define _ANSC2 0x04 220 #define _ANSC6 0x40 221 #define _ANSC7 0x80 222 223 //============================================================================== 224 225 226 //============================================================================== 227 // UCON Bits 228 229 extern __at(0x0F60) __sfr UCON; 230 231 typedef struct 232 { 233 unsigned : 1; 234 unsigned SUSPND : 1; 235 unsigned RESUME : 1; 236 unsigned USBEN : 1; 237 unsigned PKTDIS : 1; 238 unsigned SE0 : 1; 239 unsigned PPBRST : 1; 240 unsigned : 1; 241 } __UCONbits_t; 242 243 extern __at(0x0F60) volatile __UCONbits_t UCONbits; 244 245 #define _SUSPND 0x02 246 #define _RESUME 0x04 247 #define _USBEN 0x08 248 #define _PKTDIS 0x10 249 #define _SE0 0x20 250 #define _PPBRST 0x40 251 252 //============================================================================== 253 254 255 //============================================================================== 256 // USTAT Bits 257 258 extern __at(0x0F61) __sfr USTAT; 259 260 typedef union 261 { 262 struct 263 { 264 unsigned : 1; 265 unsigned PPBI : 1; 266 unsigned DIR : 1; 267 unsigned ENDP0 : 1; 268 unsigned ENDP1 : 1; 269 unsigned ENDP2 : 1; 270 unsigned ENDP3 : 1; 271 unsigned : 1; 272 }; 273 274 struct 275 { 276 unsigned : 3; 277 unsigned ENDP : 4; 278 unsigned : 1; 279 }; 280 } __USTATbits_t; 281 282 extern __at(0x0F61) volatile __USTATbits_t USTATbits; 283 284 #define _PPBI 0x02 285 #define _DIR 0x04 286 #define _ENDP0 0x08 287 #define _ENDP1 0x10 288 #define _ENDP2 0x20 289 #define _ENDP3 0x40 290 291 //============================================================================== 292 293 294 //============================================================================== 295 // UCFG Bits 296 297 extern __at(0x0F62) __sfr UCFG; 298 299 typedef union 300 { 301 struct 302 { 303 unsigned PPB0 : 1; 304 unsigned PPB1 : 1; 305 unsigned FSEN : 1; 306 unsigned UTRDIS : 1; 307 unsigned UPUEN : 1; 308 unsigned : 1; 309 unsigned UOEMON : 1; 310 unsigned UTEYE : 1; 311 }; 312 313 struct 314 { 315 unsigned PPB : 2; 316 unsigned : 6; 317 }; 318 } __UCFGbits_t; 319 320 extern __at(0x0F62) volatile __UCFGbits_t UCFGbits; 321 322 #define _PPB0 0x01 323 #define _PPB1 0x02 324 #define _FSEN 0x04 325 #define _UTRDIS 0x08 326 #define _UPUEN 0x10 327 #define _UOEMON 0x40 328 #define _UTEYE 0x80 329 330 //============================================================================== 331 332 333 //============================================================================== 334 // UADDR Bits 335 336 extern __at(0x0F63) __sfr UADDR; 337 338 typedef union 339 { 340 struct 341 { 342 unsigned ADDR0 : 1; 343 unsigned ADDR1 : 1; 344 unsigned ADDR2 : 1; 345 unsigned ADDR3 : 1; 346 unsigned ADDR4 : 1; 347 unsigned ADDR5 : 1; 348 unsigned ADDR6 : 1; 349 unsigned : 1; 350 }; 351 352 struct 353 { 354 unsigned ADDR : 7; 355 unsigned : 1; 356 }; 357 } __UADDRbits_t; 358 359 extern __at(0x0F63) volatile __UADDRbits_t UADDRbits; 360 361 #define _ADDR0 0x01 362 #define _ADDR1 0x02 363 #define _ADDR2 0x04 364 #define _ADDR3 0x08 365 #define _ADDR4 0x10 366 #define _ADDR5 0x20 367 #define _ADDR6 0x40 368 369 //============================================================================== 370 371 372 //============================================================================== 373 // UIE Bits 374 375 extern __at(0x0F64) __sfr UIE; 376 377 typedef struct 378 { 379 unsigned URSTIE : 1; 380 unsigned UERRIE : 1; 381 unsigned ACTVIE : 1; 382 unsigned TRNIE : 1; 383 unsigned IDLEIE : 1; 384 unsigned STALLIE : 1; 385 unsigned SOFIE : 1; 386 unsigned : 1; 387 } __UIEbits_t; 388 389 extern __at(0x0F64) volatile __UIEbits_t UIEbits; 390 391 #define _URSTIE 0x01 392 #define _UERRIE 0x02 393 #define _ACTVIE 0x04 394 #define _TRNIE 0x08 395 #define _IDLEIE 0x10 396 #define _STALLIE 0x20 397 #define _SOFIE 0x40 398 399 //============================================================================== 400 401 402 //============================================================================== 403 // UIR Bits 404 405 extern __at(0x0F65) __sfr UIR; 406 407 typedef struct 408 { 409 unsigned URSTIF : 1; 410 unsigned UERRIF : 1; 411 unsigned ACTVIF : 1; 412 unsigned TRNIF : 1; 413 unsigned IDLEIF : 1; 414 unsigned STALLIF : 1; 415 unsigned SOFIF : 1; 416 unsigned : 1; 417 } __UIRbits_t; 418 419 extern __at(0x0F65) volatile __UIRbits_t UIRbits; 420 421 #define _URSTIF 0x01 422 #define _UERRIF 0x02 423 #define _ACTVIF 0x04 424 #define _TRNIF 0x08 425 #define _IDLEIF 0x10 426 #define _STALLIF 0x20 427 #define _SOFIF 0x40 428 429 //============================================================================== 430 431 432 //============================================================================== 433 // UEIE Bits 434 435 extern __at(0x0F66) __sfr UEIE; 436 437 typedef struct 438 { 439 unsigned PIDEE : 1; 440 unsigned CRC5EE : 1; 441 unsigned CRC16EE : 1; 442 unsigned DFN8EE : 1; 443 unsigned BTOEE : 1; 444 unsigned : 1; 445 unsigned : 1; 446 unsigned BTSEE : 1; 447 } __UEIEbits_t; 448 449 extern __at(0x0F66) volatile __UEIEbits_t UEIEbits; 450 451 #define _PIDEE 0x01 452 #define _CRC5EE 0x02 453 #define _CRC16EE 0x04 454 #define _DFN8EE 0x08 455 #define _BTOEE 0x10 456 #define _BTSEE 0x80 457 458 //============================================================================== 459 460 461 //============================================================================== 462 // UEIR Bits 463 464 extern __at(0x0F67) __sfr UEIR; 465 466 typedef struct 467 { 468 unsigned PIDEF : 1; 469 unsigned CRC5EF : 1; 470 unsigned CRC16EF : 1; 471 unsigned DFN8EF : 1; 472 unsigned BTOEF : 1; 473 unsigned : 1; 474 unsigned : 1; 475 unsigned BTSEF : 1; 476 } __UEIRbits_t; 477 478 extern __at(0x0F67) volatile __UEIRbits_t UEIRbits; 479 480 #define _PIDEF 0x01 481 #define _CRC5EF 0x02 482 #define _CRC16EF 0x04 483 #define _DFN8EF 0x08 484 #define _BTOEF 0x10 485 #define _BTSEF 0x80 486 487 //============================================================================== 488 489 extern __at(0x0F68) __sfr UFRM; 490 491 //============================================================================== 492 // UFRML Bits 493 494 extern __at(0x0F68) __sfr UFRML; 495 496 typedef struct 497 { 498 unsigned FRM0 : 1; 499 unsigned FRM1 : 1; 500 unsigned FRM2 : 1; 501 unsigned FRM3 : 1; 502 unsigned FRM4 : 1; 503 unsigned FRM5 : 1; 504 unsigned FRM6 : 1; 505 unsigned FRM7 : 1; 506 } __UFRMLbits_t; 507 508 extern __at(0x0F68) volatile __UFRMLbits_t UFRMLbits; 509 510 #define _FRM0 0x01 511 #define _FRM1 0x02 512 #define _FRM2 0x04 513 #define _FRM3 0x08 514 #define _FRM4 0x10 515 #define _FRM5 0x20 516 #define _FRM6 0x40 517 #define _FRM7 0x80 518 519 //============================================================================== 520 521 522 //============================================================================== 523 // UFRMH Bits 524 525 extern __at(0x0F69) __sfr UFRMH; 526 527 typedef struct 528 { 529 unsigned FRM8 : 1; 530 unsigned FRM9 : 1; 531 unsigned FRM10 : 1; 532 unsigned : 1; 533 unsigned : 1; 534 unsigned : 1; 535 unsigned : 1; 536 unsigned : 1; 537 } __UFRMHbits_t; 538 539 extern __at(0x0F69) volatile __UFRMHbits_t UFRMHbits; 540 541 #define _FRM8 0x01 542 #define _FRM9 0x02 543 #define _FRM10 0x04 544 545 //============================================================================== 546 547 548 //============================================================================== 549 // UEP0 Bits 550 551 extern __at(0x0F6A) __sfr UEP0; 552 553 typedef struct 554 { 555 unsigned EPSTALL : 1; 556 unsigned EPINEN : 1; 557 unsigned EPOUTEN : 1; 558 unsigned EPCONDIS : 1; 559 unsigned EPHSHK : 1; 560 unsigned : 1; 561 unsigned : 1; 562 unsigned : 1; 563 } __UEP0bits_t; 564 565 extern __at(0x0F6A) volatile __UEP0bits_t UEP0bits; 566 567 #define _EPSTALL 0x01 568 #define _EPINEN 0x02 569 #define _EPOUTEN 0x04 570 #define _EPCONDIS 0x08 571 #define _EPHSHK 0x10 572 573 //============================================================================== 574 575 576 //============================================================================== 577 // UEP1 Bits 578 579 extern __at(0x0F6B) __sfr UEP1; 580 581 typedef struct 582 { 583 unsigned EPSTALL : 1; 584 unsigned EPINEN : 1; 585 unsigned EPOUTEN : 1; 586 unsigned EPCONDIS : 1; 587 unsigned EPHSHK : 1; 588 unsigned : 1; 589 unsigned : 1; 590 unsigned : 1; 591 } __UEP1bits_t; 592 593 extern __at(0x0F6B) volatile __UEP1bits_t UEP1bits; 594 595 #define _UEP1_EPSTALL 0x01 596 #define _UEP1_EPINEN 0x02 597 #define _UEP1_EPOUTEN 0x04 598 #define _UEP1_EPCONDIS 0x08 599 #define _UEP1_EPHSHK 0x10 600 601 //============================================================================== 602 603 604 //============================================================================== 605 // UEP2 Bits 606 607 extern __at(0x0F6C) __sfr UEP2; 608 609 typedef struct 610 { 611 unsigned EPSTALL : 1; 612 unsigned EPINEN : 1; 613 unsigned EPOUTEN : 1; 614 unsigned EPCONDIS : 1; 615 unsigned EPHSHK : 1; 616 unsigned : 1; 617 unsigned : 1; 618 unsigned : 1; 619 } __UEP2bits_t; 620 621 extern __at(0x0F6C) volatile __UEP2bits_t UEP2bits; 622 623 #define _UEP2_EPSTALL 0x01 624 #define _UEP2_EPINEN 0x02 625 #define _UEP2_EPOUTEN 0x04 626 #define _UEP2_EPCONDIS 0x08 627 #define _UEP2_EPHSHK 0x10 628 629 //============================================================================== 630 631 632 //============================================================================== 633 // UEP3 Bits 634 635 extern __at(0x0F6D) __sfr UEP3; 636 637 typedef struct 638 { 639 unsigned EPSTALL : 1; 640 unsigned EPINEN : 1; 641 unsigned EPOUTEN : 1; 642 unsigned EPCONDIS : 1; 643 unsigned EPHSHK : 1; 644 unsigned : 1; 645 unsigned : 1; 646 unsigned : 1; 647 } __UEP3bits_t; 648 649 extern __at(0x0F6D) volatile __UEP3bits_t UEP3bits; 650 651 #define _UEP3_EPSTALL 0x01 652 #define _UEP3_EPINEN 0x02 653 #define _UEP3_EPOUTEN 0x04 654 #define _UEP3_EPCONDIS 0x08 655 #define _UEP3_EPHSHK 0x10 656 657 //============================================================================== 658 659 660 //============================================================================== 661 // UEP4 Bits 662 663 extern __at(0x0F6E) __sfr UEP4; 664 665 typedef struct 666 { 667 unsigned EPSTALL : 1; 668 unsigned EPINEN : 1; 669 unsigned EPOUTEN : 1; 670 unsigned EPCONDIS : 1; 671 unsigned EPHSHK : 1; 672 unsigned : 1; 673 unsigned : 1; 674 unsigned : 1; 675 } __UEP4bits_t; 676 677 extern __at(0x0F6E) volatile __UEP4bits_t UEP4bits; 678 679 #define _UEP4_EPSTALL 0x01 680 #define _UEP4_EPINEN 0x02 681 #define _UEP4_EPOUTEN 0x04 682 #define _UEP4_EPCONDIS 0x08 683 #define _UEP4_EPHSHK 0x10 684 685 //============================================================================== 686 687 688 //============================================================================== 689 // UEP5 Bits 690 691 extern __at(0x0F6F) __sfr UEP5; 692 693 typedef struct 694 { 695 unsigned EPSTALL : 1; 696 unsigned EPINEN : 1; 697 unsigned EPOUTEN : 1; 698 unsigned EPCONDIS : 1; 699 unsigned EPHSHK : 1; 700 unsigned : 1; 701 unsigned : 1; 702 unsigned : 1; 703 } __UEP5bits_t; 704 705 extern __at(0x0F6F) volatile __UEP5bits_t UEP5bits; 706 707 #define _UEP5_EPSTALL 0x01 708 #define _UEP5_EPINEN 0x02 709 #define _UEP5_EPOUTEN 0x04 710 #define _UEP5_EPCONDIS 0x08 711 #define _UEP5_EPHSHK 0x10 712 713 //============================================================================== 714 715 716 //============================================================================== 717 // UEP6 Bits 718 719 extern __at(0x0F70) __sfr UEP6; 720 721 typedef struct 722 { 723 unsigned EPSTALL : 1; 724 unsigned EPINEN : 1; 725 unsigned EPOUTEN : 1; 726 unsigned EPCONDIS : 1; 727 unsigned EPHSHK : 1; 728 unsigned : 1; 729 unsigned : 1; 730 unsigned : 1; 731 } __UEP6bits_t; 732 733 extern __at(0x0F70) volatile __UEP6bits_t UEP6bits; 734 735 #define _UEP6_EPSTALL 0x01 736 #define _UEP6_EPINEN 0x02 737 #define _UEP6_EPOUTEN 0x04 738 #define _UEP6_EPCONDIS 0x08 739 #define _UEP6_EPHSHK 0x10 740 741 //============================================================================== 742 743 744 //============================================================================== 745 // UEP7 Bits 746 747 extern __at(0x0F71) __sfr UEP7; 748 749 typedef struct 750 { 751 unsigned EPSTALL : 1; 752 unsigned EPINEN : 1; 753 unsigned EPOUTEN : 1; 754 unsigned EPCONDIS : 1; 755 unsigned EPHSHK : 1; 756 unsigned : 1; 757 unsigned : 1; 758 unsigned : 1; 759 } __UEP7bits_t; 760 761 extern __at(0x0F71) volatile __UEP7bits_t UEP7bits; 762 763 #define _UEP7_EPSTALL 0x01 764 #define _UEP7_EPINEN 0x02 765 #define _UEP7_EPOUTEN 0x04 766 #define _UEP7_EPCONDIS 0x08 767 #define _UEP7_EPHSHK 0x10 768 769 //============================================================================== 770 771 772 //============================================================================== 773 // UEP8 Bits 774 775 extern __at(0x0F72) __sfr UEP8; 776 777 typedef struct 778 { 779 unsigned EPSTALL : 1; 780 unsigned EPINEN : 1; 781 unsigned EPOUTEN : 1; 782 unsigned EPCONDIS : 1; 783 unsigned EPHSHK : 1; 784 unsigned : 1; 785 unsigned : 1; 786 unsigned : 1; 787 } __UEP8bits_t; 788 789 extern __at(0x0F72) volatile __UEP8bits_t UEP8bits; 790 791 #define _UEP8_EPSTALL 0x01 792 #define _UEP8_EPINEN 0x02 793 #define _UEP8_EPOUTEN 0x04 794 #define _UEP8_EPCONDIS 0x08 795 #define _UEP8_EPHSHK 0x10 796 797 //============================================================================== 798 799 800 //============================================================================== 801 // UEP9 Bits 802 803 extern __at(0x0F73) __sfr UEP9; 804 805 typedef struct 806 { 807 unsigned EPSTALL : 1; 808 unsigned EPINEN : 1; 809 unsigned EPOUTEN : 1; 810 unsigned EPCONDIS : 1; 811 unsigned EPHSHK : 1; 812 unsigned : 1; 813 unsigned : 1; 814 unsigned : 1; 815 } __UEP9bits_t; 816 817 extern __at(0x0F73) volatile __UEP9bits_t UEP9bits; 818 819 #define _UEP9_EPSTALL 0x01 820 #define _UEP9_EPINEN 0x02 821 #define _UEP9_EPOUTEN 0x04 822 #define _UEP9_EPCONDIS 0x08 823 #define _UEP9_EPHSHK 0x10 824 825 //============================================================================== 826 827 828 //============================================================================== 829 // UEP10 Bits 830 831 extern __at(0x0F74) __sfr UEP10; 832 833 typedef struct 834 { 835 unsigned EPSTALL : 1; 836 unsigned EPINEN : 1; 837 unsigned EPOUTEN : 1; 838 unsigned EPCONDIS : 1; 839 unsigned EPHSHK : 1; 840 unsigned : 1; 841 unsigned : 1; 842 unsigned : 1; 843 } __UEP10bits_t; 844 845 extern __at(0x0F74) volatile __UEP10bits_t UEP10bits; 846 847 #define _UEP10_EPSTALL 0x01 848 #define _UEP10_EPINEN 0x02 849 #define _UEP10_EPOUTEN 0x04 850 #define _UEP10_EPCONDIS 0x08 851 #define _UEP10_EPHSHK 0x10 852 853 //============================================================================== 854 855 856 //============================================================================== 857 // UEP11 Bits 858 859 extern __at(0x0F75) __sfr UEP11; 860 861 typedef struct 862 { 863 unsigned EPSTALL : 1; 864 unsigned EPINEN : 1; 865 unsigned EPOUTEN : 1; 866 unsigned EPCONDIS : 1; 867 unsigned EPHSHK : 1; 868 unsigned : 1; 869 unsigned : 1; 870 unsigned : 1; 871 } __UEP11bits_t; 872 873 extern __at(0x0F75) volatile __UEP11bits_t UEP11bits; 874 875 #define _UEP11_EPSTALL 0x01 876 #define _UEP11_EPINEN 0x02 877 #define _UEP11_EPOUTEN 0x04 878 #define _UEP11_EPCONDIS 0x08 879 #define _UEP11_EPHSHK 0x10 880 881 //============================================================================== 882 883 884 //============================================================================== 885 // UEP12 Bits 886 887 extern __at(0x0F76) __sfr UEP12; 888 889 typedef struct 890 { 891 unsigned EPSTALL : 1; 892 unsigned EPINEN : 1; 893 unsigned EPOUTEN : 1; 894 unsigned EPCONDIS : 1; 895 unsigned EPHSHK : 1; 896 unsigned : 1; 897 unsigned : 1; 898 unsigned : 1; 899 } __UEP12bits_t; 900 901 extern __at(0x0F76) volatile __UEP12bits_t UEP12bits; 902 903 #define _UEP12_EPSTALL 0x01 904 #define _UEP12_EPINEN 0x02 905 #define _UEP12_EPOUTEN 0x04 906 #define _UEP12_EPCONDIS 0x08 907 #define _UEP12_EPHSHK 0x10 908 909 //============================================================================== 910 911 912 //============================================================================== 913 // UEP13 Bits 914 915 extern __at(0x0F77) __sfr UEP13; 916 917 typedef struct 918 { 919 unsigned EPSTALL : 1; 920 unsigned EPINEN : 1; 921 unsigned EPOUTEN : 1; 922 unsigned EPCONDIS : 1; 923 unsigned EPHSHK : 1; 924 unsigned : 1; 925 unsigned : 1; 926 unsigned : 1; 927 } __UEP13bits_t; 928 929 extern __at(0x0F77) volatile __UEP13bits_t UEP13bits; 930 931 #define _UEP13_EPSTALL 0x01 932 #define _UEP13_EPINEN 0x02 933 #define _UEP13_EPOUTEN 0x04 934 #define _UEP13_EPCONDIS 0x08 935 #define _UEP13_EPHSHK 0x10 936 937 //============================================================================== 938 939 940 //============================================================================== 941 // UEP14 Bits 942 943 extern __at(0x0F78) __sfr UEP14; 944 945 typedef struct 946 { 947 unsigned EPSTALL : 1; 948 unsigned EPINEN : 1; 949 unsigned EPOUTEN : 1; 950 unsigned EPCONDIS : 1; 951 unsigned EPHSHK : 1; 952 unsigned : 1; 953 unsigned : 1; 954 unsigned : 1; 955 } __UEP14bits_t; 956 957 extern __at(0x0F78) volatile __UEP14bits_t UEP14bits; 958 959 #define _UEP14_EPSTALL 0x01 960 #define _UEP14_EPINEN 0x02 961 #define _UEP14_EPOUTEN 0x04 962 #define _UEP14_EPCONDIS 0x08 963 #define _UEP14_EPHSHK 0x10 964 965 //============================================================================== 966 967 968 //============================================================================== 969 // UEP15 Bits 970 971 extern __at(0x0F79) __sfr UEP15; 972 973 typedef struct 974 { 975 unsigned EPSTALL : 1; 976 unsigned EPINEN : 1; 977 unsigned EPOUTEN : 1; 978 unsigned EPCONDIS : 1; 979 unsigned EPHSHK : 1; 980 unsigned : 1; 981 unsigned : 1; 982 unsigned : 1; 983 } __UEP15bits_t; 984 985 extern __at(0x0F79) volatile __UEP15bits_t UEP15bits; 986 987 #define _UEP15_EPSTALL 0x01 988 #define _UEP15_EPINEN 0x02 989 #define _UEP15_EPOUTEN 0x04 990 #define _UEP15_EPCONDIS 0x08 991 #define _UEP15_EPHSHK 0x10 992 993 //============================================================================== 994 995 996 //============================================================================== 997 // SLRCON Bits 998 999 extern __at(0x0F7A) __sfr SLRCON; 1000 1001 typedef struct 1002 { 1003 unsigned SLRA : 1; 1004 unsigned SLRB : 1; 1005 unsigned SLRC : 1; 1006 unsigned : 1; 1007 unsigned : 1; 1008 unsigned : 1; 1009 unsigned : 1; 1010 unsigned : 1; 1011 } __SLRCONbits_t; 1012 1013 extern __at(0x0F7A) volatile __SLRCONbits_t SLRCONbits; 1014 1015 #define _SLRA 0x01 1016 #define _SLRB 0x02 1017 #define _SLRC 0x04 1018 1019 //============================================================================== 1020 1021 1022 //============================================================================== 1023 // VREFCON2 Bits 1024 1025 extern __at(0x0F7B) __sfr VREFCON2; 1026 1027 typedef union 1028 { 1029 struct 1030 { 1031 unsigned DACR0 : 1; 1032 unsigned DACR1 : 1; 1033 unsigned DACR2 : 1; 1034 unsigned DACR3 : 1; 1035 unsigned DACR4 : 1; 1036 unsigned : 1; 1037 unsigned : 1; 1038 unsigned : 1; 1039 }; 1040 1041 struct 1042 { 1043 unsigned DACR : 5; 1044 unsigned : 3; 1045 }; 1046 } __VREFCON2bits_t; 1047 1048 extern __at(0x0F7B) volatile __VREFCON2bits_t VREFCON2bits; 1049 1050 #define _DACR0 0x01 1051 #define _DACR1 0x02 1052 #define _DACR2 0x04 1053 #define _DACR3 0x08 1054 #define _DACR4 0x10 1055 1056 //============================================================================== 1057 1058 1059 //============================================================================== 1060 // VREFCON1 Bits 1061 1062 extern __at(0x0F7C) __sfr VREFCON1; 1063 1064 typedef union 1065 { 1066 struct 1067 { 1068 unsigned DACNSS : 1; 1069 unsigned : 1; 1070 unsigned DACPSS0 : 1; 1071 unsigned DACPSS1 : 1; 1072 unsigned : 1; 1073 unsigned DACOE : 1; 1074 unsigned DACLPS : 1; 1075 unsigned DACEN : 1; 1076 }; 1077 1078 struct 1079 { 1080 unsigned : 2; 1081 unsigned DACPSS : 2; 1082 unsigned : 4; 1083 }; 1084 } __VREFCON1bits_t; 1085 1086 extern __at(0x0F7C) volatile __VREFCON1bits_t VREFCON1bits; 1087 1088 #define _DACNSS 0x01 1089 #define _DACPSS0 0x04 1090 #define _DACPSS1 0x08 1091 #define _DACOE 0x20 1092 #define _DACLPS 0x40 1093 #define _DACEN 0x80 1094 1095 //============================================================================== 1096 1097 1098 //============================================================================== 1099 // VREFCON0 Bits 1100 1101 extern __at(0x0F7D) __sfr VREFCON0; 1102 1103 typedef union 1104 { 1105 struct 1106 { 1107 unsigned : 1; 1108 unsigned : 1; 1109 unsigned TSRNG : 1; 1110 unsigned TSEN : 1; 1111 unsigned FVRS0 : 1; 1112 unsigned FVRS1 : 1; 1113 unsigned FVRST : 1; 1114 unsigned FVREN : 1; 1115 }; 1116 1117 struct 1118 { 1119 unsigned : 4; 1120 unsigned FVRS : 2; 1121 unsigned : 2; 1122 }; 1123 } __VREFCON0bits_t; 1124 1125 extern __at(0x0F7D) volatile __VREFCON0bits_t VREFCON0bits; 1126 1127 #define _TSRNG 0x04 1128 #define _TSEN 0x08 1129 #define _FVRS0 0x10 1130 #define _FVRS1 0x20 1131 #define _FVRST 0x40 1132 #define _FVREN 0x80 1133 1134 //============================================================================== 1135 1136 1137 //============================================================================== 1138 // PMD0 Bits 1139 1140 extern __at(0x0F7E) __sfr PMD0; 1141 1142 typedef union 1143 { 1144 struct 1145 { 1146 unsigned TMR1MD : 1; 1147 unsigned TMR2MD : 1; 1148 unsigned TMR3MD : 1; 1149 unsigned : 1; 1150 unsigned ACTMD : 1; 1151 unsigned USBMD : 1; 1152 unsigned UARTMD : 1; 1153 unsigned : 1; 1154 }; 1155 1156 struct 1157 { 1158 unsigned : 1; 1159 unsigned : 1; 1160 unsigned : 1; 1161 unsigned : 1; 1162 unsigned STMD : 1; 1163 unsigned : 1; 1164 unsigned UART1MD : 1; 1165 unsigned : 1; 1166 }; 1167 } __PMD0bits_t; 1168 1169 extern __at(0x0F7E) volatile __PMD0bits_t PMD0bits; 1170 1171 #define _TMR1MD 0x01 1172 #define _TMR2MD 0x02 1173 #define _TMR3MD 0x04 1174 #define _ACTMD 0x10 1175 #define _STMD 0x10 1176 #define _USBMD 0x20 1177 #define _UARTMD 0x40 1178 #define _UART1MD 0x40 1179 1180 //============================================================================== 1181 1182 1183 //============================================================================== 1184 // PMD1 Bits 1185 1186 extern __at(0x0F7F) __sfr PMD1; 1187 1188 typedef union 1189 { 1190 struct 1191 { 1192 unsigned CCP1MD : 1; 1193 unsigned CCP2MD : 1; 1194 unsigned ADCMD : 1; 1195 unsigned CMP1MD : 1; 1196 unsigned CMP2MD : 1; 1197 unsigned CTMUMD : 1; 1198 unsigned MSSPMD : 1; 1199 unsigned : 1; 1200 }; 1201 1202 struct 1203 { 1204 unsigned : 1; 1205 unsigned : 1; 1206 unsigned : 1; 1207 unsigned : 1; 1208 unsigned : 1; 1209 unsigned : 1; 1210 unsigned SSP1MD : 1; 1211 unsigned : 1; 1212 }; 1213 1214 struct 1215 { 1216 unsigned : 1; 1217 unsigned : 1; 1218 unsigned : 1; 1219 unsigned : 1; 1220 unsigned : 1; 1221 unsigned : 1; 1222 unsigned MSSP1MD : 1; 1223 unsigned : 1; 1224 }; 1225 } __PMD1bits_t; 1226 1227 extern __at(0x0F7F) volatile __PMD1bits_t PMD1bits; 1228 1229 #define _CCP1MD 0x01 1230 #define _CCP2MD 0x02 1231 #define _ADCMD 0x04 1232 #define _CMP1MD 0x08 1233 #define _CMP2MD 0x10 1234 #define _CTMUMD 0x20 1235 #define _MSSPMD 0x40 1236 #define _SSP1MD 0x40 1237 #define _MSSP1MD 0x40 1238 1239 //============================================================================== 1240 1241 1242 //============================================================================== 1243 // PORTA Bits 1244 1245 extern __at(0x0F80) __sfr PORTA; 1246 1247 typedef union 1248 { 1249 struct 1250 { 1251 unsigned RA0 : 1; 1252 unsigned RA1 : 1; 1253 unsigned RA2 : 1; 1254 unsigned RA3 : 1; 1255 unsigned RA4 : 1; 1256 unsigned RA5 : 1; 1257 unsigned RA6 : 1; 1258 unsigned RA7 : 1; 1259 }; 1260 1261 struct 1262 { 1263 unsigned AN0 : 1; 1264 unsigned AN1 : 1; 1265 unsigned AN2 : 1; 1266 unsigned AN3 : 1; 1267 unsigned T0CKI : 1; 1268 unsigned AN4 : 1; 1269 unsigned OSC2 : 1; 1270 unsigned : 1; 1271 }; 1272 1273 struct 1274 { 1275 unsigned : 1; 1276 unsigned : 1; 1277 unsigned VREFM : 1; 1278 unsigned VREFP : 1; 1279 unsigned : 1; 1280 unsigned LVDIN : 1; 1281 unsigned : 1; 1282 unsigned : 1; 1283 }; 1284 1285 struct 1286 { 1287 unsigned : 1; 1288 unsigned : 1; 1289 unsigned : 1; 1290 unsigned : 1; 1291 unsigned : 1; 1292 unsigned HLVDIN : 1; 1293 unsigned : 1; 1294 unsigned : 1; 1295 }; 1296 } __PORTAbits_t; 1297 1298 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits; 1299 1300 #define _PORTA_RA0 0x01 1301 #define _PORTA_AN0 0x01 1302 #define _PORTA_RA1 0x02 1303 #define _PORTA_AN1 0x02 1304 #define _PORTA_RA2 0x04 1305 #define _PORTA_AN2 0x04 1306 #define _PORTA_VREFM 0x04 1307 #define _PORTA_RA3 0x08 1308 #define _PORTA_AN3 0x08 1309 #define _PORTA_VREFP 0x08 1310 #define _PORTA_RA4 0x10 1311 #define _PORTA_T0CKI 0x10 1312 #define _PORTA_RA5 0x20 1313 #define _PORTA_AN4 0x20 1314 #define _PORTA_LVDIN 0x20 1315 #define _PORTA_HLVDIN 0x20 1316 #define _PORTA_RA6 0x40 1317 #define _PORTA_OSC2 0x40 1318 #define _PORTA_RA7 0x80 1319 1320 //============================================================================== 1321 1322 1323 //============================================================================== 1324 // PORTB Bits 1325 1326 extern __at(0x0F81) __sfr PORTB; 1327 1328 typedef union 1329 { 1330 struct 1331 { 1332 unsigned RB0 : 1; 1333 unsigned RB1 : 1; 1334 unsigned RB2 : 1; 1335 unsigned RB3 : 1; 1336 unsigned RB4 : 1; 1337 unsigned RB5 : 1; 1338 unsigned RB6 : 1; 1339 unsigned RB7 : 1; 1340 }; 1341 1342 struct 1343 { 1344 unsigned INT0 : 1; 1345 unsigned INT1 : 1; 1346 unsigned INT2 : 1; 1347 unsigned : 1; 1348 unsigned : 1; 1349 unsigned PGM : 1; 1350 unsigned PGC : 1; 1351 unsigned PGD : 1; 1352 }; 1353 1354 struct 1355 { 1356 unsigned INT : 3; 1357 unsigned : 5; 1358 }; 1359 } __PORTBbits_t; 1360 1361 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits; 1362 1363 #define _PORTB_RB0 0x01 1364 #define _PORTB_INT0 0x01 1365 #define _PORTB_RB1 0x02 1366 #define _PORTB_INT1 0x02 1367 #define _PORTB_RB2 0x04 1368 #define _PORTB_INT2 0x04 1369 #define _PORTB_RB3 0x08 1370 #define _PORTB_RB4 0x10 1371 #define _PORTB_RB5 0x20 1372 #define _PORTB_PGM 0x20 1373 #define _PORTB_RB6 0x40 1374 #define _PORTB_PGC 0x40 1375 #define _PORTB_RB7 0x80 1376 #define _PORTB_PGD 0x80 1377 1378 //============================================================================== 1379 1380 1381 //============================================================================== 1382 // PORTC Bits 1383 1384 extern __at(0x0F82) __sfr PORTC; 1385 1386 typedef union 1387 { 1388 struct 1389 { 1390 unsigned RC0 : 1; 1391 unsigned RC1 : 1; 1392 unsigned RC2 : 1; 1393 unsigned : 1; 1394 unsigned RC4 : 1; 1395 unsigned RC5 : 1; 1396 unsigned RC6 : 1; 1397 unsigned RC7 : 1; 1398 }; 1399 1400 struct 1401 { 1402 unsigned T1OSO : 1; 1403 unsigned T1OSI : 1; 1404 unsigned CCP1 : 1; 1405 unsigned : 1; 1406 unsigned : 1; 1407 unsigned : 1; 1408 unsigned TX : 1; 1409 unsigned RX : 1; 1410 }; 1411 1412 struct 1413 { 1414 unsigned T13CKI : 1; 1415 unsigned : 1; 1416 unsigned P1A : 1; 1417 unsigned : 1; 1418 unsigned : 1; 1419 unsigned : 1; 1420 unsigned CK : 1; 1421 unsigned : 1; 1422 }; 1423 } __PORTCbits_t; 1424 1425 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits; 1426 1427 #define _PORTC_RC0 0x01 1428 #define _PORTC_T1OSO 0x01 1429 #define _PORTC_T13CKI 0x01 1430 #define _PORTC_RC1 0x02 1431 #define _PORTC_T1OSI 0x02 1432 #define _PORTC_RC2 0x04 1433 #define _PORTC_CCP1 0x04 1434 #define _PORTC_P1A 0x04 1435 #define _PORTC_RC4 0x10 1436 #define _PORTC_RC5 0x20 1437 #define _PORTC_RC6 0x40 1438 #define _PORTC_TX 0x40 1439 #define _PORTC_CK 0x40 1440 #define _PORTC_RC7 0x80 1441 #define _PORTC_RX 0x80 1442 1443 //============================================================================== 1444 1445 1446 //============================================================================== 1447 // PORTE Bits 1448 1449 extern __at(0x0F84) __sfr PORTE; 1450 1451 typedef struct 1452 { 1453 unsigned : 1; 1454 unsigned : 1; 1455 unsigned : 1; 1456 unsigned RE3 : 1; 1457 unsigned : 1; 1458 unsigned : 1; 1459 unsigned : 1; 1460 unsigned : 1; 1461 } __PORTEbits_t; 1462 1463 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits; 1464 1465 #define _RE3 0x08 1466 1467 //============================================================================== 1468 1469 1470 //============================================================================== 1471 // WPUB Bits 1472 1473 extern __at(0x0F85) __sfr WPUB; 1474 1475 typedef struct 1476 { 1477 unsigned WPUB0 : 1; 1478 unsigned WPUB1 : 1; 1479 unsigned WPUB2 : 1; 1480 unsigned WPUB3 : 1; 1481 unsigned WPUB4 : 1; 1482 unsigned WPUB5 : 1; 1483 unsigned WPUB6 : 1; 1484 unsigned WPUB7 : 1; 1485 } __WPUBbits_t; 1486 1487 extern __at(0x0F85) volatile __WPUBbits_t WPUBbits; 1488 1489 #define _WPUB0 0x01 1490 #define _WPUB1 0x02 1491 #define _WPUB2 0x04 1492 #define _WPUB3 0x08 1493 #define _WPUB4 0x10 1494 #define _WPUB5 0x20 1495 #define _WPUB6 0x40 1496 #define _WPUB7 0x80 1497 1498 //============================================================================== 1499 1500 1501 //============================================================================== 1502 // IOCB Bits 1503 1504 extern __at(0x0F86) __sfr IOCB; 1505 1506 typedef struct 1507 { 1508 unsigned : 1; 1509 unsigned : 1; 1510 unsigned : 1; 1511 unsigned : 1; 1512 unsigned IOCB4 : 1; 1513 unsigned IOCB5 : 1; 1514 unsigned IOCB6 : 1; 1515 unsigned IOCB7 : 1; 1516 } __IOCBbits_t; 1517 1518 extern __at(0x0F86) volatile __IOCBbits_t IOCBbits; 1519 1520 #define _IOCB4 0x10 1521 #define _IOCB5 0x20 1522 #define _IOCB6 0x40 1523 #define _IOCB7 0x80 1524 1525 //============================================================================== 1526 1527 1528 //============================================================================== 1529 // IOCC Bits 1530 1531 extern __at(0x0F87) __sfr IOCC; 1532 1533 typedef struct 1534 { 1535 unsigned IOCC0 : 1; 1536 unsigned IOCC1 : 1; 1537 unsigned IOCC2 : 1; 1538 unsigned : 1; 1539 unsigned IOCC4 : 1; 1540 unsigned IOCC5 : 1; 1541 unsigned IOCC6 : 1; 1542 unsigned IOCC7 : 1; 1543 } __IOCCbits_t; 1544 1545 extern __at(0x0F87) volatile __IOCCbits_t IOCCbits; 1546 1547 #define _IOCC0 0x01 1548 #define _IOCC1 0x02 1549 #define _IOCC2 0x04 1550 #define _IOCC4 0x10 1551 #define _IOCC5 0x20 1552 #define _IOCC6 0x40 1553 #define _IOCC7 0x80 1554 1555 //============================================================================== 1556 1557 1558 //============================================================================== 1559 // CTMUICON Bits 1560 1561 extern __at(0x0F88) __sfr CTMUICON; 1562 1563 typedef union 1564 { 1565 struct 1566 { 1567 unsigned IRNG0 : 1; 1568 unsigned IRNG1 : 1; 1569 unsigned ITRIM0 : 1; 1570 unsigned ITRIM1 : 1; 1571 unsigned ITRIM2 : 1; 1572 unsigned ITRIM3 : 1; 1573 unsigned ITRIM4 : 1; 1574 unsigned ITRIM5 : 1; 1575 }; 1576 1577 struct 1578 { 1579 unsigned IRNG : 2; 1580 unsigned : 6; 1581 }; 1582 1583 struct 1584 { 1585 unsigned : 2; 1586 unsigned ITRIM : 6; 1587 }; 1588 } __CTMUICONbits_t; 1589 1590 extern __at(0x0F88) volatile __CTMUICONbits_t CTMUICONbits; 1591 1592 #define _IRNG0 0x01 1593 #define _IRNG1 0x02 1594 #define _ITRIM0 0x04 1595 #define _ITRIM1 0x08 1596 #define _ITRIM2 0x10 1597 #define _ITRIM3 0x20 1598 #define _ITRIM4 0x40 1599 #define _ITRIM5 0x80 1600 1601 //============================================================================== 1602 1603 1604 //============================================================================== 1605 // LATA Bits 1606 1607 extern __at(0x0F89) __sfr LATA; 1608 1609 typedef struct 1610 { 1611 unsigned LATA0 : 1; 1612 unsigned LATA1 : 1; 1613 unsigned LATA2 : 1; 1614 unsigned LATA3 : 1; 1615 unsigned LATA4 : 1; 1616 unsigned LATA5 : 1; 1617 unsigned LATA6 : 1; 1618 unsigned LATA7 : 1; 1619 } __LATAbits_t; 1620 1621 extern __at(0x0F89) volatile __LATAbits_t LATAbits; 1622 1623 #define _LATA0 0x01 1624 #define _LATA1 0x02 1625 #define _LATA2 0x04 1626 #define _LATA3 0x08 1627 #define _LATA4 0x10 1628 #define _LATA5 0x20 1629 #define _LATA6 0x40 1630 #define _LATA7 0x80 1631 1632 //============================================================================== 1633 1634 1635 //============================================================================== 1636 // LATB Bits 1637 1638 extern __at(0x0F8A) __sfr LATB; 1639 1640 typedef struct 1641 { 1642 unsigned LATB0 : 1; 1643 unsigned LATB1 : 1; 1644 unsigned LATB2 : 1; 1645 unsigned LATB3 : 1; 1646 unsigned LATB4 : 1; 1647 unsigned LATB5 : 1; 1648 unsigned LATB6 : 1; 1649 unsigned LATB7 : 1; 1650 } __LATBbits_t; 1651 1652 extern __at(0x0F8A) volatile __LATBbits_t LATBbits; 1653 1654 #define _LATB0 0x01 1655 #define _LATB1 0x02 1656 #define _LATB2 0x04 1657 #define _LATB3 0x08 1658 #define _LATB4 0x10 1659 #define _LATB5 0x20 1660 #define _LATB6 0x40 1661 #define _LATB7 0x80 1662 1663 //============================================================================== 1664 1665 1666 //============================================================================== 1667 // LATC Bits 1668 1669 extern __at(0x0F8B) __sfr LATC; 1670 1671 typedef struct 1672 { 1673 unsigned LATC0 : 1; 1674 unsigned LATC1 : 1; 1675 unsigned LATC2 : 1; 1676 unsigned : 1; 1677 unsigned LATC4 : 1; 1678 unsigned LATC5 : 1; 1679 unsigned LATC6 : 1; 1680 unsigned LATC7 : 1; 1681 } __LATCbits_t; 1682 1683 extern __at(0x0F8B) volatile __LATCbits_t LATCbits; 1684 1685 #define _LATC0 0x01 1686 #define _LATC1 0x02 1687 #define _LATC2 0x04 1688 #define _LATC4 0x10 1689 #define _LATC5 0x20 1690 #define _LATC6 0x40 1691 #define _LATC7 0x80 1692 1693 //============================================================================== 1694 1695 1696 //============================================================================== 1697 // CTMUCON1 Bits 1698 1699 extern __at(0x0F8E) __sfr CTMUCON1; 1700 1701 typedef union 1702 { 1703 struct 1704 { 1705 unsigned EDG1STAT : 1; 1706 unsigned EDG2STAT : 1; 1707 unsigned EDG1SEL0 : 1; 1708 unsigned EDG1SEL1 : 1; 1709 unsigned EDG1POL : 1; 1710 unsigned EDG2SEL0 : 1; 1711 unsigned EDG2SEL1 : 1; 1712 unsigned EDG2POL : 1; 1713 }; 1714 1715 struct 1716 { 1717 unsigned : 2; 1718 unsigned EDG1SEL : 2; 1719 unsigned : 4; 1720 }; 1721 1722 struct 1723 { 1724 unsigned : 5; 1725 unsigned EDG2SEL : 2; 1726 unsigned : 1; 1727 }; 1728 } __CTMUCON1bits_t; 1729 1730 extern __at(0x0F8E) volatile __CTMUCON1bits_t CTMUCON1bits; 1731 1732 #define _EDG1STAT 0x01 1733 #define _EDG2STAT 0x02 1734 #define _EDG1SEL0 0x04 1735 #define _EDG1SEL1 0x08 1736 #define _EDG1POL 0x10 1737 #define _EDG2SEL0 0x20 1738 #define _EDG2SEL1 0x40 1739 #define _EDG2POL 0x80 1740 1741 //============================================================================== 1742 1743 1744 //============================================================================== 1745 // CTMUCONL Bits 1746 1747 extern __at(0x0F8E) __sfr CTMUCONL; 1748 1749 typedef union 1750 { 1751 struct 1752 { 1753 unsigned EDG1STAT : 1; 1754 unsigned EDG2STAT : 1; 1755 unsigned EDG1SEL0 : 1; 1756 unsigned EDG1SEL1 : 1; 1757 unsigned EDG1POL : 1; 1758 unsigned EDG2SEL0 : 1; 1759 unsigned EDG2SEL1 : 1; 1760 unsigned EDG2POL : 1; 1761 }; 1762 1763 struct 1764 { 1765 unsigned : 2; 1766 unsigned EDG1SEL : 2; 1767 unsigned : 4; 1768 }; 1769 1770 struct 1771 { 1772 unsigned : 5; 1773 unsigned EDG2SEL : 2; 1774 unsigned : 1; 1775 }; 1776 } __CTMUCONLbits_t; 1777 1778 extern __at(0x0F8E) volatile __CTMUCONLbits_t CTMUCONLbits; 1779 1780 #define _CTMUCONL_EDG1STAT 0x01 1781 #define _CTMUCONL_EDG2STAT 0x02 1782 #define _CTMUCONL_EDG1SEL0 0x04 1783 #define _CTMUCONL_EDG1SEL1 0x08 1784 #define _CTMUCONL_EDG1POL 0x10 1785 #define _CTMUCONL_EDG2SEL0 0x20 1786 #define _CTMUCONL_EDG2SEL1 0x40 1787 #define _CTMUCONL_EDG2POL 0x80 1788 1789 //============================================================================== 1790 1791 1792 //============================================================================== 1793 // CTMUCON0 Bits 1794 1795 extern __at(0x0F8F) __sfr CTMUCON0; 1796 1797 typedef union 1798 { 1799 struct 1800 { 1801 unsigned CTTRIG : 1; 1802 unsigned IDISSEN : 1; 1803 unsigned EDGSEQEN : 1; 1804 unsigned EDGEN : 1; 1805 unsigned TGEN : 1; 1806 unsigned CTMUSIDL : 1; 1807 unsigned : 1; 1808 unsigned CTMUEN : 1; 1809 }; 1810 1811 struct 1812 { 1813 unsigned TRIGEN : 1; 1814 unsigned : 1; 1815 unsigned : 1; 1816 unsigned : 1; 1817 unsigned : 1; 1818 unsigned SIDL : 1; 1819 unsigned : 1; 1820 unsigned ON : 1; 1821 }; 1822 } __CTMUCON0bits_t; 1823 1824 extern __at(0x0F8F) volatile __CTMUCON0bits_t CTMUCON0bits; 1825 1826 #define _CTTRIG 0x01 1827 #define _TRIGEN 0x01 1828 #define _IDISSEN 0x02 1829 #define _EDGSEQEN 0x04 1830 #define _EDGEN 0x08 1831 #define _TGEN 0x10 1832 #define _CTMUSIDL 0x20 1833 #define _SIDL 0x20 1834 #define _CTMUEN 0x80 1835 #define _ON 0x80 1836 1837 //============================================================================== 1838 1839 1840 //============================================================================== 1841 // CTMUCONH Bits 1842 1843 extern __at(0x0F8F) __sfr CTMUCONH; 1844 1845 typedef union 1846 { 1847 struct 1848 { 1849 unsigned CTTRIG : 1; 1850 unsigned IDISSEN : 1; 1851 unsigned EDGSEQEN : 1; 1852 unsigned EDGEN : 1; 1853 unsigned TGEN : 1; 1854 unsigned CTMUSIDL : 1; 1855 unsigned : 1; 1856 unsigned CTMUEN : 1; 1857 }; 1858 1859 struct 1860 { 1861 unsigned TRIGEN : 1; 1862 unsigned : 1; 1863 unsigned : 1; 1864 unsigned : 1; 1865 unsigned : 1; 1866 unsigned SIDL : 1; 1867 unsigned : 1; 1868 unsigned ON : 1; 1869 }; 1870 } __CTMUCONHbits_t; 1871 1872 extern __at(0x0F8F) volatile __CTMUCONHbits_t CTMUCONHbits; 1873 1874 #define _CTMUCONH_CTTRIG 0x01 1875 #define _CTMUCONH_TRIGEN 0x01 1876 #define _CTMUCONH_IDISSEN 0x02 1877 #define _CTMUCONH_EDGSEQEN 0x04 1878 #define _CTMUCONH_EDGEN 0x08 1879 #define _CTMUCONH_TGEN 0x10 1880 #define _CTMUCONH_CTMUSIDL 0x20 1881 #define _CTMUCONH_SIDL 0x20 1882 #define _CTMUCONH_CTMUEN 0x80 1883 #define _CTMUCONH_ON 0x80 1884 1885 //============================================================================== 1886 1887 extern __at(0x0F90) __sfr CCPR2; 1888 extern __at(0x0F90) __sfr CCPR2L; 1889 extern __at(0x0F91) __sfr CCPR2H; 1890 1891 //============================================================================== 1892 // DDRA Bits 1893 1894 extern __at(0x0F92) __sfr DDRA; 1895 1896 typedef union 1897 { 1898 struct 1899 { 1900 unsigned TRISA0 : 1; 1901 unsigned TRISA1 : 1; 1902 unsigned TRISA2 : 1; 1903 unsigned TRISA3 : 1; 1904 unsigned TRISA4 : 1; 1905 unsigned TRISA5 : 1; 1906 unsigned TRISA6 : 1; 1907 unsigned TRISA7 : 1; 1908 }; 1909 1910 struct 1911 { 1912 unsigned RA0 : 1; 1913 unsigned RA1 : 1; 1914 unsigned RA2 : 1; 1915 unsigned RA3 : 1; 1916 unsigned RA4 : 1; 1917 unsigned RA5 : 1; 1918 unsigned RA6 : 1; 1919 unsigned RA7 : 1; 1920 }; 1921 } __DDRAbits_t; 1922 1923 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits; 1924 1925 #define _TRISA0 0x01 1926 #define _RA0 0x01 1927 #define _TRISA1 0x02 1928 #define _RA1 0x02 1929 #define _TRISA2 0x04 1930 #define _RA2 0x04 1931 #define _TRISA3 0x08 1932 #define _RA3 0x08 1933 #define _TRISA4 0x10 1934 #define _RA4 0x10 1935 #define _TRISA5 0x20 1936 #define _RA5 0x20 1937 #define _TRISA6 0x40 1938 #define _RA6 0x40 1939 #define _TRISA7 0x80 1940 #define _RA7 0x80 1941 1942 //============================================================================== 1943 1944 1945 //============================================================================== 1946 // TRISA Bits 1947 1948 extern __at(0x0F92) __sfr TRISA; 1949 1950 typedef union 1951 { 1952 struct 1953 { 1954 unsigned TRISA0 : 1; 1955 unsigned TRISA1 : 1; 1956 unsigned TRISA2 : 1; 1957 unsigned TRISA3 : 1; 1958 unsigned TRISA4 : 1; 1959 unsigned TRISA5 : 1; 1960 unsigned TRISA6 : 1; 1961 unsigned TRISA7 : 1; 1962 }; 1963 1964 struct 1965 { 1966 unsigned RA0 : 1; 1967 unsigned RA1 : 1; 1968 unsigned RA2 : 1; 1969 unsigned RA3 : 1; 1970 unsigned RA4 : 1; 1971 unsigned RA5 : 1; 1972 unsigned RA6 : 1; 1973 unsigned RA7 : 1; 1974 }; 1975 } __TRISAbits_t; 1976 1977 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits; 1978 1979 #define _TRISA_TRISA0 0x01 1980 #define _TRISA_RA0 0x01 1981 #define _TRISA_TRISA1 0x02 1982 #define _TRISA_RA1 0x02 1983 #define _TRISA_TRISA2 0x04 1984 #define _TRISA_RA2 0x04 1985 #define _TRISA_TRISA3 0x08 1986 #define _TRISA_RA3 0x08 1987 #define _TRISA_TRISA4 0x10 1988 #define _TRISA_RA4 0x10 1989 #define _TRISA_TRISA5 0x20 1990 #define _TRISA_RA5 0x20 1991 #define _TRISA_TRISA6 0x40 1992 #define _TRISA_RA6 0x40 1993 #define _TRISA_TRISA7 0x80 1994 #define _TRISA_RA7 0x80 1995 1996 //============================================================================== 1997 1998 1999 //============================================================================== 2000 // DDRB Bits 2001 2002 extern __at(0x0F93) __sfr DDRB; 2003 2004 typedef union 2005 { 2006 struct 2007 { 2008 unsigned TRISB0 : 1; 2009 unsigned TRISB1 : 1; 2010 unsigned TRISB2 : 1; 2011 unsigned TRISB3 : 1; 2012 unsigned TRISB4 : 1; 2013 unsigned TRISB5 : 1; 2014 unsigned TRISB6 : 1; 2015 unsigned TRISB7 : 1; 2016 }; 2017 2018 struct 2019 { 2020 unsigned RB0 : 1; 2021 unsigned RB1 : 1; 2022 unsigned RB2 : 1; 2023 unsigned RB3 : 1; 2024 unsigned RB4 : 1; 2025 unsigned RB5 : 1; 2026 unsigned RB6 : 1; 2027 unsigned RB7 : 1; 2028 }; 2029 } __DDRBbits_t; 2030 2031 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits; 2032 2033 #define _TRISB0 0x01 2034 #define _RB0 0x01 2035 #define _TRISB1 0x02 2036 #define _RB1 0x02 2037 #define _TRISB2 0x04 2038 #define _RB2 0x04 2039 #define _TRISB3 0x08 2040 #define _RB3 0x08 2041 #define _TRISB4 0x10 2042 #define _RB4 0x10 2043 #define _TRISB5 0x20 2044 #define _RB5 0x20 2045 #define _TRISB6 0x40 2046 #define _RB6 0x40 2047 #define _TRISB7 0x80 2048 #define _RB7 0x80 2049 2050 //============================================================================== 2051 2052 2053 //============================================================================== 2054 // TRISB Bits 2055 2056 extern __at(0x0F93) __sfr TRISB; 2057 2058 typedef union 2059 { 2060 struct 2061 { 2062 unsigned TRISB0 : 1; 2063 unsigned TRISB1 : 1; 2064 unsigned TRISB2 : 1; 2065 unsigned TRISB3 : 1; 2066 unsigned TRISB4 : 1; 2067 unsigned TRISB5 : 1; 2068 unsigned TRISB6 : 1; 2069 unsigned TRISB7 : 1; 2070 }; 2071 2072 struct 2073 { 2074 unsigned RB0 : 1; 2075 unsigned RB1 : 1; 2076 unsigned RB2 : 1; 2077 unsigned RB3 : 1; 2078 unsigned RB4 : 1; 2079 unsigned RB5 : 1; 2080 unsigned RB6 : 1; 2081 unsigned RB7 : 1; 2082 }; 2083 } __TRISBbits_t; 2084 2085 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits; 2086 2087 #define _TRISB_TRISB0 0x01 2088 #define _TRISB_RB0 0x01 2089 #define _TRISB_TRISB1 0x02 2090 #define _TRISB_RB1 0x02 2091 #define _TRISB_TRISB2 0x04 2092 #define _TRISB_RB2 0x04 2093 #define _TRISB_TRISB3 0x08 2094 #define _TRISB_RB3 0x08 2095 #define _TRISB_TRISB4 0x10 2096 #define _TRISB_RB4 0x10 2097 #define _TRISB_TRISB5 0x20 2098 #define _TRISB_RB5 0x20 2099 #define _TRISB_TRISB6 0x40 2100 #define _TRISB_RB6 0x40 2101 #define _TRISB_TRISB7 0x80 2102 #define _TRISB_RB7 0x80 2103 2104 //============================================================================== 2105 2106 2107 //============================================================================== 2108 // DDRC Bits 2109 2110 extern __at(0x0F94) __sfr DDRC; 2111 2112 typedef union 2113 { 2114 struct 2115 { 2116 unsigned TRISC0 : 1; 2117 unsigned TRISC1 : 1; 2118 unsigned TRISC2 : 1; 2119 unsigned : 1; 2120 unsigned TRISC4 : 1; 2121 unsigned TRISC5 : 1; 2122 unsigned TRISC6 : 1; 2123 unsigned TRISC7 : 1; 2124 }; 2125 2126 struct 2127 { 2128 unsigned RC0 : 1; 2129 unsigned RC1 : 1; 2130 unsigned RC2 : 1; 2131 unsigned : 1; 2132 unsigned : 1; 2133 unsigned : 1; 2134 unsigned RC6 : 1; 2135 unsigned RC7 : 1; 2136 }; 2137 } __DDRCbits_t; 2138 2139 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits; 2140 2141 #define _TRISC0 0x01 2142 #define _RC0 0x01 2143 #define _TRISC1 0x02 2144 #define _RC1 0x02 2145 #define _TRISC2 0x04 2146 #define _RC2 0x04 2147 #define _TRISC4 0x10 2148 #define _TRISC5 0x20 2149 #define _TRISC6 0x40 2150 #define _RC6 0x40 2151 #define _TRISC7 0x80 2152 #define _RC7 0x80 2153 2154 //============================================================================== 2155 2156 2157 //============================================================================== 2158 // TRISC Bits 2159 2160 extern __at(0x0F94) __sfr TRISC; 2161 2162 typedef union 2163 { 2164 struct 2165 { 2166 unsigned TRISC0 : 1; 2167 unsigned TRISC1 : 1; 2168 unsigned TRISC2 : 1; 2169 unsigned : 1; 2170 unsigned TRISC4 : 1; 2171 unsigned TRISC5 : 1; 2172 unsigned TRISC6 : 1; 2173 unsigned TRISC7 : 1; 2174 }; 2175 2176 struct 2177 { 2178 unsigned RC0 : 1; 2179 unsigned RC1 : 1; 2180 unsigned RC2 : 1; 2181 unsigned : 1; 2182 unsigned : 1; 2183 unsigned : 1; 2184 unsigned RC6 : 1; 2185 unsigned RC7 : 1; 2186 }; 2187 } __TRISCbits_t; 2188 2189 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits; 2190 2191 #define _TRISC_TRISC0 0x01 2192 #define _TRISC_RC0 0x01 2193 #define _TRISC_TRISC1 0x02 2194 #define _TRISC_RC1 0x02 2195 #define _TRISC_TRISC2 0x04 2196 #define _TRISC_RC2 0x04 2197 #define _TRISC_TRISC4 0x10 2198 #define _TRISC_TRISC5 0x20 2199 #define _TRISC_TRISC6 0x40 2200 #define _TRISC_RC6 0x40 2201 #define _TRISC_TRISC7 0x80 2202 #define _TRISC_RC7 0x80 2203 2204 //============================================================================== 2205 2206 2207 //============================================================================== 2208 // CCP2CON Bits 2209 2210 extern __at(0x0F97) __sfr CCP2CON; 2211 2212 typedef union 2213 { 2214 struct 2215 { 2216 unsigned CCP2M0 : 1; 2217 unsigned CCP2M1 : 1; 2218 unsigned CCP2M2 : 1; 2219 unsigned CCP2M3 : 1; 2220 unsigned DC2B0 : 1; 2221 unsigned DC2B1 : 1; 2222 unsigned : 1; 2223 unsigned : 1; 2224 }; 2225 2226 struct 2227 { 2228 unsigned : 1; 2229 unsigned : 1; 2230 unsigned : 1; 2231 unsigned : 1; 2232 unsigned CCP2Y : 1; 2233 unsigned CCP2X : 1; 2234 unsigned : 1; 2235 unsigned : 1; 2236 }; 2237 2238 struct 2239 { 2240 unsigned CCP2M : 4; 2241 unsigned : 4; 2242 }; 2243 2244 struct 2245 { 2246 unsigned : 4; 2247 unsigned DC2B : 2; 2248 unsigned : 2; 2249 }; 2250 } __CCP2CONbits_t; 2251 2252 extern __at(0x0F97) volatile __CCP2CONbits_t CCP2CONbits; 2253 2254 #define _CCP2M0 0x01 2255 #define _CCP2M1 0x02 2256 #define _CCP2M2 0x04 2257 #define _CCP2M3 0x08 2258 #define _DC2B0 0x10 2259 #define _CCP2Y 0x10 2260 #define _DC2B1 0x20 2261 #define _CCP2X 0x20 2262 2263 //============================================================================== 2264 2265 2266 //============================================================================== 2267 // ECCP2CON Bits 2268 2269 extern __at(0x0F97) __sfr ECCP2CON; 2270 2271 typedef union 2272 { 2273 struct 2274 { 2275 unsigned CCP2M0 : 1; 2276 unsigned CCP2M1 : 1; 2277 unsigned CCP2M2 : 1; 2278 unsigned CCP2M3 : 1; 2279 unsigned DC2B0 : 1; 2280 unsigned DC2B1 : 1; 2281 unsigned : 1; 2282 unsigned : 1; 2283 }; 2284 2285 struct 2286 { 2287 unsigned : 1; 2288 unsigned : 1; 2289 unsigned : 1; 2290 unsigned : 1; 2291 unsigned CCP2Y : 1; 2292 unsigned CCP2X : 1; 2293 unsigned : 1; 2294 unsigned : 1; 2295 }; 2296 2297 struct 2298 { 2299 unsigned CCP2M : 4; 2300 unsigned : 4; 2301 }; 2302 2303 struct 2304 { 2305 unsigned : 4; 2306 unsigned DC2B : 2; 2307 unsigned : 2; 2308 }; 2309 } __ECCP2CONbits_t; 2310 2311 extern __at(0x0F97) volatile __ECCP2CONbits_t ECCP2CONbits; 2312 2313 #define _ECCP2CON_CCP2M0 0x01 2314 #define _ECCP2CON_CCP2M1 0x02 2315 #define _ECCP2CON_CCP2M2 0x04 2316 #define _ECCP2CON_CCP2M3 0x08 2317 #define _ECCP2CON_DC2B0 0x10 2318 #define _ECCP2CON_CCP2Y 0x10 2319 #define _ECCP2CON_DC2B1 0x20 2320 #define _ECCP2CON_CCP2X 0x20 2321 2322 //============================================================================== 2323 2324 2325 //============================================================================== 2326 // CM1CON0 Bits 2327 2328 extern __at(0x0F98) __sfr CM1CON0; 2329 2330 typedef union 2331 { 2332 struct 2333 { 2334 unsigned C1CH0 : 1; 2335 unsigned C1CH1 : 1; 2336 unsigned C1R : 1; 2337 unsigned C1SP : 1; 2338 unsigned C1POL : 1; 2339 unsigned C1OE : 1; 2340 unsigned C1OUT : 1; 2341 unsigned C1ON : 1; 2342 }; 2343 2344 struct 2345 { 2346 unsigned CCH0 : 1; 2347 unsigned CCH1 : 1; 2348 unsigned CREF : 1; 2349 unsigned : 1; 2350 unsigned CPOL : 1; 2351 unsigned COE : 1; 2352 unsigned COUT1 : 1; 2353 unsigned CON : 1; 2354 }; 2355 2356 struct 2357 { 2358 unsigned CCH : 2; 2359 unsigned : 6; 2360 }; 2361 2362 struct 2363 { 2364 unsigned C1CH : 2; 2365 unsigned : 6; 2366 }; 2367 } __CM1CON0bits_t; 2368 2369 extern __at(0x0F98) volatile __CM1CON0bits_t CM1CON0bits; 2370 2371 #define _C1CH0 0x01 2372 #define _CCH0 0x01 2373 #define _C1CH1 0x02 2374 #define _CCH1 0x02 2375 #define _C1R 0x04 2376 #define _CREF 0x04 2377 #define _C1SP 0x08 2378 #define _C1POL 0x10 2379 #define _CPOL 0x10 2380 #define _C1OE 0x20 2381 #define _COE 0x20 2382 #define _C1OUT 0x40 2383 #define _COUT1 0x40 2384 #define _C1ON 0x80 2385 #define _CON 0x80 2386 2387 //============================================================================== 2388 2389 2390 //============================================================================== 2391 // CM2CON0 Bits 2392 2393 extern __at(0x0F99) __sfr CM2CON0; 2394 2395 typedef union 2396 { 2397 struct 2398 { 2399 unsigned C2CH0 : 1; 2400 unsigned C2CH1 : 1; 2401 unsigned C2R : 1; 2402 unsigned C2SP : 1; 2403 unsigned C2POL : 1; 2404 unsigned C2OE : 1; 2405 unsigned C2OUT : 1; 2406 unsigned C2ON : 1; 2407 }; 2408 2409 struct 2410 { 2411 unsigned CCH0 : 1; 2412 unsigned CCH1 : 1; 2413 unsigned CREF : 1; 2414 unsigned : 1; 2415 unsigned CPOL : 1; 2416 unsigned COE : 1; 2417 unsigned COUT2 : 1; 2418 unsigned CON : 1; 2419 }; 2420 2421 struct 2422 { 2423 unsigned CCH : 2; 2424 unsigned : 6; 2425 }; 2426 2427 struct 2428 { 2429 unsigned C2CH : 2; 2430 unsigned : 6; 2431 }; 2432 } __CM2CON0bits_t; 2433 2434 extern __at(0x0F99) volatile __CM2CON0bits_t CM2CON0bits; 2435 2436 #define _CM2CON0_C2CH0 0x01 2437 #define _CM2CON0_CCH0 0x01 2438 #define _CM2CON0_C2CH1 0x02 2439 #define _CM2CON0_CCH1 0x02 2440 #define _CM2CON0_C2R 0x04 2441 #define _CM2CON0_CREF 0x04 2442 #define _CM2CON0_C2SP 0x08 2443 #define _CM2CON0_C2POL 0x10 2444 #define _CM2CON0_CPOL 0x10 2445 #define _CM2CON0_C2OE 0x20 2446 #define _CM2CON0_COE 0x20 2447 #define _CM2CON0_C2OUT 0x40 2448 #define _CM2CON0_COUT2 0x40 2449 #define _CM2CON0_C2ON 0x80 2450 #define _CM2CON0_CON 0x80 2451 2452 //============================================================================== 2453 2454 2455 //============================================================================== 2456 // CM2CON1 Bits 2457 2458 extern __at(0x0F9A) __sfr CM2CON1; 2459 2460 typedef struct 2461 { 2462 unsigned C2SYNC : 1; 2463 unsigned C1SYNC : 1; 2464 unsigned C2HYS : 1; 2465 unsigned C1HYS : 1; 2466 unsigned C2RSEL : 1; 2467 unsigned C1RSEL : 1; 2468 unsigned MC2OUT : 1; 2469 unsigned MC1OUT : 1; 2470 } __CM2CON1bits_t; 2471 2472 extern __at(0x0F9A) volatile __CM2CON1bits_t CM2CON1bits; 2473 2474 #define _C2SYNC 0x01 2475 #define _C1SYNC 0x02 2476 #define _C2HYS 0x04 2477 #define _C1HYS 0x08 2478 #define _C2RSEL 0x10 2479 #define _C1RSEL 0x20 2480 #define _MC2OUT 0x40 2481 #define _MC1OUT 0x80 2482 2483 //============================================================================== 2484 2485 2486 //============================================================================== 2487 // OSCTUNE Bits 2488 2489 extern __at(0x0F9B) __sfr OSCTUNE; 2490 2491 typedef union 2492 { 2493 struct 2494 { 2495 unsigned TUN0 : 1; 2496 unsigned TUN1 : 1; 2497 unsigned TUN2 : 1; 2498 unsigned TUN3 : 1; 2499 unsigned TUN4 : 1; 2500 unsigned TUN5 : 1; 2501 unsigned TUN6 : 1; 2502 unsigned SPLLMULT : 1; 2503 }; 2504 2505 struct 2506 { 2507 unsigned TUN : 7; 2508 unsigned : 1; 2509 }; 2510 } __OSCTUNEbits_t; 2511 2512 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits; 2513 2514 #define _TUN0 0x01 2515 #define _TUN1 0x02 2516 #define _TUN2 0x04 2517 #define _TUN3 0x08 2518 #define _TUN4 0x10 2519 #define _TUN5 0x20 2520 #define _TUN6 0x40 2521 #define _SPLLMULT 0x80 2522 2523 //============================================================================== 2524 2525 2526 //============================================================================== 2527 // HLVDCON Bits 2528 2529 extern __at(0x0F9C) __sfr HLVDCON; 2530 2531 typedef union 2532 { 2533 struct 2534 { 2535 unsigned HLVDL0 : 1; 2536 unsigned HLVDL1 : 1; 2537 unsigned HLVDL2 : 1; 2538 unsigned HLVDL3 : 1; 2539 unsigned HLVDEN : 1; 2540 unsigned IRVST : 1; 2541 unsigned BGVST : 1; 2542 unsigned VDIRMAG : 1; 2543 }; 2544 2545 struct 2546 { 2547 unsigned HLVDL : 4; 2548 unsigned : 4; 2549 }; 2550 } __HLVDCONbits_t; 2551 2552 extern __at(0x0F9C) volatile __HLVDCONbits_t HLVDCONbits; 2553 2554 #define _HLVDL0 0x01 2555 #define _HLVDL1 0x02 2556 #define _HLVDL2 0x04 2557 #define _HLVDL3 0x08 2558 #define _HLVDEN 0x10 2559 #define _IRVST 0x20 2560 #define _BGVST 0x40 2561 #define _VDIRMAG 0x80 2562 2563 //============================================================================== 2564 2565 2566 //============================================================================== 2567 // PIE1 Bits 2568 2569 extern __at(0x0F9D) __sfr PIE1; 2570 2571 typedef union 2572 { 2573 struct 2574 { 2575 unsigned TMR1IE : 1; 2576 unsigned TMR2IE : 1; 2577 unsigned CCP1IE : 1; 2578 unsigned SSPIE : 1; 2579 unsigned TXIE : 1; 2580 unsigned RCIE : 1; 2581 unsigned ADIE : 1; 2582 unsigned ACTIE : 1; 2583 }; 2584 2585 struct 2586 { 2587 unsigned : 1; 2588 unsigned : 1; 2589 unsigned : 1; 2590 unsigned SSP1IE : 1; 2591 unsigned TX1IE : 1; 2592 unsigned RC1IE : 1; 2593 unsigned : 1; 2594 unsigned STIE : 1; 2595 }; 2596 } __PIE1bits_t; 2597 2598 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits; 2599 2600 #define _TMR1IE 0x01 2601 #define _TMR2IE 0x02 2602 #define _CCP1IE 0x04 2603 #define _SSPIE 0x08 2604 #define _SSP1IE 0x08 2605 #define _TXIE 0x10 2606 #define _TX1IE 0x10 2607 #define _RCIE 0x20 2608 #define _RC1IE 0x20 2609 #define _ADIE 0x40 2610 #define _ACTIE 0x80 2611 #define _STIE 0x80 2612 2613 //============================================================================== 2614 2615 2616 //============================================================================== 2617 // PIR1 Bits 2618 2619 extern __at(0x0F9E) __sfr PIR1; 2620 2621 typedef union 2622 { 2623 struct 2624 { 2625 unsigned TMR1IF : 1; 2626 unsigned TMR2IF : 1; 2627 unsigned CCP1IF : 1; 2628 unsigned SSPIF : 1; 2629 unsigned TXIF : 1; 2630 unsigned RCIF : 1; 2631 unsigned ADIF : 1; 2632 unsigned ACTIF : 1; 2633 }; 2634 2635 struct 2636 { 2637 unsigned : 1; 2638 unsigned : 1; 2639 unsigned : 1; 2640 unsigned SSP1IF : 1; 2641 unsigned TX1IF : 1; 2642 unsigned RC1IF : 1; 2643 unsigned : 1; 2644 unsigned STIF : 1; 2645 }; 2646 } __PIR1bits_t; 2647 2648 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits; 2649 2650 #define _TMR1IF 0x01 2651 #define _TMR2IF 0x02 2652 #define _CCP1IF 0x04 2653 #define _SSPIF 0x08 2654 #define _SSP1IF 0x08 2655 #define _TXIF 0x10 2656 #define _TX1IF 0x10 2657 #define _RCIF 0x20 2658 #define _RC1IF 0x20 2659 #define _ADIF 0x40 2660 #define _ACTIF 0x80 2661 #define _STIF 0x80 2662 2663 //============================================================================== 2664 2665 2666 //============================================================================== 2667 // IPR1 Bits 2668 2669 extern __at(0x0F9F) __sfr IPR1; 2670 2671 typedef union 2672 { 2673 struct 2674 { 2675 unsigned TMR1IP : 1; 2676 unsigned TMR2IP : 1; 2677 unsigned CCP1IP : 1; 2678 unsigned SSPIP : 1; 2679 unsigned TXIP : 1; 2680 unsigned RCIP : 1; 2681 unsigned ADIP : 1; 2682 unsigned ACTIP : 1; 2683 }; 2684 2685 struct 2686 { 2687 unsigned : 1; 2688 unsigned : 1; 2689 unsigned : 1; 2690 unsigned SSP1IP : 1; 2691 unsigned TX1IP : 1; 2692 unsigned RC1IP : 1; 2693 unsigned : 1; 2694 unsigned STIP : 1; 2695 }; 2696 } __IPR1bits_t; 2697 2698 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits; 2699 2700 #define _TMR1IP 0x01 2701 #define _TMR2IP 0x02 2702 #define _CCP1IP 0x04 2703 #define _SSPIP 0x08 2704 #define _SSP1IP 0x08 2705 #define _TXIP 0x10 2706 #define _TX1IP 0x10 2707 #define _RCIP 0x20 2708 #define _RC1IP 0x20 2709 #define _ADIP 0x40 2710 #define _ACTIP 0x80 2711 #define _STIP 0x80 2712 2713 //============================================================================== 2714 2715 2716 //============================================================================== 2717 // PIE2 Bits 2718 2719 extern __at(0x0FA0) __sfr PIE2; 2720 2721 typedef union 2722 { 2723 struct 2724 { 2725 unsigned CCP2IE : 1; 2726 unsigned TMR3IE : 1; 2727 unsigned HLVDIE : 1; 2728 unsigned BCLIE : 1; 2729 unsigned EEIE : 1; 2730 unsigned C2IE : 1; 2731 unsigned C1IE : 1; 2732 unsigned OSCFIE : 1; 2733 }; 2734 2735 struct 2736 { 2737 unsigned : 1; 2738 unsigned : 1; 2739 unsigned LVDIE : 1; 2740 unsigned BCL1IE : 1; 2741 unsigned : 1; 2742 unsigned CM2IE : 1; 2743 unsigned CM1IE : 1; 2744 unsigned : 1; 2745 }; 2746 } __PIE2bits_t; 2747 2748 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits; 2749 2750 #define _CCP2IE 0x01 2751 #define _TMR3IE 0x02 2752 #define _HLVDIE 0x04 2753 #define _LVDIE 0x04 2754 #define _BCLIE 0x08 2755 #define _BCL1IE 0x08 2756 #define _EEIE 0x10 2757 #define _C2IE 0x20 2758 #define _CM2IE 0x20 2759 #define _C1IE 0x40 2760 #define _CM1IE 0x40 2761 #define _OSCFIE 0x80 2762 2763 //============================================================================== 2764 2765 2766 //============================================================================== 2767 // PIR2 Bits 2768 2769 extern __at(0x0FA1) __sfr PIR2; 2770 2771 typedef union 2772 { 2773 struct 2774 { 2775 unsigned CCP2IF : 1; 2776 unsigned TMR3IF : 1; 2777 unsigned HLVDIF : 1; 2778 unsigned BCLIF : 1; 2779 unsigned EEIF : 1; 2780 unsigned C2IF : 1; 2781 unsigned C1IF : 1; 2782 unsigned OSCFIF : 1; 2783 }; 2784 2785 struct 2786 { 2787 unsigned : 1; 2788 unsigned : 1; 2789 unsigned LVDIF : 1; 2790 unsigned BCL1IF : 1; 2791 unsigned : 1; 2792 unsigned CM2IF : 1; 2793 unsigned CM1IF : 1; 2794 unsigned : 1; 2795 }; 2796 } __PIR2bits_t; 2797 2798 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits; 2799 2800 #define _CCP2IF 0x01 2801 #define _TMR3IF 0x02 2802 #define _HLVDIF 0x04 2803 #define _LVDIF 0x04 2804 #define _BCLIF 0x08 2805 #define _BCL1IF 0x08 2806 #define _EEIF 0x10 2807 #define _C2IF 0x20 2808 #define _CM2IF 0x20 2809 #define _C1IF 0x40 2810 #define _CM1IF 0x40 2811 #define _OSCFIF 0x80 2812 2813 //============================================================================== 2814 2815 2816 //============================================================================== 2817 // IPR2 Bits 2818 2819 extern __at(0x0FA2) __sfr IPR2; 2820 2821 typedef union 2822 { 2823 struct 2824 { 2825 unsigned CCP2IP : 1; 2826 unsigned TMR3IP : 1; 2827 unsigned HLVDIP : 1; 2828 unsigned BCLIP : 1; 2829 unsigned EEIP : 1; 2830 unsigned C2IP : 1; 2831 unsigned C1IP : 1; 2832 unsigned OSCFIP : 1; 2833 }; 2834 2835 struct 2836 { 2837 unsigned : 1; 2838 unsigned : 1; 2839 unsigned LVDIP : 1; 2840 unsigned BCL1IP : 1; 2841 unsigned : 1; 2842 unsigned CM2IP : 1; 2843 unsigned CM1IP : 1; 2844 unsigned : 1; 2845 }; 2846 } __IPR2bits_t; 2847 2848 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits; 2849 2850 #define _CCP2IP 0x01 2851 #define _TMR3IP 0x02 2852 #define _HLVDIP 0x04 2853 #define _LVDIP 0x04 2854 #define _BCLIP 0x08 2855 #define _BCL1IP 0x08 2856 #define _EEIP 0x10 2857 #define _C2IP 0x20 2858 #define _CM2IP 0x20 2859 #define _C1IP 0x40 2860 #define _CM1IP 0x40 2861 #define _OSCFIP 0x80 2862 2863 //============================================================================== 2864 2865 2866 //============================================================================== 2867 // PIE3 Bits 2868 2869 extern __at(0x0FA3) __sfr PIE3; 2870 2871 typedef struct 2872 { 2873 unsigned TMR1GIE : 1; 2874 unsigned TMR3GIE : 1; 2875 unsigned USBIE : 1; 2876 unsigned CTMUIE : 1; 2877 unsigned : 1; 2878 unsigned : 1; 2879 unsigned : 1; 2880 unsigned : 1; 2881 } __PIE3bits_t; 2882 2883 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits; 2884 2885 #define _TMR1GIE 0x01 2886 #define _TMR3GIE 0x02 2887 #define _USBIE 0x04 2888 #define _CTMUIE 0x08 2889 2890 //============================================================================== 2891 2892 2893 //============================================================================== 2894 // PIR3 Bits 2895 2896 extern __at(0x0FA4) __sfr PIR3; 2897 2898 typedef struct 2899 { 2900 unsigned TMR1GIF : 1; 2901 unsigned TMR3GIF : 1; 2902 unsigned USBIF : 1; 2903 unsigned CTMUIF : 1; 2904 unsigned : 1; 2905 unsigned : 1; 2906 unsigned : 1; 2907 unsigned : 1; 2908 } __PIR3bits_t; 2909 2910 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits; 2911 2912 #define _TMR1GIF 0x01 2913 #define _TMR3GIF 0x02 2914 #define _USBIF 0x04 2915 #define _CTMUIF 0x08 2916 2917 //============================================================================== 2918 2919 2920 //============================================================================== 2921 // IPR3 Bits 2922 2923 extern __at(0x0FA5) __sfr IPR3; 2924 2925 typedef struct 2926 { 2927 unsigned TMR1GIP : 1; 2928 unsigned TMR3GIP : 1; 2929 unsigned USBIP : 1; 2930 unsigned CTMUIP : 1; 2931 unsigned : 1; 2932 unsigned : 1; 2933 unsigned : 1; 2934 unsigned : 1; 2935 } __IPR3bits_t; 2936 2937 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits; 2938 2939 #define _TMR1GIP 0x01 2940 #define _TMR3GIP 0x02 2941 #define _USBIP 0x04 2942 #define _CTMUIP 0x08 2943 2944 //============================================================================== 2945 2946 2947 //============================================================================== 2948 // EECON1 Bits 2949 2950 extern __at(0x0FA6) __sfr EECON1; 2951 2952 typedef struct 2953 { 2954 unsigned RD : 1; 2955 unsigned WR : 1; 2956 unsigned WREN : 1; 2957 unsigned WRERR : 1; 2958 unsigned FREE : 1; 2959 unsigned : 1; 2960 unsigned CFGS : 1; 2961 unsigned EEPGD : 1; 2962 } __EECON1bits_t; 2963 2964 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits; 2965 2966 #define _RD 0x01 2967 #define _WR 0x02 2968 #define _WREN 0x04 2969 #define _WRERR 0x08 2970 #define _FREE 0x10 2971 #define _CFGS 0x40 2972 #define _EEPGD 0x80 2973 2974 //============================================================================== 2975 2976 extern __at(0x0FA7) __sfr EECON2; 2977 extern __at(0x0FA8) __sfr EEDATA; 2978 extern __at(0x0FA9) __sfr EEADR; 2979 2980 //============================================================================== 2981 // RCSTA Bits 2982 2983 extern __at(0x0FAB) __sfr RCSTA; 2984 2985 typedef union 2986 { 2987 struct 2988 { 2989 unsigned RX9D : 1; 2990 unsigned OERR : 1; 2991 unsigned FERR : 1; 2992 unsigned ADDEN : 1; 2993 unsigned CREN : 1; 2994 unsigned SREN : 1; 2995 unsigned RX9 : 1; 2996 unsigned SPEN : 1; 2997 }; 2998 2999 struct 3000 { 3001 unsigned : 1; 3002 unsigned : 1; 3003 unsigned : 1; 3004 unsigned ADEN : 1; 3005 unsigned : 1; 3006 unsigned : 1; 3007 unsigned : 1; 3008 unsigned : 1; 3009 }; 3010 } __RCSTAbits_t; 3011 3012 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits; 3013 3014 #define _RX9D 0x01 3015 #define _OERR 0x02 3016 #define _FERR 0x04 3017 #define _ADDEN 0x08 3018 #define _ADEN 0x08 3019 #define _CREN 0x10 3020 #define _SREN 0x20 3021 #define _RX9 0x40 3022 #define _SPEN 0x80 3023 3024 //============================================================================== 3025 3026 3027 //============================================================================== 3028 // RCSTA1 Bits 3029 3030 extern __at(0x0FAB) __sfr RCSTA1; 3031 3032 typedef union 3033 { 3034 struct 3035 { 3036 unsigned RX9D : 1; 3037 unsigned OERR : 1; 3038 unsigned FERR : 1; 3039 unsigned ADDEN : 1; 3040 unsigned CREN : 1; 3041 unsigned SREN : 1; 3042 unsigned RX9 : 1; 3043 unsigned SPEN : 1; 3044 }; 3045 3046 struct 3047 { 3048 unsigned : 1; 3049 unsigned : 1; 3050 unsigned : 1; 3051 unsigned ADEN : 1; 3052 unsigned : 1; 3053 unsigned : 1; 3054 unsigned : 1; 3055 unsigned : 1; 3056 }; 3057 } __RCSTA1bits_t; 3058 3059 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits; 3060 3061 #define _RCSTA1_RX9D 0x01 3062 #define _RCSTA1_OERR 0x02 3063 #define _RCSTA1_FERR 0x04 3064 #define _RCSTA1_ADDEN 0x08 3065 #define _RCSTA1_ADEN 0x08 3066 #define _RCSTA1_CREN 0x10 3067 #define _RCSTA1_SREN 0x20 3068 #define _RCSTA1_RX9 0x40 3069 #define _RCSTA1_SPEN 0x80 3070 3071 //============================================================================== 3072 3073 3074 //============================================================================== 3075 // TXSTA Bits 3076 3077 extern __at(0x0FAC) __sfr TXSTA; 3078 3079 typedef struct 3080 { 3081 unsigned TX9D : 1; 3082 unsigned TRMT : 1; 3083 unsigned BRGH : 1; 3084 unsigned SENDB : 1; 3085 unsigned SYNC : 1; 3086 unsigned TXEN : 1; 3087 unsigned TX9 : 1; 3088 unsigned CSRC : 1; 3089 } __TXSTAbits_t; 3090 3091 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits; 3092 3093 #define _TX9D 0x01 3094 #define _TRMT 0x02 3095 #define _BRGH 0x04 3096 #define _SENDB 0x08 3097 #define _SYNC 0x10 3098 #define _TXEN 0x20 3099 #define _TX9 0x40 3100 #define _CSRC 0x80 3101 3102 //============================================================================== 3103 3104 3105 //============================================================================== 3106 // TXSTA1 Bits 3107 3108 extern __at(0x0FAC) __sfr TXSTA1; 3109 3110 typedef struct 3111 { 3112 unsigned TX9D : 1; 3113 unsigned TRMT : 1; 3114 unsigned BRGH : 1; 3115 unsigned SENDB : 1; 3116 unsigned SYNC : 1; 3117 unsigned TXEN : 1; 3118 unsigned TX9 : 1; 3119 unsigned CSRC : 1; 3120 } __TXSTA1bits_t; 3121 3122 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits; 3123 3124 #define _TXSTA1_TX9D 0x01 3125 #define _TXSTA1_TRMT 0x02 3126 #define _TXSTA1_BRGH 0x04 3127 #define _TXSTA1_SENDB 0x08 3128 #define _TXSTA1_SYNC 0x10 3129 #define _TXSTA1_TXEN 0x20 3130 #define _TXSTA1_TX9 0x40 3131 #define _TXSTA1_CSRC 0x80 3132 3133 //============================================================================== 3134 3135 extern __at(0x0FAD) __sfr TXREG; 3136 extern __at(0x0FAD) __sfr TXREG1; 3137 extern __at(0x0FAE) __sfr RCREG; 3138 extern __at(0x0FAE) __sfr RCREG1; 3139 3140 //============================================================================== 3141 // SPBRG Bits 3142 3143 extern __at(0x0FAF) __sfr SPBRG; 3144 3145 typedef struct 3146 { 3147 unsigned BRG0 : 1; 3148 unsigned BRG1 : 1; 3149 unsigned BRG2 : 1; 3150 unsigned BRG3 : 1; 3151 unsigned BRG4 : 1; 3152 unsigned BRG5 : 1; 3153 unsigned BRG6 : 1; 3154 unsigned BRG7 : 1; 3155 } __SPBRGbits_t; 3156 3157 extern __at(0x0FAF) volatile __SPBRGbits_t SPBRGbits; 3158 3159 #define _BRG0 0x01 3160 #define _BRG1 0x02 3161 #define _BRG2 0x04 3162 #define _BRG3 0x08 3163 #define _BRG4 0x10 3164 #define _BRG5 0x20 3165 #define _BRG6 0x40 3166 #define _BRG7 0x80 3167 3168 //============================================================================== 3169 3170 3171 //============================================================================== 3172 // SPBRG1 Bits 3173 3174 extern __at(0x0FAF) __sfr SPBRG1; 3175 3176 typedef struct 3177 { 3178 unsigned BRG0 : 1; 3179 unsigned BRG1 : 1; 3180 unsigned BRG2 : 1; 3181 unsigned BRG3 : 1; 3182 unsigned BRG4 : 1; 3183 unsigned BRG5 : 1; 3184 unsigned BRG6 : 1; 3185 unsigned BRG7 : 1; 3186 } __SPBRG1bits_t; 3187 3188 extern __at(0x0FAF) volatile __SPBRG1bits_t SPBRG1bits; 3189 3190 #define _SPBRG1_BRG0 0x01 3191 #define _SPBRG1_BRG1 0x02 3192 #define _SPBRG1_BRG2 0x04 3193 #define _SPBRG1_BRG3 0x08 3194 #define _SPBRG1_BRG4 0x10 3195 #define _SPBRG1_BRG5 0x20 3196 #define _SPBRG1_BRG6 0x40 3197 #define _SPBRG1_BRG7 0x80 3198 3199 //============================================================================== 3200 3201 3202 //============================================================================== 3203 // SPBRGH Bits 3204 3205 extern __at(0x0FB0) __sfr SPBRGH; 3206 3207 typedef struct 3208 { 3209 unsigned BRG8 : 1; 3210 unsigned BRG9 : 1; 3211 unsigned BRG10 : 1; 3212 unsigned BRG11 : 1; 3213 unsigned BRG12 : 1; 3214 unsigned BRG13 : 1; 3215 unsigned BRG14 : 1; 3216 unsigned BRG15 : 1; 3217 } __SPBRGHbits_t; 3218 3219 extern __at(0x0FB0) volatile __SPBRGHbits_t SPBRGHbits; 3220 3221 #define _BRG8 0x01 3222 #define _BRG9 0x02 3223 #define _BRG10 0x04 3224 #define _BRG11 0x08 3225 #define _BRG12 0x10 3226 #define _BRG13 0x20 3227 #define _BRG14 0x40 3228 #define _BRG15 0x80 3229 3230 //============================================================================== 3231 3232 3233 //============================================================================== 3234 // SPBRGH1 Bits 3235 3236 extern __at(0x0FB0) __sfr SPBRGH1; 3237 3238 typedef struct 3239 { 3240 unsigned BRG8 : 1; 3241 unsigned BRG9 : 1; 3242 unsigned BRG10 : 1; 3243 unsigned BRG11 : 1; 3244 unsigned BRG12 : 1; 3245 unsigned BRG13 : 1; 3246 unsigned BRG14 : 1; 3247 unsigned BRG15 : 1; 3248 } __SPBRGH1bits_t; 3249 3250 extern __at(0x0FB0) volatile __SPBRGH1bits_t SPBRGH1bits; 3251 3252 #define _SPBRGH1_BRG8 0x01 3253 #define _SPBRGH1_BRG9 0x02 3254 #define _SPBRGH1_BRG10 0x04 3255 #define _SPBRGH1_BRG11 0x08 3256 #define _SPBRGH1_BRG12 0x10 3257 #define _SPBRGH1_BRG13 0x20 3258 #define _SPBRGH1_BRG14 0x40 3259 #define _SPBRGH1_BRG15 0x80 3260 3261 //============================================================================== 3262 3263 3264 //============================================================================== 3265 // T3CON Bits 3266 3267 extern __at(0x0FB1) __sfr T3CON; 3268 3269 typedef union 3270 { 3271 struct 3272 { 3273 unsigned TMR3ON : 1; 3274 unsigned RD16 : 1; 3275 unsigned NOT_T3SYNC : 1; 3276 unsigned SOSCEN : 1; 3277 unsigned T3CKPS0 : 1; 3278 unsigned T3CKPS1 : 1; 3279 unsigned TMR3CS0 : 1; 3280 unsigned TMR3CS1 : 1; 3281 }; 3282 3283 struct 3284 { 3285 unsigned : 1; 3286 unsigned T3RD16 : 1; 3287 unsigned T3SYNC : 1; 3288 unsigned T3SOSCEN : 1; 3289 unsigned : 1; 3290 unsigned : 1; 3291 unsigned : 1; 3292 unsigned : 1; 3293 }; 3294 3295 struct 3296 { 3297 unsigned : 1; 3298 unsigned : 1; 3299 unsigned : 1; 3300 unsigned T3OSCEN : 1; 3301 unsigned : 1; 3302 unsigned : 1; 3303 unsigned : 1; 3304 unsigned : 1; 3305 }; 3306 3307 struct 3308 { 3309 unsigned : 4; 3310 unsigned T3CKPS : 2; 3311 unsigned : 2; 3312 }; 3313 3314 struct 3315 { 3316 unsigned : 6; 3317 unsigned TMR3CS : 2; 3318 }; 3319 } __T3CONbits_t; 3320 3321 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits; 3322 3323 #define _T3CON_TMR3ON 0x01 3324 #define _T3CON_RD16 0x02 3325 #define _T3CON_T3RD16 0x02 3326 #define _T3CON_NOT_T3SYNC 0x04 3327 #define _T3CON_T3SYNC 0x04 3328 #define _T3CON_SOSCEN 0x08 3329 #define _T3CON_T3SOSCEN 0x08 3330 #define _T3CON_T3OSCEN 0x08 3331 #define _T3CON_T3CKPS0 0x10 3332 #define _T3CON_T3CKPS1 0x20 3333 #define _T3CON_TMR3CS0 0x40 3334 #define _T3CON_TMR3CS1 0x80 3335 3336 //============================================================================== 3337 3338 extern __at(0x0FB2) __sfr TMR3; 3339 extern __at(0x0FB2) __sfr TMR3L; 3340 extern __at(0x0FB3) __sfr TMR3H; 3341 3342 //============================================================================== 3343 // T3GCON Bits 3344 3345 extern __at(0x0FB4) __sfr T3GCON; 3346 3347 typedef union 3348 { 3349 struct 3350 { 3351 unsigned T3GSS0 : 1; 3352 unsigned T3GSS1 : 1; 3353 unsigned T3GVAL : 1; 3354 unsigned T3GGO_NOT_T3DONE : 1; 3355 unsigned T3GSPM : 1; 3356 unsigned T3GTM : 1; 3357 unsigned T3GPOL : 1; 3358 unsigned TMR3GE : 1; 3359 }; 3360 3361 struct 3362 { 3363 unsigned : 1; 3364 unsigned : 1; 3365 unsigned : 1; 3366 unsigned T3GGO : 1; 3367 unsigned : 1; 3368 unsigned : 1; 3369 unsigned : 1; 3370 unsigned : 1; 3371 }; 3372 3373 struct 3374 { 3375 unsigned : 1; 3376 unsigned : 1; 3377 unsigned : 1; 3378 unsigned NOT_T3DONE : 1; 3379 unsigned : 1; 3380 unsigned : 1; 3381 unsigned : 1; 3382 unsigned : 1; 3383 }; 3384 3385 struct 3386 { 3387 unsigned : 1; 3388 unsigned : 1; 3389 unsigned : 1; 3390 unsigned T3DONE : 1; 3391 unsigned : 1; 3392 unsigned : 1; 3393 unsigned : 1; 3394 unsigned : 1; 3395 }; 3396 3397 struct 3398 { 3399 unsigned : 1; 3400 unsigned : 1; 3401 unsigned : 1; 3402 unsigned T3GGO_NOT_DONE : 1; 3403 unsigned : 1; 3404 unsigned : 1; 3405 unsigned : 1; 3406 unsigned : 1; 3407 }; 3408 3409 struct 3410 { 3411 unsigned T3GSS : 2; 3412 unsigned : 6; 3413 }; 3414 } __T3GCONbits_t; 3415 3416 extern __at(0x0FB4) volatile __T3GCONbits_t T3GCONbits; 3417 3418 #define _T3GSS0 0x01 3419 #define _T3GSS1 0x02 3420 #define _T3GVAL 0x04 3421 #define _T3GGO_NOT_T3DONE 0x08 3422 #define _T3GGO 0x08 3423 #define _NOT_T3DONE 0x08 3424 #define _T3DONE 0x08 3425 #define _T3GGO_NOT_DONE 0x08 3426 #define _T3GSPM 0x10 3427 #define _T3GTM 0x20 3428 #define _T3GPOL 0x40 3429 #define _TMR3GE 0x80 3430 3431 //============================================================================== 3432 3433 3434 //============================================================================== 3435 // ACTCON Bits 3436 3437 extern __at(0x0FB5) __sfr ACTCON; 3438 3439 typedef union 3440 { 3441 struct 3442 { 3443 unsigned : 1; 3444 unsigned ACTORS : 1; 3445 unsigned : 1; 3446 unsigned ACTLOCK : 1; 3447 unsigned ACTSRC : 1; 3448 unsigned : 1; 3449 unsigned ACTUD : 1; 3450 unsigned ACTEN : 1; 3451 }; 3452 3453 struct 3454 { 3455 unsigned : 1; 3456 unsigned STOR : 1; 3457 unsigned : 1; 3458 unsigned STLOCK : 1; 3459 unsigned STSRC : 1; 3460 unsigned : 1; 3461 unsigned STUD : 1; 3462 unsigned STEN : 1; 3463 }; 3464 3465 struct 3466 { 3467 unsigned : 1; 3468 unsigned ACTOR : 1; 3469 unsigned : 1; 3470 unsigned : 1; 3471 unsigned : 1; 3472 unsigned : 1; 3473 unsigned ACTD : 1; 3474 unsigned ACTSEL : 1; 3475 }; 3476 } __ACTCONbits_t; 3477 3478 extern __at(0x0FB5) volatile __ACTCONbits_t ACTCONbits; 3479 3480 #define _ACTORS 0x02 3481 #define _STOR 0x02 3482 #define _ACTOR 0x02 3483 #define _ACTLOCK 0x08 3484 #define _STLOCK 0x08 3485 #define _ACTSRC 0x10 3486 #define _STSRC 0x10 3487 #define _ACTUD 0x40 3488 #define _STUD 0x40 3489 #define _ACTD 0x40 3490 #define _ACTEN 0x80 3491 #define _STEN 0x80 3492 #define _ACTSEL 0x80 3493 3494 //============================================================================== 3495 3496 3497 //============================================================================== 3498 // STCON Bits 3499 3500 extern __at(0x0FB5) __sfr STCON; 3501 3502 typedef union 3503 { 3504 struct 3505 { 3506 unsigned : 1; 3507 unsigned ACTORS : 1; 3508 unsigned : 1; 3509 unsigned ACTLOCK : 1; 3510 unsigned ACTSRC : 1; 3511 unsigned : 1; 3512 unsigned ACTUD : 1; 3513 unsigned ACTEN : 1; 3514 }; 3515 3516 struct 3517 { 3518 unsigned : 1; 3519 unsigned STOR : 1; 3520 unsigned : 1; 3521 unsigned STLOCK : 1; 3522 unsigned STSRC : 1; 3523 unsigned : 1; 3524 unsigned STUD : 1; 3525 unsigned STEN : 1; 3526 }; 3527 3528 struct 3529 { 3530 unsigned : 1; 3531 unsigned ACTOR : 1; 3532 unsigned : 1; 3533 unsigned : 1; 3534 unsigned : 1; 3535 unsigned : 1; 3536 unsigned ACTD : 1; 3537 unsigned ACTSEL : 1; 3538 }; 3539 } __STCONbits_t; 3540 3541 extern __at(0x0FB5) volatile __STCONbits_t STCONbits; 3542 3543 #define _STCON_ACTORS 0x02 3544 #define _STCON_STOR 0x02 3545 #define _STCON_ACTOR 0x02 3546 #define _STCON_ACTLOCK 0x08 3547 #define _STCON_STLOCK 0x08 3548 #define _STCON_ACTSRC 0x10 3549 #define _STCON_STSRC 0x10 3550 #define _STCON_ACTUD 0x40 3551 #define _STCON_STUD 0x40 3552 #define _STCON_ACTD 0x40 3553 #define _STCON_ACTEN 0x80 3554 #define _STCON_STEN 0x80 3555 #define _STCON_ACTSEL 0x80 3556 3557 //============================================================================== 3558 3559 3560 //============================================================================== 3561 // ECCP1AS Bits 3562 3563 extern __at(0x0FB6) __sfr ECCP1AS; 3564 3565 typedef union 3566 { 3567 struct 3568 { 3569 unsigned PSS1BD0 : 1; 3570 unsigned PSS1BD1 : 1; 3571 unsigned PSS1AC0 : 1; 3572 unsigned PSS1AC1 : 1; 3573 unsigned ECCP1AS0 : 1; 3574 unsigned ECCP1AS1 : 1; 3575 unsigned ECCP1AS2 : 1; 3576 unsigned ECCP1ASE : 1; 3577 }; 3578 3579 struct 3580 { 3581 unsigned PSSBD0 : 1; 3582 unsigned PSSBD1 : 1; 3583 unsigned PSSAC0 : 1; 3584 unsigned PSSAC1 : 1; 3585 unsigned : 1; 3586 unsigned : 1; 3587 unsigned : 1; 3588 unsigned CCP1ASE : 1; 3589 }; 3590 3591 struct 3592 { 3593 unsigned PSS1BD : 2; 3594 unsigned : 6; 3595 }; 3596 3597 struct 3598 { 3599 unsigned PSSBD : 2; 3600 unsigned : 6; 3601 }; 3602 3603 struct 3604 { 3605 unsigned : 2; 3606 unsigned PSS1AC : 2; 3607 unsigned : 4; 3608 }; 3609 3610 struct 3611 { 3612 unsigned : 2; 3613 unsigned PSSAC : 2; 3614 unsigned : 4; 3615 }; 3616 3617 struct 3618 { 3619 unsigned : 4; 3620 unsigned ECCP1AS : 3; 3621 unsigned : 1; 3622 }; 3623 } __ECCP1ASbits_t; 3624 3625 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits; 3626 3627 #define _PSS1BD0 0x01 3628 #define _PSSBD0 0x01 3629 #define _PSS1BD1 0x02 3630 #define _PSSBD1 0x02 3631 #define _PSS1AC0 0x04 3632 #define _PSSAC0 0x04 3633 #define _PSS1AC1 0x08 3634 #define _PSSAC1 0x08 3635 #define _ECCP1AS0 0x10 3636 #define _ECCP1AS1 0x20 3637 #define _ECCP1AS2 0x40 3638 #define _ECCP1ASE 0x80 3639 #define _CCP1ASE 0x80 3640 3641 //============================================================================== 3642 3643 3644 //============================================================================== 3645 // ECCP1DEL Bits 3646 3647 extern __at(0x0FB7) __sfr ECCP1DEL; 3648 3649 typedef union 3650 { 3651 struct 3652 { 3653 unsigned PDC0 : 1; 3654 unsigned PDC1 : 1; 3655 unsigned PDC2 : 1; 3656 unsigned PDC3 : 1; 3657 unsigned PDC4 : 1; 3658 unsigned PDC5 : 1; 3659 unsigned PDC6 : 1; 3660 unsigned P1RSEN : 1; 3661 }; 3662 3663 struct 3664 { 3665 unsigned : 1; 3666 unsigned : 1; 3667 unsigned : 1; 3668 unsigned : 1; 3669 unsigned : 1; 3670 unsigned : 1; 3671 unsigned : 1; 3672 unsigned PR1SEN : 1; 3673 }; 3674 3675 struct 3676 { 3677 unsigned PDC : 7; 3678 unsigned : 1; 3679 }; 3680 } __ECCP1DELbits_t; 3681 3682 extern __at(0x0FB7) volatile __ECCP1DELbits_t ECCP1DELbits; 3683 3684 #define _PDC0 0x01 3685 #define _PDC1 0x02 3686 #define _PDC2 0x04 3687 #define _PDC3 0x08 3688 #define _PDC4 0x10 3689 #define _PDC5 0x20 3690 #define _PDC6 0x40 3691 #define _P1RSEN 0x80 3692 #define _PR1SEN 0x80 3693 3694 //============================================================================== 3695 3696 3697 //============================================================================== 3698 // PWM1CON Bits 3699 3700 extern __at(0x0FB7) __sfr PWM1CON; 3701 3702 typedef union 3703 { 3704 struct 3705 { 3706 unsigned PDC0 : 1; 3707 unsigned PDC1 : 1; 3708 unsigned PDC2 : 1; 3709 unsigned PDC3 : 1; 3710 unsigned PDC4 : 1; 3711 unsigned PDC5 : 1; 3712 unsigned PDC6 : 1; 3713 unsigned P1RSEN : 1; 3714 }; 3715 3716 struct 3717 { 3718 unsigned : 1; 3719 unsigned : 1; 3720 unsigned : 1; 3721 unsigned : 1; 3722 unsigned : 1; 3723 unsigned : 1; 3724 unsigned : 1; 3725 unsigned PR1SEN : 1; 3726 }; 3727 3728 struct 3729 { 3730 unsigned PDC : 7; 3731 unsigned : 1; 3732 }; 3733 } __PWM1CONbits_t; 3734 3735 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits; 3736 3737 #define _PWM1CON_PDC0 0x01 3738 #define _PWM1CON_PDC1 0x02 3739 #define _PWM1CON_PDC2 0x04 3740 #define _PWM1CON_PDC3 0x08 3741 #define _PWM1CON_PDC4 0x10 3742 #define _PWM1CON_PDC5 0x20 3743 #define _PWM1CON_PDC6 0x40 3744 #define _PWM1CON_P1RSEN 0x80 3745 #define _PWM1CON_PR1SEN 0x80 3746 3747 //============================================================================== 3748 3749 3750 //============================================================================== 3751 // BAUDCON Bits 3752 3753 extern __at(0x0FB8) __sfr BAUDCON; 3754 3755 typedef union 3756 { 3757 struct 3758 { 3759 unsigned ABDEN : 1; 3760 unsigned WUE : 1; 3761 unsigned : 1; 3762 unsigned BRG16 : 1; 3763 unsigned TXCKP : 1; 3764 unsigned RXDTP : 1; 3765 unsigned RCIDL : 1; 3766 unsigned ABDOVF : 1; 3767 }; 3768 3769 struct 3770 { 3771 unsigned : 1; 3772 unsigned : 1; 3773 unsigned : 1; 3774 unsigned : 1; 3775 unsigned CKTXP : 1; 3776 unsigned DTRXP : 1; 3777 unsigned RCMT : 1; 3778 unsigned : 1; 3779 }; 3780 3781 struct 3782 { 3783 unsigned : 1; 3784 unsigned : 1; 3785 unsigned : 1; 3786 unsigned : 1; 3787 unsigned SCKP : 1; 3788 unsigned : 1; 3789 unsigned : 1; 3790 unsigned : 1; 3791 }; 3792 } __BAUDCONbits_t; 3793 3794 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits; 3795 3796 #define _ABDEN 0x01 3797 #define _WUE 0x02 3798 #define _BRG16 0x08 3799 #define _TXCKP 0x10 3800 #define _CKTXP 0x10 3801 #define _SCKP 0x10 3802 #define _RXDTP 0x20 3803 #define _DTRXP 0x20 3804 #define _RCIDL 0x40 3805 #define _RCMT 0x40 3806 #define _ABDOVF 0x80 3807 3808 //============================================================================== 3809 3810 3811 //============================================================================== 3812 // BAUDCON1 Bits 3813 3814 extern __at(0x0FB8) __sfr BAUDCON1; 3815 3816 typedef union 3817 { 3818 struct 3819 { 3820 unsigned ABDEN : 1; 3821 unsigned WUE : 1; 3822 unsigned : 1; 3823 unsigned BRG16 : 1; 3824 unsigned TXCKP : 1; 3825 unsigned RXDTP : 1; 3826 unsigned RCIDL : 1; 3827 unsigned ABDOVF : 1; 3828 }; 3829 3830 struct 3831 { 3832 unsigned : 1; 3833 unsigned : 1; 3834 unsigned : 1; 3835 unsigned : 1; 3836 unsigned CKTXP : 1; 3837 unsigned DTRXP : 1; 3838 unsigned RCMT : 1; 3839 unsigned : 1; 3840 }; 3841 3842 struct 3843 { 3844 unsigned : 1; 3845 unsigned : 1; 3846 unsigned : 1; 3847 unsigned : 1; 3848 unsigned SCKP : 1; 3849 unsigned : 1; 3850 unsigned : 1; 3851 unsigned : 1; 3852 }; 3853 } __BAUDCON1bits_t; 3854 3855 extern __at(0x0FB8) volatile __BAUDCON1bits_t BAUDCON1bits; 3856 3857 #define _BAUDCON1_ABDEN 0x01 3858 #define _BAUDCON1_WUE 0x02 3859 #define _BAUDCON1_BRG16 0x08 3860 #define _BAUDCON1_TXCKP 0x10 3861 #define _BAUDCON1_CKTXP 0x10 3862 #define _BAUDCON1_SCKP 0x10 3863 #define _BAUDCON1_RXDTP 0x20 3864 #define _BAUDCON1_DTRXP 0x20 3865 #define _BAUDCON1_RCIDL 0x40 3866 #define _BAUDCON1_RCMT 0x40 3867 #define _BAUDCON1_ABDOVF 0x80 3868 3869 //============================================================================== 3870 3871 3872 //============================================================================== 3873 // PSTR1CON Bits 3874 3875 extern __at(0x0FB9) __sfr PSTR1CON; 3876 3877 typedef union 3878 { 3879 struct 3880 { 3881 unsigned STRA : 1; 3882 unsigned STRB : 1; 3883 unsigned STRC : 1; 3884 unsigned STRD : 1; 3885 unsigned STRSYNC : 1; 3886 unsigned : 1; 3887 unsigned : 1; 3888 unsigned : 1; 3889 }; 3890 3891 struct 3892 { 3893 unsigned STR1A : 1; 3894 unsigned STR1B : 1; 3895 unsigned STR1C : 1; 3896 unsigned STR1D : 1; 3897 unsigned STR1SYNC : 1; 3898 unsigned : 1; 3899 unsigned : 1; 3900 unsigned : 1; 3901 }; 3902 } __PSTR1CONbits_t; 3903 3904 extern __at(0x0FB9) volatile __PSTR1CONbits_t PSTR1CONbits; 3905 3906 #define _STRA 0x01 3907 #define _STR1A 0x01 3908 #define _STRB 0x02 3909 #define _STR1B 0x02 3910 #define _STRC 0x04 3911 #define _STR1C 0x04 3912 #define _STRD 0x08 3913 #define _STR1D 0x08 3914 #define _STRSYNC 0x10 3915 #define _STR1SYNC 0x10 3916 3917 //============================================================================== 3918 3919 3920 //============================================================================== 3921 // T2CON Bits 3922 3923 extern __at(0x0FBA) __sfr T2CON; 3924 3925 typedef union 3926 { 3927 struct 3928 { 3929 unsigned T2CKPS0 : 1; 3930 unsigned T2CKPS1 : 1; 3931 unsigned TMR2ON : 1; 3932 unsigned T2OUTPS0 : 1; 3933 unsigned T2OUTPS1 : 1; 3934 unsigned T2OUTPS2 : 1; 3935 unsigned T2OUTPS3 : 1; 3936 unsigned : 1; 3937 }; 3938 3939 struct 3940 { 3941 unsigned T2CKPS : 2; 3942 unsigned : 6; 3943 }; 3944 3945 struct 3946 { 3947 unsigned : 3; 3948 unsigned T2OUTPS : 4; 3949 unsigned : 1; 3950 }; 3951 } __T2CONbits_t; 3952 3953 extern __at(0x0FBA) volatile __T2CONbits_t T2CONbits; 3954 3955 #define _T2CKPS0 0x01 3956 #define _T2CKPS1 0x02 3957 #define _TMR2ON 0x04 3958 #define _T2OUTPS0 0x08 3959 #define _T2OUTPS1 0x10 3960 #define _T2OUTPS2 0x20 3961 #define _T2OUTPS3 0x40 3962 3963 //============================================================================== 3964 3965 extern __at(0x0FBB) __sfr PR2; 3966 extern __at(0x0FBC) __sfr TMR2; 3967 3968 //============================================================================== 3969 // CCP1CON Bits 3970 3971 extern __at(0x0FBD) __sfr CCP1CON; 3972 3973 typedef union 3974 { 3975 struct 3976 { 3977 unsigned CCP1M0 : 1; 3978 unsigned CCP1M1 : 1; 3979 unsigned CCP1M2 : 1; 3980 unsigned CCP1M3 : 1; 3981 unsigned DC1B0 : 1; 3982 unsigned DC1B1 : 1; 3983 unsigned P1M0 : 1; 3984 unsigned P1M1 : 1; 3985 }; 3986 3987 struct 3988 { 3989 unsigned : 1; 3990 unsigned : 1; 3991 unsigned : 1; 3992 unsigned : 1; 3993 unsigned CCP1Y : 1; 3994 unsigned CCP1X : 1; 3995 unsigned : 1; 3996 unsigned : 1; 3997 }; 3998 3999 struct 4000 { 4001 unsigned CCP1M : 4; 4002 unsigned : 4; 4003 }; 4004 4005 struct 4006 { 4007 unsigned : 4; 4008 unsigned DC1B : 2; 4009 unsigned : 2; 4010 }; 4011 4012 struct 4013 { 4014 unsigned : 6; 4015 unsigned P1M : 2; 4016 }; 4017 } __CCP1CONbits_t; 4018 4019 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits; 4020 4021 #define _CCP1M0 0x01 4022 #define _CCP1M1 0x02 4023 #define _CCP1M2 0x04 4024 #define _CCP1M3 0x08 4025 #define _DC1B0 0x10 4026 #define _CCP1Y 0x10 4027 #define _DC1B1 0x20 4028 #define _CCP1X 0x20 4029 #define _P1M0 0x40 4030 #define _P1M1 0x80 4031 4032 //============================================================================== 4033 4034 4035 //============================================================================== 4036 // ECCP1CON Bits 4037 4038 extern __at(0x0FBD) __sfr ECCP1CON; 4039 4040 typedef union 4041 { 4042 struct 4043 { 4044 unsigned CCP1M0 : 1; 4045 unsigned CCP1M1 : 1; 4046 unsigned CCP1M2 : 1; 4047 unsigned CCP1M3 : 1; 4048 unsigned DC1B0 : 1; 4049 unsigned DC1B1 : 1; 4050 unsigned P1M0 : 1; 4051 unsigned P1M1 : 1; 4052 }; 4053 4054 struct 4055 { 4056 unsigned : 1; 4057 unsigned : 1; 4058 unsigned : 1; 4059 unsigned : 1; 4060 unsigned CCP1Y : 1; 4061 unsigned CCP1X : 1; 4062 unsigned : 1; 4063 unsigned : 1; 4064 }; 4065 4066 struct 4067 { 4068 unsigned CCP1M : 4; 4069 unsigned : 4; 4070 }; 4071 4072 struct 4073 { 4074 unsigned : 4; 4075 unsigned DC1B : 2; 4076 unsigned : 2; 4077 }; 4078 4079 struct 4080 { 4081 unsigned : 6; 4082 unsigned P1M : 2; 4083 }; 4084 } __ECCP1CONbits_t; 4085 4086 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits; 4087 4088 #define _ECCP1CON_CCP1M0 0x01 4089 #define _ECCP1CON_CCP1M1 0x02 4090 #define _ECCP1CON_CCP1M2 0x04 4091 #define _ECCP1CON_CCP1M3 0x08 4092 #define _ECCP1CON_DC1B0 0x10 4093 #define _ECCP1CON_CCP1Y 0x10 4094 #define _ECCP1CON_DC1B1 0x20 4095 #define _ECCP1CON_CCP1X 0x20 4096 #define _ECCP1CON_P1M0 0x40 4097 #define _ECCP1CON_P1M1 0x80 4098 4099 //============================================================================== 4100 4101 extern __at(0x0FBE) __sfr CCPR1; 4102 extern __at(0x0FBE) __sfr CCPR1L; 4103 extern __at(0x0FBF) __sfr CCPR1H; 4104 4105 //============================================================================== 4106 // ADCON2 Bits 4107 4108 extern __at(0x0FC0) __sfr ADCON2; 4109 4110 typedef union 4111 { 4112 struct 4113 { 4114 unsigned ADCS0 : 1; 4115 unsigned ADCS1 : 1; 4116 unsigned ADCS2 : 1; 4117 unsigned ACQT0 : 1; 4118 unsigned ACQT1 : 1; 4119 unsigned ACQT2 : 1; 4120 unsigned : 1; 4121 unsigned ADFM : 1; 4122 }; 4123 4124 struct 4125 { 4126 unsigned ADCS : 3; 4127 unsigned : 5; 4128 }; 4129 4130 struct 4131 { 4132 unsigned : 3; 4133 unsigned ACQT : 3; 4134 unsigned : 2; 4135 }; 4136 } __ADCON2bits_t; 4137 4138 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits; 4139 4140 #define _ADCS0 0x01 4141 #define _ADCS1 0x02 4142 #define _ADCS2 0x04 4143 #define _ACQT0 0x08 4144 #define _ACQT1 0x10 4145 #define _ACQT2 0x20 4146 #define _ADFM 0x80 4147 4148 //============================================================================== 4149 4150 4151 //============================================================================== 4152 // ADCON1 Bits 4153 4154 extern __at(0x0FC1) __sfr ADCON1; 4155 4156 typedef union 4157 { 4158 struct 4159 { 4160 unsigned NVCFG0 : 1; 4161 unsigned NVCFG1 : 1; 4162 unsigned PVCFG0 : 1; 4163 unsigned PVCFG1 : 1; 4164 unsigned : 1; 4165 unsigned : 1; 4166 unsigned : 1; 4167 unsigned TRIGSEL : 1; 4168 }; 4169 4170 struct 4171 { 4172 unsigned NVCFG : 2; 4173 unsigned : 6; 4174 }; 4175 4176 struct 4177 { 4178 unsigned : 2; 4179 unsigned PVCFG : 2; 4180 unsigned : 4; 4181 }; 4182 } __ADCON1bits_t; 4183 4184 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits; 4185 4186 #define _NVCFG0 0x01 4187 #define _NVCFG1 0x02 4188 #define _PVCFG0 0x04 4189 #define _PVCFG1 0x08 4190 #define _TRIGSEL 0x80 4191 4192 //============================================================================== 4193 4194 4195 //============================================================================== 4196 // ADCON0 Bits 4197 4198 extern __at(0x0FC2) __sfr ADCON0; 4199 4200 typedef union 4201 { 4202 struct 4203 { 4204 unsigned ADON : 1; 4205 unsigned GO_NOT_DONE : 1; 4206 unsigned : 1; 4207 unsigned : 1; 4208 unsigned : 1; 4209 unsigned : 1; 4210 unsigned : 1; 4211 unsigned : 1; 4212 }; 4213 4214 struct 4215 { 4216 unsigned : 1; 4217 unsigned DONE : 1; 4218 unsigned : 1; 4219 unsigned : 1; 4220 unsigned : 1; 4221 unsigned : 1; 4222 unsigned : 1; 4223 unsigned : 1; 4224 }; 4225 4226 struct 4227 { 4228 unsigned : 1; 4229 unsigned GO : 1; 4230 unsigned : 1; 4231 unsigned : 1; 4232 unsigned : 1; 4233 unsigned : 1; 4234 unsigned : 1; 4235 unsigned : 1; 4236 }; 4237 4238 struct 4239 { 4240 unsigned : 1; 4241 unsigned NOT_DONE : 1; 4242 unsigned : 1; 4243 unsigned : 1; 4244 unsigned : 1; 4245 unsigned : 1; 4246 unsigned : 1; 4247 unsigned : 1; 4248 }; 4249 } __ADCON0bits_t; 4250 4251 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits; 4252 4253 #define _ADON 0x01 4254 #define _GO_NOT_DONE 0x02 4255 #define _DONE 0x02 4256 #define _GO 0x02 4257 #define _NOT_DONE 0x02 4258 4259 //============================================================================== 4260 4261 extern __at(0x0FC3) __sfr ADRESL; 4262 extern __at(0x0FC4) __sfr ADRESH; 4263 4264 //============================================================================== 4265 // SSP1CON2 Bits 4266 4267 extern __at(0x0FC5) __sfr SSP1CON2; 4268 4269 typedef struct 4270 { 4271 unsigned SEN : 1; 4272 unsigned RSEN : 1; 4273 unsigned PEN : 1; 4274 unsigned RCEN : 1; 4275 unsigned ACKEN : 1; 4276 unsigned ACKDT : 1; 4277 unsigned ACKSTAT : 1; 4278 unsigned GCEN : 1; 4279 } __SSP1CON2bits_t; 4280 4281 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits; 4282 4283 #define _SEN 0x01 4284 #define _RSEN 0x02 4285 #define _PEN 0x04 4286 #define _RCEN 0x08 4287 #define _ACKEN 0x10 4288 #define _ACKDT 0x20 4289 #define _ACKSTAT 0x40 4290 #define _GCEN 0x80 4291 4292 //============================================================================== 4293 4294 4295 //============================================================================== 4296 // SSPCON2 Bits 4297 4298 extern __at(0x0FC5) __sfr SSPCON2; 4299 4300 typedef struct 4301 { 4302 unsigned SEN : 1; 4303 unsigned RSEN : 1; 4304 unsigned PEN : 1; 4305 unsigned RCEN : 1; 4306 unsigned ACKEN : 1; 4307 unsigned ACKDT : 1; 4308 unsigned ACKSTAT : 1; 4309 unsigned GCEN : 1; 4310 } __SSPCON2bits_t; 4311 4312 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits; 4313 4314 #define _SSPCON2_SEN 0x01 4315 #define _SSPCON2_RSEN 0x02 4316 #define _SSPCON2_PEN 0x04 4317 #define _SSPCON2_RCEN 0x08 4318 #define _SSPCON2_ACKEN 0x10 4319 #define _SSPCON2_ACKDT 0x20 4320 #define _SSPCON2_ACKSTAT 0x40 4321 #define _SSPCON2_GCEN 0x80 4322 4323 //============================================================================== 4324 4325 4326 //============================================================================== 4327 // SSP1CON1 Bits 4328 4329 extern __at(0x0FC6) __sfr SSP1CON1; 4330 4331 typedef union 4332 { 4333 struct 4334 { 4335 unsigned SSPM0 : 1; 4336 unsigned SSPM1 : 1; 4337 unsigned SSPM2 : 1; 4338 unsigned SSPM3 : 1; 4339 unsigned CKP : 1; 4340 unsigned SSPEN : 1; 4341 unsigned SSPOV : 1; 4342 unsigned WCOL : 1; 4343 }; 4344 4345 struct 4346 { 4347 unsigned SSPM : 4; 4348 unsigned : 4; 4349 }; 4350 } __SSP1CON1bits_t; 4351 4352 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits; 4353 4354 #define _SSPM0 0x01 4355 #define _SSPM1 0x02 4356 #define _SSPM2 0x04 4357 #define _SSPM3 0x08 4358 #define _CKP 0x10 4359 #define _SSPEN 0x20 4360 #define _SSPOV 0x40 4361 #define _WCOL 0x80 4362 4363 //============================================================================== 4364 4365 4366 //============================================================================== 4367 // SSPCON Bits 4368 4369 extern __at(0x0FC6) __sfr SSPCON; 4370 4371 typedef union 4372 { 4373 struct 4374 { 4375 unsigned SSPM0 : 1; 4376 unsigned SSPM1 : 1; 4377 unsigned SSPM2 : 1; 4378 unsigned SSPM3 : 1; 4379 unsigned CKP : 1; 4380 unsigned SSPEN : 1; 4381 unsigned SSPOV : 1; 4382 unsigned WCOL : 1; 4383 }; 4384 4385 struct 4386 { 4387 unsigned SSPM : 4; 4388 unsigned : 4; 4389 }; 4390 } __SSPCONbits_t; 4391 4392 extern __at(0x0FC6) volatile __SSPCONbits_t SSPCONbits; 4393 4394 #define _SSPCON_SSPM0 0x01 4395 #define _SSPCON_SSPM1 0x02 4396 #define _SSPCON_SSPM2 0x04 4397 #define _SSPCON_SSPM3 0x08 4398 #define _SSPCON_CKP 0x10 4399 #define _SSPCON_SSPEN 0x20 4400 #define _SSPCON_SSPOV 0x40 4401 #define _SSPCON_WCOL 0x80 4402 4403 //============================================================================== 4404 4405 4406 //============================================================================== 4407 // SSPCON1 Bits 4408 4409 extern __at(0x0FC6) __sfr SSPCON1; 4410 4411 typedef union 4412 { 4413 struct 4414 { 4415 unsigned SSPM0 : 1; 4416 unsigned SSPM1 : 1; 4417 unsigned SSPM2 : 1; 4418 unsigned SSPM3 : 1; 4419 unsigned CKP : 1; 4420 unsigned SSPEN : 1; 4421 unsigned SSPOV : 1; 4422 unsigned WCOL : 1; 4423 }; 4424 4425 struct 4426 { 4427 unsigned SSPM : 4; 4428 unsigned : 4; 4429 }; 4430 } __SSPCON1bits_t; 4431 4432 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits; 4433 4434 #define _SSPCON1_SSPM0 0x01 4435 #define _SSPCON1_SSPM1 0x02 4436 #define _SSPCON1_SSPM2 0x04 4437 #define _SSPCON1_SSPM3 0x08 4438 #define _SSPCON1_CKP 0x10 4439 #define _SSPCON1_SSPEN 0x20 4440 #define _SSPCON1_SSPOV 0x40 4441 #define _SSPCON1_WCOL 0x80 4442 4443 //============================================================================== 4444 4445 4446 //============================================================================== 4447 // SSP1STAT Bits 4448 4449 extern __at(0x0FC7) __sfr SSP1STAT; 4450 4451 typedef struct 4452 { 4453 unsigned BF : 1; 4454 unsigned UA : 1; 4455 unsigned R_NOT_W : 1; 4456 unsigned S : 1; 4457 unsigned P : 1; 4458 unsigned D_NOT_A : 1; 4459 unsigned CKE : 1; 4460 unsigned SMP : 1; 4461 } __SSP1STATbits_t; 4462 4463 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits; 4464 4465 #define _BF 0x01 4466 #define _UA 0x02 4467 #define _R_NOT_W 0x04 4468 #define _S 0x08 4469 #define _P 0x10 4470 #define _D_NOT_A 0x20 4471 #define _CKE 0x40 4472 #define _SMP 0x80 4473 4474 //============================================================================== 4475 4476 4477 //============================================================================== 4478 // SSPSTAT Bits 4479 4480 extern __at(0x0FC7) __sfr SSPSTAT; 4481 4482 typedef struct 4483 { 4484 unsigned BF : 1; 4485 unsigned UA : 1; 4486 unsigned R_NOT_W : 1; 4487 unsigned S : 1; 4488 unsigned P : 1; 4489 unsigned D_NOT_A : 1; 4490 unsigned CKE : 1; 4491 unsigned SMP : 1; 4492 } __SSPSTATbits_t; 4493 4494 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits; 4495 4496 #define _SSPSTAT_BF 0x01 4497 #define _SSPSTAT_UA 0x02 4498 #define _SSPSTAT_R_NOT_W 0x04 4499 #define _SSPSTAT_S 0x08 4500 #define _SSPSTAT_P 0x10 4501 #define _SSPSTAT_D_NOT_A 0x20 4502 #define _SSPSTAT_CKE 0x40 4503 #define _SSPSTAT_SMP 0x80 4504 4505 //============================================================================== 4506 4507 4508 //============================================================================== 4509 // SSP1ADD Bits 4510 4511 extern __at(0x0FC8) __sfr SSP1ADD; 4512 4513 typedef struct 4514 { 4515 unsigned SSP1ADD0 : 1; 4516 unsigned SSP1ADD1 : 1; 4517 unsigned SSP1ADD2 : 1; 4518 unsigned SSP1ADD3 : 1; 4519 unsigned SSP1ADD4 : 1; 4520 unsigned SSP1ADD5 : 1; 4521 unsigned SSP1ADD6 : 1; 4522 unsigned SSP1ADD7 : 1; 4523 } __SSP1ADDbits_t; 4524 4525 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits; 4526 4527 #define _SSP1ADD0 0x01 4528 #define _SSP1ADD1 0x02 4529 #define _SSP1ADD2 0x04 4530 #define _SSP1ADD3 0x08 4531 #define _SSP1ADD4 0x10 4532 #define _SSP1ADD5 0x20 4533 #define _SSP1ADD6 0x40 4534 #define _SSP1ADD7 0x80 4535 4536 //============================================================================== 4537 4538 4539 //============================================================================== 4540 // SSPADD Bits 4541 4542 extern __at(0x0FC8) __sfr SSPADD; 4543 4544 typedef struct 4545 { 4546 unsigned SSP1ADD0 : 1; 4547 unsigned SSP1ADD1 : 1; 4548 unsigned SSP1ADD2 : 1; 4549 unsigned SSP1ADD3 : 1; 4550 unsigned SSP1ADD4 : 1; 4551 unsigned SSP1ADD5 : 1; 4552 unsigned SSP1ADD6 : 1; 4553 unsigned SSP1ADD7 : 1; 4554 } __SSPADDbits_t; 4555 4556 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits; 4557 4558 #define _SSPADD_SSP1ADD0 0x01 4559 #define _SSPADD_SSP1ADD1 0x02 4560 #define _SSPADD_SSP1ADD2 0x04 4561 #define _SSPADD_SSP1ADD3 0x08 4562 #define _SSPADD_SSP1ADD4 0x10 4563 #define _SSPADD_SSP1ADD5 0x20 4564 #define _SSPADD_SSP1ADD6 0x40 4565 #define _SSPADD_SSP1ADD7 0x80 4566 4567 //============================================================================== 4568 4569 extern __at(0x0FC9) __sfr SSP1BUF; 4570 extern __at(0x0FC9) __sfr SSPBUF; 4571 4572 //============================================================================== 4573 // SSP1MSK Bits 4574 4575 extern __at(0x0FCA) __sfr SSP1MSK; 4576 4577 typedef struct 4578 { 4579 unsigned SSP1MSK0 : 1; 4580 unsigned SSP1MSK1 : 1; 4581 unsigned SSP1MSK2 : 1; 4582 unsigned SSP1MSK3 : 1; 4583 unsigned SSP1MSK4 : 1; 4584 unsigned SSP1MSK5 : 1; 4585 unsigned SSP1MSK6 : 1; 4586 unsigned SSP1MSK7 : 1; 4587 } __SSP1MSKbits_t; 4588 4589 extern __at(0x0FCA) volatile __SSP1MSKbits_t SSP1MSKbits; 4590 4591 #define _SSP1MSK0 0x01 4592 #define _SSP1MSK1 0x02 4593 #define _SSP1MSK2 0x04 4594 #define _SSP1MSK3 0x08 4595 #define _SSP1MSK4 0x10 4596 #define _SSP1MSK5 0x20 4597 #define _SSP1MSK6 0x40 4598 #define _SSP1MSK7 0x80 4599 4600 //============================================================================== 4601 4602 4603 //============================================================================== 4604 // SSPMSK Bits 4605 4606 extern __at(0x0FCA) __sfr SSPMSK; 4607 4608 typedef struct 4609 { 4610 unsigned SSP1MSK0 : 1; 4611 unsigned SSP1MSK1 : 1; 4612 unsigned SSP1MSK2 : 1; 4613 unsigned SSP1MSK3 : 1; 4614 unsigned SSP1MSK4 : 1; 4615 unsigned SSP1MSK5 : 1; 4616 unsigned SSP1MSK6 : 1; 4617 unsigned SSP1MSK7 : 1; 4618 } __SSPMSKbits_t; 4619 4620 extern __at(0x0FCA) volatile __SSPMSKbits_t SSPMSKbits; 4621 4622 #define _SSPMSK_SSP1MSK0 0x01 4623 #define _SSPMSK_SSP1MSK1 0x02 4624 #define _SSPMSK_SSP1MSK2 0x04 4625 #define _SSPMSK_SSP1MSK3 0x08 4626 #define _SSPMSK_SSP1MSK4 0x10 4627 #define _SSPMSK_SSP1MSK5 0x20 4628 #define _SSPMSK_SSP1MSK6 0x40 4629 #define _SSPMSK_SSP1MSK7 0x80 4630 4631 //============================================================================== 4632 4633 4634 //============================================================================== 4635 // SSP1CON3 Bits 4636 4637 extern __at(0x0FCB) __sfr SSP1CON3; 4638 4639 typedef struct 4640 { 4641 unsigned DHEN : 1; 4642 unsigned AHEN : 1; 4643 unsigned SBCDE : 1; 4644 unsigned SDAHT : 1; 4645 unsigned BOEN : 1; 4646 unsigned SCIE : 1; 4647 unsigned PCIE : 1; 4648 unsigned ACKTIM : 1; 4649 } __SSP1CON3bits_t; 4650 4651 extern __at(0x0FCB) volatile __SSP1CON3bits_t SSP1CON3bits; 4652 4653 #define _DHEN 0x01 4654 #define _AHEN 0x02 4655 #define _SBCDE 0x04 4656 #define _SDAHT 0x08 4657 #define _BOEN 0x10 4658 #define _SCIE 0x20 4659 #define _PCIE 0x40 4660 #define _ACKTIM 0x80 4661 4662 //============================================================================== 4663 4664 4665 //============================================================================== 4666 // SSPCON3 Bits 4667 4668 extern __at(0x0FCB) __sfr SSPCON3; 4669 4670 typedef struct 4671 { 4672 unsigned DHEN : 1; 4673 unsigned AHEN : 1; 4674 unsigned SBCDE : 1; 4675 unsigned SDAHT : 1; 4676 unsigned BOEN : 1; 4677 unsigned SCIE : 1; 4678 unsigned PCIE : 1; 4679 unsigned ACKTIM : 1; 4680 } __SSPCON3bits_t; 4681 4682 extern __at(0x0FCB) volatile __SSPCON3bits_t SSPCON3bits; 4683 4684 #define _SSPCON3_DHEN 0x01 4685 #define _SSPCON3_AHEN 0x02 4686 #define _SSPCON3_SBCDE 0x04 4687 #define _SSPCON3_SDAHT 0x08 4688 #define _SSPCON3_BOEN 0x10 4689 #define _SSPCON3_SCIE 0x20 4690 #define _SSPCON3_PCIE 0x40 4691 #define _SSPCON3_ACKTIM 0x80 4692 4693 //============================================================================== 4694 4695 4696 //============================================================================== 4697 // T1GCON Bits 4698 4699 extern __at(0x0FCC) __sfr T1GCON; 4700 4701 typedef union 4702 { 4703 struct 4704 { 4705 unsigned T1GSS0 : 1; 4706 unsigned T1GSS1 : 1; 4707 unsigned T1GVAL : 1; 4708 unsigned T1GGO_NOT_T1DONE : 1; 4709 unsigned T1GSPM : 1; 4710 unsigned T1GTM : 1; 4711 unsigned T1GPOL : 1; 4712 unsigned TMR1GE : 1; 4713 }; 4714 4715 struct 4716 { 4717 unsigned : 1; 4718 unsigned : 1; 4719 unsigned : 1; 4720 unsigned T1GGO : 1; 4721 unsigned : 1; 4722 unsigned : 1; 4723 unsigned : 1; 4724 unsigned : 1; 4725 }; 4726 4727 struct 4728 { 4729 unsigned : 1; 4730 unsigned : 1; 4731 unsigned : 1; 4732 unsigned NOT_T1DONE : 1; 4733 unsigned : 1; 4734 unsigned : 1; 4735 unsigned : 1; 4736 unsigned : 1; 4737 }; 4738 4739 struct 4740 { 4741 unsigned : 1; 4742 unsigned : 1; 4743 unsigned : 1; 4744 unsigned T1DONE : 1; 4745 unsigned : 1; 4746 unsigned : 1; 4747 unsigned : 1; 4748 unsigned : 1; 4749 }; 4750 4751 struct 4752 { 4753 unsigned : 1; 4754 unsigned : 1; 4755 unsigned : 1; 4756 unsigned T1GGO_NOT_DONE : 1; 4757 unsigned : 1; 4758 unsigned : 1; 4759 unsigned : 1; 4760 unsigned : 1; 4761 }; 4762 4763 struct 4764 { 4765 unsigned T1GSS : 2; 4766 unsigned : 6; 4767 }; 4768 } __T1GCONbits_t; 4769 4770 extern __at(0x0FCC) volatile __T1GCONbits_t T1GCONbits; 4771 4772 #define _T1GSS0 0x01 4773 #define _T1GSS1 0x02 4774 #define _T1GVAL 0x04 4775 #define _T1GGO_NOT_T1DONE 0x08 4776 #define _T1GGO 0x08 4777 #define _NOT_T1DONE 0x08 4778 #define _T1DONE 0x08 4779 #define _T1GGO_NOT_DONE 0x08 4780 #define _T1GSPM 0x10 4781 #define _T1GTM 0x20 4782 #define _T1GPOL 0x40 4783 #define _TMR1GE 0x80 4784 4785 //============================================================================== 4786 4787 4788 //============================================================================== 4789 // T1CON Bits 4790 4791 extern __at(0x0FCD) __sfr T1CON; 4792 4793 typedef union 4794 { 4795 struct 4796 { 4797 unsigned TMR1ON : 1; 4798 unsigned RD16 : 1; 4799 unsigned NOT_T1SYNC : 1; 4800 unsigned SOSCEN : 1; 4801 unsigned T1CKPS0 : 1; 4802 unsigned T1CKPS1 : 1; 4803 unsigned TMR1CS0 : 1; 4804 unsigned TMR1CS1 : 1; 4805 }; 4806 4807 struct 4808 { 4809 unsigned : 1; 4810 unsigned T1RD16 : 1; 4811 unsigned T1SYNC : 1; 4812 unsigned T1SOSCEN : 1; 4813 unsigned : 1; 4814 unsigned : 1; 4815 unsigned : 1; 4816 unsigned : 1; 4817 }; 4818 4819 struct 4820 { 4821 unsigned : 1; 4822 unsigned : 1; 4823 unsigned : 1; 4824 unsigned T1OSCEN : 1; 4825 unsigned : 1; 4826 unsigned : 1; 4827 unsigned : 1; 4828 unsigned : 1; 4829 }; 4830 4831 struct 4832 { 4833 unsigned : 4; 4834 unsigned T1CKPS : 2; 4835 unsigned : 2; 4836 }; 4837 4838 struct 4839 { 4840 unsigned : 6; 4841 unsigned TMR1CS : 2; 4842 }; 4843 } __T1CONbits_t; 4844 4845 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits; 4846 4847 #define _TMR1ON 0x01 4848 #define _RD16 0x02 4849 #define _T1RD16 0x02 4850 #define _NOT_T1SYNC 0x04 4851 #define _T1SYNC 0x04 4852 #define _SOSCEN 0x08 4853 #define _T1SOSCEN 0x08 4854 #define _T1OSCEN 0x08 4855 #define _T1CKPS0 0x10 4856 #define _T1CKPS1 0x20 4857 #define _TMR1CS0 0x40 4858 #define _TMR1CS1 0x80 4859 4860 //============================================================================== 4861 4862 extern __at(0x0FCE) __sfr TMR1; 4863 extern __at(0x0FCE) __sfr TMR1L; 4864 extern __at(0x0FCF) __sfr TMR1H; 4865 4866 //============================================================================== 4867 // RCON Bits 4868 4869 extern __at(0x0FD0) __sfr RCON; 4870 4871 typedef union 4872 { 4873 struct 4874 { 4875 unsigned NOT_BOR : 1; 4876 unsigned NOT_POR : 1; 4877 unsigned NOT_PD : 1; 4878 unsigned NOT_TO : 1; 4879 unsigned NOT_RI : 1; 4880 unsigned : 1; 4881 unsigned SBOREN : 1; 4882 unsigned IPEN : 1; 4883 }; 4884 4885 struct 4886 { 4887 unsigned BOR : 1; 4888 unsigned POR : 1; 4889 unsigned PD : 1; 4890 unsigned TO : 1; 4891 unsigned RI : 1; 4892 unsigned : 1; 4893 unsigned : 1; 4894 unsigned : 1; 4895 }; 4896 } __RCONbits_t; 4897 4898 extern __at(0x0FD0) volatile __RCONbits_t RCONbits; 4899 4900 #define _NOT_BOR 0x01 4901 #define _BOR 0x01 4902 #define _NOT_POR 0x02 4903 #define _POR 0x02 4904 #define _NOT_PD 0x04 4905 #define _PD 0x04 4906 #define _NOT_TO 0x08 4907 #define _TO 0x08 4908 #define _NOT_RI 0x10 4909 #define _RI 0x10 4910 #define _SBOREN 0x40 4911 #define _IPEN 0x80 4912 4913 //============================================================================== 4914 4915 4916 //============================================================================== 4917 // WDTCON Bits 4918 4919 extern __at(0x0FD1) __sfr WDTCON; 4920 4921 typedef union 4922 { 4923 struct 4924 { 4925 unsigned SWDTEN : 1; 4926 unsigned : 1; 4927 unsigned : 1; 4928 unsigned : 1; 4929 unsigned : 1; 4930 unsigned : 1; 4931 unsigned : 1; 4932 unsigned : 1; 4933 }; 4934 4935 struct 4936 { 4937 unsigned SWDTE : 1; 4938 unsigned : 1; 4939 unsigned : 1; 4940 unsigned : 1; 4941 unsigned : 1; 4942 unsigned : 1; 4943 unsigned : 1; 4944 unsigned : 1; 4945 }; 4946 } __WDTCONbits_t; 4947 4948 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits; 4949 4950 #define _SWDTEN 0x01 4951 #define _SWDTE 0x01 4952 4953 //============================================================================== 4954 4955 4956 //============================================================================== 4957 // OSCCON2 Bits 4958 4959 extern __at(0x0FD2) __sfr OSCCON2; 4960 4961 typedef struct 4962 { 4963 unsigned LFIOFS : 1; 4964 unsigned HFIOFR : 1; 4965 unsigned PRISD : 1; 4966 unsigned SOSCGO : 1; 4967 unsigned PLLEN : 1; 4968 unsigned INTSRC : 1; 4969 unsigned SOSCRUN : 1; 4970 unsigned PLLRDY : 1; 4971 } __OSCCON2bits_t; 4972 4973 extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits; 4974 4975 #define _LFIOFS 0x01 4976 #define _HFIOFR 0x02 4977 #define _PRISD 0x04 4978 #define _SOSCGO 0x08 4979 #define _PLLEN 0x10 4980 #define _INTSRC 0x20 4981 #define _SOSCRUN 0x40 4982 #define _PLLRDY 0x80 4983 4984 //============================================================================== 4985 4986 4987 //============================================================================== 4988 // OSCCON Bits 4989 4990 extern __at(0x0FD3) __sfr OSCCON; 4991 4992 typedef union 4993 { 4994 struct 4995 { 4996 unsigned SCS0 : 1; 4997 unsigned SCS1 : 1; 4998 unsigned HFIOFS : 1; 4999 unsigned OSTS : 1; 5000 unsigned IRCF0 : 1; 5001 unsigned IRCF1 : 1; 5002 unsigned IRCF2 : 1; 5003 unsigned IDLEN : 1; 5004 }; 5005 5006 struct 5007 { 5008 unsigned : 1; 5009 unsigned : 1; 5010 unsigned FLTS : 1; 5011 unsigned : 1; 5012 unsigned : 1; 5013 unsigned : 1; 5014 unsigned : 1; 5015 unsigned : 1; 5016 }; 5017 5018 struct 5019 { 5020 unsigned SCS : 2; 5021 unsigned : 6; 5022 }; 5023 5024 struct 5025 { 5026 unsigned : 4; 5027 unsigned IRCF : 3; 5028 unsigned : 1; 5029 }; 5030 } __OSCCONbits_t; 5031 5032 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits; 5033 5034 #define _SCS0 0x01 5035 #define _SCS1 0x02 5036 #define _HFIOFS 0x04 5037 #define _FLTS 0x04 5038 #define _OSTS 0x08 5039 #define _IRCF0 0x10 5040 #define _IRCF1 0x20 5041 #define _IRCF2 0x40 5042 #define _IDLEN 0x80 5043 5044 //============================================================================== 5045 5046 5047 //============================================================================== 5048 // T0CON Bits 5049 5050 extern __at(0x0FD5) __sfr T0CON; 5051 5052 typedef union 5053 { 5054 struct 5055 { 5056 unsigned T0PS0 : 1; 5057 unsigned T0PS1 : 1; 5058 unsigned T0PS2 : 1; 5059 unsigned PSA : 1; 5060 unsigned T0SE : 1; 5061 unsigned T0CS : 1; 5062 unsigned T08BIT : 1; 5063 unsigned TMR0ON : 1; 5064 }; 5065 5066 struct 5067 { 5068 unsigned T0PS : 3; 5069 unsigned : 5; 5070 }; 5071 } __T0CONbits_t; 5072 5073 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits; 5074 5075 #define _T0PS0 0x01 5076 #define _T0PS1 0x02 5077 #define _T0PS2 0x04 5078 #define _PSA 0x08 5079 #define _T0SE 0x10 5080 #define _T0CS 0x20 5081 #define _T08BIT 0x40 5082 #define _TMR0ON 0x80 5083 5084 //============================================================================== 5085 5086 extern __at(0x0FD6) __sfr TMR0; 5087 extern __at(0x0FD6) __sfr TMR0L; 5088 extern __at(0x0FD7) __sfr TMR0H; 5089 5090 //============================================================================== 5091 // STATUS Bits 5092 5093 extern __at(0x0FD8) __sfr STATUS; 5094 5095 typedef struct 5096 { 5097 unsigned C : 1; 5098 unsigned DC : 1; 5099 unsigned Z : 1; 5100 unsigned OV : 1; 5101 unsigned N : 1; 5102 unsigned : 1; 5103 unsigned : 1; 5104 unsigned : 1; 5105 } __STATUSbits_t; 5106 5107 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits; 5108 5109 #define _C 0x01 5110 #define _DC 0x02 5111 #define _Z 0x04 5112 #define _OV 0x08 5113 #define _N 0x10 5114 5115 //============================================================================== 5116 5117 extern __at(0x0FD9) __sfr FSR2L; 5118 extern __at(0x0FDA) __sfr FSR2H; 5119 extern __at(0x0FDB) __sfr PLUSW2; 5120 extern __at(0x0FDC) __sfr PREINC2; 5121 extern __at(0x0FDD) __sfr POSTDEC2; 5122 extern __at(0x0FDE) __sfr POSTINC2; 5123 extern __at(0x0FDF) __sfr INDF2; 5124 extern __at(0x0FE0) __sfr BSR; 5125 extern __at(0x0FE1) __sfr FSR1L; 5126 extern __at(0x0FE2) __sfr FSR1H; 5127 extern __at(0x0FE3) __sfr PLUSW1; 5128 extern __at(0x0FE4) __sfr PREINC1; 5129 extern __at(0x0FE5) __sfr POSTDEC1; 5130 extern __at(0x0FE6) __sfr POSTINC1; 5131 extern __at(0x0FE7) __sfr INDF1; 5132 extern __at(0x0FE8) __sfr WREG; 5133 extern __at(0x0FE9) __sfr FSR0L; 5134 extern __at(0x0FEA) __sfr FSR0H; 5135 extern __at(0x0FEB) __sfr PLUSW0; 5136 extern __at(0x0FEC) __sfr PREINC0; 5137 extern __at(0x0FED) __sfr POSTDEC0; 5138 extern __at(0x0FEE) __sfr POSTINC0; 5139 extern __at(0x0FEF) __sfr INDF0; 5140 5141 //============================================================================== 5142 // INTCON3 Bits 5143 5144 extern __at(0x0FF0) __sfr INTCON3; 5145 5146 typedef union 5147 { 5148 struct 5149 { 5150 unsigned INT1IF : 1; 5151 unsigned INT2IF : 1; 5152 unsigned : 1; 5153 unsigned INT1IE : 1; 5154 unsigned INT2IE : 1; 5155 unsigned : 1; 5156 unsigned INT1IP : 1; 5157 unsigned INT2IP : 1; 5158 }; 5159 5160 struct 5161 { 5162 unsigned INT1F : 1; 5163 unsigned INT2F : 1; 5164 unsigned : 1; 5165 unsigned INT1E : 1; 5166 unsigned INT2E : 1; 5167 unsigned : 1; 5168 unsigned INT1P : 1; 5169 unsigned INT2P : 1; 5170 }; 5171 } __INTCON3bits_t; 5172 5173 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits; 5174 5175 #define _INT1IF 0x01 5176 #define _INT1F 0x01 5177 #define _INT2IF 0x02 5178 #define _INT2F 0x02 5179 #define _INT1IE 0x08 5180 #define _INT1E 0x08 5181 #define _INT2IE 0x10 5182 #define _INT2E 0x10 5183 #define _INT1IP 0x40 5184 #define _INT1P 0x40 5185 #define _INT2IP 0x80 5186 #define _INT2P 0x80 5187 5188 //============================================================================== 5189 5190 5191 //============================================================================== 5192 // INTCON2 Bits 5193 5194 extern __at(0x0FF1) __sfr INTCON2; 5195 5196 typedef union 5197 { 5198 struct 5199 { 5200 unsigned IOCIP : 1; 5201 unsigned : 1; 5202 unsigned TMR0IP : 1; 5203 unsigned : 1; 5204 unsigned INTEDG2 : 1; 5205 unsigned INTEDG1 : 1; 5206 unsigned INTEDG0 : 1; 5207 unsigned NOT_RBPU : 1; 5208 }; 5209 5210 struct 5211 { 5212 unsigned : 1; 5213 unsigned : 1; 5214 unsigned T0IP : 1; 5215 unsigned : 1; 5216 unsigned : 1; 5217 unsigned : 1; 5218 unsigned : 1; 5219 unsigned RBPU : 1; 5220 }; 5221 } __INTCON2bits_t; 5222 5223 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits; 5224 5225 #define _IOCIP 0x01 5226 #define _TMR0IP 0x04 5227 #define _T0IP 0x04 5228 #define _INTEDG2 0x10 5229 #define _INTEDG1 0x20 5230 #define _INTEDG0 0x40 5231 #define _NOT_RBPU 0x80 5232 #define _RBPU 0x80 5233 5234 //============================================================================== 5235 5236 5237 //============================================================================== 5238 // INTCON Bits 5239 5240 extern __at(0x0FF2) __sfr INTCON; 5241 5242 typedef union 5243 { 5244 struct 5245 { 5246 unsigned IOCIF : 1; 5247 unsigned INT0IF : 1; 5248 unsigned TMR0IF : 1; 5249 unsigned IOCIE : 1; 5250 unsigned INT0IE : 1; 5251 unsigned TMR0IE : 1; 5252 unsigned PEIE_GIEL : 1; 5253 unsigned GIE_GIEH : 1; 5254 }; 5255 5256 struct 5257 { 5258 unsigned : 1; 5259 unsigned INT0F : 1; 5260 unsigned T0IF : 1; 5261 unsigned : 1; 5262 unsigned INT0E : 1; 5263 unsigned T0IE : 1; 5264 unsigned PEIE : 1; 5265 unsigned GIE : 1; 5266 }; 5267 5268 struct 5269 { 5270 unsigned : 1; 5271 unsigned : 1; 5272 unsigned : 1; 5273 unsigned : 1; 5274 unsigned : 1; 5275 unsigned : 1; 5276 unsigned GIEL : 1; 5277 unsigned GIEH : 1; 5278 }; 5279 } __INTCONbits_t; 5280 5281 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits; 5282 5283 #define _IOCIF 0x01 5284 #define _INT0IF 0x02 5285 #define _INT0F 0x02 5286 #define _TMR0IF 0x04 5287 #define _T0IF 0x04 5288 #define _IOCIE 0x08 5289 #define _INT0IE 0x10 5290 #define _INT0E 0x10 5291 #define _TMR0IE 0x20 5292 #define _T0IE 0x20 5293 #define _PEIE_GIEL 0x40 5294 #define _PEIE 0x40 5295 #define _GIEL 0x40 5296 #define _GIE_GIEH 0x80 5297 #define _GIE 0x80 5298 #define _GIEH 0x80 5299 5300 //============================================================================== 5301 5302 extern __at(0x0FF3) __sfr PROD; 5303 extern __at(0x0FF3) __sfr PRODL; 5304 extern __at(0x0FF4) __sfr PRODH; 5305 extern __at(0x0FF5) __sfr TABLAT; 5306 extern __at(0x0FF6) __sfr TBLPTR; 5307 extern __at(0x0FF6) __sfr TBLPTRL; 5308 extern __at(0x0FF7) __sfr TBLPTRH; 5309 extern __at(0x0FF8) __sfr TBLPTRU; 5310 extern __at(0x0FF9) __sfr PC; 5311 extern __at(0x0FF9) __sfr PCL; 5312 extern __at(0x0FFA) __sfr PCLATH; 5313 extern __at(0x0FFB) __sfr PCLATU; 5314 5315 //============================================================================== 5316 // STKPTR Bits 5317 5318 extern __at(0x0FFC) __sfr STKPTR; 5319 5320 typedef union 5321 { 5322 struct 5323 { 5324 unsigned SP0 : 1; 5325 unsigned SP1 : 1; 5326 unsigned SP2 : 1; 5327 unsigned SP3 : 1; 5328 unsigned SP4 : 1; 5329 unsigned : 1; 5330 unsigned STKUNF : 1; 5331 unsigned STKFUL : 1; 5332 }; 5333 5334 struct 5335 { 5336 unsigned : 1; 5337 unsigned : 1; 5338 unsigned : 1; 5339 unsigned : 1; 5340 unsigned : 1; 5341 unsigned : 1; 5342 unsigned : 1; 5343 unsigned STKOVF : 1; 5344 }; 5345 5346 struct 5347 { 5348 unsigned SP : 5; 5349 unsigned : 3; 5350 }; 5351 } __STKPTRbits_t; 5352 5353 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits; 5354 5355 #define _SP0 0x01 5356 #define _SP1 0x02 5357 #define _SP2 0x04 5358 #define _SP3 0x08 5359 #define _SP4 0x10 5360 #define _STKUNF 0x40 5361 #define _STKFUL 0x80 5362 #define _STKOVF 0x80 5363 5364 //============================================================================== 5365 5366 extern __at(0x0FFD) __sfr TOS; 5367 extern __at(0x0FFD) __sfr TOSL; 5368 extern __at(0x0FFE) __sfr TOSH; 5369 extern __at(0x0FFF) __sfr TOSU; 5370 5371 //============================================================================== 5372 // 5373 // Configuration Bits 5374 // 5375 //============================================================================== 5376 5377 #define __CONFIG1L 0x300000 5378 #define __CONFIG1H 0x300001 5379 #define __CONFIG2L 0x300002 5380 #define __CONFIG2H 0x300003 5381 #define __CONFIG3H 0x300005 5382 #define __CONFIG4L 0x300006 5383 #define __CONFIG5L 0x300008 5384 #define __CONFIG5H 0x300009 5385 #define __CONFIG6L 0x30000A 5386 #define __CONFIG6H 0x30000B 5387 #define __CONFIG7L 0x30000C 5388 #define __CONFIG7H 0x30000D 5389 5390 //----------------------------- CONFIG1L Options ------------------------------- 5391 5392 #define _PLLSEL_PLL4X_1L 0xFE // 4x clock multiplier. 5393 #define _PLLSEL_PLL3X_1L 0xFF // 3x clock multiplier. 5394 #define _CFGPLLEN_OFF_1L 0xFD // PLL Disabled (firmware controlled). 5395 #define _CFGPLLEN_ON_1L 0xFF // PLL Enabled. 5396 #define _CPUDIV_NOCLKDIV_1L 0xE7 // CPU uses system clock (no divide). 5397 #define _CPUDIV_CLKDIV2_1L 0xEF // CPU uses system clock divided by 2. 5398 #define _CPUDIV_CLKDIV3_1L 0xF7 // CPU uses system clock divided by 3. 5399 #define _CPUDIV_CLKDIV6_1L 0xFF // CPU uses system clock divided by 6. 5400 #define _LS48MHZ_SYS24X4_1L 0xDF // System clock at 24 MHz, USB clock divider is set to 4. 5401 #define _LS48MHZ_SYS48X8_1L 0xFF // System clock at 48 MHz, USB clock divider is set to 8. 5402 5403 //----------------------------- CONFIG1H Options ------------------------------- 5404 5405 #define _FOSC_LP_1H 0xF0 // LP oscillator. 5406 #define _FOSC_XT_1H 0xF1 // XT oscillator. 5407 #define _FOSC_HSH_1H 0xF2 // HS oscillator, high power 16MHz to 25MHz. 5408 #define _FOSC_HSM_1H 0xF3 // HS oscillator, medium power 4MHz to 16MHz. 5409 #define _FOSC_ECHCLKO_1H 0xF4 // EC oscillator, high power 16MHz to 48MHz, clock output on OSC2. 5410 #define _FOSC_ECHIO_1H 0xF5 // EC oscillator, high power 16MHz to 48MHz. 5411 #define _FOSC_RCCLKO_1H 0xF6 // External RC oscillator, clock output on OSC2. 5412 #define _FOSC_RCIO_1H 0xF7 // External RC oscillator. 5413 #define _FOSC_INTOSCIO_1H 0xF8 // Internal oscillator. 5414 #define _FOSC_INTOSCCLKO_1H 0xF9 // Internal oscillator, clock output on OSC2. 5415 #define _FOSC_ECMCLKO_1H 0xFA // EC oscillator, medium power 4MHz to 16MHz, clock output on OSC2. 5416 #define _FOSC_ECMIO_1H 0xFB // EC oscillator, medium power 4MHz to 16MHz. 5417 #define _FOSC_ECLCLKO_1H 0xFC // EC oscillator, low power <4MHz, clock output on OSC2. 5418 #define _FOSC_ECLIO_1H 0xFD // EC oscillator, low power <4MHz. 5419 #define _PCLKEN_OFF_1H 0xDF // Primary oscillator shutdown firmware controlled. 5420 #define _PCLKEN_ON_1H 0xFF // Primary oscillator enabled. 5421 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled. 5422 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled. 5423 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled. 5424 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled. 5425 5426 //----------------------------- CONFIG2L Options ------------------------------- 5427 5428 #define _nPWRTEN_ON_2L 0xFE // Power up timer enabled. 5429 #define _nPWRTEN_OFF_2L 0xFF // Power up timer disabled. 5430 #define _BOREN_OFF_2L 0xF9 // BOR disabled in hardware (SBOREN is ignored). 5431 #define _BOREN_ON_2L 0xFB // BOR controlled by firmware (SBOREN is enabled). 5432 #define _BOREN_NOSLP_2L 0xFD // BOR enabled in hardware, disabled in Sleep mode (SBOREN is ignored). 5433 #define _BOREN_SBORDIS_2L 0xFF // BOR enabled in hardware (SBOREN is ignored). 5434 #define _BORV_285_2L 0xE7 // BOR set to 2.85V nominal. 5435 #define _BORV_250_2L 0xEF // BOR set to 2.5V nominal. 5436 #define _BORV_220_2L 0xF7 // BOR set to 2.2V nominal. 5437 #define _BORV_190_2L 0xFF // BOR set to 1.9V nominal. 5438 #define _nLPBOR_ON_2L 0xBF // Low-Power Brown-out Reset enabled. 5439 #define _nLPBOR_OFF_2L 0xFF // Low-Power Brown-out Reset disabled. 5440 5441 //----------------------------- CONFIG2H Options ------------------------------- 5442 5443 #define _WDTEN_OFF_2H 0xFC // WDT disabled in hardware (SWDTEN ignored). 5444 #define _WDTEN_NOSLP_2H 0xFD // WDT enabled in hardware, disabled in Sleep mode (SWDTEN ignored). 5445 #define _WDTEN_SWON_2H 0xFE // WDT controlled by firmware (SWDTEN enabled). 5446 #define _WDTEN_ON_2H 0xFF // WDT enabled in hardware (SWDTEN ignored). 5447 #define _WDTPS_1_2H 0xC3 // 1:1. 5448 #define _WDTPS_2_2H 0xC7 // 1:2. 5449 #define _WDTPS_4_2H 0xCB // 1:4. 5450 #define _WDTPS_8_2H 0xCF // 1:8. 5451 #define _WDTPS_16_2H 0xD3 // 1:16. 5452 #define _WDTPS_32_2H 0xD7 // 1:32. 5453 #define _WDTPS_64_2H 0xDB // 1:64. 5454 #define _WDTPS_128_2H 0xDF // 1:128. 5455 #define _WDTPS_256_2H 0xE3 // 1:256. 5456 #define _WDTPS_512_2H 0xE7 // 1:512. 5457 #define _WDTPS_1024_2H 0xEB // 1:1024. 5458 #define _WDTPS_2048_2H 0xEF // 1:2048. 5459 #define _WDTPS_4096_2H 0xF3 // 1:4096. 5460 #define _WDTPS_8192_2H 0xF7 // 1:8192. 5461 #define _WDTPS_16384_2H 0xFB // 1:16384. 5462 #define _WDTPS_32768_2H 0xFF // 1:32768. 5463 5464 //----------------------------- CONFIG3H Options ------------------------------- 5465 5466 #define _CCP2MX_RB3_3H 0xFE // CCP2 input/output is multiplexed with RB3. 5467 #define _CCP2MX_RC1_3H 0xFF // CCP2 input/output is multiplexed with RC1. 5468 #define _PBADEN_OFF_3H 0xFD // PORTB<5:0> pins are configured as digital I/O on Reset. 5469 #define _PBADEN_ON_3H 0xFF // PORTB<5:0> pins are configured as analog input channels on Reset. 5470 #define _T3CMX_RB5_3H 0xEF // T3CKI function is on RB5. 5471 #define _T3CMX_RC0_3H 0xFF // T3CKI function is on RC0. 5472 #define _SDOMX_RC7_3H 0xBF // SDO function is on RC7. 5473 #define _SDOMX_RB3_3H 0xFF // SDO function is on RB3. 5474 #define _MCLRE_OFF_3H 0x7F // RE3 input pin enabled; external MCLR disabled. 5475 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RE3 input disabled. 5476 5477 //----------------------------- CONFIG4L Options ------------------------------- 5478 5479 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset. 5480 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset. 5481 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled. 5482 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled if MCLRE is also 1. 5483 #define _ICPRT_OFF_4L 0xDF // ICPORT disabled. 5484 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled. 5485 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled. 5486 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug. 5487 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins. 5488 5489 //----------------------------- CONFIG5L Options ------------------------------- 5490 5491 #define _CP0_ON_5L 0xFE // Block 0 is code-protected. 5492 #define _CP0_OFF_5L 0xFF // Block 0 is not code-protected. 5493 #define _CP1_ON_5L 0xFD // Block 1 is code-protected. 5494 #define _CP1_OFF_5L 0xFF // Block 1 is not code-protected. 5495 5496 //----------------------------- CONFIG5H Options ------------------------------- 5497 5498 #define _CPB_ON_5H 0xBF // Boot block is code-protected. 5499 #define _CPB_OFF_5H 0xFF // Boot block is not code-protected. 5500 #define _CPD_ON_5H 0x7F // Data EEPROM is code-protected. 5501 #define _CPD_OFF_5H 0xFF // Data EEPROM is not code-protected. 5502 5503 //----------------------------- CONFIG6L Options ------------------------------- 5504 5505 #define _WRT0_ON_6L 0xFE // Block 0 (0800-1FFFh) is write-protected. 5506 #define _WRT0_OFF_6L 0xFF // Block 0 (0800-1FFFh) is not write-protected. 5507 #define _WRT1_ON_6L 0xFD // Block 1 (2000-3FFFh) is write-protected. 5508 #define _WRT1_OFF_6L 0xFF // Block 1 (2000-3FFFh) is not write-protected. 5509 5510 //----------------------------- CONFIG6H Options ------------------------------- 5511 5512 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) are write-protected. 5513 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) are not write-protected. 5514 #define _WRTB_ON_6H 0xBF // Boot block (0000-7FFh) is write-protected. 5515 #define _WRTB_OFF_6H 0xFF // Boot block (0000-7FFh) is not write-protected. 5516 #define _WRTD_ON_6H 0x7F // Data EEPROM is write-protected. 5517 #define _WRTD_OFF_6H 0xFF // Data EEPROM is not write-protected. 5518 5519 //----------------------------- CONFIG7L Options ------------------------------- 5520 5521 #define _EBTR0_ON_7L 0xFE // Block 0 is protected from table reads executed in other blocks. 5522 #define _EBTR0_OFF_7L 0xFF // Block 0 is not protected from table reads executed in other blocks. 5523 #define _EBTR1_ON_7L 0xFD // Block 1 is protected from table reads executed in other blocks. 5524 #define _EBTR1_OFF_7L 0xFF // Block 1 is not protected from table reads executed in other blocks. 5525 5526 //----------------------------- CONFIG7H Options ------------------------------- 5527 5528 #define _EBTRB_ON_7H 0xBF // Boot block is protected from table reads executed in other blocks. 5529 #define _EBTRB_OFF_7H 0xFF // Boot block is not protected from table reads executed in other blocks. 5530 5531 //============================================================================== 5532 5533 #define __DEVID1 0x3FFFFE 5534 #define __DEVID2 0x3FFFFF 5535 5536 #define __IDLOC0 0x200000 5537 #define __IDLOC1 0x200001 5538 #define __IDLOC2 0x200002 5539 #define __IDLOC3 0x200003 5540 #define __IDLOC4 0x200004 5541 #define __IDLOC5 0x200005 5542 #define __IDLOC6 0x200006 5543 #define __IDLOC7 0x200007 5544 5545 #endif // #ifndef __PIC18LF24K50_H__ 5546