1 /* 2 * This declarations of the PIC18F43K22 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:29 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 __PIC18F43K22_H__ 26 #define __PIC18F43K22_H__ 27 28 //============================================================================== 29 30 //============================================================================== 31 // 32 // Register Definitions 33 // 34 //============================================================================== 35 36 37 //============================================================================== 38 // ANSELA Bits 39 40 extern __at(0x0F38) __sfr ANSELA; 41 42 typedef struct 43 { 44 unsigned ANSA0 : 1; 45 unsigned ANSA1 : 1; 46 unsigned ANSA2 : 1; 47 unsigned ANSA3 : 1; 48 unsigned : 1; 49 unsigned ANSA5 : 1; 50 unsigned : 1; 51 unsigned : 1; 52 } __ANSELAbits_t; 53 54 extern __at(0x0F38) volatile __ANSELAbits_t ANSELAbits; 55 56 #define _ANSA0 0x01 57 #define _ANSA1 0x02 58 #define _ANSA2 0x04 59 #define _ANSA3 0x08 60 #define _ANSA5 0x20 61 62 //============================================================================== 63 64 65 //============================================================================== 66 // ANSELB Bits 67 68 extern __at(0x0F39) __sfr ANSELB; 69 70 typedef union 71 { 72 struct 73 { 74 unsigned ANSB0 : 1; 75 unsigned ANSB1 : 1; 76 unsigned ANSB2 : 1; 77 unsigned ANSB3 : 1; 78 unsigned ANSB4 : 1; 79 unsigned ANSB5 : 1; 80 unsigned : 1; 81 unsigned : 1; 82 }; 83 84 struct 85 { 86 unsigned ANSB : 6; 87 unsigned : 2; 88 }; 89 } __ANSELBbits_t; 90 91 extern __at(0x0F39) volatile __ANSELBbits_t ANSELBbits; 92 93 #define _ANSB0 0x01 94 #define _ANSB1 0x02 95 #define _ANSB2 0x04 96 #define _ANSB3 0x08 97 #define _ANSB4 0x10 98 #define _ANSB5 0x20 99 100 //============================================================================== 101 102 103 //============================================================================== 104 // ANSELC Bits 105 106 extern __at(0x0F3A) __sfr ANSELC; 107 108 typedef struct 109 { 110 unsigned : 1; 111 unsigned : 1; 112 unsigned ANSC2 : 1; 113 unsigned ANSC3 : 1; 114 unsigned ANSC4 : 1; 115 unsigned ANSC5 : 1; 116 unsigned ANSC6 : 1; 117 unsigned ANSC7 : 1; 118 } __ANSELCbits_t; 119 120 extern __at(0x0F3A) volatile __ANSELCbits_t ANSELCbits; 121 122 #define _ANSC2 0x04 123 #define _ANSC3 0x08 124 #define _ANSC4 0x10 125 #define _ANSC5 0x20 126 #define _ANSC6 0x40 127 #define _ANSC7 0x80 128 129 //============================================================================== 130 131 132 //============================================================================== 133 // ANSELD Bits 134 135 extern __at(0x0F3B) __sfr ANSELD; 136 137 typedef struct 138 { 139 unsigned ANSD0 : 1; 140 unsigned ANSD1 : 1; 141 unsigned ANSD2 : 1; 142 unsigned ANSD3 : 1; 143 unsigned ANSD4 : 1; 144 unsigned ANSD5 : 1; 145 unsigned ANSD6 : 1; 146 unsigned ANSD7 : 1; 147 } __ANSELDbits_t; 148 149 extern __at(0x0F3B) volatile __ANSELDbits_t ANSELDbits; 150 151 #define _ANSD0 0x01 152 #define _ANSD1 0x02 153 #define _ANSD2 0x04 154 #define _ANSD3 0x08 155 #define _ANSD4 0x10 156 #define _ANSD5 0x20 157 #define _ANSD6 0x40 158 #define _ANSD7 0x80 159 160 //============================================================================== 161 162 163 //============================================================================== 164 // ANSELE Bits 165 166 extern __at(0x0F3C) __sfr ANSELE; 167 168 typedef union 169 { 170 struct 171 { 172 unsigned ANSE0 : 1; 173 unsigned ANSE1 : 1; 174 unsigned ANSE2 : 1; 175 unsigned : 1; 176 unsigned : 1; 177 unsigned : 1; 178 unsigned : 1; 179 unsigned : 1; 180 }; 181 182 struct 183 { 184 unsigned ANSE : 3; 185 unsigned : 5; 186 }; 187 } __ANSELEbits_t; 188 189 extern __at(0x0F3C) volatile __ANSELEbits_t ANSELEbits; 190 191 #define _ANSE0 0x01 192 #define _ANSE1 0x02 193 #define _ANSE2 0x04 194 195 //============================================================================== 196 197 198 //============================================================================== 199 // PMD2 Bits 200 201 extern __at(0x0F3D) __sfr PMD2; 202 203 typedef struct 204 { 205 unsigned ADCMD : 1; 206 unsigned CMP1MD : 1; 207 unsigned CMP2MD : 1; 208 unsigned CTMUMD : 1; 209 unsigned : 1; 210 unsigned : 1; 211 unsigned : 1; 212 unsigned : 1; 213 } __PMD2bits_t; 214 215 extern __at(0x0F3D) volatile __PMD2bits_t PMD2bits; 216 217 #define _ADCMD 0x01 218 #define _CMP1MD 0x02 219 #define _CMP2MD 0x04 220 #define _CTMUMD 0x08 221 222 //============================================================================== 223 224 225 //============================================================================== 226 // PMD1 Bits 227 228 extern __at(0x0F3E) __sfr PMD1; 229 230 typedef struct 231 { 232 unsigned CCP1MD : 1; 233 unsigned CCP2MD : 1; 234 unsigned CCP3MD : 1; 235 unsigned CCP4MD : 1; 236 unsigned CCP5MD : 1; 237 unsigned : 1; 238 unsigned MSSP1MD : 1; 239 unsigned MSSP2MD : 1; 240 } __PMD1bits_t; 241 242 extern __at(0x0F3E) volatile __PMD1bits_t PMD1bits; 243 244 #define _CCP1MD 0x01 245 #define _CCP2MD 0x02 246 #define _CCP3MD 0x04 247 #define _CCP4MD 0x08 248 #define _CCP5MD 0x10 249 #define _MSSP1MD 0x40 250 #define _MSSP2MD 0x80 251 252 //============================================================================== 253 254 255 //============================================================================== 256 // PMD0 Bits 257 258 extern __at(0x0F3F) __sfr PMD0; 259 260 typedef struct 261 { 262 unsigned TMR1MD : 1; 263 unsigned TMR2MD : 1; 264 unsigned TMR3MD : 1; 265 unsigned TMR4MD : 1; 266 unsigned TMR5MD : 1; 267 unsigned TMR6MD : 1; 268 unsigned UART1MD : 1; 269 unsigned UART2MD : 1; 270 } __PMD0bits_t; 271 272 extern __at(0x0F3F) volatile __PMD0bits_t PMD0bits; 273 274 #define _TMR1MD 0x01 275 #define _TMR2MD 0x02 276 #define _TMR3MD 0x04 277 #define _TMR4MD 0x08 278 #define _TMR5MD 0x10 279 #define _TMR6MD 0x20 280 #define _UART1MD 0x40 281 #define _UART2MD 0x80 282 283 //============================================================================== 284 285 286 //============================================================================== 287 // DACCON1 Bits 288 289 extern __at(0x0F40) __sfr DACCON1; 290 291 typedef union 292 { 293 struct 294 { 295 unsigned DACR0 : 1; 296 unsigned DACR1 : 1; 297 unsigned DACR2 : 1; 298 unsigned DACR3 : 1; 299 unsigned DACR4 : 1; 300 unsigned : 1; 301 unsigned : 1; 302 unsigned : 1; 303 }; 304 305 struct 306 { 307 unsigned DACR : 5; 308 unsigned : 3; 309 }; 310 } __DACCON1bits_t; 311 312 extern __at(0x0F40) volatile __DACCON1bits_t DACCON1bits; 313 314 #define _DACR0 0x01 315 #define _DACR1 0x02 316 #define _DACR2 0x04 317 #define _DACR3 0x08 318 #define _DACR4 0x10 319 320 //============================================================================== 321 322 323 //============================================================================== 324 // VREFCON2 Bits 325 326 extern __at(0x0F40) __sfr VREFCON2; 327 328 typedef union 329 { 330 struct 331 { 332 unsigned DACR0 : 1; 333 unsigned DACR1 : 1; 334 unsigned DACR2 : 1; 335 unsigned DACR3 : 1; 336 unsigned DACR4 : 1; 337 unsigned : 1; 338 unsigned : 1; 339 unsigned : 1; 340 }; 341 342 struct 343 { 344 unsigned DACR : 5; 345 unsigned : 3; 346 }; 347 } __VREFCON2bits_t; 348 349 extern __at(0x0F40) volatile __VREFCON2bits_t VREFCON2bits; 350 351 #define _VREFCON2_DACR0 0x01 352 #define _VREFCON2_DACR1 0x02 353 #define _VREFCON2_DACR2 0x04 354 #define _VREFCON2_DACR3 0x08 355 #define _VREFCON2_DACR4 0x10 356 357 //============================================================================== 358 359 360 //============================================================================== 361 // DACCON0 Bits 362 363 extern __at(0x0F41) __sfr DACCON0; 364 365 typedef union 366 { 367 struct 368 { 369 unsigned DACNSS : 1; 370 unsigned : 1; 371 unsigned DACPSS0 : 1; 372 unsigned DACPSS1 : 1; 373 unsigned : 1; 374 unsigned DACOE : 1; 375 unsigned DACLPS : 1; 376 unsigned DACEN : 1; 377 }; 378 379 struct 380 { 381 unsigned : 2; 382 unsigned DACPSS : 2; 383 unsigned : 4; 384 }; 385 } __DACCON0bits_t; 386 387 extern __at(0x0F41) volatile __DACCON0bits_t DACCON0bits; 388 389 #define _DACNSS 0x01 390 #define _DACPSS0 0x04 391 #define _DACPSS1 0x08 392 #define _DACOE 0x20 393 #define _DACLPS 0x40 394 #define _DACEN 0x80 395 396 //============================================================================== 397 398 399 //============================================================================== 400 // VREFCON1 Bits 401 402 extern __at(0x0F41) __sfr VREFCON1; 403 404 typedef union 405 { 406 struct 407 { 408 unsigned DACNSS : 1; 409 unsigned : 1; 410 unsigned DACPSS0 : 1; 411 unsigned DACPSS1 : 1; 412 unsigned : 1; 413 unsigned DACOE : 1; 414 unsigned DACLPS : 1; 415 unsigned DACEN : 1; 416 }; 417 418 struct 419 { 420 unsigned : 2; 421 unsigned DACPSS : 2; 422 unsigned : 4; 423 }; 424 } __VREFCON1bits_t; 425 426 extern __at(0x0F41) volatile __VREFCON1bits_t VREFCON1bits; 427 428 #define _VREFCON1_DACNSS 0x01 429 #define _VREFCON1_DACPSS0 0x04 430 #define _VREFCON1_DACPSS1 0x08 431 #define _VREFCON1_DACOE 0x20 432 #define _VREFCON1_DACLPS 0x40 433 #define _VREFCON1_DACEN 0x80 434 435 //============================================================================== 436 437 438 //============================================================================== 439 // FVRCON Bits 440 441 extern __at(0x0F42) __sfr FVRCON; 442 443 typedef union 444 { 445 struct 446 { 447 unsigned : 1; 448 unsigned : 1; 449 unsigned : 1; 450 unsigned : 1; 451 unsigned FVRS0 : 1; 452 unsigned FVRS1 : 1; 453 unsigned FVRST : 1; 454 unsigned FVREN : 1; 455 }; 456 457 struct 458 { 459 unsigned : 4; 460 unsigned FVRS : 2; 461 unsigned : 2; 462 }; 463 } __FVRCONbits_t; 464 465 extern __at(0x0F42) volatile __FVRCONbits_t FVRCONbits; 466 467 #define _FVRS0 0x10 468 #define _FVRS1 0x20 469 #define _FVRST 0x40 470 #define _FVREN 0x80 471 472 //============================================================================== 473 474 475 //============================================================================== 476 // VREFCON0 Bits 477 478 extern __at(0x0F42) __sfr VREFCON0; 479 480 typedef union 481 { 482 struct 483 { 484 unsigned : 1; 485 unsigned : 1; 486 unsigned : 1; 487 unsigned : 1; 488 unsigned FVRS0 : 1; 489 unsigned FVRS1 : 1; 490 unsigned FVRST : 1; 491 unsigned FVREN : 1; 492 }; 493 494 struct 495 { 496 unsigned : 4; 497 unsigned FVRS : 2; 498 unsigned : 2; 499 }; 500 } __VREFCON0bits_t; 501 502 extern __at(0x0F42) volatile __VREFCON0bits_t VREFCON0bits; 503 504 #define _VREFCON0_FVRS0 0x10 505 #define _VREFCON0_FVRS1 0x20 506 #define _VREFCON0_FVRST 0x40 507 #define _VREFCON0_FVREN 0x80 508 509 //============================================================================== 510 511 512 //============================================================================== 513 // CTMUICON Bits 514 515 extern __at(0x0F43) __sfr CTMUICON; 516 517 typedef union 518 { 519 struct 520 { 521 unsigned IRNG0 : 1; 522 unsigned IRNG1 : 1; 523 unsigned ITRIM0 : 1; 524 unsigned ITRIM1 : 1; 525 unsigned ITRIM2 : 1; 526 unsigned ITRIM3 : 1; 527 unsigned ITRIM4 : 1; 528 unsigned ITRIM5 : 1; 529 }; 530 531 struct 532 { 533 unsigned IRNG : 2; 534 unsigned : 6; 535 }; 536 537 struct 538 { 539 unsigned : 2; 540 unsigned ITRIM : 6; 541 }; 542 } __CTMUICONbits_t; 543 544 extern __at(0x0F43) volatile __CTMUICONbits_t CTMUICONbits; 545 546 #define _IRNG0 0x01 547 #define _IRNG1 0x02 548 #define _ITRIM0 0x04 549 #define _ITRIM1 0x08 550 #define _ITRIM2 0x10 551 #define _ITRIM3 0x20 552 #define _ITRIM4 0x40 553 #define _ITRIM5 0x80 554 555 //============================================================================== 556 557 558 //============================================================================== 559 // CTMUICONH Bits 560 561 extern __at(0x0F43) __sfr CTMUICONH; 562 563 typedef union 564 { 565 struct 566 { 567 unsigned IRNG0 : 1; 568 unsigned IRNG1 : 1; 569 unsigned ITRIM0 : 1; 570 unsigned ITRIM1 : 1; 571 unsigned ITRIM2 : 1; 572 unsigned ITRIM3 : 1; 573 unsigned ITRIM4 : 1; 574 unsigned ITRIM5 : 1; 575 }; 576 577 struct 578 { 579 unsigned IRNG : 2; 580 unsigned : 6; 581 }; 582 583 struct 584 { 585 unsigned : 2; 586 unsigned ITRIM : 6; 587 }; 588 } __CTMUICONHbits_t; 589 590 extern __at(0x0F43) volatile __CTMUICONHbits_t CTMUICONHbits; 591 592 #define _CTMUICONH_IRNG0 0x01 593 #define _CTMUICONH_IRNG1 0x02 594 #define _CTMUICONH_ITRIM0 0x04 595 #define _CTMUICONH_ITRIM1 0x08 596 #define _CTMUICONH_ITRIM2 0x10 597 #define _CTMUICONH_ITRIM3 0x20 598 #define _CTMUICONH_ITRIM4 0x40 599 #define _CTMUICONH_ITRIM5 0x80 600 601 //============================================================================== 602 603 604 //============================================================================== 605 // CTMUCON1 Bits 606 607 extern __at(0x0F44) __sfr CTMUCON1; 608 609 typedef union 610 { 611 struct 612 { 613 unsigned EDG1STAT : 1; 614 unsigned EDG2STAT : 1; 615 unsigned EDG1SEL0 : 1; 616 unsigned EDG1SEL1 : 1; 617 unsigned EDG1POL : 1; 618 unsigned EDG2SEL0 : 1; 619 unsigned EDG2SEL1 : 1; 620 unsigned EDG2POL : 1; 621 }; 622 623 struct 624 { 625 unsigned : 2; 626 unsigned EDG1SEL : 2; 627 unsigned : 4; 628 }; 629 630 struct 631 { 632 unsigned : 5; 633 unsigned EDG2SEL : 2; 634 unsigned : 1; 635 }; 636 } __CTMUCON1bits_t; 637 638 extern __at(0x0F44) volatile __CTMUCON1bits_t CTMUCON1bits; 639 640 #define _EDG1STAT 0x01 641 #define _EDG2STAT 0x02 642 #define _EDG1SEL0 0x04 643 #define _EDG1SEL1 0x08 644 #define _EDG1POL 0x10 645 #define _EDG2SEL0 0x20 646 #define _EDG2SEL1 0x40 647 #define _EDG2POL 0x80 648 649 //============================================================================== 650 651 652 //============================================================================== 653 // CTMUCONL Bits 654 655 extern __at(0x0F44) __sfr CTMUCONL; 656 657 typedef union 658 { 659 struct 660 { 661 unsigned EDG1STAT : 1; 662 unsigned EDG2STAT : 1; 663 unsigned EDG1SEL0 : 1; 664 unsigned EDG1SEL1 : 1; 665 unsigned EDG1POL : 1; 666 unsigned EDG2SEL0 : 1; 667 unsigned EDG2SEL1 : 1; 668 unsigned EDG2POL : 1; 669 }; 670 671 struct 672 { 673 unsigned : 2; 674 unsigned EDG1SEL : 2; 675 unsigned : 4; 676 }; 677 678 struct 679 { 680 unsigned : 5; 681 unsigned EDG2SEL : 2; 682 unsigned : 1; 683 }; 684 } __CTMUCONLbits_t; 685 686 extern __at(0x0F44) volatile __CTMUCONLbits_t CTMUCONLbits; 687 688 #define _CTMUCONL_EDG1STAT 0x01 689 #define _CTMUCONL_EDG2STAT 0x02 690 #define _CTMUCONL_EDG1SEL0 0x04 691 #define _CTMUCONL_EDG1SEL1 0x08 692 #define _CTMUCONL_EDG1POL 0x10 693 #define _CTMUCONL_EDG2SEL0 0x20 694 #define _CTMUCONL_EDG2SEL1 0x40 695 #define _CTMUCONL_EDG2POL 0x80 696 697 //============================================================================== 698 699 700 //============================================================================== 701 // CTMUCON0 Bits 702 703 extern __at(0x0F45) __sfr CTMUCON0; 704 705 typedef struct 706 { 707 unsigned CTTRIG : 1; 708 unsigned IDISSEN : 1; 709 unsigned EDGSEQEN : 1; 710 unsigned EDGEN : 1; 711 unsigned TGEN : 1; 712 unsigned CTMUSIDL : 1; 713 unsigned : 1; 714 unsigned CTMUEN : 1; 715 } __CTMUCON0bits_t; 716 717 extern __at(0x0F45) volatile __CTMUCON0bits_t CTMUCON0bits; 718 719 #define _CTTRIG 0x01 720 #define _IDISSEN 0x02 721 #define _EDGSEQEN 0x04 722 #define _EDGEN 0x08 723 #define _TGEN 0x10 724 #define _CTMUSIDL 0x20 725 #define _CTMUEN 0x80 726 727 //============================================================================== 728 729 730 //============================================================================== 731 // CTMUCONH Bits 732 733 extern __at(0x0F45) __sfr CTMUCONH; 734 735 typedef struct 736 { 737 unsigned CTTRIG : 1; 738 unsigned IDISSEN : 1; 739 unsigned EDGSEQEN : 1; 740 unsigned EDGEN : 1; 741 unsigned TGEN : 1; 742 unsigned CTMUSIDL : 1; 743 unsigned : 1; 744 unsigned CTMUEN : 1; 745 } __CTMUCONHbits_t; 746 747 extern __at(0x0F45) volatile __CTMUCONHbits_t CTMUCONHbits; 748 749 #define _CTMUCONH_CTTRIG 0x01 750 #define _CTMUCONH_IDISSEN 0x02 751 #define _CTMUCONH_EDGSEQEN 0x04 752 #define _CTMUCONH_EDGEN 0x08 753 #define _CTMUCONH_TGEN 0x10 754 #define _CTMUCONH_CTMUSIDL 0x20 755 #define _CTMUCONH_CTMUEN 0x80 756 757 //============================================================================== 758 759 760 //============================================================================== 761 // SRCON1 Bits 762 763 extern __at(0x0F46) __sfr SRCON1; 764 765 typedef struct 766 { 767 unsigned SRRC1E : 1; 768 unsigned SRRC2E : 1; 769 unsigned SRRCKE : 1; 770 unsigned SRRPE : 1; 771 unsigned SRSC1E : 1; 772 unsigned SRSC2E : 1; 773 unsigned SRSCKE : 1; 774 unsigned SRSPE : 1; 775 } __SRCON1bits_t; 776 777 extern __at(0x0F46) volatile __SRCON1bits_t SRCON1bits; 778 779 #define _SRRC1E 0x01 780 #define _SRRC2E 0x02 781 #define _SRRCKE 0x04 782 #define _SRRPE 0x08 783 #define _SRSC1E 0x10 784 #define _SRSC2E 0x20 785 #define _SRSCKE 0x40 786 #define _SRSPE 0x80 787 788 //============================================================================== 789 790 791 //============================================================================== 792 // SRCON0 Bits 793 794 extern __at(0x0F47) __sfr SRCON0; 795 796 typedef union 797 { 798 struct 799 { 800 unsigned SRPR : 1; 801 unsigned SRPS : 1; 802 unsigned SRNQEN : 1; 803 unsigned SRQEN : 1; 804 unsigned SRCLK0 : 1; 805 unsigned SRCLK1 : 1; 806 unsigned SRCLK2 : 1; 807 unsigned SRLEN : 1; 808 }; 809 810 struct 811 { 812 unsigned : 4; 813 unsigned SRCLK : 3; 814 unsigned : 1; 815 }; 816 } __SRCON0bits_t; 817 818 extern __at(0x0F47) volatile __SRCON0bits_t SRCON0bits; 819 820 #define _SRPR 0x01 821 #define _SRPS 0x02 822 #define _SRNQEN 0x04 823 #define _SRQEN 0x08 824 #define _SRCLK0 0x10 825 #define _SRCLK1 0x20 826 #define _SRCLK2 0x40 827 #define _SRLEN 0x80 828 829 //============================================================================== 830 831 832 //============================================================================== 833 // CCPTMRS1 Bits 834 835 extern __at(0x0F48) __sfr CCPTMRS1; 836 837 typedef union 838 { 839 struct 840 { 841 unsigned C4TSEL0 : 1; 842 unsigned C4TSEL1 : 1; 843 unsigned C5TSEL0 : 1; 844 unsigned C5TSEL1 : 1; 845 unsigned : 1; 846 unsigned : 1; 847 unsigned : 1; 848 unsigned : 1; 849 }; 850 851 struct 852 { 853 unsigned C4TSEL : 2; 854 unsigned : 6; 855 }; 856 857 struct 858 { 859 unsigned : 2; 860 unsigned C5TSEL : 2; 861 unsigned : 4; 862 }; 863 } __CCPTMRS1bits_t; 864 865 extern __at(0x0F48) volatile __CCPTMRS1bits_t CCPTMRS1bits; 866 867 #define _C4TSEL0 0x01 868 #define _C4TSEL1 0x02 869 #define _C5TSEL0 0x04 870 #define _C5TSEL1 0x08 871 872 //============================================================================== 873 874 875 //============================================================================== 876 // CCPTMRS0 Bits 877 878 extern __at(0x0F49) __sfr CCPTMRS0; 879 880 typedef union 881 { 882 struct 883 { 884 unsigned C1TSEL0 : 1; 885 unsigned C1TSEL1 : 1; 886 unsigned : 1; 887 unsigned C2TSEL0 : 1; 888 unsigned C2TSEL1 : 1; 889 unsigned : 1; 890 unsigned C3TSEL0 : 1; 891 unsigned C3TSEL1 : 1; 892 }; 893 894 struct 895 { 896 unsigned C1TSEL : 2; 897 unsigned : 6; 898 }; 899 900 struct 901 { 902 unsigned : 3; 903 unsigned C2TSEL : 2; 904 unsigned : 3; 905 }; 906 907 struct 908 { 909 unsigned : 6; 910 unsigned C3TSEL : 2; 911 }; 912 } __CCPTMRS0bits_t; 913 914 extern __at(0x0F49) volatile __CCPTMRS0bits_t CCPTMRS0bits; 915 916 #define _C1TSEL0 0x01 917 #define _C1TSEL1 0x02 918 #define _C2TSEL0 0x08 919 #define _C2TSEL1 0x10 920 #define _C3TSEL0 0x40 921 #define _C3TSEL1 0x80 922 923 //============================================================================== 924 925 926 //============================================================================== 927 // T6CON Bits 928 929 extern __at(0x0F4A) __sfr T6CON; 930 931 typedef union 932 { 933 struct 934 { 935 unsigned T6CKPS0 : 1; 936 unsigned T6CKPS1 : 1; 937 unsigned TMR6ON : 1; 938 unsigned T6OUTPS0 : 1; 939 unsigned T6OUTPS1 : 1; 940 unsigned T6OUTPS2 : 1; 941 unsigned T6OUTPS3 : 1; 942 unsigned : 1; 943 }; 944 945 struct 946 { 947 unsigned T6CKPS : 2; 948 unsigned : 6; 949 }; 950 951 struct 952 { 953 unsigned : 3; 954 unsigned T6OUTPS : 4; 955 unsigned : 1; 956 }; 957 } __T6CONbits_t; 958 959 extern __at(0x0F4A) volatile __T6CONbits_t T6CONbits; 960 961 #define _T6CKPS0 0x01 962 #define _T6CKPS1 0x02 963 #define _TMR6ON 0x04 964 #define _T6OUTPS0 0x08 965 #define _T6OUTPS1 0x10 966 #define _T6OUTPS2 0x20 967 #define _T6OUTPS3 0x40 968 969 //============================================================================== 970 971 extern __at(0x0F4B) __sfr PR6; 972 extern __at(0x0F4C) __sfr TMR6; 973 974 //============================================================================== 975 // T5GCON Bits 976 977 extern __at(0x0F4D) __sfr T5GCON; 978 979 typedef union 980 { 981 struct 982 { 983 unsigned T5GSS0 : 1; 984 unsigned T5GSS1 : 1; 985 unsigned T5GVAL : 1; 986 unsigned T5GGO_NOT_DONE : 1; 987 unsigned T5GSPM : 1; 988 unsigned T5GTM : 1; 989 unsigned T5GPOL : 1; 990 unsigned TMR5GE : 1; 991 }; 992 993 struct 994 { 995 unsigned : 1; 996 unsigned : 1; 997 unsigned : 1; 998 unsigned T5GGO : 1; 999 unsigned : 1; 1000 unsigned : 1; 1001 unsigned : 1; 1002 unsigned : 1; 1003 }; 1004 1005 struct 1006 { 1007 unsigned : 1; 1008 unsigned : 1; 1009 unsigned : 1; 1010 unsigned T5G_DONE : 1; 1011 unsigned : 1; 1012 unsigned : 1; 1013 unsigned : 1; 1014 unsigned : 1; 1015 }; 1016 1017 struct 1018 { 1019 unsigned T5GSS : 2; 1020 unsigned : 6; 1021 }; 1022 } __T5GCONbits_t; 1023 1024 extern __at(0x0F4D) volatile __T5GCONbits_t T5GCONbits; 1025 1026 #define _T5GSS0 0x01 1027 #define _T5GSS1 0x02 1028 #define _T5GVAL 0x04 1029 #define _T5GGO_NOT_DONE 0x08 1030 #define _T5GGO 0x08 1031 #define _T5G_DONE 0x08 1032 #define _T5GSPM 0x10 1033 #define _T5GTM 0x20 1034 #define _T5GPOL 0x40 1035 #define _TMR5GE 0x80 1036 1037 //============================================================================== 1038 1039 1040 //============================================================================== 1041 // T5CON Bits 1042 1043 extern __at(0x0F4E) __sfr T5CON; 1044 1045 typedef union 1046 { 1047 struct 1048 { 1049 unsigned TMR5ON : 1; 1050 unsigned T5RD16 : 1; 1051 unsigned NOT_T5SYNC : 1; 1052 unsigned T5SOSCEN : 1; 1053 unsigned T5CKPS0 : 1; 1054 unsigned T5CKPS1 : 1; 1055 unsigned TMR5CS0 : 1; 1056 unsigned TMR5CS1 : 1; 1057 }; 1058 1059 struct 1060 { 1061 unsigned : 1; 1062 unsigned : 1; 1063 unsigned T5SYNC : 1; 1064 unsigned : 1; 1065 unsigned : 1; 1066 unsigned : 1; 1067 unsigned : 1; 1068 unsigned : 1; 1069 }; 1070 1071 struct 1072 { 1073 unsigned : 4; 1074 unsigned T5CKPS : 2; 1075 unsigned : 2; 1076 }; 1077 1078 struct 1079 { 1080 unsigned : 6; 1081 unsigned TMR5CS : 2; 1082 }; 1083 } __T5CONbits_t; 1084 1085 extern __at(0x0F4E) volatile __T5CONbits_t T5CONbits; 1086 1087 #define _TMR5ON 0x01 1088 #define _T5RD16 0x02 1089 #define _NOT_T5SYNC 0x04 1090 #define _T5SYNC 0x04 1091 #define _T5SOSCEN 0x08 1092 #define _T5CKPS0 0x10 1093 #define _T5CKPS1 0x20 1094 #define _TMR5CS0 0x40 1095 #define _TMR5CS1 0x80 1096 1097 //============================================================================== 1098 1099 extern __at(0x0F4F) __sfr TMR5; 1100 extern __at(0x0F4F) __sfr TMR5L; 1101 extern __at(0x0F50) __sfr TMR5H; 1102 1103 //============================================================================== 1104 // T4CON Bits 1105 1106 extern __at(0x0F51) __sfr T4CON; 1107 1108 typedef union 1109 { 1110 struct 1111 { 1112 unsigned T4CKPS0 : 1; 1113 unsigned T4CKPS1 : 1; 1114 unsigned TMR4ON : 1; 1115 unsigned T4OUTPS0 : 1; 1116 unsigned T4OUTPS1 : 1; 1117 unsigned T4OUTPS2 : 1; 1118 unsigned T4OUTPS3 : 1; 1119 unsigned : 1; 1120 }; 1121 1122 struct 1123 { 1124 unsigned T4CKPS : 2; 1125 unsigned : 6; 1126 }; 1127 1128 struct 1129 { 1130 unsigned : 3; 1131 unsigned T4OUTPS : 4; 1132 unsigned : 1; 1133 }; 1134 } __T4CONbits_t; 1135 1136 extern __at(0x0F51) volatile __T4CONbits_t T4CONbits; 1137 1138 #define _T4CKPS0 0x01 1139 #define _T4CKPS1 0x02 1140 #define _TMR4ON 0x04 1141 #define _T4OUTPS0 0x08 1142 #define _T4OUTPS1 0x10 1143 #define _T4OUTPS2 0x20 1144 #define _T4OUTPS3 0x40 1145 1146 //============================================================================== 1147 1148 extern __at(0x0F52) __sfr PR4; 1149 extern __at(0x0F53) __sfr TMR4; 1150 1151 //============================================================================== 1152 // CCP5CON Bits 1153 1154 extern __at(0x0F54) __sfr CCP5CON; 1155 1156 typedef union 1157 { 1158 struct 1159 { 1160 unsigned CCP5M0 : 1; 1161 unsigned CCP5M1 : 1; 1162 unsigned CCP5M2 : 1; 1163 unsigned CCP5M3 : 1; 1164 unsigned DC5B0 : 1; 1165 unsigned DC5B1 : 1; 1166 unsigned : 1; 1167 unsigned : 1; 1168 }; 1169 1170 struct 1171 { 1172 unsigned CCP5M : 4; 1173 unsigned : 4; 1174 }; 1175 1176 struct 1177 { 1178 unsigned : 4; 1179 unsigned DC5B : 2; 1180 unsigned : 2; 1181 }; 1182 } __CCP5CONbits_t; 1183 1184 extern __at(0x0F54) volatile __CCP5CONbits_t CCP5CONbits; 1185 1186 #define _CCP5M0 0x01 1187 #define _CCP5M1 0x02 1188 #define _CCP5M2 0x04 1189 #define _CCP5M3 0x08 1190 #define _DC5B0 0x10 1191 #define _DC5B1 0x20 1192 1193 //============================================================================== 1194 1195 extern __at(0x0F55) __sfr CCPR5; 1196 extern __at(0x0F55) __sfr CCPR5L; 1197 extern __at(0x0F56) __sfr CCPR5H; 1198 1199 //============================================================================== 1200 // CCP4CON Bits 1201 1202 extern __at(0x0F57) __sfr CCP4CON; 1203 1204 typedef union 1205 { 1206 struct 1207 { 1208 unsigned CCP4M0 : 1; 1209 unsigned CCP4M1 : 1; 1210 unsigned CCP4M2 : 1; 1211 unsigned CCP4M3 : 1; 1212 unsigned DC4B0 : 1; 1213 unsigned DC4B1 : 1; 1214 unsigned : 1; 1215 unsigned : 1; 1216 }; 1217 1218 struct 1219 { 1220 unsigned CCP4M : 4; 1221 unsigned : 4; 1222 }; 1223 1224 struct 1225 { 1226 unsigned : 4; 1227 unsigned DC4B : 2; 1228 unsigned : 2; 1229 }; 1230 } __CCP4CONbits_t; 1231 1232 extern __at(0x0F57) volatile __CCP4CONbits_t CCP4CONbits; 1233 1234 #define _CCP4M0 0x01 1235 #define _CCP4M1 0x02 1236 #define _CCP4M2 0x04 1237 #define _CCP4M3 0x08 1238 #define _DC4B0 0x10 1239 #define _DC4B1 0x20 1240 1241 //============================================================================== 1242 1243 extern __at(0x0F58) __sfr CCPR4; 1244 extern __at(0x0F58) __sfr CCPR4L; 1245 extern __at(0x0F59) __sfr CCPR4H; 1246 1247 //============================================================================== 1248 // PSTR3CON Bits 1249 1250 extern __at(0x0F5A) __sfr PSTR3CON; 1251 1252 typedef struct 1253 { 1254 unsigned STR3A : 1; 1255 unsigned STR3B : 1; 1256 unsigned STR3C : 1; 1257 unsigned STR3D : 1; 1258 unsigned STR3SYNC : 1; 1259 unsigned : 1; 1260 unsigned : 1; 1261 unsigned : 1; 1262 } __PSTR3CONbits_t; 1263 1264 extern __at(0x0F5A) volatile __PSTR3CONbits_t PSTR3CONbits; 1265 1266 #define _STR3A 0x01 1267 #define _STR3B 0x02 1268 #define _STR3C 0x04 1269 #define _STR3D 0x08 1270 #define _STR3SYNC 0x10 1271 1272 //============================================================================== 1273 1274 1275 //============================================================================== 1276 // CCP3AS Bits 1277 1278 extern __at(0x0F5B) __sfr CCP3AS; 1279 1280 typedef union 1281 { 1282 struct 1283 { 1284 unsigned P3SSBD0 : 1; 1285 unsigned P3SSBD1 : 1; 1286 unsigned P3SSAC0 : 1; 1287 unsigned P3SSAC1 : 1; 1288 unsigned CCP3AS0 : 1; 1289 unsigned CCP3AS1 : 1; 1290 unsigned CCP3AS2 : 1; 1291 unsigned CCP3ASE : 1; 1292 }; 1293 1294 struct 1295 { 1296 unsigned PSS3BD0 : 1; 1297 unsigned PSS3BD1 : 1; 1298 unsigned PSS3AC0 : 1; 1299 unsigned PSS3AC1 : 1; 1300 unsigned : 1; 1301 unsigned : 1; 1302 unsigned : 1; 1303 unsigned : 1; 1304 }; 1305 1306 struct 1307 { 1308 unsigned PSS3BD : 2; 1309 unsigned : 6; 1310 }; 1311 1312 struct 1313 { 1314 unsigned P3SSBD : 2; 1315 unsigned : 6; 1316 }; 1317 1318 struct 1319 { 1320 unsigned : 2; 1321 unsigned P3SSAC : 2; 1322 unsigned : 4; 1323 }; 1324 1325 struct 1326 { 1327 unsigned : 2; 1328 unsigned PSS3AC : 2; 1329 unsigned : 4; 1330 }; 1331 1332 struct 1333 { 1334 unsigned : 4; 1335 unsigned CCP3AS : 3; 1336 unsigned : 1; 1337 }; 1338 } __CCP3ASbits_t; 1339 1340 extern __at(0x0F5B) volatile __CCP3ASbits_t CCP3ASbits; 1341 1342 #define _P3SSBD0 0x01 1343 #define _PSS3BD0 0x01 1344 #define _P3SSBD1 0x02 1345 #define _PSS3BD1 0x02 1346 #define _P3SSAC0 0x04 1347 #define _PSS3AC0 0x04 1348 #define _P3SSAC1 0x08 1349 #define _PSS3AC1 0x08 1350 #define _CCP3AS0 0x10 1351 #define _CCP3AS1 0x20 1352 #define _CCP3AS2 0x40 1353 #define _CCP3ASE 0x80 1354 1355 //============================================================================== 1356 1357 1358 //============================================================================== 1359 // ECCP3AS Bits 1360 1361 extern __at(0x0F5B) __sfr ECCP3AS; 1362 1363 typedef union 1364 { 1365 struct 1366 { 1367 unsigned P3SSBD0 : 1; 1368 unsigned P3SSBD1 : 1; 1369 unsigned P3SSAC0 : 1; 1370 unsigned P3SSAC1 : 1; 1371 unsigned CCP3AS0 : 1; 1372 unsigned CCP3AS1 : 1; 1373 unsigned CCP3AS2 : 1; 1374 unsigned CCP3ASE : 1; 1375 }; 1376 1377 struct 1378 { 1379 unsigned PSS3BD0 : 1; 1380 unsigned PSS3BD1 : 1; 1381 unsigned PSS3AC0 : 1; 1382 unsigned PSS3AC1 : 1; 1383 unsigned : 1; 1384 unsigned : 1; 1385 unsigned : 1; 1386 unsigned : 1; 1387 }; 1388 1389 struct 1390 { 1391 unsigned P3SSBD : 2; 1392 unsigned : 6; 1393 }; 1394 1395 struct 1396 { 1397 unsigned PSS3BD : 2; 1398 unsigned : 6; 1399 }; 1400 1401 struct 1402 { 1403 unsigned : 2; 1404 unsigned P3SSAC : 2; 1405 unsigned : 4; 1406 }; 1407 1408 struct 1409 { 1410 unsigned : 2; 1411 unsigned PSS3AC : 2; 1412 unsigned : 4; 1413 }; 1414 1415 struct 1416 { 1417 unsigned : 4; 1418 unsigned CCP3AS : 3; 1419 unsigned : 1; 1420 }; 1421 } __ECCP3ASbits_t; 1422 1423 extern __at(0x0F5B) volatile __ECCP3ASbits_t ECCP3ASbits; 1424 1425 #define _ECCP3AS_P3SSBD0 0x01 1426 #define _ECCP3AS_PSS3BD0 0x01 1427 #define _ECCP3AS_P3SSBD1 0x02 1428 #define _ECCP3AS_PSS3BD1 0x02 1429 #define _ECCP3AS_P3SSAC0 0x04 1430 #define _ECCP3AS_PSS3AC0 0x04 1431 #define _ECCP3AS_P3SSAC1 0x08 1432 #define _ECCP3AS_PSS3AC1 0x08 1433 #define _ECCP3AS_CCP3AS0 0x10 1434 #define _ECCP3AS_CCP3AS1 0x20 1435 #define _ECCP3AS_CCP3AS2 0x40 1436 #define _ECCP3AS_CCP3ASE 0x80 1437 1438 //============================================================================== 1439 1440 1441 //============================================================================== 1442 // PWM3CON Bits 1443 1444 extern __at(0x0F5C) __sfr PWM3CON; 1445 1446 typedef union 1447 { 1448 struct 1449 { 1450 unsigned P3DC0 : 1; 1451 unsigned P3DC1 : 1; 1452 unsigned P3DC2 : 1; 1453 unsigned P3DC3 : 1; 1454 unsigned P3DC4 : 1; 1455 unsigned P3DC5 : 1; 1456 unsigned P3DC6 : 1; 1457 unsigned P3RSEN : 1; 1458 }; 1459 1460 struct 1461 { 1462 unsigned P3DC : 7; 1463 unsigned : 1; 1464 }; 1465 } __PWM3CONbits_t; 1466 1467 extern __at(0x0F5C) volatile __PWM3CONbits_t PWM3CONbits; 1468 1469 #define _P3DC0 0x01 1470 #define _P3DC1 0x02 1471 #define _P3DC2 0x04 1472 #define _P3DC3 0x08 1473 #define _P3DC4 0x10 1474 #define _P3DC5 0x20 1475 #define _P3DC6 0x40 1476 #define _P3RSEN 0x80 1477 1478 //============================================================================== 1479 1480 1481 //============================================================================== 1482 // CCP3CON Bits 1483 1484 extern __at(0x0F5D) __sfr CCP3CON; 1485 1486 typedef union 1487 { 1488 struct 1489 { 1490 unsigned CCP3M0 : 1; 1491 unsigned CCP3M1 : 1; 1492 unsigned CCP3M2 : 1; 1493 unsigned CCP3M3 : 1; 1494 unsigned DC3B0 : 1; 1495 unsigned DC3B1 : 1; 1496 unsigned P3M0 : 1; 1497 unsigned P3M1 : 1; 1498 }; 1499 1500 struct 1501 { 1502 unsigned CCP3M : 4; 1503 unsigned : 4; 1504 }; 1505 1506 struct 1507 { 1508 unsigned : 4; 1509 unsigned DC3B : 2; 1510 unsigned : 2; 1511 }; 1512 1513 struct 1514 { 1515 unsigned : 6; 1516 unsigned P3M : 2; 1517 }; 1518 } __CCP3CONbits_t; 1519 1520 extern __at(0x0F5D) volatile __CCP3CONbits_t CCP3CONbits; 1521 1522 #define _CCP3M0 0x01 1523 #define _CCP3M1 0x02 1524 #define _CCP3M2 0x04 1525 #define _CCP3M3 0x08 1526 #define _DC3B0 0x10 1527 #define _DC3B1 0x20 1528 #define _P3M0 0x40 1529 #define _P3M1 0x80 1530 1531 //============================================================================== 1532 1533 extern __at(0x0F5E) __sfr CCPR3; 1534 extern __at(0x0F5E) __sfr CCPR3L; 1535 extern __at(0x0F5F) __sfr CCPR3H; 1536 1537 //============================================================================== 1538 // SLRCON Bits 1539 1540 extern __at(0x0F60) __sfr SLRCON; 1541 1542 typedef struct 1543 { 1544 unsigned SLRA : 1; 1545 unsigned SLRB : 1; 1546 unsigned SLRC : 1; 1547 unsigned SLRD : 1; 1548 unsigned SLRE : 1; 1549 unsigned : 1; 1550 unsigned : 1; 1551 unsigned : 1; 1552 } __SLRCONbits_t; 1553 1554 extern __at(0x0F60) volatile __SLRCONbits_t SLRCONbits; 1555 1556 #define _SLRA 0x01 1557 #define _SLRB 0x02 1558 #define _SLRC 0x04 1559 #define _SLRD 0x08 1560 #define _SLRE 0x10 1561 1562 //============================================================================== 1563 1564 1565 //============================================================================== 1566 // WPUB Bits 1567 1568 extern __at(0x0F61) __sfr WPUB; 1569 1570 typedef struct 1571 { 1572 unsigned WPUB0 : 1; 1573 unsigned WPUB1 : 1; 1574 unsigned WPUB2 : 1; 1575 unsigned WPUB3 : 1; 1576 unsigned WPUB4 : 1; 1577 unsigned WPUB5 : 1; 1578 unsigned WPUB6 : 1; 1579 unsigned WPUB7 : 1; 1580 } __WPUBbits_t; 1581 1582 extern __at(0x0F61) volatile __WPUBbits_t WPUBbits; 1583 1584 #define _WPUB0 0x01 1585 #define _WPUB1 0x02 1586 #define _WPUB2 0x04 1587 #define _WPUB3 0x08 1588 #define _WPUB4 0x10 1589 #define _WPUB5 0x20 1590 #define _WPUB6 0x40 1591 #define _WPUB7 0x80 1592 1593 //============================================================================== 1594 1595 1596 //============================================================================== 1597 // IOCB Bits 1598 1599 extern __at(0x0F62) __sfr IOCB; 1600 1601 typedef struct 1602 { 1603 unsigned : 1; 1604 unsigned : 1; 1605 unsigned : 1; 1606 unsigned : 1; 1607 unsigned IOCB4 : 1; 1608 unsigned IOCB5 : 1; 1609 unsigned IOCB6 : 1; 1610 unsigned IOCB7 : 1; 1611 } __IOCBbits_t; 1612 1613 extern __at(0x0F62) volatile __IOCBbits_t IOCBbits; 1614 1615 #define _IOCB4 0x10 1616 #define _IOCB5 0x20 1617 #define _IOCB6 0x40 1618 #define _IOCB7 0x80 1619 1620 //============================================================================== 1621 1622 1623 //============================================================================== 1624 // PSTR2CON Bits 1625 1626 extern __at(0x0F63) __sfr PSTR2CON; 1627 1628 typedef struct 1629 { 1630 unsigned STR2A : 1; 1631 unsigned STR2B : 1; 1632 unsigned STR2C : 1; 1633 unsigned STR2D : 1; 1634 unsigned STR2SYNC : 1; 1635 unsigned : 1; 1636 unsigned : 1; 1637 unsigned : 1; 1638 } __PSTR2CONbits_t; 1639 1640 extern __at(0x0F63) volatile __PSTR2CONbits_t PSTR2CONbits; 1641 1642 #define _STR2A 0x01 1643 #define _STR2B 0x02 1644 #define _STR2C 0x04 1645 #define _STR2D 0x08 1646 #define _STR2SYNC 0x10 1647 1648 //============================================================================== 1649 1650 1651 //============================================================================== 1652 // CCP2AS Bits 1653 1654 extern __at(0x0F64) __sfr CCP2AS; 1655 1656 typedef union 1657 { 1658 struct 1659 { 1660 unsigned P2SSBD0 : 1; 1661 unsigned P2SSBD1 : 1; 1662 unsigned P2SSAC0 : 1; 1663 unsigned P2SSAC1 : 1; 1664 unsigned CCP2AS0 : 1; 1665 unsigned CCP2AS1 : 1; 1666 unsigned CCP2AS2 : 1; 1667 unsigned CCP2ASE : 1; 1668 }; 1669 1670 struct 1671 { 1672 unsigned PSS2BD0 : 1; 1673 unsigned PSS2BD1 : 1; 1674 unsigned PSS2AC0 : 1; 1675 unsigned PSS2AC1 : 1; 1676 unsigned : 1; 1677 unsigned : 1; 1678 unsigned : 1; 1679 unsigned : 1; 1680 }; 1681 1682 struct 1683 { 1684 unsigned PSS2BD : 2; 1685 unsigned : 6; 1686 }; 1687 1688 struct 1689 { 1690 unsigned P2SSBD : 2; 1691 unsigned : 6; 1692 }; 1693 1694 struct 1695 { 1696 unsigned : 2; 1697 unsigned PSS2AC : 2; 1698 unsigned : 4; 1699 }; 1700 1701 struct 1702 { 1703 unsigned : 2; 1704 unsigned P2SSAC : 2; 1705 unsigned : 4; 1706 }; 1707 1708 struct 1709 { 1710 unsigned : 4; 1711 unsigned CCP2AS : 3; 1712 unsigned : 1; 1713 }; 1714 } __CCP2ASbits_t; 1715 1716 extern __at(0x0F64) volatile __CCP2ASbits_t CCP2ASbits; 1717 1718 #define _P2SSBD0 0x01 1719 #define _PSS2BD0 0x01 1720 #define _P2SSBD1 0x02 1721 #define _PSS2BD1 0x02 1722 #define _P2SSAC0 0x04 1723 #define _PSS2AC0 0x04 1724 #define _P2SSAC1 0x08 1725 #define _PSS2AC1 0x08 1726 #define _CCP2AS0 0x10 1727 #define _CCP2AS1 0x20 1728 #define _CCP2AS2 0x40 1729 #define _CCP2ASE 0x80 1730 1731 //============================================================================== 1732 1733 1734 //============================================================================== 1735 // ECCP2AS Bits 1736 1737 extern __at(0x0F64) __sfr ECCP2AS; 1738 1739 typedef union 1740 { 1741 struct 1742 { 1743 unsigned P2SSBD0 : 1; 1744 unsigned P2SSBD1 : 1; 1745 unsigned P2SSAC0 : 1; 1746 unsigned P2SSAC1 : 1; 1747 unsigned CCP2AS0 : 1; 1748 unsigned CCP2AS1 : 1; 1749 unsigned CCP2AS2 : 1; 1750 unsigned CCP2ASE : 1; 1751 }; 1752 1753 struct 1754 { 1755 unsigned PSS2BD0 : 1; 1756 unsigned PSS2BD1 : 1; 1757 unsigned PSS2AC0 : 1; 1758 unsigned PSS2AC1 : 1; 1759 unsigned : 1; 1760 unsigned : 1; 1761 unsigned : 1; 1762 unsigned : 1; 1763 }; 1764 1765 struct 1766 { 1767 unsigned PSS2BD : 2; 1768 unsigned : 6; 1769 }; 1770 1771 struct 1772 { 1773 unsigned P2SSBD : 2; 1774 unsigned : 6; 1775 }; 1776 1777 struct 1778 { 1779 unsigned : 2; 1780 unsigned P2SSAC : 2; 1781 unsigned : 4; 1782 }; 1783 1784 struct 1785 { 1786 unsigned : 2; 1787 unsigned PSS2AC : 2; 1788 unsigned : 4; 1789 }; 1790 1791 struct 1792 { 1793 unsigned : 4; 1794 unsigned CCP2AS : 3; 1795 unsigned : 1; 1796 }; 1797 } __ECCP2ASbits_t; 1798 1799 extern __at(0x0F64) volatile __ECCP2ASbits_t ECCP2ASbits; 1800 1801 #define _ECCP2AS_P2SSBD0 0x01 1802 #define _ECCP2AS_PSS2BD0 0x01 1803 #define _ECCP2AS_P2SSBD1 0x02 1804 #define _ECCP2AS_PSS2BD1 0x02 1805 #define _ECCP2AS_P2SSAC0 0x04 1806 #define _ECCP2AS_PSS2AC0 0x04 1807 #define _ECCP2AS_P2SSAC1 0x08 1808 #define _ECCP2AS_PSS2AC1 0x08 1809 #define _ECCP2AS_CCP2AS0 0x10 1810 #define _ECCP2AS_CCP2AS1 0x20 1811 #define _ECCP2AS_CCP2AS2 0x40 1812 #define _ECCP2AS_CCP2ASE 0x80 1813 1814 //============================================================================== 1815 1816 1817 //============================================================================== 1818 // PWM2CON Bits 1819 1820 extern __at(0x0F65) __sfr PWM2CON; 1821 1822 typedef union 1823 { 1824 struct 1825 { 1826 unsigned P2DC0 : 1; 1827 unsigned P2DC1 : 1; 1828 unsigned P2DC2 : 1; 1829 unsigned P2DC3 : 1; 1830 unsigned P2DC4 : 1; 1831 unsigned P2DC5 : 1; 1832 unsigned P2DC6 : 1; 1833 unsigned P2RSEN : 1; 1834 }; 1835 1836 struct 1837 { 1838 unsigned P2DC : 7; 1839 unsigned : 1; 1840 }; 1841 } __PWM2CONbits_t; 1842 1843 extern __at(0x0F65) volatile __PWM2CONbits_t PWM2CONbits; 1844 1845 #define _P2DC0 0x01 1846 #define _P2DC1 0x02 1847 #define _P2DC2 0x04 1848 #define _P2DC3 0x08 1849 #define _P2DC4 0x10 1850 #define _P2DC5 0x20 1851 #define _P2DC6 0x40 1852 #define _P2RSEN 0x80 1853 1854 //============================================================================== 1855 1856 1857 //============================================================================== 1858 // CCP2CON Bits 1859 1860 extern __at(0x0F66) __sfr CCP2CON; 1861 1862 typedef union 1863 { 1864 struct 1865 { 1866 unsigned CCP2M0 : 1; 1867 unsigned CCP2M1 : 1; 1868 unsigned CCP2M2 : 1; 1869 unsigned CCP2M3 : 1; 1870 unsigned DC2B0 : 1; 1871 unsigned DC2B1 : 1; 1872 unsigned P2M0 : 1; 1873 unsigned P2M1 : 1; 1874 }; 1875 1876 struct 1877 { 1878 unsigned CCP2M : 4; 1879 unsigned : 4; 1880 }; 1881 1882 struct 1883 { 1884 unsigned : 4; 1885 unsigned DC2B : 2; 1886 unsigned : 2; 1887 }; 1888 1889 struct 1890 { 1891 unsigned : 6; 1892 unsigned P2M : 2; 1893 }; 1894 } __CCP2CONbits_t; 1895 1896 extern __at(0x0F66) volatile __CCP2CONbits_t CCP2CONbits; 1897 1898 #define _CCP2M0 0x01 1899 #define _CCP2M1 0x02 1900 #define _CCP2M2 0x04 1901 #define _CCP2M3 0x08 1902 #define _DC2B0 0x10 1903 #define _DC2B1 0x20 1904 #define _P2M0 0x40 1905 #define _P2M1 0x80 1906 1907 //============================================================================== 1908 1909 extern __at(0x0F67) __sfr CCPR2; 1910 extern __at(0x0F67) __sfr CCPR2L; 1911 extern __at(0x0F68) __sfr CCPR2H; 1912 1913 //============================================================================== 1914 // SSP2CON3 Bits 1915 1916 extern __at(0x0F69) __sfr SSP2CON3; 1917 1918 typedef struct 1919 { 1920 unsigned DHEN : 1; 1921 unsigned AHEN : 1; 1922 unsigned SBCDE : 1; 1923 unsigned SDAHT : 1; 1924 unsigned BOEN : 1; 1925 unsigned SCIE : 1; 1926 unsigned PCIE : 1; 1927 unsigned ACKTIM : 1; 1928 } __SSP2CON3bits_t; 1929 1930 extern __at(0x0F69) volatile __SSP2CON3bits_t SSP2CON3bits; 1931 1932 #define _SSP2CON3_DHEN 0x01 1933 #define _SSP2CON3_AHEN 0x02 1934 #define _SSP2CON3_SBCDE 0x04 1935 #define _SSP2CON3_SDAHT 0x08 1936 #define _SSP2CON3_BOEN 0x10 1937 #define _SSP2CON3_SCIE 0x20 1938 #define _SSP2CON3_PCIE 0x40 1939 #define _SSP2CON3_ACKTIM 0x80 1940 1941 //============================================================================== 1942 1943 1944 //============================================================================== 1945 // SSP2MSK Bits 1946 1947 extern __at(0x0F6A) __sfr SSP2MSK; 1948 1949 typedef struct 1950 { 1951 unsigned MSK0 : 1; 1952 unsigned MSK1 : 1; 1953 unsigned MSK2 : 1; 1954 unsigned MSK3 : 1; 1955 unsigned MSK4 : 1; 1956 unsigned MSK5 : 1; 1957 unsigned MSK6 : 1; 1958 unsigned MSK7 : 1; 1959 } __SSP2MSKbits_t; 1960 1961 extern __at(0x0F6A) volatile __SSP2MSKbits_t SSP2MSKbits; 1962 1963 #define _SSP2MSK_MSK0 0x01 1964 #define _SSP2MSK_MSK1 0x02 1965 #define _SSP2MSK_MSK2 0x04 1966 #define _SSP2MSK_MSK3 0x08 1967 #define _SSP2MSK_MSK4 0x10 1968 #define _SSP2MSK_MSK5 0x20 1969 #define _SSP2MSK_MSK6 0x40 1970 #define _SSP2MSK_MSK7 0x80 1971 1972 //============================================================================== 1973 1974 1975 //============================================================================== 1976 // SSP2CON2 Bits 1977 1978 extern __at(0x0F6B) __sfr SSP2CON2; 1979 1980 typedef struct 1981 { 1982 unsigned SEN : 1; 1983 unsigned RSEN : 1; 1984 unsigned PEN : 1; 1985 unsigned RCEN : 1; 1986 unsigned ACKEN : 1; 1987 unsigned ACKDT : 1; 1988 unsigned ACKSTAT : 1; 1989 unsigned GCEN : 1; 1990 } __SSP2CON2bits_t; 1991 1992 extern __at(0x0F6B) volatile __SSP2CON2bits_t SSP2CON2bits; 1993 1994 #define _SSP2CON2_SEN 0x01 1995 #define _SSP2CON2_RSEN 0x02 1996 #define _SSP2CON2_PEN 0x04 1997 #define _SSP2CON2_RCEN 0x08 1998 #define _SSP2CON2_ACKEN 0x10 1999 #define _SSP2CON2_ACKDT 0x20 2000 #define _SSP2CON2_ACKSTAT 0x40 2001 #define _SSP2CON2_GCEN 0x80 2002 2003 //============================================================================== 2004 2005 2006 //============================================================================== 2007 // SSP2CON1 Bits 2008 2009 extern __at(0x0F6C) __sfr SSP2CON1; 2010 2011 typedef union 2012 { 2013 struct 2014 { 2015 unsigned SSPM0 : 1; 2016 unsigned SSPM1 : 1; 2017 unsigned SSPM2 : 1; 2018 unsigned SSPM3 : 1; 2019 unsigned CKP : 1; 2020 unsigned SSPEN : 1; 2021 unsigned SSPOV : 1; 2022 unsigned WCOL : 1; 2023 }; 2024 2025 struct 2026 { 2027 unsigned SSPM : 4; 2028 unsigned : 4; 2029 }; 2030 } __SSP2CON1bits_t; 2031 2032 extern __at(0x0F6C) volatile __SSP2CON1bits_t SSP2CON1bits; 2033 2034 #define _SSP2CON1_SSPM0 0x01 2035 #define _SSP2CON1_SSPM1 0x02 2036 #define _SSP2CON1_SSPM2 0x04 2037 #define _SSP2CON1_SSPM3 0x08 2038 #define _SSP2CON1_CKP 0x10 2039 #define _SSP2CON1_SSPEN 0x20 2040 #define _SSP2CON1_SSPOV 0x40 2041 #define _SSP2CON1_WCOL 0x80 2042 2043 //============================================================================== 2044 2045 2046 //============================================================================== 2047 // SSP2STAT Bits 2048 2049 extern __at(0x0F6D) __sfr SSP2STAT; 2050 2051 typedef union 2052 { 2053 struct 2054 { 2055 unsigned BF : 1; 2056 unsigned UA : 1; 2057 unsigned R_NOT_W : 1; 2058 unsigned S : 1; 2059 unsigned P : 1; 2060 unsigned D_NOT_A : 1; 2061 unsigned CKE : 1; 2062 unsigned SMP : 1; 2063 }; 2064 2065 struct 2066 { 2067 unsigned : 1; 2068 unsigned : 1; 2069 unsigned R : 1; 2070 unsigned : 1; 2071 unsigned : 1; 2072 unsigned D : 1; 2073 unsigned : 1; 2074 unsigned : 1; 2075 }; 2076 2077 struct 2078 { 2079 unsigned : 1; 2080 unsigned : 1; 2081 unsigned NOT_W : 1; 2082 unsigned : 1; 2083 unsigned : 1; 2084 unsigned NOT_A : 1; 2085 unsigned : 1; 2086 unsigned : 1; 2087 }; 2088 2089 struct 2090 { 2091 unsigned : 1; 2092 unsigned : 1; 2093 unsigned R_W : 1; 2094 unsigned : 1; 2095 unsigned : 1; 2096 unsigned D_A : 1; 2097 unsigned : 1; 2098 unsigned : 1; 2099 }; 2100 2101 struct 2102 { 2103 unsigned : 1; 2104 unsigned : 1; 2105 unsigned NOT_WRITE : 1; 2106 unsigned : 1; 2107 unsigned : 1; 2108 unsigned NOT_ADDRESS : 1; 2109 unsigned : 1; 2110 unsigned : 1; 2111 }; 2112 } __SSP2STATbits_t; 2113 2114 extern __at(0x0F6D) volatile __SSP2STATbits_t SSP2STATbits; 2115 2116 #define _SSP2STAT_BF 0x01 2117 #define _SSP2STAT_UA 0x02 2118 #define _SSP2STAT_R_NOT_W 0x04 2119 #define _SSP2STAT_R 0x04 2120 #define _SSP2STAT_NOT_W 0x04 2121 #define _SSP2STAT_R_W 0x04 2122 #define _SSP2STAT_NOT_WRITE 0x04 2123 #define _SSP2STAT_S 0x08 2124 #define _SSP2STAT_P 0x10 2125 #define _SSP2STAT_D_NOT_A 0x20 2126 #define _SSP2STAT_D 0x20 2127 #define _SSP2STAT_NOT_A 0x20 2128 #define _SSP2STAT_D_A 0x20 2129 #define _SSP2STAT_NOT_ADDRESS 0x20 2130 #define _SSP2STAT_CKE 0x40 2131 #define _SSP2STAT_SMP 0x80 2132 2133 //============================================================================== 2134 2135 extern __at(0x0F6E) __sfr SSP2ADD; 2136 extern __at(0x0F6F) __sfr SSP2BUF; 2137 2138 //============================================================================== 2139 // BAUD2CON Bits 2140 2141 extern __at(0x0F70) __sfr BAUD2CON; 2142 2143 typedef union 2144 { 2145 struct 2146 { 2147 unsigned ABDEN : 1; 2148 unsigned WUE : 1; 2149 unsigned : 1; 2150 unsigned BRG16 : 1; 2151 unsigned CKTXP : 1; 2152 unsigned DTRXP : 1; 2153 unsigned RCIDL : 1; 2154 unsigned ABDOVF : 1; 2155 }; 2156 2157 struct 2158 { 2159 unsigned : 1; 2160 unsigned : 1; 2161 unsigned : 1; 2162 unsigned : 1; 2163 unsigned SCKP : 1; 2164 unsigned : 1; 2165 unsigned : 1; 2166 unsigned : 1; 2167 }; 2168 } __BAUD2CONbits_t; 2169 2170 extern __at(0x0F70) volatile __BAUD2CONbits_t BAUD2CONbits; 2171 2172 #define _BAUD2CON_ABDEN 0x01 2173 #define _BAUD2CON_WUE 0x02 2174 #define _BAUD2CON_BRG16 0x08 2175 #define _BAUD2CON_CKTXP 0x10 2176 #define _BAUD2CON_SCKP 0x10 2177 #define _BAUD2CON_DTRXP 0x20 2178 #define _BAUD2CON_RCIDL 0x40 2179 #define _BAUD2CON_ABDOVF 0x80 2180 2181 //============================================================================== 2182 2183 2184 //============================================================================== 2185 // BAUDCON2 Bits 2186 2187 extern __at(0x0F70) __sfr BAUDCON2; 2188 2189 typedef union 2190 { 2191 struct 2192 { 2193 unsigned ABDEN : 1; 2194 unsigned WUE : 1; 2195 unsigned : 1; 2196 unsigned BRG16 : 1; 2197 unsigned CKTXP : 1; 2198 unsigned DTRXP : 1; 2199 unsigned RCIDL : 1; 2200 unsigned ABDOVF : 1; 2201 }; 2202 2203 struct 2204 { 2205 unsigned : 1; 2206 unsigned : 1; 2207 unsigned : 1; 2208 unsigned : 1; 2209 unsigned SCKP : 1; 2210 unsigned : 1; 2211 unsigned : 1; 2212 unsigned : 1; 2213 }; 2214 } __BAUDCON2bits_t; 2215 2216 extern __at(0x0F70) volatile __BAUDCON2bits_t BAUDCON2bits; 2217 2218 #define _BAUDCON2_ABDEN 0x01 2219 #define _BAUDCON2_WUE 0x02 2220 #define _BAUDCON2_BRG16 0x08 2221 #define _BAUDCON2_CKTXP 0x10 2222 #define _BAUDCON2_SCKP 0x10 2223 #define _BAUDCON2_DTRXP 0x20 2224 #define _BAUDCON2_RCIDL 0x40 2225 #define _BAUDCON2_ABDOVF 0x80 2226 2227 //============================================================================== 2228 2229 2230 //============================================================================== 2231 // RC2STA Bits 2232 2233 extern __at(0x0F71) __sfr RC2STA; 2234 2235 typedef union 2236 { 2237 struct 2238 { 2239 unsigned RX9D : 1; 2240 unsigned OERR : 1; 2241 unsigned FERR : 1; 2242 unsigned ADDEN : 1; 2243 unsigned CREN : 1; 2244 unsigned SREN : 1; 2245 unsigned RX9 : 1; 2246 unsigned SPEN : 1; 2247 }; 2248 2249 struct 2250 { 2251 unsigned RX9D2 : 1; 2252 unsigned OERR2 : 1; 2253 unsigned FERR2 : 1; 2254 unsigned ADEN : 1; 2255 unsigned CREN2 : 1; 2256 unsigned SREN2 : 1; 2257 unsigned RX92 : 1; 2258 unsigned SPEN2 : 1; 2259 }; 2260 2261 struct 2262 { 2263 unsigned : 1; 2264 unsigned : 1; 2265 unsigned : 1; 2266 unsigned ADDEN2 : 1; 2267 unsigned : 1; 2268 unsigned : 1; 2269 unsigned : 1; 2270 unsigned : 1; 2271 }; 2272 } __RC2STAbits_t; 2273 2274 extern __at(0x0F71) volatile __RC2STAbits_t RC2STAbits; 2275 2276 #define _RC2STA_RX9D 0x01 2277 #define _RC2STA_RX9D2 0x01 2278 #define _RC2STA_OERR 0x02 2279 #define _RC2STA_OERR2 0x02 2280 #define _RC2STA_FERR 0x04 2281 #define _RC2STA_FERR2 0x04 2282 #define _RC2STA_ADDEN 0x08 2283 #define _RC2STA_ADEN 0x08 2284 #define _RC2STA_ADDEN2 0x08 2285 #define _RC2STA_CREN 0x10 2286 #define _RC2STA_CREN2 0x10 2287 #define _RC2STA_SREN 0x20 2288 #define _RC2STA_SREN2 0x20 2289 #define _RC2STA_RX9 0x40 2290 #define _RC2STA_RX92 0x40 2291 #define _RC2STA_SPEN 0x80 2292 #define _RC2STA_SPEN2 0x80 2293 2294 //============================================================================== 2295 2296 2297 //============================================================================== 2298 // RCSTA2 Bits 2299 2300 extern __at(0x0F71) __sfr RCSTA2; 2301 2302 typedef union 2303 { 2304 struct 2305 { 2306 unsigned RX9D : 1; 2307 unsigned OERR : 1; 2308 unsigned FERR : 1; 2309 unsigned ADDEN : 1; 2310 unsigned CREN : 1; 2311 unsigned SREN : 1; 2312 unsigned RX9 : 1; 2313 unsigned SPEN : 1; 2314 }; 2315 2316 struct 2317 { 2318 unsigned RX9D2 : 1; 2319 unsigned OERR2 : 1; 2320 unsigned FERR2 : 1; 2321 unsigned ADEN : 1; 2322 unsigned CREN2 : 1; 2323 unsigned SREN2 : 1; 2324 unsigned RX92 : 1; 2325 unsigned SPEN2 : 1; 2326 }; 2327 2328 struct 2329 { 2330 unsigned : 1; 2331 unsigned : 1; 2332 unsigned : 1; 2333 unsigned ADDEN2 : 1; 2334 unsigned : 1; 2335 unsigned : 1; 2336 unsigned : 1; 2337 unsigned : 1; 2338 }; 2339 } __RCSTA2bits_t; 2340 2341 extern __at(0x0F71) volatile __RCSTA2bits_t RCSTA2bits; 2342 2343 #define _RCSTA2_RX9D 0x01 2344 #define _RCSTA2_RX9D2 0x01 2345 #define _RCSTA2_OERR 0x02 2346 #define _RCSTA2_OERR2 0x02 2347 #define _RCSTA2_FERR 0x04 2348 #define _RCSTA2_FERR2 0x04 2349 #define _RCSTA2_ADDEN 0x08 2350 #define _RCSTA2_ADEN 0x08 2351 #define _RCSTA2_ADDEN2 0x08 2352 #define _RCSTA2_CREN 0x10 2353 #define _RCSTA2_CREN2 0x10 2354 #define _RCSTA2_SREN 0x20 2355 #define _RCSTA2_SREN2 0x20 2356 #define _RCSTA2_RX9 0x40 2357 #define _RCSTA2_RX92 0x40 2358 #define _RCSTA2_SPEN 0x80 2359 #define _RCSTA2_SPEN2 0x80 2360 2361 //============================================================================== 2362 2363 2364 //============================================================================== 2365 // TX2STA Bits 2366 2367 extern __at(0x0F72) __sfr TX2STA; 2368 2369 typedef union 2370 { 2371 struct 2372 { 2373 unsigned TX9D : 1; 2374 unsigned TRMT : 1; 2375 unsigned BRGH : 1; 2376 unsigned SENDB : 1; 2377 unsigned SYNC : 1; 2378 unsigned TXEN : 1; 2379 unsigned TX9 : 1; 2380 unsigned CSRC : 1; 2381 }; 2382 2383 struct 2384 { 2385 unsigned TX9D2 : 1; 2386 unsigned TRMT2 : 1; 2387 unsigned BRGH2 : 1; 2388 unsigned SENDB2 : 1; 2389 unsigned SYNC2 : 1; 2390 unsigned TXEN2 : 1; 2391 unsigned TX92 : 1; 2392 unsigned CSRC2 : 1; 2393 }; 2394 } __TX2STAbits_t; 2395 2396 extern __at(0x0F72) volatile __TX2STAbits_t TX2STAbits; 2397 2398 #define _TX2STA_TX9D 0x01 2399 #define _TX2STA_TX9D2 0x01 2400 #define _TX2STA_TRMT 0x02 2401 #define _TX2STA_TRMT2 0x02 2402 #define _TX2STA_BRGH 0x04 2403 #define _TX2STA_BRGH2 0x04 2404 #define _TX2STA_SENDB 0x08 2405 #define _TX2STA_SENDB2 0x08 2406 #define _TX2STA_SYNC 0x10 2407 #define _TX2STA_SYNC2 0x10 2408 #define _TX2STA_TXEN 0x20 2409 #define _TX2STA_TXEN2 0x20 2410 #define _TX2STA_TX9 0x40 2411 #define _TX2STA_TX92 0x40 2412 #define _TX2STA_CSRC 0x80 2413 #define _TX2STA_CSRC2 0x80 2414 2415 //============================================================================== 2416 2417 2418 //============================================================================== 2419 // TXSTA2 Bits 2420 2421 extern __at(0x0F72) __sfr TXSTA2; 2422 2423 typedef union 2424 { 2425 struct 2426 { 2427 unsigned TX9D : 1; 2428 unsigned TRMT : 1; 2429 unsigned BRGH : 1; 2430 unsigned SENDB : 1; 2431 unsigned SYNC : 1; 2432 unsigned TXEN : 1; 2433 unsigned TX9 : 1; 2434 unsigned CSRC : 1; 2435 }; 2436 2437 struct 2438 { 2439 unsigned TX9D2 : 1; 2440 unsigned TRMT2 : 1; 2441 unsigned BRGH2 : 1; 2442 unsigned SENDB2 : 1; 2443 unsigned SYNC2 : 1; 2444 unsigned TXEN2 : 1; 2445 unsigned TX92 : 1; 2446 unsigned CSRC2 : 1; 2447 }; 2448 } __TXSTA2bits_t; 2449 2450 extern __at(0x0F72) volatile __TXSTA2bits_t TXSTA2bits; 2451 2452 #define _TXSTA2_TX9D 0x01 2453 #define _TXSTA2_TX9D2 0x01 2454 #define _TXSTA2_TRMT 0x02 2455 #define _TXSTA2_TRMT2 0x02 2456 #define _TXSTA2_BRGH 0x04 2457 #define _TXSTA2_BRGH2 0x04 2458 #define _TXSTA2_SENDB 0x08 2459 #define _TXSTA2_SENDB2 0x08 2460 #define _TXSTA2_SYNC 0x10 2461 #define _TXSTA2_SYNC2 0x10 2462 #define _TXSTA2_TXEN 0x20 2463 #define _TXSTA2_TXEN2 0x20 2464 #define _TXSTA2_TX9 0x40 2465 #define _TXSTA2_TX92 0x40 2466 #define _TXSTA2_CSRC 0x80 2467 #define _TXSTA2_CSRC2 0x80 2468 2469 //============================================================================== 2470 2471 extern __at(0x0F73) __sfr TX2REG; 2472 extern __at(0x0F73) __sfr TXREG2; 2473 extern __at(0x0F74) __sfr RC2REG; 2474 extern __at(0x0F74) __sfr RCREG2; 2475 extern __at(0x0F75) __sfr SP2BRG; 2476 extern __at(0x0F75) __sfr SPBRG2; 2477 extern __at(0x0F76) __sfr SP2BRGH; 2478 extern __at(0x0F76) __sfr SPBRGH2; 2479 2480 //============================================================================== 2481 // CM12CON Bits 2482 2483 extern __at(0x0F77) __sfr CM12CON; 2484 2485 typedef struct 2486 { 2487 unsigned C2SYNC : 1; 2488 unsigned C1SYNC : 1; 2489 unsigned C2HYS : 1; 2490 unsigned C1HYS : 1; 2491 unsigned C2RSEL : 1; 2492 unsigned C1RSEL : 1; 2493 unsigned MC2OUT : 1; 2494 unsigned MC1OUT : 1; 2495 } __CM12CONbits_t; 2496 2497 extern __at(0x0F77) volatile __CM12CONbits_t CM12CONbits; 2498 2499 #define _CM12CON_C2SYNC 0x01 2500 #define _CM12CON_C1SYNC 0x02 2501 #define _CM12CON_C2HYS 0x04 2502 #define _CM12CON_C1HYS 0x08 2503 #define _CM12CON_C2RSEL 0x10 2504 #define _CM12CON_C1RSEL 0x20 2505 #define _CM12CON_MC2OUT 0x40 2506 #define _CM12CON_MC1OUT 0x80 2507 2508 //============================================================================== 2509 2510 2511 //============================================================================== 2512 // CM2CON1 Bits 2513 2514 extern __at(0x0F77) __sfr CM2CON1; 2515 2516 typedef struct 2517 { 2518 unsigned C2SYNC : 1; 2519 unsigned C1SYNC : 1; 2520 unsigned C2HYS : 1; 2521 unsigned C1HYS : 1; 2522 unsigned C2RSEL : 1; 2523 unsigned C1RSEL : 1; 2524 unsigned MC2OUT : 1; 2525 unsigned MC1OUT : 1; 2526 } __CM2CON1bits_t; 2527 2528 extern __at(0x0F77) volatile __CM2CON1bits_t CM2CON1bits; 2529 2530 #define _C2SYNC 0x01 2531 #define _C1SYNC 0x02 2532 #define _C2HYS 0x04 2533 #define _C1HYS 0x08 2534 #define _C2RSEL 0x10 2535 #define _C1RSEL 0x20 2536 #define _MC2OUT 0x40 2537 #define _MC1OUT 0x80 2538 2539 //============================================================================== 2540 2541 2542 //============================================================================== 2543 // CM2CON Bits 2544 2545 extern __at(0x0F78) __sfr CM2CON; 2546 2547 typedef union 2548 { 2549 struct 2550 { 2551 unsigned C2CH0 : 1; 2552 unsigned C2CH1 : 1; 2553 unsigned C2R : 1; 2554 unsigned C2SP : 1; 2555 unsigned C2POL : 1; 2556 unsigned C2OE : 1; 2557 unsigned C2OUT : 1; 2558 unsigned C2ON : 1; 2559 }; 2560 2561 struct 2562 { 2563 unsigned C2CH : 2; 2564 unsigned : 6; 2565 }; 2566 } __CM2CONbits_t; 2567 2568 extern __at(0x0F78) volatile __CM2CONbits_t CM2CONbits; 2569 2570 #define _C2CH0 0x01 2571 #define _C2CH1 0x02 2572 #define _C2R 0x04 2573 #define _C2SP 0x08 2574 #define _C2POL 0x10 2575 #define _C2OE 0x20 2576 #define _C2OUT 0x40 2577 #define _C2ON 0x80 2578 2579 //============================================================================== 2580 2581 2582 //============================================================================== 2583 // CM2CON0 Bits 2584 2585 extern __at(0x0F78) __sfr CM2CON0; 2586 2587 typedef union 2588 { 2589 struct 2590 { 2591 unsigned C2CH0 : 1; 2592 unsigned C2CH1 : 1; 2593 unsigned C2R : 1; 2594 unsigned C2SP : 1; 2595 unsigned C2POL : 1; 2596 unsigned C2OE : 1; 2597 unsigned C2OUT : 1; 2598 unsigned C2ON : 1; 2599 }; 2600 2601 struct 2602 { 2603 unsigned C2CH : 2; 2604 unsigned : 6; 2605 }; 2606 } __CM2CON0bits_t; 2607 2608 extern __at(0x0F78) volatile __CM2CON0bits_t CM2CON0bits; 2609 2610 #define _CM2CON0_C2CH0 0x01 2611 #define _CM2CON0_C2CH1 0x02 2612 #define _CM2CON0_C2R 0x04 2613 #define _CM2CON0_C2SP 0x08 2614 #define _CM2CON0_C2POL 0x10 2615 #define _CM2CON0_C2OE 0x20 2616 #define _CM2CON0_C2OUT 0x40 2617 #define _CM2CON0_C2ON 0x80 2618 2619 //============================================================================== 2620 2621 2622 //============================================================================== 2623 // CM1CON Bits 2624 2625 extern __at(0x0F79) __sfr CM1CON; 2626 2627 typedef union 2628 { 2629 struct 2630 { 2631 unsigned C1CH0 : 1; 2632 unsigned C1CH1 : 1; 2633 unsigned C1R : 1; 2634 unsigned C1SP : 1; 2635 unsigned C1POL : 1; 2636 unsigned C1OE : 1; 2637 unsigned C1OUT : 1; 2638 unsigned C1ON : 1; 2639 }; 2640 2641 struct 2642 { 2643 unsigned C1CH : 2; 2644 unsigned : 6; 2645 }; 2646 } __CM1CONbits_t; 2647 2648 extern __at(0x0F79) volatile __CM1CONbits_t CM1CONbits; 2649 2650 #define _C1CH0 0x01 2651 #define _C1CH1 0x02 2652 #define _C1R 0x04 2653 #define _C1SP 0x08 2654 #define _C1POL 0x10 2655 #define _C1OE 0x20 2656 #define _C1OUT 0x40 2657 #define _C1ON 0x80 2658 2659 //============================================================================== 2660 2661 2662 //============================================================================== 2663 // CM1CON0 Bits 2664 2665 extern __at(0x0F79) __sfr CM1CON0; 2666 2667 typedef union 2668 { 2669 struct 2670 { 2671 unsigned C1CH0 : 1; 2672 unsigned C1CH1 : 1; 2673 unsigned C1R : 1; 2674 unsigned C1SP : 1; 2675 unsigned C1POL : 1; 2676 unsigned C1OE : 1; 2677 unsigned C1OUT : 1; 2678 unsigned C1ON : 1; 2679 }; 2680 2681 struct 2682 { 2683 unsigned C1CH : 2; 2684 unsigned : 6; 2685 }; 2686 } __CM1CON0bits_t; 2687 2688 extern __at(0x0F79) volatile __CM1CON0bits_t CM1CON0bits; 2689 2690 #define _CM1CON0_C1CH0 0x01 2691 #define _CM1CON0_C1CH1 0x02 2692 #define _CM1CON0_C1R 0x04 2693 #define _CM1CON0_C1SP 0x08 2694 #define _CM1CON0_C1POL 0x10 2695 #define _CM1CON0_C1OE 0x20 2696 #define _CM1CON0_C1OUT 0x40 2697 #define _CM1CON0_C1ON 0x80 2698 2699 //============================================================================== 2700 2701 2702 //============================================================================== 2703 // PIE4 Bits 2704 2705 extern __at(0x0F7A) __sfr PIE4; 2706 2707 typedef struct 2708 { 2709 unsigned CCP3IE : 1; 2710 unsigned CCP4IE : 1; 2711 unsigned CCP5IE : 1; 2712 unsigned : 1; 2713 unsigned : 1; 2714 unsigned : 1; 2715 unsigned : 1; 2716 unsigned : 1; 2717 } __PIE4bits_t; 2718 2719 extern __at(0x0F7A) volatile __PIE4bits_t PIE4bits; 2720 2721 #define _CCP3IE 0x01 2722 #define _CCP4IE 0x02 2723 #define _CCP5IE 0x04 2724 2725 //============================================================================== 2726 2727 2728 //============================================================================== 2729 // PIR4 Bits 2730 2731 extern __at(0x0F7B) __sfr PIR4; 2732 2733 typedef struct 2734 { 2735 unsigned CCP3IF : 1; 2736 unsigned CCP4IF : 1; 2737 unsigned CCP5IF : 1; 2738 unsigned : 1; 2739 unsigned : 1; 2740 unsigned : 1; 2741 unsigned : 1; 2742 unsigned : 1; 2743 } __PIR4bits_t; 2744 2745 extern __at(0x0F7B) volatile __PIR4bits_t PIR4bits; 2746 2747 #define _CCP3IF 0x01 2748 #define _CCP4IF 0x02 2749 #define _CCP5IF 0x04 2750 2751 //============================================================================== 2752 2753 2754 //============================================================================== 2755 // IPR4 Bits 2756 2757 extern __at(0x0F7C) __sfr IPR4; 2758 2759 typedef struct 2760 { 2761 unsigned CCP3IP : 1; 2762 unsigned CCP4IP : 1; 2763 unsigned CCP5IP : 1; 2764 unsigned : 1; 2765 unsigned : 1; 2766 unsigned : 1; 2767 unsigned : 1; 2768 unsigned : 1; 2769 } __IPR4bits_t; 2770 2771 extern __at(0x0F7C) volatile __IPR4bits_t IPR4bits; 2772 2773 #define _CCP3IP 0x01 2774 #define _CCP4IP 0x02 2775 #define _CCP5IP 0x04 2776 2777 //============================================================================== 2778 2779 2780 //============================================================================== 2781 // PIE5 Bits 2782 2783 extern __at(0x0F7D) __sfr PIE5; 2784 2785 typedef struct 2786 { 2787 unsigned TMR4IE : 1; 2788 unsigned TMR5IE : 1; 2789 unsigned TMR6IE : 1; 2790 unsigned : 1; 2791 unsigned : 1; 2792 unsigned : 1; 2793 unsigned : 1; 2794 unsigned : 1; 2795 } __PIE5bits_t; 2796 2797 extern __at(0x0F7D) volatile __PIE5bits_t PIE5bits; 2798 2799 #define _TMR4IE 0x01 2800 #define _TMR5IE 0x02 2801 #define _TMR6IE 0x04 2802 2803 //============================================================================== 2804 2805 2806 //============================================================================== 2807 // PIR5 Bits 2808 2809 extern __at(0x0F7E) __sfr PIR5; 2810 2811 typedef struct 2812 { 2813 unsigned TMR4IF : 1; 2814 unsigned TMR5IF : 1; 2815 unsigned TMR6IF : 1; 2816 unsigned : 1; 2817 unsigned : 1; 2818 unsigned : 1; 2819 unsigned : 1; 2820 unsigned : 1; 2821 } __PIR5bits_t; 2822 2823 extern __at(0x0F7E) volatile __PIR5bits_t PIR5bits; 2824 2825 #define _TMR4IF 0x01 2826 #define _TMR5IF 0x02 2827 #define _TMR6IF 0x04 2828 2829 //============================================================================== 2830 2831 2832 //============================================================================== 2833 // IPR5 Bits 2834 2835 extern __at(0x0F7F) __sfr IPR5; 2836 2837 typedef struct 2838 { 2839 unsigned TMR4IP : 1; 2840 unsigned TMR5IP : 1; 2841 unsigned TMR6IP : 1; 2842 unsigned : 1; 2843 unsigned : 1; 2844 unsigned : 1; 2845 unsigned : 1; 2846 unsigned : 1; 2847 } __IPR5bits_t; 2848 2849 extern __at(0x0F7F) volatile __IPR5bits_t IPR5bits; 2850 2851 #define _TMR4IP 0x01 2852 #define _TMR5IP 0x02 2853 #define _TMR6IP 0x04 2854 2855 //============================================================================== 2856 2857 2858 //============================================================================== 2859 // PORTA Bits 2860 2861 extern __at(0x0F80) __sfr PORTA; 2862 2863 typedef union 2864 { 2865 struct 2866 { 2867 unsigned RA0 : 1; 2868 unsigned RA1 : 1; 2869 unsigned RA2 : 1; 2870 unsigned RA3 : 1; 2871 unsigned RA4 : 1; 2872 unsigned RA5 : 1; 2873 unsigned RA6 : 1; 2874 unsigned RA7 : 1; 2875 }; 2876 2877 struct 2878 { 2879 unsigned AN0 : 1; 2880 unsigned AN1 : 1; 2881 unsigned AN2 : 1; 2882 unsigned AN3 : 1; 2883 unsigned C1OUT : 1; 2884 unsigned AN4 : 1; 2885 unsigned : 1; 2886 unsigned : 1; 2887 }; 2888 2889 struct 2890 { 2891 unsigned C12IN0M : 1; 2892 unsigned C12IN1M : 1; 2893 unsigned C2INP : 1; 2894 unsigned C1INP : 1; 2895 unsigned T0CKI : 1; 2896 unsigned C2OUT : 1; 2897 unsigned : 1; 2898 unsigned : 1; 2899 }; 2900 2901 struct 2902 { 2903 unsigned C12IN0N : 1; 2904 unsigned C12IN1N : 1; 2905 unsigned VREFM : 1; 2906 unsigned VREFP : 1; 2907 unsigned SRQ : 1; 2908 unsigned SS : 1; 2909 unsigned : 1; 2910 unsigned : 1; 2911 }; 2912 2913 struct 2914 { 2915 unsigned : 1; 2916 unsigned : 1; 2917 unsigned VREFN : 1; 2918 unsigned : 1; 2919 unsigned : 1; 2920 unsigned NOT_SS : 1; 2921 unsigned : 1; 2922 unsigned : 1; 2923 }; 2924 2925 struct 2926 { 2927 unsigned : 1; 2928 unsigned : 1; 2929 unsigned CVREF : 1; 2930 unsigned : 1; 2931 unsigned : 1; 2932 unsigned LVDIN : 1; 2933 unsigned : 1; 2934 unsigned : 1; 2935 }; 2936 2937 struct 2938 { 2939 unsigned : 1; 2940 unsigned : 1; 2941 unsigned DACOUT : 1; 2942 unsigned : 1; 2943 unsigned : 1; 2944 unsigned HLVDIN : 1; 2945 unsigned : 1; 2946 unsigned : 1; 2947 }; 2948 2949 struct 2950 { 2951 unsigned : 1; 2952 unsigned : 1; 2953 unsigned : 1; 2954 unsigned : 1; 2955 unsigned : 1; 2956 unsigned SS1 : 1; 2957 unsigned : 1; 2958 unsigned : 1; 2959 }; 2960 2961 struct 2962 { 2963 unsigned : 1; 2964 unsigned : 1; 2965 unsigned : 1; 2966 unsigned : 1; 2967 unsigned : 1; 2968 unsigned NOT_SS1 : 1; 2969 unsigned : 1; 2970 unsigned : 1; 2971 }; 2972 2973 struct 2974 { 2975 unsigned : 1; 2976 unsigned : 1; 2977 unsigned : 1; 2978 unsigned : 1; 2979 unsigned : 1; 2980 unsigned SRNQ : 1; 2981 unsigned : 1; 2982 unsigned : 1; 2983 }; 2984 } __PORTAbits_t; 2985 2986 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits; 2987 2988 #define _PORTA_RA0 0x01 2989 #define _PORTA_AN0 0x01 2990 #define _PORTA_C12IN0M 0x01 2991 #define _PORTA_C12IN0N 0x01 2992 #define _PORTA_RA1 0x02 2993 #define _PORTA_AN1 0x02 2994 #define _PORTA_C12IN1M 0x02 2995 #define _PORTA_C12IN1N 0x02 2996 #define _PORTA_RA2 0x04 2997 #define _PORTA_AN2 0x04 2998 #define _PORTA_C2INP 0x04 2999 #define _PORTA_VREFM 0x04 3000 #define _PORTA_VREFN 0x04 3001 #define _PORTA_CVREF 0x04 3002 #define _PORTA_DACOUT 0x04 3003 #define _PORTA_RA3 0x08 3004 #define _PORTA_AN3 0x08 3005 #define _PORTA_C1INP 0x08 3006 #define _PORTA_VREFP 0x08 3007 #define _PORTA_RA4 0x10 3008 #define _PORTA_C1OUT 0x10 3009 #define _PORTA_T0CKI 0x10 3010 #define _PORTA_SRQ 0x10 3011 #define _PORTA_RA5 0x20 3012 #define _PORTA_AN4 0x20 3013 #define _PORTA_C2OUT 0x20 3014 #define _PORTA_SS 0x20 3015 #define _PORTA_NOT_SS 0x20 3016 #define _PORTA_LVDIN 0x20 3017 #define _PORTA_HLVDIN 0x20 3018 #define _PORTA_SS1 0x20 3019 #define _PORTA_NOT_SS1 0x20 3020 #define _PORTA_SRNQ 0x20 3021 #define _PORTA_RA6 0x40 3022 #define _PORTA_RA7 0x80 3023 3024 //============================================================================== 3025 3026 3027 //============================================================================== 3028 // PORTB Bits 3029 3030 extern __at(0x0F81) __sfr PORTB; 3031 3032 typedef union 3033 { 3034 struct 3035 { 3036 unsigned RB0 : 1; 3037 unsigned RB1 : 1; 3038 unsigned RB2 : 1; 3039 unsigned RB3 : 1; 3040 unsigned RB4 : 1; 3041 unsigned RB5 : 1; 3042 unsigned RB6 : 1; 3043 unsigned RB7 : 1; 3044 }; 3045 3046 struct 3047 { 3048 unsigned INT0 : 1; 3049 unsigned INT1 : 1; 3050 unsigned INT2 : 1; 3051 unsigned CCP2 : 1; 3052 unsigned KBI0 : 1; 3053 unsigned KBI1 : 1; 3054 unsigned KBI2 : 1; 3055 unsigned KBI3 : 1; 3056 }; 3057 3058 struct 3059 { 3060 unsigned AN12 : 1; 3061 unsigned AN10 : 1; 3062 unsigned AN8 : 1; 3063 unsigned AN9 : 1; 3064 unsigned AN11 : 1; 3065 unsigned AN13 : 1; 3066 unsigned PGC : 1; 3067 unsigned PGD : 1; 3068 }; 3069 3070 struct 3071 { 3072 unsigned FLT0 : 1; 3073 unsigned C12IN3M : 1; 3074 unsigned CTED1 : 1; 3075 unsigned C12IN2M : 1; 3076 unsigned T5G : 1; 3077 unsigned T1G : 1; 3078 unsigned : 1; 3079 unsigned : 1; 3080 }; 3081 3082 struct 3083 { 3084 unsigned SRI : 1; 3085 unsigned C12IN3N : 1; 3086 unsigned : 1; 3087 unsigned C12IN2N : 1; 3088 unsigned : 1; 3089 unsigned CCP3 : 1; 3090 unsigned : 1; 3091 unsigned : 1; 3092 }; 3093 3094 struct 3095 { 3096 unsigned : 1; 3097 unsigned : 1; 3098 unsigned : 1; 3099 unsigned CTED2 : 1; 3100 unsigned : 1; 3101 unsigned T3CKI : 1; 3102 unsigned : 1; 3103 unsigned : 1; 3104 }; 3105 3106 struct 3107 { 3108 unsigned : 1; 3109 unsigned : 1; 3110 unsigned : 1; 3111 unsigned P2A : 1; 3112 unsigned : 1; 3113 unsigned P3A : 1; 3114 unsigned : 1; 3115 unsigned : 1; 3116 }; 3117 3118 struct 3119 { 3120 unsigned INT : 3; 3121 unsigned : 5; 3122 }; 3123 3124 struct 3125 { 3126 unsigned : 4; 3127 unsigned KBI : 4; 3128 }; 3129 } __PORTBbits_t; 3130 3131 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits; 3132 3133 #define _PORTB_RB0 0x01 3134 #define _PORTB_INT0 0x01 3135 #define _PORTB_AN12 0x01 3136 #define _PORTB_FLT0 0x01 3137 #define _PORTB_SRI 0x01 3138 #define _PORTB_RB1 0x02 3139 #define _PORTB_INT1 0x02 3140 #define _PORTB_AN10 0x02 3141 #define _PORTB_C12IN3M 0x02 3142 #define _PORTB_C12IN3N 0x02 3143 #define _PORTB_RB2 0x04 3144 #define _PORTB_INT2 0x04 3145 #define _PORTB_AN8 0x04 3146 #define _PORTB_CTED1 0x04 3147 #define _PORTB_RB3 0x08 3148 #define _PORTB_CCP2 0x08 3149 #define _PORTB_AN9 0x08 3150 #define _PORTB_C12IN2M 0x08 3151 #define _PORTB_C12IN2N 0x08 3152 #define _PORTB_CTED2 0x08 3153 #define _PORTB_P2A 0x08 3154 #define _PORTB_RB4 0x10 3155 #define _PORTB_KBI0 0x10 3156 #define _PORTB_AN11 0x10 3157 #define _PORTB_T5G 0x10 3158 #define _PORTB_RB5 0x20 3159 #define _PORTB_KBI1 0x20 3160 #define _PORTB_AN13 0x20 3161 #define _PORTB_T1G 0x20 3162 #define _PORTB_CCP3 0x20 3163 #define _PORTB_T3CKI 0x20 3164 #define _PORTB_P3A 0x20 3165 #define _PORTB_RB6 0x40 3166 #define _PORTB_KBI2 0x40 3167 #define _PORTB_PGC 0x40 3168 #define _PORTB_RB7 0x80 3169 #define _PORTB_KBI3 0x80 3170 #define _PORTB_PGD 0x80 3171 3172 //============================================================================== 3173 3174 3175 //============================================================================== 3176 // PORTC Bits 3177 3178 extern __at(0x0F82) __sfr PORTC; 3179 3180 typedef union 3181 { 3182 struct 3183 { 3184 unsigned RC0 : 1; 3185 unsigned RC1 : 1; 3186 unsigned RC2 : 1; 3187 unsigned RC3 : 1; 3188 unsigned RC4 : 1; 3189 unsigned RC5 : 1; 3190 unsigned RC6 : 1; 3191 unsigned RC7 : 1; 3192 }; 3193 3194 struct 3195 { 3196 unsigned T1OSO : 1; 3197 unsigned T1OSI : 1; 3198 unsigned T5CKI : 1; 3199 unsigned SCK : 1; 3200 unsigned SDI : 1; 3201 unsigned SDO : 1; 3202 unsigned TX : 1; 3203 unsigned RX : 1; 3204 }; 3205 3206 struct 3207 { 3208 unsigned P2B : 1; 3209 unsigned P2A : 1; 3210 unsigned P1A : 1; 3211 unsigned SCL : 1; 3212 unsigned SDA : 1; 3213 unsigned SDO1 : 1; 3214 unsigned CK : 1; 3215 unsigned RX1 : 1; 3216 }; 3217 3218 struct 3219 { 3220 unsigned T1CKI : 1; 3221 unsigned CCP2 : 1; 3222 unsigned CCP1 : 1; 3223 unsigned SCK1 : 1; 3224 unsigned SDI1 : 1; 3225 unsigned AN17 : 1; 3226 unsigned TX1 : 1; 3227 unsigned DT1 : 1; 3228 }; 3229 3230 struct 3231 { 3232 unsigned T3CKI : 1; 3233 unsigned : 1; 3234 unsigned CTPLS : 1; 3235 unsigned SCL1 : 1; 3236 unsigned SDA1 : 1; 3237 unsigned : 1; 3238 unsigned CK1 : 1; 3239 unsigned AN19 : 1; 3240 }; 3241 3242 struct 3243 { 3244 unsigned T3G : 1; 3245 unsigned : 1; 3246 unsigned AN14 : 1; 3247 unsigned AN15 : 1; 3248 unsigned AN16 : 1; 3249 unsigned : 1; 3250 unsigned AN18 : 1; 3251 unsigned : 1; 3252 }; 3253 } __PORTCbits_t; 3254 3255 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits; 3256 3257 #define _PORTC_RC0 0x01 3258 #define _PORTC_T1OSO 0x01 3259 #define _PORTC_P2B 0x01 3260 #define _PORTC_T1CKI 0x01 3261 #define _PORTC_T3CKI 0x01 3262 #define _PORTC_T3G 0x01 3263 #define _PORTC_RC1 0x02 3264 #define _PORTC_T1OSI 0x02 3265 #define _PORTC_P2A 0x02 3266 #define _PORTC_CCP2 0x02 3267 #define _PORTC_RC2 0x04 3268 #define _PORTC_T5CKI 0x04 3269 #define _PORTC_P1A 0x04 3270 #define _PORTC_CCP1 0x04 3271 #define _PORTC_CTPLS 0x04 3272 #define _PORTC_AN14 0x04 3273 #define _PORTC_RC3 0x08 3274 #define _PORTC_SCK 0x08 3275 #define _PORTC_SCL 0x08 3276 #define _PORTC_SCK1 0x08 3277 #define _PORTC_SCL1 0x08 3278 #define _PORTC_AN15 0x08 3279 #define _PORTC_RC4 0x10 3280 #define _PORTC_SDI 0x10 3281 #define _PORTC_SDA 0x10 3282 #define _PORTC_SDI1 0x10 3283 #define _PORTC_SDA1 0x10 3284 #define _PORTC_AN16 0x10 3285 #define _PORTC_RC5 0x20 3286 #define _PORTC_SDO 0x20 3287 #define _PORTC_SDO1 0x20 3288 #define _PORTC_AN17 0x20 3289 #define _PORTC_RC6 0x40 3290 #define _PORTC_TX 0x40 3291 #define _PORTC_CK 0x40 3292 #define _PORTC_TX1 0x40 3293 #define _PORTC_CK1 0x40 3294 #define _PORTC_AN18 0x40 3295 #define _PORTC_RC7 0x80 3296 #define _PORTC_RX 0x80 3297 #define _PORTC_RX1 0x80 3298 #define _PORTC_DT1 0x80 3299 #define _PORTC_AN19 0x80 3300 3301 //============================================================================== 3302 3303 3304 //============================================================================== 3305 // PORTD Bits 3306 3307 extern __at(0x0F83) __sfr PORTD; 3308 3309 typedef union 3310 { 3311 struct 3312 { 3313 unsigned RD0 : 1; 3314 unsigned RD1 : 1; 3315 unsigned RD2 : 1; 3316 unsigned RD3 : 1; 3317 unsigned RD4 : 1; 3318 unsigned RD5 : 1; 3319 unsigned RD6 : 1; 3320 unsigned RD7 : 1; 3321 }; 3322 3323 struct 3324 { 3325 unsigned SCK2 : 1; 3326 unsigned CCP4 : 1; 3327 unsigned P2B : 1; 3328 unsigned P2C : 1; 3329 unsigned P2D : 1; 3330 unsigned P1B : 1; 3331 unsigned P1C : 1; 3332 unsigned P1D : 1; 3333 }; 3334 3335 struct 3336 { 3337 unsigned SCL2 : 1; 3338 unsigned SDI2 : 1; 3339 unsigned AN22 : 1; 3340 unsigned NOT_SS2 : 1; 3341 unsigned SDO2 : 1; 3342 unsigned AN25 : 1; 3343 unsigned TX2 : 1; 3344 unsigned RX2 : 1; 3345 }; 3346 3347 struct 3348 { 3349 unsigned AN20 : 1; 3350 unsigned SDA2 : 1; 3351 unsigned : 1; 3352 unsigned SS2 : 1; 3353 unsigned AN24 : 1; 3354 unsigned : 1; 3355 unsigned CK2 : 1; 3356 unsigned DT2 : 1; 3357 }; 3358 3359 struct 3360 { 3361 unsigned : 1; 3362 unsigned AN21 : 1; 3363 unsigned : 1; 3364 unsigned AN23 : 1; 3365 unsigned : 1; 3366 unsigned : 1; 3367 unsigned AN26 : 1; 3368 unsigned AN27 : 1; 3369 }; 3370 } __PORTDbits_t; 3371 3372 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits; 3373 3374 #define _PORTD_RD0 0x01 3375 #define _PORTD_SCK2 0x01 3376 #define _PORTD_SCL2 0x01 3377 #define _PORTD_AN20 0x01 3378 #define _PORTD_RD1 0x02 3379 #define _PORTD_CCP4 0x02 3380 #define _PORTD_SDI2 0x02 3381 #define _PORTD_SDA2 0x02 3382 #define _PORTD_AN21 0x02 3383 #define _PORTD_RD2 0x04 3384 #define _PORTD_P2B 0x04 3385 #define _PORTD_AN22 0x04 3386 #define _PORTD_RD3 0x08 3387 #define _PORTD_P2C 0x08 3388 #define _PORTD_NOT_SS2 0x08 3389 #define _PORTD_SS2 0x08 3390 #define _PORTD_AN23 0x08 3391 #define _PORTD_RD4 0x10 3392 #define _PORTD_P2D 0x10 3393 #define _PORTD_SDO2 0x10 3394 #define _PORTD_AN24 0x10 3395 #define _PORTD_RD5 0x20 3396 #define _PORTD_P1B 0x20 3397 #define _PORTD_AN25 0x20 3398 #define _PORTD_RD6 0x40 3399 #define _PORTD_P1C 0x40 3400 #define _PORTD_TX2 0x40 3401 #define _PORTD_CK2 0x40 3402 #define _PORTD_AN26 0x40 3403 #define _PORTD_RD7 0x80 3404 #define _PORTD_P1D 0x80 3405 #define _PORTD_RX2 0x80 3406 #define _PORTD_DT2 0x80 3407 #define _PORTD_AN27 0x80 3408 3409 //============================================================================== 3410 3411 3412 //============================================================================== 3413 // PORTE Bits 3414 3415 extern __at(0x0F84) __sfr PORTE; 3416 3417 typedef union 3418 { 3419 struct 3420 { 3421 unsigned RE0 : 1; 3422 unsigned RE1 : 1; 3423 unsigned RE2 : 1; 3424 unsigned RE3 : 1; 3425 unsigned : 1; 3426 unsigned : 1; 3427 unsigned : 1; 3428 unsigned : 1; 3429 }; 3430 3431 struct 3432 { 3433 unsigned AN5 : 1; 3434 unsigned AN6 : 1; 3435 unsigned AN7 : 1; 3436 unsigned MCLR : 1; 3437 unsigned : 1; 3438 unsigned : 1; 3439 unsigned : 1; 3440 unsigned : 1; 3441 }; 3442 3443 struct 3444 { 3445 unsigned P3A : 1; 3446 unsigned P3B : 1; 3447 unsigned CCP5 : 1; 3448 unsigned NOT_MCLR : 1; 3449 unsigned : 1; 3450 unsigned : 1; 3451 unsigned : 1; 3452 unsigned : 1; 3453 }; 3454 3455 struct 3456 { 3457 unsigned CCP3 : 1; 3458 unsigned : 1; 3459 unsigned : 1; 3460 unsigned VPP : 1; 3461 unsigned : 1; 3462 unsigned : 1; 3463 unsigned : 1; 3464 unsigned : 1; 3465 }; 3466 3467 struct 3468 { 3469 unsigned RE : 4; 3470 unsigned : 4; 3471 }; 3472 } __PORTEbits_t; 3473 3474 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits; 3475 3476 #define _PORTE_RE0 0x01 3477 #define _PORTE_AN5 0x01 3478 #define _PORTE_P3A 0x01 3479 #define _PORTE_CCP3 0x01 3480 #define _PORTE_RE1 0x02 3481 #define _PORTE_AN6 0x02 3482 #define _PORTE_P3B 0x02 3483 #define _PORTE_RE2 0x04 3484 #define _PORTE_AN7 0x04 3485 #define _PORTE_CCP5 0x04 3486 #define _PORTE_RE3 0x08 3487 #define _PORTE_MCLR 0x08 3488 #define _PORTE_NOT_MCLR 0x08 3489 #define _PORTE_VPP 0x08 3490 3491 //============================================================================== 3492 3493 3494 //============================================================================== 3495 // LATA Bits 3496 3497 extern __at(0x0F89) __sfr LATA; 3498 3499 typedef struct 3500 { 3501 unsigned LATA0 : 1; 3502 unsigned LATA1 : 1; 3503 unsigned LATA2 : 1; 3504 unsigned LATA3 : 1; 3505 unsigned LATA4 : 1; 3506 unsigned LATA5 : 1; 3507 unsigned LATA6 : 1; 3508 unsigned LATA7 : 1; 3509 } __LATAbits_t; 3510 3511 extern __at(0x0F89) volatile __LATAbits_t LATAbits; 3512 3513 #define _LATA0 0x01 3514 #define _LATA1 0x02 3515 #define _LATA2 0x04 3516 #define _LATA3 0x08 3517 #define _LATA4 0x10 3518 #define _LATA5 0x20 3519 #define _LATA6 0x40 3520 #define _LATA7 0x80 3521 3522 //============================================================================== 3523 3524 3525 //============================================================================== 3526 // LATB Bits 3527 3528 extern __at(0x0F8A) __sfr LATB; 3529 3530 typedef struct 3531 { 3532 unsigned LATB0 : 1; 3533 unsigned LATB1 : 1; 3534 unsigned LATB2 : 1; 3535 unsigned LATB3 : 1; 3536 unsigned LATB4 : 1; 3537 unsigned LATB5 : 1; 3538 unsigned LATB6 : 1; 3539 unsigned LATB7 : 1; 3540 } __LATBbits_t; 3541 3542 extern __at(0x0F8A) volatile __LATBbits_t LATBbits; 3543 3544 #define _LATB0 0x01 3545 #define _LATB1 0x02 3546 #define _LATB2 0x04 3547 #define _LATB3 0x08 3548 #define _LATB4 0x10 3549 #define _LATB5 0x20 3550 #define _LATB6 0x40 3551 #define _LATB7 0x80 3552 3553 //============================================================================== 3554 3555 3556 //============================================================================== 3557 // LATC Bits 3558 3559 extern __at(0x0F8B) __sfr LATC; 3560 3561 typedef struct 3562 { 3563 unsigned LATC0 : 1; 3564 unsigned LATC1 : 1; 3565 unsigned LATC2 : 1; 3566 unsigned LATC3 : 1; 3567 unsigned LATC4 : 1; 3568 unsigned LATC5 : 1; 3569 unsigned LATC6 : 1; 3570 unsigned LATC7 : 1; 3571 } __LATCbits_t; 3572 3573 extern __at(0x0F8B) volatile __LATCbits_t LATCbits; 3574 3575 #define _LATC0 0x01 3576 #define _LATC1 0x02 3577 #define _LATC2 0x04 3578 #define _LATC3 0x08 3579 #define _LATC4 0x10 3580 #define _LATC5 0x20 3581 #define _LATC6 0x40 3582 #define _LATC7 0x80 3583 3584 //============================================================================== 3585 3586 3587 //============================================================================== 3588 // LATD Bits 3589 3590 extern __at(0x0F8C) __sfr LATD; 3591 3592 typedef struct 3593 { 3594 unsigned LATD0 : 1; 3595 unsigned LATD1 : 1; 3596 unsigned LATD2 : 1; 3597 unsigned LATD3 : 1; 3598 unsigned LATD4 : 1; 3599 unsigned LATD5 : 1; 3600 unsigned LATD6 : 1; 3601 unsigned LATD7 : 1; 3602 } __LATDbits_t; 3603 3604 extern __at(0x0F8C) volatile __LATDbits_t LATDbits; 3605 3606 #define _LATD0 0x01 3607 #define _LATD1 0x02 3608 #define _LATD2 0x04 3609 #define _LATD3 0x08 3610 #define _LATD4 0x10 3611 #define _LATD5 0x20 3612 #define _LATD6 0x40 3613 #define _LATD7 0x80 3614 3615 //============================================================================== 3616 3617 3618 //============================================================================== 3619 // LATE Bits 3620 3621 extern __at(0x0F8D) __sfr LATE; 3622 3623 typedef union 3624 { 3625 struct 3626 { 3627 unsigned LATE0 : 1; 3628 unsigned LATE1 : 1; 3629 unsigned LATE2 : 1; 3630 unsigned : 1; 3631 unsigned : 1; 3632 unsigned : 1; 3633 unsigned : 1; 3634 unsigned : 1; 3635 }; 3636 3637 struct 3638 { 3639 unsigned LATE : 3; 3640 unsigned : 5; 3641 }; 3642 } __LATEbits_t; 3643 3644 extern __at(0x0F8D) volatile __LATEbits_t LATEbits; 3645 3646 #define _LATE0 0x01 3647 #define _LATE1 0x02 3648 #define _LATE2 0x04 3649 3650 //============================================================================== 3651 3652 3653 //============================================================================== 3654 // DDRA Bits 3655 3656 extern __at(0x0F92) __sfr DDRA; 3657 3658 typedef union 3659 { 3660 struct 3661 { 3662 unsigned TRISA0 : 1; 3663 unsigned TRISA1 : 1; 3664 unsigned TRISA2 : 1; 3665 unsigned TRISA3 : 1; 3666 unsigned TRISA4 : 1; 3667 unsigned TRISA5 : 1; 3668 unsigned TRISA6 : 1; 3669 unsigned TRISA7 : 1; 3670 }; 3671 3672 struct 3673 { 3674 unsigned RA0 : 1; 3675 unsigned RA1 : 1; 3676 unsigned RA2 : 1; 3677 unsigned RA3 : 1; 3678 unsigned RA4 : 1; 3679 unsigned RA5 : 1; 3680 unsigned RA6 : 1; 3681 unsigned RA7 : 1; 3682 }; 3683 } __DDRAbits_t; 3684 3685 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits; 3686 3687 #define _TRISA0 0x01 3688 #define _RA0 0x01 3689 #define _TRISA1 0x02 3690 #define _RA1 0x02 3691 #define _TRISA2 0x04 3692 #define _RA2 0x04 3693 #define _TRISA3 0x08 3694 #define _RA3 0x08 3695 #define _TRISA4 0x10 3696 #define _RA4 0x10 3697 #define _TRISA5 0x20 3698 #define _RA5 0x20 3699 #define _TRISA6 0x40 3700 #define _RA6 0x40 3701 #define _TRISA7 0x80 3702 #define _RA7 0x80 3703 3704 //============================================================================== 3705 3706 3707 //============================================================================== 3708 // TRISA Bits 3709 3710 extern __at(0x0F92) __sfr TRISA; 3711 3712 typedef union 3713 { 3714 struct 3715 { 3716 unsigned TRISA0 : 1; 3717 unsigned TRISA1 : 1; 3718 unsigned TRISA2 : 1; 3719 unsigned TRISA3 : 1; 3720 unsigned TRISA4 : 1; 3721 unsigned TRISA5 : 1; 3722 unsigned TRISA6 : 1; 3723 unsigned TRISA7 : 1; 3724 }; 3725 3726 struct 3727 { 3728 unsigned RA0 : 1; 3729 unsigned RA1 : 1; 3730 unsigned RA2 : 1; 3731 unsigned RA3 : 1; 3732 unsigned RA4 : 1; 3733 unsigned RA5 : 1; 3734 unsigned RA6 : 1; 3735 unsigned RA7 : 1; 3736 }; 3737 } __TRISAbits_t; 3738 3739 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits; 3740 3741 #define _TRISA_TRISA0 0x01 3742 #define _TRISA_RA0 0x01 3743 #define _TRISA_TRISA1 0x02 3744 #define _TRISA_RA1 0x02 3745 #define _TRISA_TRISA2 0x04 3746 #define _TRISA_RA2 0x04 3747 #define _TRISA_TRISA3 0x08 3748 #define _TRISA_RA3 0x08 3749 #define _TRISA_TRISA4 0x10 3750 #define _TRISA_RA4 0x10 3751 #define _TRISA_TRISA5 0x20 3752 #define _TRISA_RA5 0x20 3753 #define _TRISA_TRISA6 0x40 3754 #define _TRISA_RA6 0x40 3755 #define _TRISA_TRISA7 0x80 3756 #define _TRISA_RA7 0x80 3757 3758 //============================================================================== 3759 3760 3761 //============================================================================== 3762 // DDRB Bits 3763 3764 extern __at(0x0F93) __sfr DDRB; 3765 3766 typedef union 3767 { 3768 struct 3769 { 3770 unsigned TRISB0 : 1; 3771 unsigned TRISB1 : 1; 3772 unsigned TRISB2 : 1; 3773 unsigned TRISB3 : 1; 3774 unsigned TRISB4 : 1; 3775 unsigned TRISB5 : 1; 3776 unsigned TRISB6 : 1; 3777 unsigned TRISB7 : 1; 3778 }; 3779 3780 struct 3781 { 3782 unsigned RB0 : 1; 3783 unsigned RB1 : 1; 3784 unsigned RB2 : 1; 3785 unsigned RB3 : 1; 3786 unsigned RB4 : 1; 3787 unsigned RB5 : 1; 3788 unsigned RB6 : 1; 3789 unsigned RB7 : 1; 3790 }; 3791 } __DDRBbits_t; 3792 3793 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits; 3794 3795 #define _TRISB0 0x01 3796 #define _RB0 0x01 3797 #define _TRISB1 0x02 3798 #define _RB1 0x02 3799 #define _TRISB2 0x04 3800 #define _RB2 0x04 3801 #define _TRISB3 0x08 3802 #define _RB3 0x08 3803 #define _TRISB4 0x10 3804 #define _RB4 0x10 3805 #define _TRISB5 0x20 3806 #define _RB5 0x20 3807 #define _TRISB6 0x40 3808 #define _RB6 0x40 3809 #define _TRISB7 0x80 3810 #define _RB7 0x80 3811 3812 //============================================================================== 3813 3814 3815 //============================================================================== 3816 // TRISB Bits 3817 3818 extern __at(0x0F93) __sfr TRISB; 3819 3820 typedef union 3821 { 3822 struct 3823 { 3824 unsigned TRISB0 : 1; 3825 unsigned TRISB1 : 1; 3826 unsigned TRISB2 : 1; 3827 unsigned TRISB3 : 1; 3828 unsigned TRISB4 : 1; 3829 unsigned TRISB5 : 1; 3830 unsigned TRISB6 : 1; 3831 unsigned TRISB7 : 1; 3832 }; 3833 3834 struct 3835 { 3836 unsigned RB0 : 1; 3837 unsigned RB1 : 1; 3838 unsigned RB2 : 1; 3839 unsigned RB3 : 1; 3840 unsigned RB4 : 1; 3841 unsigned RB5 : 1; 3842 unsigned RB6 : 1; 3843 unsigned RB7 : 1; 3844 }; 3845 } __TRISBbits_t; 3846 3847 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits; 3848 3849 #define _TRISB_TRISB0 0x01 3850 #define _TRISB_RB0 0x01 3851 #define _TRISB_TRISB1 0x02 3852 #define _TRISB_RB1 0x02 3853 #define _TRISB_TRISB2 0x04 3854 #define _TRISB_RB2 0x04 3855 #define _TRISB_TRISB3 0x08 3856 #define _TRISB_RB3 0x08 3857 #define _TRISB_TRISB4 0x10 3858 #define _TRISB_RB4 0x10 3859 #define _TRISB_TRISB5 0x20 3860 #define _TRISB_RB5 0x20 3861 #define _TRISB_TRISB6 0x40 3862 #define _TRISB_RB6 0x40 3863 #define _TRISB_TRISB7 0x80 3864 #define _TRISB_RB7 0x80 3865 3866 //============================================================================== 3867 3868 3869 //============================================================================== 3870 // DDRC Bits 3871 3872 extern __at(0x0F94) __sfr DDRC; 3873 3874 typedef union 3875 { 3876 struct 3877 { 3878 unsigned TRISC0 : 1; 3879 unsigned TRISC1 : 1; 3880 unsigned TRISC2 : 1; 3881 unsigned TRISC3 : 1; 3882 unsigned TRISC4 : 1; 3883 unsigned TRISC5 : 1; 3884 unsigned TRISC6 : 1; 3885 unsigned TRISC7 : 1; 3886 }; 3887 3888 struct 3889 { 3890 unsigned RC0 : 1; 3891 unsigned RC1 : 1; 3892 unsigned RC2 : 1; 3893 unsigned RC3 : 1; 3894 unsigned RC4 : 1; 3895 unsigned RC5 : 1; 3896 unsigned RC6 : 1; 3897 unsigned RC7 : 1; 3898 }; 3899 } __DDRCbits_t; 3900 3901 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits; 3902 3903 #define _TRISC0 0x01 3904 #define _RC0 0x01 3905 #define _TRISC1 0x02 3906 #define _RC1 0x02 3907 #define _TRISC2 0x04 3908 #define _RC2 0x04 3909 #define _TRISC3 0x08 3910 #define _RC3 0x08 3911 #define _TRISC4 0x10 3912 #define _RC4 0x10 3913 #define _TRISC5 0x20 3914 #define _RC5 0x20 3915 #define _TRISC6 0x40 3916 #define _RC6 0x40 3917 #define _TRISC7 0x80 3918 #define _RC7 0x80 3919 3920 //============================================================================== 3921 3922 3923 //============================================================================== 3924 // TRISC Bits 3925 3926 extern __at(0x0F94) __sfr TRISC; 3927 3928 typedef union 3929 { 3930 struct 3931 { 3932 unsigned TRISC0 : 1; 3933 unsigned TRISC1 : 1; 3934 unsigned TRISC2 : 1; 3935 unsigned TRISC3 : 1; 3936 unsigned TRISC4 : 1; 3937 unsigned TRISC5 : 1; 3938 unsigned TRISC6 : 1; 3939 unsigned TRISC7 : 1; 3940 }; 3941 3942 struct 3943 { 3944 unsigned RC0 : 1; 3945 unsigned RC1 : 1; 3946 unsigned RC2 : 1; 3947 unsigned RC3 : 1; 3948 unsigned RC4 : 1; 3949 unsigned RC5 : 1; 3950 unsigned RC6 : 1; 3951 unsigned RC7 : 1; 3952 }; 3953 } __TRISCbits_t; 3954 3955 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits; 3956 3957 #define _TRISC_TRISC0 0x01 3958 #define _TRISC_RC0 0x01 3959 #define _TRISC_TRISC1 0x02 3960 #define _TRISC_RC1 0x02 3961 #define _TRISC_TRISC2 0x04 3962 #define _TRISC_RC2 0x04 3963 #define _TRISC_TRISC3 0x08 3964 #define _TRISC_RC3 0x08 3965 #define _TRISC_TRISC4 0x10 3966 #define _TRISC_RC4 0x10 3967 #define _TRISC_TRISC5 0x20 3968 #define _TRISC_RC5 0x20 3969 #define _TRISC_TRISC6 0x40 3970 #define _TRISC_RC6 0x40 3971 #define _TRISC_TRISC7 0x80 3972 #define _TRISC_RC7 0x80 3973 3974 //============================================================================== 3975 3976 3977 //============================================================================== 3978 // DDRD Bits 3979 3980 extern __at(0x0F95) __sfr DDRD; 3981 3982 typedef union 3983 { 3984 struct 3985 { 3986 unsigned TRISD0 : 1; 3987 unsigned TRISD1 : 1; 3988 unsigned TRISD2 : 1; 3989 unsigned TRISD3 : 1; 3990 unsigned TRISD4 : 1; 3991 unsigned TRISD5 : 1; 3992 unsigned TRISD6 : 1; 3993 unsigned TRISD7 : 1; 3994 }; 3995 3996 struct 3997 { 3998 unsigned RD0 : 1; 3999 unsigned RD1 : 1; 4000 unsigned RD2 : 1; 4001 unsigned RD3 : 1; 4002 unsigned RD4 : 1; 4003 unsigned RD5 : 1; 4004 unsigned RD6 : 1; 4005 unsigned RD7 : 1; 4006 }; 4007 } __DDRDbits_t; 4008 4009 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits; 4010 4011 #define _TRISD0 0x01 4012 #define _RD0 0x01 4013 #define _TRISD1 0x02 4014 #define _RD1 0x02 4015 #define _TRISD2 0x04 4016 #define _RD2 0x04 4017 #define _TRISD3 0x08 4018 #define _RD3 0x08 4019 #define _TRISD4 0x10 4020 #define _RD4 0x10 4021 #define _TRISD5 0x20 4022 #define _RD5 0x20 4023 #define _TRISD6 0x40 4024 #define _RD6 0x40 4025 #define _TRISD7 0x80 4026 #define _RD7 0x80 4027 4028 //============================================================================== 4029 4030 4031 //============================================================================== 4032 // TRISD Bits 4033 4034 extern __at(0x0F95) __sfr TRISD; 4035 4036 typedef union 4037 { 4038 struct 4039 { 4040 unsigned TRISD0 : 1; 4041 unsigned TRISD1 : 1; 4042 unsigned TRISD2 : 1; 4043 unsigned TRISD3 : 1; 4044 unsigned TRISD4 : 1; 4045 unsigned TRISD5 : 1; 4046 unsigned TRISD6 : 1; 4047 unsigned TRISD7 : 1; 4048 }; 4049 4050 struct 4051 { 4052 unsigned RD0 : 1; 4053 unsigned RD1 : 1; 4054 unsigned RD2 : 1; 4055 unsigned RD3 : 1; 4056 unsigned RD4 : 1; 4057 unsigned RD5 : 1; 4058 unsigned RD6 : 1; 4059 unsigned RD7 : 1; 4060 }; 4061 } __TRISDbits_t; 4062 4063 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits; 4064 4065 #define _TRISD_TRISD0 0x01 4066 #define _TRISD_RD0 0x01 4067 #define _TRISD_TRISD1 0x02 4068 #define _TRISD_RD1 0x02 4069 #define _TRISD_TRISD2 0x04 4070 #define _TRISD_RD2 0x04 4071 #define _TRISD_TRISD3 0x08 4072 #define _TRISD_RD3 0x08 4073 #define _TRISD_TRISD4 0x10 4074 #define _TRISD_RD4 0x10 4075 #define _TRISD_TRISD5 0x20 4076 #define _TRISD_RD5 0x20 4077 #define _TRISD_TRISD6 0x40 4078 #define _TRISD_RD6 0x40 4079 #define _TRISD_TRISD7 0x80 4080 #define _TRISD_RD7 0x80 4081 4082 //============================================================================== 4083 4084 4085 //============================================================================== 4086 // DDRE Bits 4087 4088 extern __at(0x0F96) __sfr DDRE; 4089 4090 typedef union 4091 { 4092 struct 4093 { 4094 unsigned TRISE0 : 1; 4095 unsigned TRISE1 : 1; 4096 unsigned TRISE2 : 1; 4097 unsigned : 1; 4098 unsigned : 1; 4099 unsigned : 1; 4100 unsigned : 1; 4101 unsigned WPUE3 : 1; 4102 }; 4103 4104 struct 4105 { 4106 unsigned RE0 : 1; 4107 unsigned RE1 : 1; 4108 unsigned RE2 : 1; 4109 unsigned : 1; 4110 unsigned : 1; 4111 unsigned : 1; 4112 unsigned : 1; 4113 unsigned : 1; 4114 }; 4115 4116 struct 4117 { 4118 unsigned RE : 3; 4119 unsigned : 5; 4120 }; 4121 4122 struct 4123 { 4124 unsigned TRISE : 3; 4125 unsigned : 5; 4126 }; 4127 } __DDREbits_t; 4128 4129 extern __at(0x0F96) volatile __DDREbits_t DDREbits; 4130 4131 #define _TRISE0 0x01 4132 #define _RE0 0x01 4133 #define _TRISE1 0x02 4134 #define _RE1 0x02 4135 #define _TRISE2 0x04 4136 #define _RE2 0x04 4137 #define _WPUE3 0x80 4138 4139 //============================================================================== 4140 4141 4142 //============================================================================== 4143 // TRISE Bits 4144 4145 extern __at(0x0F96) __sfr TRISE; 4146 4147 typedef union 4148 { 4149 struct 4150 { 4151 unsigned TRISE0 : 1; 4152 unsigned TRISE1 : 1; 4153 unsigned TRISE2 : 1; 4154 unsigned : 1; 4155 unsigned : 1; 4156 unsigned : 1; 4157 unsigned : 1; 4158 unsigned WPUE3 : 1; 4159 }; 4160 4161 struct 4162 { 4163 unsigned RE0 : 1; 4164 unsigned RE1 : 1; 4165 unsigned RE2 : 1; 4166 unsigned : 1; 4167 unsigned : 1; 4168 unsigned : 1; 4169 unsigned : 1; 4170 unsigned : 1; 4171 }; 4172 4173 struct 4174 { 4175 unsigned TRISE : 3; 4176 unsigned : 5; 4177 }; 4178 4179 struct 4180 { 4181 unsigned RE : 3; 4182 unsigned : 5; 4183 }; 4184 } __TRISEbits_t; 4185 4186 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits; 4187 4188 #define _TRISE_TRISE0 0x01 4189 #define _TRISE_RE0 0x01 4190 #define _TRISE_TRISE1 0x02 4191 #define _TRISE_RE1 0x02 4192 #define _TRISE_TRISE2 0x04 4193 #define _TRISE_RE2 0x04 4194 #define _TRISE_WPUE3 0x80 4195 4196 //============================================================================== 4197 4198 4199 //============================================================================== 4200 // OSCTUNE Bits 4201 4202 extern __at(0x0F9B) __sfr OSCTUNE; 4203 4204 typedef union 4205 { 4206 struct 4207 { 4208 unsigned TUN0 : 1; 4209 unsigned TUN1 : 1; 4210 unsigned TUN2 : 1; 4211 unsigned TUN3 : 1; 4212 unsigned TUN4 : 1; 4213 unsigned TUN5 : 1; 4214 unsigned PLLEN : 1; 4215 unsigned INTSRC : 1; 4216 }; 4217 4218 struct 4219 { 4220 unsigned TUN : 6; 4221 unsigned : 2; 4222 }; 4223 } __OSCTUNEbits_t; 4224 4225 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits; 4226 4227 #define _TUN0 0x01 4228 #define _TUN1 0x02 4229 #define _TUN2 0x04 4230 #define _TUN3 0x08 4231 #define _TUN4 0x10 4232 #define _TUN5 0x20 4233 #define _PLLEN 0x40 4234 #define _INTSRC 0x80 4235 4236 //============================================================================== 4237 4238 4239 //============================================================================== 4240 // HLVDCON Bits 4241 4242 extern __at(0x0F9C) __sfr HLVDCON; 4243 4244 typedef union 4245 { 4246 struct 4247 { 4248 unsigned HLVDL0 : 1; 4249 unsigned HLVDL1 : 1; 4250 unsigned HLVDL2 : 1; 4251 unsigned HLVDL3 : 1; 4252 unsigned HLVDEN : 1; 4253 unsigned IRVST : 1; 4254 unsigned BGVST : 1; 4255 unsigned VDIRMAG : 1; 4256 }; 4257 4258 struct 4259 { 4260 unsigned LVDL0 : 1; 4261 unsigned LVDL1 : 1; 4262 unsigned LVDL2 : 1; 4263 unsigned LVDL3 : 1; 4264 unsigned LVDEN : 1; 4265 unsigned IVRST : 1; 4266 unsigned : 1; 4267 unsigned : 1; 4268 }; 4269 4270 struct 4271 { 4272 unsigned LVV0 : 1; 4273 unsigned LVV1 : 1; 4274 unsigned LVV2 : 1; 4275 unsigned LVV3 : 1; 4276 unsigned : 1; 4277 unsigned BGST : 1; 4278 unsigned : 1; 4279 unsigned : 1; 4280 }; 4281 4282 struct 4283 { 4284 unsigned LVDL : 4; 4285 unsigned : 4; 4286 }; 4287 4288 struct 4289 { 4290 unsigned LVV : 4; 4291 unsigned : 4; 4292 }; 4293 4294 struct 4295 { 4296 unsigned HLVDL : 4; 4297 unsigned : 4; 4298 }; 4299 } __HLVDCONbits_t; 4300 4301 extern __at(0x0F9C) volatile __HLVDCONbits_t HLVDCONbits; 4302 4303 #define _HLVDL0 0x01 4304 #define _LVDL0 0x01 4305 #define _LVV0 0x01 4306 #define _HLVDL1 0x02 4307 #define _LVDL1 0x02 4308 #define _LVV1 0x02 4309 #define _HLVDL2 0x04 4310 #define _LVDL2 0x04 4311 #define _LVV2 0x04 4312 #define _HLVDL3 0x08 4313 #define _LVDL3 0x08 4314 #define _LVV3 0x08 4315 #define _HLVDEN 0x10 4316 #define _LVDEN 0x10 4317 #define _IRVST 0x20 4318 #define _IVRST 0x20 4319 #define _BGST 0x20 4320 #define _BGVST 0x40 4321 #define _VDIRMAG 0x80 4322 4323 //============================================================================== 4324 4325 4326 //============================================================================== 4327 // LVDCON Bits 4328 4329 extern __at(0x0F9C) __sfr LVDCON; 4330 4331 typedef union 4332 { 4333 struct 4334 { 4335 unsigned HLVDL0 : 1; 4336 unsigned HLVDL1 : 1; 4337 unsigned HLVDL2 : 1; 4338 unsigned HLVDL3 : 1; 4339 unsigned HLVDEN : 1; 4340 unsigned IRVST : 1; 4341 unsigned BGVST : 1; 4342 unsigned VDIRMAG : 1; 4343 }; 4344 4345 struct 4346 { 4347 unsigned LVDL0 : 1; 4348 unsigned LVDL1 : 1; 4349 unsigned LVDL2 : 1; 4350 unsigned LVDL3 : 1; 4351 unsigned LVDEN : 1; 4352 unsigned IVRST : 1; 4353 unsigned : 1; 4354 unsigned : 1; 4355 }; 4356 4357 struct 4358 { 4359 unsigned LVV0 : 1; 4360 unsigned LVV1 : 1; 4361 unsigned LVV2 : 1; 4362 unsigned LVV3 : 1; 4363 unsigned : 1; 4364 unsigned BGST : 1; 4365 unsigned : 1; 4366 unsigned : 1; 4367 }; 4368 4369 struct 4370 { 4371 unsigned HLVDL : 4; 4372 unsigned : 4; 4373 }; 4374 4375 struct 4376 { 4377 unsigned LVDL : 4; 4378 unsigned : 4; 4379 }; 4380 4381 struct 4382 { 4383 unsigned LVV : 4; 4384 unsigned : 4; 4385 }; 4386 } __LVDCONbits_t; 4387 4388 extern __at(0x0F9C) volatile __LVDCONbits_t LVDCONbits; 4389 4390 #define _LVDCON_HLVDL0 0x01 4391 #define _LVDCON_LVDL0 0x01 4392 #define _LVDCON_LVV0 0x01 4393 #define _LVDCON_HLVDL1 0x02 4394 #define _LVDCON_LVDL1 0x02 4395 #define _LVDCON_LVV1 0x02 4396 #define _LVDCON_HLVDL2 0x04 4397 #define _LVDCON_LVDL2 0x04 4398 #define _LVDCON_LVV2 0x04 4399 #define _LVDCON_HLVDL3 0x08 4400 #define _LVDCON_LVDL3 0x08 4401 #define _LVDCON_LVV3 0x08 4402 #define _LVDCON_HLVDEN 0x10 4403 #define _LVDCON_LVDEN 0x10 4404 #define _LVDCON_IRVST 0x20 4405 #define _LVDCON_IVRST 0x20 4406 #define _LVDCON_BGST 0x20 4407 #define _LVDCON_BGVST 0x40 4408 #define _LVDCON_VDIRMAG 0x80 4409 4410 //============================================================================== 4411 4412 4413 //============================================================================== 4414 // PIE1 Bits 4415 4416 extern __at(0x0F9D) __sfr PIE1; 4417 4418 typedef union 4419 { 4420 struct 4421 { 4422 unsigned TMR1IE : 1; 4423 unsigned TMR2IE : 1; 4424 unsigned CCP1IE : 1; 4425 unsigned SSP1IE : 1; 4426 unsigned TX1IE : 1; 4427 unsigned RC1IE : 1; 4428 unsigned ADIE : 1; 4429 unsigned : 1; 4430 }; 4431 4432 struct 4433 { 4434 unsigned : 1; 4435 unsigned : 1; 4436 unsigned : 1; 4437 unsigned SSPIE : 1; 4438 unsigned TXIE : 1; 4439 unsigned RCIE : 1; 4440 unsigned : 1; 4441 unsigned : 1; 4442 }; 4443 } __PIE1bits_t; 4444 4445 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits; 4446 4447 #define _TMR1IE 0x01 4448 #define _TMR2IE 0x02 4449 #define _CCP1IE 0x04 4450 #define _SSP1IE 0x08 4451 #define _SSPIE 0x08 4452 #define _TX1IE 0x10 4453 #define _TXIE 0x10 4454 #define _RC1IE 0x20 4455 #define _RCIE 0x20 4456 #define _ADIE 0x40 4457 4458 //============================================================================== 4459 4460 4461 //============================================================================== 4462 // PIR1 Bits 4463 4464 extern __at(0x0F9E) __sfr PIR1; 4465 4466 typedef union 4467 { 4468 struct 4469 { 4470 unsigned TMR1IF : 1; 4471 unsigned TMR2IF : 1; 4472 unsigned CCP1IF : 1; 4473 unsigned SSP1IF : 1; 4474 unsigned TX1IF : 1; 4475 unsigned RC1IF : 1; 4476 unsigned ADIF : 1; 4477 unsigned : 1; 4478 }; 4479 4480 struct 4481 { 4482 unsigned : 1; 4483 unsigned : 1; 4484 unsigned : 1; 4485 unsigned SSPIF : 1; 4486 unsigned TXIF : 1; 4487 unsigned RCIF : 1; 4488 unsigned : 1; 4489 unsigned : 1; 4490 }; 4491 } __PIR1bits_t; 4492 4493 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits; 4494 4495 #define _TMR1IF 0x01 4496 #define _TMR2IF 0x02 4497 #define _CCP1IF 0x04 4498 #define _SSP1IF 0x08 4499 #define _SSPIF 0x08 4500 #define _TX1IF 0x10 4501 #define _TXIF 0x10 4502 #define _RC1IF 0x20 4503 #define _RCIF 0x20 4504 #define _ADIF 0x40 4505 4506 //============================================================================== 4507 4508 4509 //============================================================================== 4510 // IPR1 Bits 4511 4512 extern __at(0x0F9F) __sfr IPR1; 4513 4514 typedef union 4515 { 4516 struct 4517 { 4518 unsigned TMR1IP : 1; 4519 unsigned TMR2IP : 1; 4520 unsigned CCP1IP : 1; 4521 unsigned SSP1IP : 1; 4522 unsigned TX1IP : 1; 4523 unsigned RC1IP : 1; 4524 unsigned ADIP : 1; 4525 unsigned : 1; 4526 }; 4527 4528 struct 4529 { 4530 unsigned : 1; 4531 unsigned : 1; 4532 unsigned : 1; 4533 unsigned SSPIP : 1; 4534 unsigned TXIP : 1; 4535 unsigned RCIP : 1; 4536 unsigned : 1; 4537 unsigned : 1; 4538 }; 4539 } __IPR1bits_t; 4540 4541 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits; 4542 4543 #define _TMR1IP 0x01 4544 #define _TMR2IP 0x02 4545 #define _CCP1IP 0x04 4546 #define _SSP1IP 0x08 4547 #define _SSPIP 0x08 4548 #define _TX1IP 0x10 4549 #define _TXIP 0x10 4550 #define _RC1IP 0x20 4551 #define _RCIP 0x20 4552 #define _ADIP 0x40 4553 4554 //============================================================================== 4555 4556 4557 //============================================================================== 4558 // PIE2 Bits 4559 4560 extern __at(0x0FA0) __sfr PIE2; 4561 4562 typedef union 4563 { 4564 struct 4565 { 4566 unsigned CCP2IE : 1; 4567 unsigned TMR3IE : 1; 4568 unsigned HLVDIE : 1; 4569 unsigned BCL1IE : 1; 4570 unsigned EEIE : 1; 4571 unsigned C2IE : 1; 4572 unsigned C1IE : 1; 4573 unsigned OSCFIE : 1; 4574 }; 4575 4576 struct 4577 { 4578 unsigned : 1; 4579 unsigned : 1; 4580 unsigned LVDIE : 1; 4581 unsigned BCLIE : 1; 4582 unsigned : 1; 4583 unsigned : 1; 4584 unsigned : 1; 4585 unsigned : 1; 4586 }; 4587 } __PIE2bits_t; 4588 4589 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits; 4590 4591 #define _CCP2IE 0x01 4592 #define _TMR3IE 0x02 4593 #define _HLVDIE 0x04 4594 #define _LVDIE 0x04 4595 #define _BCL1IE 0x08 4596 #define _BCLIE 0x08 4597 #define _EEIE 0x10 4598 #define _C2IE 0x20 4599 #define _C1IE 0x40 4600 #define _OSCFIE 0x80 4601 4602 //============================================================================== 4603 4604 4605 //============================================================================== 4606 // PIR2 Bits 4607 4608 extern __at(0x0FA1) __sfr PIR2; 4609 4610 typedef union 4611 { 4612 struct 4613 { 4614 unsigned CCP2IF : 1; 4615 unsigned TMR3IF : 1; 4616 unsigned HLVDIF : 1; 4617 unsigned BCL1IF : 1; 4618 unsigned EEIF : 1; 4619 unsigned C2IF : 1; 4620 unsigned C1IF : 1; 4621 unsigned OSCFIF : 1; 4622 }; 4623 4624 struct 4625 { 4626 unsigned : 1; 4627 unsigned : 1; 4628 unsigned LVDIF : 1; 4629 unsigned BCLIF : 1; 4630 unsigned : 1; 4631 unsigned : 1; 4632 unsigned : 1; 4633 unsigned : 1; 4634 }; 4635 } __PIR2bits_t; 4636 4637 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits; 4638 4639 #define _CCP2IF 0x01 4640 #define _TMR3IF 0x02 4641 #define _HLVDIF 0x04 4642 #define _LVDIF 0x04 4643 #define _BCL1IF 0x08 4644 #define _BCLIF 0x08 4645 #define _EEIF 0x10 4646 #define _C2IF 0x20 4647 #define _C1IF 0x40 4648 #define _OSCFIF 0x80 4649 4650 //============================================================================== 4651 4652 4653 //============================================================================== 4654 // IPR2 Bits 4655 4656 extern __at(0x0FA2) __sfr IPR2; 4657 4658 typedef union 4659 { 4660 struct 4661 { 4662 unsigned CCP2IP : 1; 4663 unsigned TMR3IP : 1; 4664 unsigned HLVDIP : 1; 4665 unsigned BCL1IP : 1; 4666 unsigned EEIP : 1; 4667 unsigned C2IP : 1; 4668 unsigned C1IP : 1; 4669 unsigned OSCFIP : 1; 4670 }; 4671 4672 struct 4673 { 4674 unsigned : 1; 4675 unsigned : 1; 4676 unsigned LVDIP : 1; 4677 unsigned BCLIP : 1; 4678 unsigned : 1; 4679 unsigned : 1; 4680 unsigned : 1; 4681 unsigned : 1; 4682 }; 4683 } __IPR2bits_t; 4684 4685 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits; 4686 4687 #define _CCP2IP 0x01 4688 #define _TMR3IP 0x02 4689 #define _HLVDIP 0x04 4690 #define _LVDIP 0x04 4691 #define _BCL1IP 0x08 4692 #define _BCLIP 0x08 4693 #define _EEIP 0x10 4694 #define _C2IP 0x20 4695 #define _C1IP 0x40 4696 #define _OSCFIP 0x80 4697 4698 //============================================================================== 4699 4700 4701 //============================================================================== 4702 // PIE3 Bits 4703 4704 extern __at(0x0FA3) __sfr PIE3; 4705 4706 typedef struct 4707 { 4708 unsigned TMR1GIE : 1; 4709 unsigned TMR3GIE : 1; 4710 unsigned TMR5GIE : 1; 4711 unsigned CTMUIE : 1; 4712 unsigned TX2IE : 1; 4713 unsigned RC2IE : 1; 4714 unsigned BCL2IE : 1; 4715 unsigned SSP2IE : 1; 4716 } __PIE3bits_t; 4717 4718 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits; 4719 4720 #define _TMR1GIE 0x01 4721 #define _TMR3GIE 0x02 4722 #define _TMR5GIE 0x04 4723 #define _CTMUIE 0x08 4724 #define _TX2IE 0x10 4725 #define _RC2IE 0x20 4726 #define _BCL2IE 0x40 4727 #define _SSP2IE 0x80 4728 4729 //============================================================================== 4730 4731 4732 //============================================================================== 4733 // PIR3 Bits 4734 4735 extern __at(0x0FA4) __sfr PIR3; 4736 4737 typedef struct 4738 { 4739 unsigned TMR1GIF : 1; 4740 unsigned TMR3GIF : 1; 4741 unsigned TMR5GIF : 1; 4742 unsigned CTMUIF : 1; 4743 unsigned TX2IF : 1; 4744 unsigned RC2IF : 1; 4745 unsigned BCL2IF : 1; 4746 unsigned SSP2IF : 1; 4747 } __PIR3bits_t; 4748 4749 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits; 4750 4751 #define _TMR1GIF 0x01 4752 #define _TMR3GIF 0x02 4753 #define _TMR5GIF 0x04 4754 #define _CTMUIF 0x08 4755 #define _TX2IF 0x10 4756 #define _RC2IF 0x20 4757 #define _BCL2IF 0x40 4758 #define _SSP2IF 0x80 4759 4760 //============================================================================== 4761 4762 4763 //============================================================================== 4764 // IPR3 Bits 4765 4766 extern __at(0x0FA5) __sfr IPR3; 4767 4768 typedef struct 4769 { 4770 unsigned TMR1GIP : 1; 4771 unsigned TMR3GIP : 1; 4772 unsigned TMR5GIP : 1; 4773 unsigned CTMUIP : 1; 4774 unsigned TX2IP : 1; 4775 unsigned RC2IP : 1; 4776 unsigned BCL2IP : 1; 4777 unsigned SSP2IP : 1; 4778 } __IPR3bits_t; 4779 4780 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits; 4781 4782 #define _TMR1GIP 0x01 4783 #define _TMR3GIP 0x02 4784 #define _TMR5GIP 0x04 4785 #define _CTMUIP 0x08 4786 #define _TX2IP 0x10 4787 #define _RC2IP 0x20 4788 #define _BCL2IP 0x40 4789 #define _SSP2IP 0x80 4790 4791 //============================================================================== 4792 4793 4794 //============================================================================== 4795 // EECON1 Bits 4796 4797 extern __at(0x0FA6) __sfr EECON1; 4798 4799 typedef struct 4800 { 4801 unsigned RD : 1; 4802 unsigned WR : 1; 4803 unsigned WREN : 1; 4804 unsigned WRERR : 1; 4805 unsigned FREE : 1; 4806 unsigned : 1; 4807 unsigned CFGS : 1; 4808 unsigned EEPGD : 1; 4809 } __EECON1bits_t; 4810 4811 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits; 4812 4813 #define _RD 0x01 4814 #define _WR 0x02 4815 #define _WREN 0x04 4816 #define _WRERR 0x08 4817 #define _FREE 0x10 4818 #define _CFGS 0x40 4819 #define _EEPGD 0x80 4820 4821 //============================================================================== 4822 4823 extern __at(0x0FA7) __sfr EECON2; 4824 extern __at(0x0FA8) __sfr EEDATA; 4825 4826 //============================================================================== 4827 // EEADR Bits 4828 4829 extern __at(0x0FA9) __sfr EEADR; 4830 4831 typedef struct 4832 { 4833 unsigned EEADR0 : 1; 4834 unsigned EEADR1 : 1; 4835 unsigned EEADR2 : 1; 4836 unsigned EEADR3 : 1; 4837 unsigned EEADR4 : 1; 4838 unsigned EEADR5 : 1; 4839 unsigned EEADR6 : 1; 4840 unsigned EEADR7 : 1; 4841 } __EEADRbits_t; 4842 4843 extern __at(0x0FA9) volatile __EEADRbits_t EEADRbits; 4844 4845 #define _EEADR0 0x01 4846 #define _EEADR1 0x02 4847 #define _EEADR2 0x04 4848 #define _EEADR3 0x08 4849 #define _EEADR4 0x10 4850 #define _EEADR5 0x20 4851 #define _EEADR6 0x40 4852 #define _EEADR7 0x80 4853 4854 //============================================================================== 4855 4856 4857 //============================================================================== 4858 // RC1STA Bits 4859 4860 extern __at(0x0FAB) __sfr RC1STA; 4861 4862 typedef union 4863 { 4864 struct 4865 { 4866 unsigned RX9D : 1; 4867 unsigned OERR : 1; 4868 unsigned FERR : 1; 4869 unsigned ADDEN : 1; 4870 unsigned CREN : 1; 4871 unsigned SREN : 1; 4872 unsigned RX9 : 1; 4873 unsigned SPEN : 1; 4874 }; 4875 4876 struct 4877 { 4878 unsigned RX9D1 : 1; 4879 unsigned OERR1 : 1; 4880 unsigned FERR1 : 1; 4881 unsigned ADEN : 1; 4882 unsigned CREN1 : 1; 4883 unsigned SREN1 : 1; 4884 unsigned RX91 : 1; 4885 unsigned SPEN1 : 1; 4886 }; 4887 4888 struct 4889 { 4890 unsigned : 1; 4891 unsigned : 1; 4892 unsigned : 1; 4893 unsigned ADDEN1 : 1; 4894 unsigned : 1; 4895 unsigned : 1; 4896 unsigned : 1; 4897 unsigned : 1; 4898 }; 4899 } __RC1STAbits_t; 4900 4901 extern __at(0x0FAB) volatile __RC1STAbits_t RC1STAbits; 4902 4903 #define _RX9D 0x01 4904 #define _RX9D1 0x01 4905 #define _OERR 0x02 4906 #define _OERR1 0x02 4907 #define _FERR 0x04 4908 #define _FERR1 0x04 4909 #define _ADDEN 0x08 4910 #define _ADEN 0x08 4911 #define _ADDEN1 0x08 4912 #define _CREN 0x10 4913 #define _CREN1 0x10 4914 #define _SREN 0x20 4915 #define _SREN1 0x20 4916 #define _RX9 0x40 4917 #define _RX91 0x40 4918 #define _SPEN 0x80 4919 #define _SPEN1 0x80 4920 4921 //============================================================================== 4922 4923 4924 //============================================================================== 4925 // RCSTA Bits 4926 4927 extern __at(0x0FAB) __sfr RCSTA; 4928 4929 typedef union 4930 { 4931 struct 4932 { 4933 unsigned RX9D : 1; 4934 unsigned OERR : 1; 4935 unsigned FERR : 1; 4936 unsigned ADDEN : 1; 4937 unsigned CREN : 1; 4938 unsigned SREN : 1; 4939 unsigned RX9 : 1; 4940 unsigned SPEN : 1; 4941 }; 4942 4943 struct 4944 { 4945 unsigned RX9D1 : 1; 4946 unsigned OERR1 : 1; 4947 unsigned FERR1 : 1; 4948 unsigned ADEN : 1; 4949 unsigned CREN1 : 1; 4950 unsigned SREN1 : 1; 4951 unsigned RX91 : 1; 4952 unsigned SPEN1 : 1; 4953 }; 4954 4955 struct 4956 { 4957 unsigned : 1; 4958 unsigned : 1; 4959 unsigned : 1; 4960 unsigned ADDEN1 : 1; 4961 unsigned : 1; 4962 unsigned : 1; 4963 unsigned : 1; 4964 unsigned : 1; 4965 }; 4966 } __RCSTAbits_t; 4967 4968 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits; 4969 4970 #define _RCSTA_RX9D 0x01 4971 #define _RCSTA_RX9D1 0x01 4972 #define _RCSTA_OERR 0x02 4973 #define _RCSTA_OERR1 0x02 4974 #define _RCSTA_FERR 0x04 4975 #define _RCSTA_FERR1 0x04 4976 #define _RCSTA_ADDEN 0x08 4977 #define _RCSTA_ADEN 0x08 4978 #define _RCSTA_ADDEN1 0x08 4979 #define _RCSTA_CREN 0x10 4980 #define _RCSTA_CREN1 0x10 4981 #define _RCSTA_SREN 0x20 4982 #define _RCSTA_SREN1 0x20 4983 #define _RCSTA_RX9 0x40 4984 #define _RCSTA_RX91 0x40 4985 #define _RCSTA_SPEN 0x80 4986 #define _RCSTA_SPEN1 0x80 4987 4988 //============================================================================== 4989 4990 4991 //============================================================================== 4992 // RCSTA1 Bits 4993 4994 extern __at(0x0FAB) __sfr RCSTA1; 4995 4996 typedef union 4997 { 4998 struct 4999 { 5000 unsigned RX9D : 1; 5001 unsigned OERR : 1; 5002 unsigned FERR : 1; 5003 unsigned ADDEN : 1; 5004 unsigned CREN : 1; 5005 unsigned SREN : 1; 5006 unsigned RX9 : 1; 5007 unsigned SPEN : 1; 5008 }; 5009 5010 struct 5011 { 5012 unsigned RX9D1 : 1; 5013 unsigned OERR1 : 1; 5014 unsigned FERR1 : 1; 5015 unsigned ADEN : 1; 5016 unsigned CREN1 : 1; 5017 unsigned SREN1 : 1; 5018 unsigned RX91 : 1; 5019 unsigned SPEN1 : 1; 5020 }; 5021 5022 struct 5023 { 5024 unsigned : 1; 5025 unsigned : 1; 5026 unsigned : 1; 5027 unsigned ADDEN1 : 1; 5028 unsigned : 1; 5029 unsigned : 1; 5030 unsigned : 1; 5031 unsigned : 1; 5032 }; 5033 } __RCSTA1bits_t; 5034 5035 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits; 5036 5037 #define _RCSTA1_RX9D 0x01 5038 #define _RCSTA1_RX9D1 0x01 5039 #define _RCSTA1_OERR 0x02 5040 #define _RCSTA1_OERR1 0x02 5041 #define _RCSTA1_FERR 0x04 5042 #define _RCSTA1_FERR1 0x04 5043 #define _RCSTA1_ADDEN 0x08 5044 #define _RCSTA1_ADEN 0x08 5045 #define _RCSTA1_ADDEN1 0x08 5046 #define _RCSTA1_CREN 0x10 5047 #define _RCSTA1_CREN1 0x10 5048 #define _RCSTA1_SREN 0x20 5049 #define _RCSTA1_SREN1 0x20 5050 #define _RCSTA1_RX9 0x40 5051 #define _RCSTA1_RX91 0x40 5052 #define _RCSTA1_SPEN 0x80 5053 #define _RCSTA1_SPEN1 0x80 5054 5055 //============================================================================== 5056 5057 5058 //============================================================================== 5059 // TX1STA Bits 5060 5061 extern __at(0x0FAC) __sfr TX1STA; 5062 5063 typedef union 5064 { 5065 struct 5066 { 5067 unsigned TX9D : 1; 5068 unsigned TRMT : 1; 5069 unsigned BRGH : 1; 5070 unsigned SENDB : 1; 5071 unsigned SYNC : 1; 5072 unsigned TXEN : 1; 5073 unsigned TX9 : 1; 5074 unsigned CSRC : 1; 5075 }; 5076 5077 struct 5078 { 5079 unsigned TX9D1 : 1; 5080 unsigned TRMT1 : 1; 5081 unsigned BRGH1 : 1; 5082 unsigned SENDB1 : 1; 5083 unsigned SYNC1 : 1; 5084 unsigned TXEN1 : 1; 5085 unsigned TX91 : 1; 5086 unsigned CSRC1 : 1; 5087 }; 5088 } __TX1STAbits_t; 5089 5090 extern __at(0x0FAC) volatile __TX1STAbits_t TX1STAbits; 5091 5092 #define _TX9D 0x01 5093 #define _TX9D1 0x01 5094 #define _TRMT 0x02 5095 #define _TRMT1 0x02 5096 #define _BRGH 0x04 5097 #define _BRGH1 0x04 5098 #define _SENDB 0x08 5099 #define _SENDB1 0x08 5100 #define _SYNC 0x10 5101 #define _SYNC1 0x10 5102 #define _TXEN 0x20 5103 #define _TXEN1 0x20 5104 #define _TX9 0x40 5105 #define _TX91 0x40 5106 #define _CSRC 0x80 5107 #define _CSRC1 0x80 5108 5109 //============================================================================== 5110 5111 5112 //============================================================================== 5113 // TXSTA Bits 5114 5115 extern __at(0x0FAC) __sfr TXSTA; 5116 5117 typedef union 5118 { 5119 struct 5120 { 5121 unsigned TX9D : 1; 5122 unsigned TRMT : 1; 5123 unsigned BRGH : 1; 5124 unsigned SENDB : 1; 5125 unsigned SYNC : 1; 5126 unsigned TXEN : 1; 5127 unsigned TX9 : 1; 5128 unsigned CSRC : 1; 5129 }; 5130 5131 struct 5132 { 5133 unsigned TX9D1 : 1; 5134 unsigned TRMT1 : 1; 5135 unsigned BRGH1 : 1; 5136 unsigned SENDB1 : 1; 5137 unsigned SYNC1 : 1; 5138 unsigned TXEN1 : 1; 5139 unsigned TX91 : 1; 5140 unsigned CSRC1 : 1; 5141 }; 5142 } __TXSTAbits_t; 5143 5144 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits; 5145 5146 #define _TXSTA_TX9D 0x01 5147 #define _TXSTA_TX9D1 0x01 5148 #define _TXSTA_TRMT 0x02 5149 #define _TXSTA_TRMT1 0x02 5150 #define _TXSTA_BRGH 0x04 5151 #define _TXSTA_BRGH1 0x04 5152 #define _TXSTA_SENDB 0x08 5153 #define _TXSTA_SENDB1 0x08 5154 #define _TXSTA_SYNC 0x10 5155 #define _TXSTA_SYNC1 0x10 5156 #define _TXSTA_TXEN 0x20 5157 #define _TXSTA_TXEN1 0x20 5158 #define _TXSTA_TX9 0x40 5159 #define _TXSTA_TX91 0x40 5160 #define _TXSTA_CSRC 0x80 5161 #define _TXSTA_CSRC1 0x80 5162 5163 //============================================================================== 5164 5165 5166 //============================================================================== 5167 // TXSTA1 Bits 5168 5169 extern __at(0x0FAC) __sfr TXSTA1; 5170 5171 typedef union 5172 { 5173 struct 5174 { 5175 unsigned TX9D : 1; 5176 unsigned TRMT : 1; 5177 unsigned BRGH : 1; 5178 unsigned SENDB : 1; 5179 unsigned SYNC : 1; 5180 unsigned TXEN : 1; 5181 unsigned TX9 : 1; 5182 unsigned CSRC : 1; 5183 }; 5184 5185 struct 5186 { 5187 unsigned TX9D1 : 1; 5188 unsigned TRMT1 : 1; 5189 unsigned BRGH1 : 1; 5190 unsigned SENDB1 : 1; 5191 unsigned SYNC1 : 1; 5192 unsigned TXEN1 : 1; 5193 unsigned TX91 : 1; 5194 unsigned CSRC1 : 1; 5195 }; 5196 } __TXSTA1bits_t; 5197 5198 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits; 5199 5200 #define _TXSTA1_TX9D 0x01 5201 #define _TXSTA1_TX9D1 0x01 5202 #define _TXSTA1_TRMT 0x02 5203 #define _TXSTA1_TRMT1 0x02 5204 #define _TXSTA1_BRGH 0x04 5205 #define _TXSTA1_BRGH1 0x04 5206 #define _TXSTA1_SENDB 0x08 5207 #define _TXSTA1_SENDB1 0x08 5208 #define _TXSTA1_SYNC 0x10 5209 #define _TXSTA1_SYNC1 0x10 5210 #define _TXSTA1_TXEN 0x20 5211 #define _TXSTA1_TXEN1 0x20 5212 #define _TXSTA1_TX9 0x40 5213 #define _TXSTA1_TX91 0x40 5214 #define _TXSTA1_CSRC 0x80 5215 #define _TXSTA1_CSRC1 0x80 5216 5217 //============================================================================== 5218 5219 extern __at(0x0FAD) __sfr TX1REG; 5220 extern __at(0x0FAD) __sfr TXREG; 5221 extern __at(0x0FAD) __sfr TXREG1; 5222 extern __at(0x0FAE) __sfr RC1REG; 5223 extern __at(0x0FAE) __sfr RCREG; 5224 extern __at(0x0FAE) __sfr RCREG1; 5225 extern __at(0x0FAF) __sfr SP1BRG; 5226 extern __at(0x0FAF) __sfr SPBRG; 5227 extern __at(0x0FAF) __sfr SPBRG1; 5228 extern __at(0x0FB0) __sfr SP1BRGH; 5229 extern __at(0x0FB0) __sfr SPBRGH; 5230 extern __at(0x0FB0) __sfr SPBRGH1; 5231 5232 //============================================================================== 5233 // T3CON Bits 5234 5235 extern __at(0x0FB1) __sfr T3CON; 5236 5237 typedef union 5238 { 5239 struct 5240 { 5241 unsigned TMR3ON : 1; 5242 unsigned T3RD16 : 1; 5243 unsigned NOT_T3SYNC : 1; 5244 unsigned T3SOSCEN : 1; 5245 unsigned T3CKPS0 : 1; 5246 unsigned T3CKPS1 : 1; 5247 unsigned TMR3CS0 : 1; 5248 unsigned TMR3CS1 : 1; 5249 }; 5250 5251 struct 5252 { 5253 unsigned : 1; 5254 unsigned : 1; 5255 unsigned : 1; 5256 unsigned T3OSCEN : 1; 5257 unsigned : 1; 5258 unsigned : 1; 5259 unsigned : 1; 5260 unsigned : 1; 5261 }; 5262 5263 struct 5264 { 5265 unsigned : 4; 5266 unsigned T3CKPS : 2; 5267 unsigned : 2; 5268 }; 5269 5270 struct 5271 { 5272 unsigned : 6; 5273 unsigned TMR3CS : 2; 5274 }; 5275 } __T3CONbits_t; 5276 5277 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits; 5278 5279 #define _TMR3ON 0x01 5280 #define _T3RD16 0x02 5281 #define _NOT_T3SYNC 0x04 5282 #define _T3SOSCEN 0x08 5283 #define _T3OSCEN 0x08 5284 #define _T3CKPS0 0x10 5285 #define _T3CKPS1 0x20 5286 #define _TMR3CS0 0x40 5287 #define _TMR3CS1 0x80 5288 5289 //============================================================================== 5290 5291 extern __at(0x0FB2) __sfr TMR3; 5292 extern __at(0x0FB2) __sfr TMR3L; 5293 extern __at(0x0FB3) __sfr TMR3H; 5294 5295 //============================================================================== 5296 // T3GCON Bits 5297 5298 extern __at(0x0FB4) __sfr T3GCON; 5299 5300 typedef union 5301 { 5302 struct 5303 { 5304 unsigned T3GSS0 : 1; 5305 unsigned T3GSS1 : 1; 5306 unsigned T3GVAL : 1; 5307 unsigned T3GGO_NOT_DONE : 1; 5308 unsigned T3GSPM : 1; 5309 unsigned T3GTM : 1; 5310 unsigned T3GPOL : 1; 5311 unsigned TMR3GE : 1; 5312 }; 5313 5314 struct 5315 { 5316 unsigned : 1; 5317 unsigned : 1; 5318 unsigned : 1; 5319 unsigned T3G_DONE : 1; 5320 unsigned : 1; 5321 unsigned : 1; 5322 unsigned : 1; 5323 unsigned : 1; 5324 }; 5325 5326 struct 5327 { 5328 unsigned : 1; 5329 unsigned : 1; 5330 unsigned : 1; 5331 unsigned T3GGO : 1; 5332 unsigned : 1; 5333 unsigned : 1; 5334 unsigned : 1; 5335 unsigned : 1; 5336 }; 5337 5338 struct 5339 { 5340 unsigned T3GSS : 2; 5341 unsigned : 6; 5342 }; 5343 } __T3GCONbits_t; 5344 5345 extern __at(0x0FB4) volatile __T3GCONbits_t T3GCONbits; 5346 5347 #define _T3GSS0 0x01 5348 #define _T3GSS1 0x02 5349 #define _T3GVAL 0x04 5350 #define _T3GGO_NOT_DONE 0x08 5351 #define _T3G_DONE 0x08 5352 #define _T3GGO 0x08 5353 #define _T3GSPM 0x10 5354 #define _T3GTM 0x20 5355 #define _T3GPOL 0x40 5356 #define _TMR3GE 0x80 5357 5358 //============================================================================== 5359 5360 5361 //============================================================================== 5362 // ECCP1AS Bits 5363 5364 extern __at(0x0FB6) __sfr ECCP1AS; 5365 5366 typedef union 5367 { 5368 struct 5369 { 5370 unsigned P1SSBD0 : 1; 5371 unsigned P1SSBD1 : 1; 5372 unsigned P1SSAC0 : 1; 5373 unsigned P1SSAC1 : 1; 5374 unsigned CCP1AS0 : 1; 5375 unsigned CCP1AS1 : 1; 5376 unsigned CCP1AS2 : 1; 5377 unsigned CCP1ASE : 1; 5378 }; 5379 5380 struct 5381 { 5382 unsigned PSS1BD0 : 1; 5383 unsigned PSS1BD1 : 1; 5384 unsigned PSS1AC0 : 1; 5385 unsigned PSS1AC1 : 1; 5386 unsigned ECCPAS0 : 1; 5387 unsigned ECCPAS1 : 1; 5388 unsigned ECCPAS2 : 1; 5389 unsigned ECCPASE : 1; 5390 }; 5391 5392 struct 5393 { 5394 unsigned PSSBD0 : 1; 5395 unsigned PSSBD1 : 1; 5396 unsigned PSSAC0 : 1; 5397 unsigned PSSAC1 : 1; 5398 unsigned : 1; 5399 unsigned : 1; 5400 unsigned : 1; 5401 unsigned : 1; 5402 }; 5403 5404 struct 5405 { 5406 unsigned P1SSBD : 2; 5407 unsigned : 6; 5408 }; 5409 5410 struct 5411 { 5412 unsigned PSSBD : 2; 5413 unsigned : 6; 5414 }; 5415 5416 struct 5417 { 5418 unsigned PSS1BD : 2; 5419 unsigned : 6; 5420 }; 5421 5422 struct 5423 { 5424 unsigned : 2; 5425 unsigned PSS1AC : 2; 5426 unsigned : 4; 5427 }; 5428 5429 struct 5430 { 5431 unsigned : 2; 5432 unsigned PSSAC : 2; 5433 unsigned : 4; 5434 }; 5435 5436 struct 5437 { 5438 unsigned : 2; 5439 unsigned P1SSAC : 2; 5440 unsigned : 4; 5441 }; 5442 5443 struct 5444 { 5445 unsigned : 4; 5446 unsigned ECCPAS : 3; 5447 unsigned : 1; 5448 }; 5449 5450 struct 5451 { 5452 unsigned : 4; 5453 unsigned CCP1AS : 3; 5454 unsigned : 1; 5455 }; 5456 } __ECCP1ASbits_t; 5457 5458 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits; 5459 5460 #define _P1SSBD0 0x01 5461 #define _PSS1BD0 0x01 5462 #define _PSSBD0 0x01 5463 #define _P1SSBD1 0x02 5464 #define _PSS1BD1 0x02 5465 #define _PSSBD1 0x02 5466 #define _P1SSAC0 0x04 5467 #define _PSS1AC0 0x04 5468 #define _PSSAC0 0x04 5469 #define _P1SSAC1 0x08 5470 #define _PSS1AC1 0x08 5471 #define _PSSAC1 0x08 5472 #define _CCP1AS0 0x10 5473 #define _ECCPAS0 0x10 5474 #define _CCP1AS1 0x20 5475 #define _ECCPAS1 0x20 5476 #define _CCP1AS2 0x40 5477 #define _ECCPAS2 0x40 5478 #define _CCP1ASE 0x80 5479 #define _ECCPASE 0x80 5480 5481 //============================================================================== 5482 5483 5484 //============================================================================== 5485 // ECCPAS Bits 5486 5487 extern __at(0x0FB6) __sfr ECCPAS; 5488 5489 typedef union 5490 { 5491 struct 5492 { 5493 unsigned P1SSBD0 : 1; 5494 unsigned P1SSBD1 : 1; 5495 unsigned P1SSAC0 : 1; 5496 unsigned P1SSAC1 : 1; 5497 unsigned CCP1AS0 : 1; 5498 unsigned CCP1AS1 : 1; 5499 unsigned CCP1AS2 : 1; 5500 unsigned CCP1ASE : 1; 5501 }; 5502 5503 struct 5504 { 5505 unsigned PSS1BD0 : 1; 5506 unsigned PSS1BD1 : 1; 5507 unsigned PSS1AC0 : 1; 5508 unsigned PSS1AC1 : 1; 5509 unsigned ECCPAS0 : 1; 5510 unsigned ECCPAS1 : 1; 5511 unsigned ECCPAS2 : 1; 5512 unsigned ECCPASE : 1; 5513 }; 5514 5515 struct 5516 { 5517 unsigned PSSBD0 : 1; 5518 unsigned PSSBD1 : 1; 5519 unsigned PSSAC0 : 1; 5520 unsigned PSSAC1 : 1; 5521 unsigned : 1; 5522 unsigned : 1; 5523 unsigned : 1; 5524 unsigned : 1; 5525 }; 5526 5527 struct 5528 { 5529 unsigned P1SSBD : 2; 5530 unsigned : 6; 5531 }; 5532 5533 struct 5534 { 5535 unsigned PSSBD : 2; 5536 unsigned : 6; 5537 }; 5538 5539 struct 5540 { 5541 unsigned PSS1BD : 2; 5542 unsigned : 6; 5543 }; 5544 5545 struct 5546 { 5547 unsigned : 2; 5548 unsigned PSS1AC : 2; 5549 unsigned : 4; 5550 }; 5551 5552 struct 5553 { 5554 unsigned : 2; 5555 unsigned PSSAC : 2; 5556 unsigned : 4; 5557 }; 5558 5559 struct 5560 { 5561 unsigned : 2; 5562 unsigned P1SSAC : 2; 5563 unsigned : 4; 5564 }; 5565 5566 struct 5567 { 5568 unsigned : 4; 5569 unsigned ECCPAS : 3; 5570 unsigned : 1; 5571 }; 5572 5573 struct 5574 { 5575 unsigned : 4; 5576 unsigned CCP1AS : 3; 5577 unsigned : 1; 5578 }; 5579 } __ECCPASbits_t; 5580 5581 extern __at(0x0FB6) volatile __ECCPASbits_t ECCPASbits; 5582 5583 #define _ECCPAS_P1SSBD0 0x01 5584 #define _ECCPAS_PSS1BD0 0x01 5585 #define _ECCPAS_PSSBD0 0x01 5586 #define _ECCPAS_P1SSBD1 0x02 5587 #define _ECCPAS_PSS1BD1 0x02 5588 #define _ECCPAS_PSSBD1 0x02 5589 #define _ECCPAS_P1SSAC0 0x04 5590 #define _ECCPAS_PSS1AC0 0x04 5591 #define _ECCPAS_PSSAC0 0x04 5592 #define _ECCPAS_P1SSAC1 0x08 5593 #define _ECCPAS_PSS1AC1 0x08 5594 #define _ECCPAS_PSSAC1 0x08 5595 #define _ECCPAS_CCP1AS0 0x10 5596 #define _ECCPAS_ECCPAS0 0x10 5597 #define _ECCPAS_CCP1AS1 0x20 5598 #define _ECCPAS_ECCPAS1 0x20 5599 #define _ECCPAS_CCP1AS2 0x40 5600 #define _ECCPAS_ECCPAS2 0x40 5601 #define _ECCPAS_CCP1ASE 0x80 5602 #define _ECCPAS_ECCPASE 0x80 5603 5604 //============================================================================== 5605 5606 5607 //============================================================================== 5608 // PWM1CON Bits 5609 5610 extern __at(0x0FB7) __sfr PWM1CON; 5611 5612 typedef union 5613 { 5614 struct 5615 { 5616 unsigned P1DC0 : 1; 5617 unsigned P1DC1 : 1; 5618 unsigned P1DC2 : 1; 5619 unsigned P1DC3 : 1; 5620 unsigned P1DC4 : 1; 5621 unsigned P1DC5 : 1; 5622 unsigned P1DC6 : 1; 5623 unsigned P1RSEN : 1; 5624 }; 5625 5626 struct 5627 { 5628 unsigned PDC0 : 1; 5629 unsigned PDC1 : 1; 5630 unsigned PDC2 : 1; 5631 unsigned PDC3 : 1; 5632 unsigned PDC4 : 1; 5633 unsigned PDC5 : 1; 5634 unsigned PDC6 : 1; 5635 unsigned PRSEN : 1; 5636 }; 5637 5638 struct 5639 { 5640 unsigned P1DC : 7; 5641 unsigned : 1; 5642 }; 5643 5644 struct 5645 { 5646 unsigned PDC : 7; 5647 unsigned : 1; 5648 }; 5649 } __PWM1CONbits_t; 5650 5651 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits; 5652 5653 #define _P1DC0 0x01 5654 #define _PDC0 0x01 5655 #define _P1DC1 0x02 5656 #define _PDC1 0x02 5657 #define _P1DC2 0x04 5658 #define _PDC2 0x04 5659 #define _P1DC3 0x08 5660 #define _PDC3 0x08 5661 #define _P1DC4 0x10 5662 #define _PDC4 0x10 5663 #define _P1DC5 0x20 5664 #define _PDC5 0x20 5665 #define _P1DC6 0x40 5666 #define _PDC6 0x40 5667 #define _P1RSEN 0x80 5668 #define _PRSEN 0x80 5669 5670 //============================================================================== 5671 5672 5673 //============================================================================== 5674 // PWMCON Bits 5675 5676 extern __at(0x0FB7) __sfr PWMCON; 5677 5678 typedef union 5679 { 5680 struct 5681 { 5682 unsigned P1DC0 : 1; 5683 unsigned P1DC1 : 1; 5684 unsigned P1DC2 : 1; 5685 unsigned P1DC3 : 1; 5686 unsigned P1DC4 : 1; 5687 unsigned P1DC5 : 1; 5688 unsigned P1DC6 : 1; 5689 unsigned P1RSEN : 1; 5690 }; 5691 5692 struct 5693 { 5694 unsigned PDC0 : 1; 5695 unsigned PDC1 : 1; 5696 unsigned PDC2 : 1; 5697 unsigned PDC3 : 1; 5698 unsigned PDC4 : 1; 5699 unsigned PDC5 : 1; 5700 unsigned PDC6 : 1; 5701 unsigned PRSEN : 1; 5702 }; 5703 5704 struct 5705 { 5706 unsigned P1DC : 7; 5707 unsigned : 1; 5708 }; 5709 5710 struct 5711 { 5712 unsigned PDC : 7; 5713 unsigned : 1; 5714 }; 5715 } __PWMCONbits_t; 5716 5717 extern __at(0x0FB7) volatile __PWMCONbits_t PWMCONbits; 5718 5719 #define _PWMCON_P1DC0 0x01 5720 #define _PWMCON_PDC0 0x01 5721 #define _PWMCON_P1DC1 0x02 5722 #define _PWMCON_PDC1 0x02 5723 #define _PWMCON_P1DC2 0x04 5724 #define _PWMCON_PDC2 0x04 5725 #define _PWMCON_P1DC3 0x08 5726 #define _PWMCON_PDC3 0x08 5727 #define _PWMCON_P1DC4 0x10 5728 #define _PWMCON_PDC4 0x10 5729 #define _PWMCON_P1DC5 0x20 5730 #define _PWMCON_PDC5 0x20 5731 #define _PWMCON_P1DC6 0x40 5732 #define _PWMCON_PDC6 0x40 5733 #define _PWMCON_P1RSEN 0x80 5734 #define _PWMCON_PRSEN 0x80 5735 5736 //============================================================================== 5737 5738 5739 //============================================================================== 5740 // BAUD1CON Bits 5741 5742 extern __at(0x0FB8) __sfr BAUD1CON; 5743 5744 typedef union 5745 { 5746 struct 5747 { 5748 unsigned ABDEN : 1; 5749 unsigned WUE : 1; 5750 unsigned : 1; 5751 unsigned BRG16 : 1; 5752 unsigned CKTXP : 1; 5753 unsigned DTRXP : 1; 5754 unsigned RCIDL : 1; 5755 unsigned ABDOVF : 1; 5756 }; 5757 5758 struct 5759 { 5760 unsigned : 1; 5761 unsigned : 1; 5762 unsigned : 1; 5763 unsigned : 1; 5764 unsigned SCKP : 1; 5765 unsigned : 1; 5766 unsigned : 1; 5767 unsigned : 1; 5768 }; 5769 } __BAUD1CONbits_t; 5770 5771 extern __at(0x0FB8) volatile __BAUD1CONbits_t BAUD1CONbits; 5772 5773 #define _ABDEN 0x01 5774 #define _WUE 0x02 5775 #define _BRG16 0x08 5776 #define _CKTXP 0x10 5777 #define _SCKP 0x10 5778 #define _DTRXP 0x20 5779 #define _RCIDL 0x40 5780 #define _ABDOVF 0x80 5781 5782 //============================================================================== 5783 5784 5785 //============================================================================== 5786 // BAUDCON Bits 5787 5788 extern __at(0x0FB8) __sfr BAUDCON; 5789 5790 typedef union 5791 { 5792 struct 5793 { 5794 unsigned ABDEN : 1; 5795 unsigned WUE : 1; 5796 unsigned : 1; 5797 unsigned BRG16 : 1; 5798 unsigned CKTXP : 1; 5799 unsigned DTRXP : 1; 5800 unsigned RCIDL : 1; 5801 unsigned ABDOVF : 1; 5802 }; 5803 5804 struct 5805 { 5806 unsigned : 1; 5807 unsigned : 1; 5808 unsigned : 1; 5809 unsigned : 1; 5810 unsigned SCKP : 1; 5811 unsigned : 1; 5812 unsigned : 1; 5813 unsigned : 1; 5814 }; 5815 } __BAUDCONbits_t; 5816 5817 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits; 5818 5819 #define _BAUDCON_ABDEN 0x01 5820 #define _BAUDCON_WUE 0x02 5821 #define _BAUDCON_BRG16 0x08 5822 #define _BAUDCON_CKTXP 0x10 5823 #define _BAUDCON_SCKP 0x10 5824 #define _BAUDCON_DTRXP 0x20 5825 #define _BAUDCON_RCIDL 0x40 5826 #define _BAUDCON_ABDOVF 0x80 5827 5828 //============================================================================== 5829 5830 5831 //============================================================================== 5832 // BAUDCON1 Bits 5833 5834 extern __at(0x0FB8) __sfr BAUDCON1; 5835 5836 typedef union 5837 { 5838 struct 5839 { 5840 unsigned ABDEN : 1; 5841 unsigned WUE : 1; 5842 unsigned : 1; 5843 unsigned BRG16 : 1; 5844 unsigned CKTXP : 1; 5845 unsigned DTRXP : 1; 5846 unsigned RCIDL : 1; 5847 unsigned ABDOVF : 1; 5848 }; 5849 5850 struct 5851 { 5852 unsigned : 1; 5853 unsigned : 1; 5854 unsigned : 1; 5855 unsigned : 1; 5856 unsigned SCKP : 1; 5857 unsigned : 1; 5858 unsigned : 1; 5859 unsigned : 1; 5860 }; 5861 } __BAUDCON1bits_t; 5862 5863 extern __at(0x0FB8) volatile __BAUDCON1bits_t BAUDCON1bits; 5864 5865 #define _BAUDCON1_ABDEN 0x01 5866 #define _BAUDCON1_WUE 0x02 5867 #define _BAUDCON1_BRG16 0x08 5868 #define _BAUDCON1_CKTXP 0x10 5869 #define _BAUDCON1_SCKP 0x10 5870 #define _BAUDCON1_DTRXP 0x20 5871 #define _BAUDCON1_RCIDL 0x40 5872 #define _BAUDCON1_ABDOVF 0x80 5873 5874 //============================================================================== 5875 5876 5877 //============================================================================== 5878 // BAUDCTL Bits 5879 5880 extern __at(0x0FB8) __sfr BAUDCTL; 5881 5882 typedef union 5883 { 5884 struct 5885 { 5886 unsigned ABDEN : 1; 5887 unsigned WUE : 1; 5888 unsigned : 1; 5889 unsigned BRG16 : 1; 5890 unsigned CKTXP : 1; 5891 unsigned DTRXP : 1; 5892 unsigned RCIDL : 1; 5893 unsigned ABDOVF : 1; 5894 }; 5895 5896 struct 5897 { 5898 unsigned : 1; 5899 unsigned : 1; 5900 unsigned : 1; 5901 unsigned : 1; 5902 unsigned SCKP : 1; 5903 unsigned : 1; 5904 unsigned : 1; 5905 unsigned : 1; 5906 }; 5907 } __BAUDCTLbits_t; 5908 5909 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits; 5910 5911 #define _BAUDCTL_ABDEN 0x01 5912 #define _BAUDCTL_WUE 0x02 5913 #define _BAUDCTL_BRG16 0x08 5914 #define _BAUDCTL_CKTXP 0x10 5915 #define _BAUDCTL_SCKP 0x10 5916 #define _BAUDCTL_DTRXP 0x20 5917 #define _BAUDCTL_RCIDL 0x40 5918 #define _BAUDCTL_ABDOVF 0x80 5919 5920 //============================================================================== 5921 5922 5923 //============================================================================== 5924 // PSTR1CON Bits 5925 5926 extern __at(0x0FB9) __sfr PSTR1CON; 5927 5928 typedef struct 5929 { 5930 unsigned STR1A : 1; 5931 unsigned STR1B : 1; 5932 unsigned STR1C : 1; 5933 unsigned STR1D : 1; 5934 unsigned STR1SYNC : 1; 5935 unsigned : 1; 5936 unsigned : 1; 5937 unsigned : 1; 5938 } __PSTR1CONbits_t; 5939 5940 extern __at(0x0FB9) volatile __PSTR1CONbits_t PSTR1CONbits; 5941 5942 #define _STR1A 0x01 5943 #define _STR1B 0x02 5944 #define _STR1C 0x04 5945 #define _STR1D 0x08 5946 #define _STR1SYNC 0x10 5947 5948 //============================================================================== 5949 5950 5951 //============================================================================== 5952 // PSTRCON Bits 5953 5954 extern __at(0x0FB9) __sfr PSTRCON; 5955 5956 typedef struct 5957 { 5958 unsigned STR1A : 1; 5959 unsigned STR1B : 1; 5960 unsigned STR1C : 1; 5961 unsigned STR1D : 1; 5962 unsigned STR1SYNC : 1; 5963 unsigned : 1; 5964 unsigned : 1; 5965 unsigned : 1; 5966 } __PSTRCONbits_t; 5967 5968 extern __at(0x0FB9) volatile __PSTRCONbits_t PSTRCONbits; 5969 5970 #define _PSTRCON_STR1A 0x01 5971 #define _PSTRCON_STR1B 0x02 5972 #define _PSTRCON_STR1C 0x04 5973 #define _PSTRCON_STR1D 0x08 5974 #define _PSTRCON_STR1SYNC 0x10 5975 5976 //============================================================================== 5977 5978 5979 //============================================================================== 5980 // T2CON Bits 5981 5982 extern __at(0x0FBA) __sfr T2CON; 5983 5984 typedef union 5985 { 5986 struct 5987 { 5988 unsigned T2CKPS0 : 1; 5989 unsigned T2CKPS1 : 1; 5990 unsigned TMR2ON : 1; 5991 unsigned T2OUTPS0 : 1; 5992 unsigned T2OUTPS1 : 1; 5993 unsigned T2OUTPS2 : 1; 5994 unsigned T2OUTPS3 : 1; 5995 unsigned : 1; 5996 }; 5997 5998 struct 5999 { 6000 unsigned T2CKPS : 2; 6001 unsigned : 6; 6002 }; 6003 6004 struct 6005 { 6006 unsigned : 3; 6007 unsigned T2OUTPS : 4; 6008 unsigned : 1; 6009 }; 6010 } __T2CONbits_t; 6011 6012 extern __at(0x0FBA) volatile __T2CONbits_t T2CONbits; 6013 6014 #define _T2CKPS0 0x01 6015 #define _T2CKPS1 0x02 6016 #define _TMR2ON 0x04 6017 #define _T2OUTPS0 0x08 6018 #define _T2OUTPS1 0x10 6019 #define _T2OUTPS2 0x20 6020 #define _T2OUTPS3 0x40 6021 6022 //============================================================================== 6023 6024 extern __at(0x0FBB) __sfr PR2; 6025 extern __at(0x0FBC) __sfr TMR2; 6026 6027 //============================================================================== 6028 // CCP1CON Bits 6029 6030 extern __at(0x0FBD) __sfr CCP1CON; 6031 6032 typedef union 6033 { 6034 struct 6035 { 6036 unsigned CCP1M0 : 1; 6037 unsigned CCP1M1 : 1; 6038 unsigned CCP1M2 : 1; 6039 unsigned CCP1M3 : 1; 6040 unsigned DC1B0 : 1; 6041 unsigned DC1B1 : 1; 6042 unsigned P1M0 : 1; 6043 unsigned P1M1 : 1; 6044 }; 6045 6046 struct 6047 { 6048 unsigned CCP1M : 4; 6049 unsigned : 4; 6050 }; 6051 6052 struct 6053 { 6054 unsigned : 4; 6055 unsigned DC1B : 2; 6056 unsigned : 2; 6057 }; 6058 6059 struct 6060 { 6061 unsigned : 6; 6062 unsigned P1M : 2; 6063 }; 6064 } __CCP1CONbits_t; 6065 6066 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits; 6067 6068 #define _CCP1M0 0x01 6069 #define _CCP1M1 0x02 6070 #define _CCP1M2 0x04 6071 #define _CCP1M3 0x08 6072 #define _DC1B0 0x10 6073 #define _DC1B1 0x20 6074 #define _P1M0 0x40 6075 #define _P1M1 0x80 6076 6077 //============================================================================== 6078 6079 extern __at(0x0FBE) __sfr CCPR1; 6080 extern __at(0x0FBE) __sfr CCPR1L; 6081 extern __at(0x0FBF) __sfr CCPR1H; 6082 6083 //============================================================================== 6084 // ADCON2 Bits 6085 6086 extern __at(0x0FC0) __sfr ADCON2; 6087 6088 typedef union 6089 { 6090 struct 6091 { 6092 unsigned ADCS0 : 1; 6093 unsigned ADCS1 : 1; 6094 unsigned ADCS2 : 1; 6095 unsigned ACQT0 : 1; 6096 unsigned ACQT1 : 1; 6097 unsigned ACQT2 : 1; 6098 unsigned : 1; 6099 unsigned ADFM : 1; 6100 }; 6101 6102 struct 6103 { 6104 unsigned ADCS : 3; 6105 unsigned : 5; 6106 }; 6107 6108 struct 6109 { 6110 unsigned : 3; 6111 unsigned ACQT : 3; 6112 unsigned : 2; 6113 }; 6114 } __ADCON2bits_t; 6115 6116 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits; 6117 6118 #define _ADCS0 0x01 6119 #define _ADCS1 0x02 6120 #define _ADCS2 0x04 6121 #define _ACQT0 0x08 6122 #define _ACQT1 0x10 6123 #define _ACQT2 0x20 6124 #define _ADFM 0x80 6125 6126 //============================================================================== 6127 6128 6129 //============================================================================== 6130 // ADCON1 Bits 6131 6132 extern __at(0x0FC1) __sfr ADCON1; 6133 6134 typedef union 6135 { 6136 struct 6137 { 6138 unsigned NVCFG0 : 1; 6139 unsigned NVCFG1 : 1; 6140 unsigned PVCFG0 : 1; 6141 unsigned PVCFG1 : 1; 6142 unsigned : 1; 6143 unsigned : 1; 6144 unsigned : 1; 6145 unsigned TRIGSEL : 1; 6146 }; 6147 6148 struct 6149 { 6150 unsigned NVCFG : 2; 6151 unsigned : 6; 6152 }; 6153 6154 struct 6155 { 6156 unsigned : 2; 6157 unsigned PVCFG : 2; 6158 unsigned : 4; 6159 }; 6160 } __ADCON1bits_t; 6161 6162 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits; 6163 6164 #define _NVCFG0 0x01 6165 #define _NVCFG1 0x02 6166 #define _PVCFG0 0x04 6167 #define _PVCFG1 0x08 6168 #define _TRIGSEL 0x80 6169 6170 //============================================================================== 6171 6172 6173 //============================================================================== 6174 // ADCON0 Bits 6175 6176 extern __at(0x0FC2) __sfr ADCON0; 6177 6178 typedef union 6179 { 6180 struct 6181 { 6182 unsigned ADON : 1; 6183 unsigned GO_NOT_DONE : 1; 6184 unsigned CHS0 : 1; 6185 unsigned CHS1 : 1; 6186 unsigned CHS2 : 1; 6187 unsigned CHS3 : 1; 6188 unsigned CHS4 : 1; 6189 unsigned : 1; 6190 }; 6191 6192 struct 6193 { 6194 unsigned : 1; 6195 unsigned GO : 1; 6196 unsigned : 1; 6197 unsigned : 1; 6198 unsigned : 1; 6199 unsigned : 1; 6200 unsigned : 1; 6201 unsigned : 1; 6202 }; 6203 6204 struct 6205 { 6206 unsigned : 1; 6207 unsigned DONE : 1; 6208 unsigned : 1; 6209 unsigned : 1; 6210 unsigned : 1; 6211 unsigned : 1; 6212 unsigned : 1; 6213 unsigned : 1; 6214 }; 6215 6216 struct 6217 { 6218 unsigned : 1; 6219 unsigned NOT_DONE : 1; 6220 unsigned : 1; 6221 unsigned : 1; 6222 unsigned : 1; 6223 unsigned : 1; 6224 unsigned : 1; 6225 unsigned : 1; 6226 }; 6227 6228 struct 6229 { 6230 unsigned : 1; 6231 unsigned GO_DONE : 1; 6232 unsigned : 1; 6233 unsigned : 1; 6234 unsigned : 1; 6235 unsigned : 1; 6236 unsigned : 1; 6237 unsigned : 1; 6238 }; 6239 6240 struct 6241 { 6242 unsigned : 2; 6243 unsigned CHS : 5; 6244 unsigned : 1; 6245 }; 6246 } __ADCON0bits_t; 6247 6248 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits; 6249 6250 #define _ADON 0x01 6251 #define _GO_NOT_DONE 0x02 6252 #define _GO 0x02 6253 #define _DONE 0x02 6254 #define _NOT_DONE 0x02 6255 #define _GO_DONE 0x02 6256 #define _CHS0 0x04 6257 #define _CHS1 0x08 6258 #define _CHS2 0x10 6259 #define _CHS3 0x20 6260 #define _CHS4 0x40 6261 6262 //============================================================================== 6263 6264 extern __at(0x0FC3) __sfr ADRES; 6265 extern __at(0x0FC3) __sfr ADRESL; 6266 extern __at(0x0FC4) __sfr ADRESH; 6267 6268 //============================================================================== 6269 // SSP1CON2 Bits 6270 6271 extern __at(0x0FC5) __sfr SSP1CON2; 6272 6273 typedef struct 6274 { 6275 unsigned SEN : 1; 6276 unsigned RSEN : 1; 6277 unsigned PEN : 1; 6278 unsigned RCEN : 1; 6279 unsigned ACKEN : 1; 6280 unsigned ACKDT : 1; 6281 unsigned ACKSTAT : 1; 6282 unsigned GCEN : 1; 6283 } __SSP1CON2bits_t; 6284 6285 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits; 6286 6287 #define _SEN 0x01 6288 #define _RSEN 0x02 6289 #define _PEN 0x04 6290 #define _RCEN 0x08 6291 #define _ACKEN 0x10 6292 #define _ACKDT 0x20 6293 #define _ACKSTAT 0x40 6294 #define _GCEN 0x80 6295 6296 //============================================================================== 6297 6298 6299 //============================================================================== 6300 // SSPCON2 Bits 6301 6302 extern __at(0x0FC5) __sfr SSPCON2; 6303 6304 typedef struct 6305 { 6306 unsigned SEN : 1; 6307 unsigned RSEN : 1; 6308 unsigned PEN : 1; 6309 unsigned RCEN : 1; 6310 unsigned ACKEN : 1; 6311 unsigned ACKDT : 1; 6312 unsigned ACKSTAT : 1; 6313 unsigned GCEN : 1; 6314 } __SSPCON2bits_t; 6315 6316 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits; 6317 6318 #define _SSPCON2_SEN 0x01 6319 #define _SSPCON2_RSEN 0x02 6320 #define _SSPCON2_PEN 0x04 6321 #define _SSPCON2_RCEN 0x08 6322 #define _SSPCON2_ACKEN 0x10 6323 #define _SSPCON2_ACKDT 0x20 6324 #define _SSPCON2_ACKSTAT 0x40 6325 #define _SSPCON2_GCEN 0x80 6326 6327 //============================================================================== 6328 6329 6330 //============================================================================== 6331 // SSP1CON1 Bits 6332 6333 extern __at(0x0FC6) __sfr SSP1CON1; 6334 6335 typedef union 6336 { 6337 struct 6338 { 6339 unsigned SSPM0 : 1; 6340 unsigned SSPM1 : 1; 6341 unsigned SSPM2 : 1; 6342 unsigned SSPM3 : 1; 6343 unsigned CKP : 1; 6344 unsigned SSPEN : 1; 6345 unsigned SSPOV : 1; 6346 unsigned WCOL : 1; 6347 }; 6348 6349 struct 6350 { 6351 unsigned SSPM : 4; 6352 unsigned : 4; 6353 }; 6354 } __SSP1CON1bits_t; 6355 6356 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits; 6357 6358 #define _SSPM0 0x01 6359 #define _SSPM1 0x02 6360 #define _SSPM2 0x04 6361 #define _SSPM3 0x08 6362 #define _CKP 0x10 6363 #define _SSPEN 0x20 6364 #define _SSPOV 0x40 6365 #define _WCOL 0x80 6366 6367 //============================================================================== 6368 6369 6370 //============================================================================== 6371 // SSPCON1 Bits 6372 6373 extern __at(0x0FC6) __sfr SSPCON1; 6374 6375 typedef union 6376 { 6377 struct 6378 { 6379 unsigned SSPM0 : 1; 6380 unsigned SSPM1 : 1; 6381 unsigned SSPM2 : 1; 6382 unsigned SSPM3 : 1; 6383 unsigned CKP : 1; 6384 unsigned SSPEN : 1; 6385 unsigned SSPOV : 1; 6386 unsigned WCOL : 1; 6387 }; 6388 6389 struct 6390 { 6391 unsigned SSPM : 4; 6392 unsigned : 4; 6393 }; 6394 } __SSPCON1bits_t; 6395 6396 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits; 6397 6398 #define _SSPCON1_SSPM0 0x01 6399 #define _SSPCON1_SSPM1 0x02 6400 #define _SSPCON1_SSPM2 0x04 6401 #define _SSPCON1_SSPM3 0x08 6402 #define _SSPCON1_CKP 0x10 6403 #define _SSPCON1_SSPEN 0x20 6404 #define _SSPCON1_SSPOV 0x40 6405 #define _SSPCON1_WCOL 0x80 6406 6407 //============================================================================== 6408 6409 6410 //============================================================================== 6411 // SSP1STAT Bits 6412 6413 extern __at(0x0FC7) __sfr SSP1STAT; 6414 6415 typedef union 6416 { 6417 struct 6418 { 6419 unsigned BF : 1; 6420 unsigned UA : 1; 6421 unsigned R_NOT_W : 1; 6422 unsigned S : 1; 6423 unsigned P : 1; 6424 unsigned D_NOT_A : 1; 6425 unsigned CKE : 1; 6426 unsigned SMP : 1; 6427 }; 6428 6429 struct 6430 { 6431 unsigned : 1; 6432 unsigned : 1; 6433 unsigned R : 1; 6434 unsigned : 1; 6435 unsigned : 1; 6436 unsigned D : 1; 6437 unsigned : 1; 6438 unsigned : 1; 6439 }; 6440 6441 struct 6442 { 6443 unsigned : 1; 6444 unsigned : 1; 6445 unsigned NOT_W : 1; 6446 unsigned : 1; 6447 unsigned : 1; 6448 unsigned NOT_A : 1; 6449 unsigned : 1; 6450 unsigned : 1; 6451 }; 6452 6453 struct 6454 { 6455 unsigned : 1; 6456 unsigned : 1; 6457 unsigned R_W : 1; 6458 unsigned : 1; 6459 unsigned : 1; 6460 unsigned D_A : 1; 6461 unsigned : 1; 6462 unsigned : 1; 6463 }; 6464 6465 struct 6466 { 6467 unsigned : 1; 6468 unsigned : 1; 6469 unsigned NOT_WRITE : 1; 6470 unsigned : 1; 6471 unsigned : 1; 6472 unsigned NOT_ADDRESS : 1; 6473 unsigned : 1; 6474 unsigned : 1; 6475 }; 6476 } __SSP1STATbits_t; 6477 6478 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits; 6479 6480 #define _BF 0x01 6481 #define _UA 0x02 6482 #define _R_NOT_W 0x04 6483 #define _R 0x04 6484 #define _NOT_W 0x04 6485 #define _R_W 0x04 6486 #define _NOT_WRITE 0x04 6487 #define _S 0x08 6488 #define _P 0x10 6489 #define _D_NOT_A 0x20 6490 #define _D 0x20 6491 #define _NOT_A 0x20 6492 #define _D_A 0x20 6493 #define _NOT_ADDRESS 0x20 6494 #define _CKE 0x40 6495 #define _SMP 0x80 6496 6497 //============================================================================== 6498 6499 6500 //============================================================================== 6501 // SSPSTAT Bits 6502 6503 extern __at(0x0FC7) __sfr SSPSTAT; 6504 6505 typedef union 6506 { 6507 struct 6508 { 6509 unsigned BF : 1; 6510 unsigned UA : 1; 6511 unsigned R_NOT_W : 1; 6512 unsigned S : 1; 6513 unsigned P : 1; 6514 unsigned D_NOT_A : 1; 6515 unsigned CKE : 1; 6516 unsigned SMP : 1; 6517 }; 6518 6519 struct 6520 { 6521 unsigned : 1; 6522 unsigned : 1; 6523 unsigned R : 1; 6524 unsigned : 1; 6525 unsigned : 1; 6526 unsigned D : 1; 6527 unsigned : 1; 6528 unsigned : 1; 6529 }; 6530 6531 struct 6532 { 6533 unsigned : 1; 6534 unsigned : 1; 6535 unsigned NOT_W : 1; 6536 unsigned : 1; 6537 unsigned : 1; 6538 unsigned NOT_A : 1; 6539 unsigned : 1; 6540 unsigned : 1; 6541 }; 6542 6543 struct 6544 { 6545 unsigned : 1; 6546 unsigned : 1; 6547 unsigned R_W : 1; 6548 unsigned : 1; 6549 unsigned : 1; 6550 unsigned D_A : 1; 6551 unsigned : 1; 6552 unsigned : 1; 6553 }; 6554 6555 struct 6556 { 6557 unsigned : 1; 6558 unsigned : 1; 6559 unsigned NOT_WRITE : 1; 6560 unsigned : 1; 6561 unsigned : 1; 6562 unsigned NOT_ADDRESS : 1; 6563 unsigned : 1; 6564 unsigned : 1; 6565 }; 6566 } __SSPSTATbits_t; 6567 6568 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits; 6569 6570 #define _SSPSTAT_BF 0x01 6571 #define _SSPSTAT_UA 0x02 6572 #define _SSPSTAT_R_NOT_W 0x04 6573 #define _SSPSTAT_R 0x04 6574 #define _SSPSTAT_NOT_W 0x04 6575 #define _SSPSTAT_R_W 0x04 6576 #define _SSPSTAT_NOT_WRITE 0x04 6577 #define _SSPSTAT_S 0x08 6578 #define _SSPSTAT_P 0x10 6579 #define _SSPSTAT_D_NOT_A 0x20 6580 #define _SSPSTAT_D 0x20 6581 #define _SSPSTAT_NOT_A 0x20 6582 #define _SSPSTAT_D_A 0x20 6583 #define _SSPSTAT_NOT_ADDRESS 0x20 6584 #define _SSPSTAT_CKE 0x40 6585 #define _SSPSTAT_SMP 0x80 6586 6587 //============================================================================== 6588 6589 extern __at(0x0FC8) __sfr SSP1ADD; 6590 extern __at(0x0FC8) __sfr SSPADD; 6591 extern __at(0x0FC9) __sfr SSP1BUF; 6592 extern __at(0x0FC9) __sfr SSPBUF; 6593 6594 //============================================================================== 6595 // SSP1MSK Bits 6596 6597 extern __at(0x0FCA) __sfr SSP1MSK; 6598 6599 typedef struct 6600 { 6601 unsigned MSK0 : 1; 6602 unsigned MSK1 : 1; 6603 unsigned MSK2 : 1; 6604 unsigned MSK3 : 1; 6605 unsigned MSK4 : 1; 6606 unsigned MSK5 : 1; 6607 unsigned MSK6 : 1; 6608 unsigned MSK7 : 1; 6609 } __SSP1MSKbits_t; 6610 6611 extern __at(0x0FCA) volatile __SSP1MSKbits_t SSP1MSKbits; 6612 6613 #define _MSK0 0x01 6614 #define _MSK1 0x02 6615 #define _MSK2 0x04 6616 #define _MSK3 0x08 6617 #define _MSK4 0x10 6618 #define _MSK5 0x20 6619 #define _MSK6 0x40 6620 #define _MSK7 0x80 6621 6622 //============================================================================== 6623 6624 6625 //============================================================================== 6626 // SSPMSK Bits 6627 6628 extern __at(0x0FCA) __sfr SSPMSK; 6629 6630 typedef struct 6631 { 6632 unsigned MSK0 : 1; 6633 unsigned MSK1 : 1; 6634 unsigned MSK2 : 1; 6635 unsigned MSK3 : 1; 6636 unsigned MSK4 : 1; 6637 unsigned MSK5 : 1; 6638 unsigned MSK6 : 1; 6639 unsigned MSK7 : 1; 6640 } __SSPMSKbits_t; 6641 6642 extern __at(0x0FCA) volatile __SSPMSKbits_t SSPMSKbits; 6643 6644 #define _SSPMSK_MSK0 0x01 6645 #define _SSPMSK_MSK1 0x02 6646 #define _SSPMSK_MSK2 0x04 6647 #define _SSPMSK_MSK3 0x08 6648 #define _SSPMSK_MSK4 0x10 6649 #define _SSPMSK_MSK5 0x20 6650 #define _SSPMSK_MSK6 0x40 6651 #define _SSPMSK_MSK7 0x80 6652 6653 //============================================================================== 6654 6655 6656 //============================================================================== 6657 // SSP1CON3 Bits 6658 6659 extern __at(0x0FCB) __sfr SSP1CON3; 6660 6661 typedef struct 6662 { 6663 unsigned DHEN : 1; 6664 unsigned AHEN : 1; 6665 unsigned SBCDE : 1; 6666 unsigned SDAHT : 1; 6667 unsigned BOEN : 1; 6668 unsigned SCIE : 1; 6669 unsigned PCIE : 1; 6670 unsigned ACKTIM : 1; 6671 } __SSP1CON3bits_t; 6672 6673 extern __at(0x0FCB) volatile __SSP1CON3bits_t SSP1CON3bits; 6674 6675 #define _DHEN 0x01 6676 #define _AHEN 0x02 6677 #define _SBCDE 0x04 6678 #define _SDAHT 0x08 6679 #define _BOEN 0x10 6680 #define _SCIE 0x20 6681 #define _PCIE 0x40 6682 #define _ACKTIM 0x80 6683 6684 //============================================================================== 6685 6686 6687 //============================================================================== 6688 // SSPCON3 Bits 6689 6690 extern __at(0x0FCB) __sfr SSPCON3; 6691 6692 typedef struct 6693 { 6694 unsigned DHEN : 1; 6695 unsigned AHEN : 1; 6696 unsigned SBCDE : 1; 6697 unsigned SDAHT : 1; 6698 unsigned BOEN : 1; 6699 unsigned SCIE : 1; 6700 unsigned PCIE : 1; 6701 unsigned ACKTIM : 1; 6702 } __SSPCON3bits_t; 6703 6704 extern __at(0x0FCB) volatile __SSPCON3bits_t SSPCON3bits; 6705 6706 #define _SSPCON3_DHEN 0x01 6707 #define _SSPCON3_AHEN 0x02 6708 #define _SSPCON3_SBCDE 0x04 6709 #define _SSPCON3_SDAHT 0x08 6710 #define _SSPCON3_BOEN 0x10 6711 #define _SSPCON3_SCIE 0x20 6712 #define _SSPCON3_PCIE 0x40 6713 #define _SSPCON3_ACKTIM 0x80 6714 6715 //============================================================================== 6716 6717 6718 //============================================================================== 6719 // T1GCON Bits 6720 6721 extern __at(0x0FCC) __sfr T1GCON; 6722 6723 typedef union 6724 { 6725 struct 6726 { 6727 unsigned T1GSS0 : 1; 6728 unsigned T1GSS1 : 1; 6729 unsigned T1GVAL : 1; 6730 unsigned T1GGO_NOT_DONE : 1; 6731 unsigned T1GSPM : 1; 6732 unsigned T1GTM : 1; 6733 unsigned T1GPOL : 1; 6734 unsigned TMR1GE : 1; 6735 }; 6736 6737 struct 6738 { 6739 unsigned : 1; 6740 unsigned : 1; 6741 unsigned : 1; 6742 unsigned T1G_DONE : 1; 6743 unsigned : 1; 6744 unsigned : 1; 6745 unsigned : 1; 6746 unsigned : 1; 6747 }; 6748 6749 struct 6750 { 6751 unsigned : 1; 6752 unsigned : 1; 6753 unsigned : 1; 6754 unsigned T1GGO : 1; 6755 unsigned : 1; 6756 unsigned : 1; 6757 unsigned : 1; 6758 unsigned : 1; 6759 }; 6760 6761 struct 6762 { 6763 unsigned T1GSS : 2; 6764 unsigned : 6; 6765 }; 6766 } __T1GCONbits_t; 6767 6768 extern __at(0x0FCC) volatile __T1GCONbits_t T1GCONbits; 6769 6770 #define _T1GSS0 0x01 6771 #define _T1GSS1 0x02 6772 #define _T1GVAL 0x04 6773 #define _T1GGO_NOT_DONE 0x08 6774 #define _T1G_DONE 0x08 6775 #define _T1GGO 0x08 6776 #define _T1GSPM 0x10 6777 #define _T1GTM 0x20 6778 #define _T1GPOL 0x40 6779 #define _TMR1GE 0x80 6780 6781 //============================================================================== 6782 6783 6784 //============================================================================== 6785 // T1CON Bits 6786 6787 extern __at(0x0FCD) __sfr T1CON; 6788 6789 typedef union 6790 { 6791 struct 6792 { 6793 unsigned TMR1ON : 1; 6794 unsigned T1RD16 : 1; 6795 unsigned NOT_T1SYNC : 1; 6796 unsigned T1SOSCEN : 1; 6797 unsigned T1CKPS0 : 1; 6798 unsigned T1CKPS1 : 1; 6799 unsigned TMR1CS0 : 1; 6800 unsigned TMR1CS1 : 1; 6801 }; 6802 6803 struct 6804 { 6805 unsigned : 1; 6806 unsigned RD16 : 1; 6807 unsigned T1SYNC : 1; 6808 unsigned T1OSCEN : 1; 6809 unsigned : 1; 6810 unsigned : 1; 6811 unsigned : 1; 6812 unsigned : 1; 6813 }; 6814 6815 struct 6816 { 6817 unsigned : 4; 6818 unsigned T1CKPS : 2; 6819 unsigned : 2; 6820 }; 6821 6822 struct 6823 { 6824 unsigned : 6; 6825 unsigned TMR1CS : 2; 6826 }; 6827 } __T1CONbits_t; 6828 6829 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits; 6830 6831 #define _TMR1ON 0x01 6832 #define _T1RD16 0x02 6833 #define _RD16 0x02 6834 #define _NOT_T1SYNC 0x04 6835 #define _T1SYNC 0x04 6836 #define _T1SOSCEN 0x08 6837 #define _T1OSCEN 0x08 6838 #define _T1CKPS0 0x10 6839 #define _T1CKPS1 0x20 6840 #define _TMR1CS0 0x40 6841 #define _TMR1CS1 0x80 6842 6843 //============================================================================== 6844 6845 extern __at(0x0FCE) __sfr TMR1; 6846 extern __at(0x0FCE) __sfr TMR1L; 6847 extern __at(0x0FCF) __sfr TMR1H; 6848 6849 //============================================================================== 6850 // RCON Bits 6851 6852 extern __at(0x0FD0) __sfr RCON; 6853 6854 typedef union 6855 { 6856 struct 6857 { 6858 unsigned NOT_BOR : 1; 6859 unsigned NOT_POR : 1; 6860 unsigned NOT_PD : 1; 6861 unsigned NOT_TO : 1; 6862 unsigned NOT_RI : 1; 6863 unsigned : 1; 6864 unsigned SBOREN : 1; 6865 unsigned IPEN : 1; 6866 }; 6867 6868 struct 6869 { 6870 unsigned BOR : 1; 6871 unsigned POR : 1; 6872 unsigned PD : 1; 6873 unsigned TO : 1; 6874 unsigned RI : 1; 6875 unsigned : 1; 6876 unsigned : 1; 6877 unsigned : 1; 6878 }; 6879 } __RCONbits_t; 6880 6881 extern __at(0x0FD0) volatile __RCONbits_t RCONbits; 6882 6883 #define _NOT_BOR 0x01 6884 #define _BOR 0x01 6885 #define _NOT_POR 0x02 6886 #define _POR 0x02 6887 #define _NOT_PD 0x04 6888 #define _PD 0x04 6889 #define _NOT_TO 0x08 6890 #define _TO 0x08 6891 #define _NOT_RI 0x10 6892 #define _RI 0x10 6893 #define _SBOREN 0x40 6894 #define _IPEN 0x80 6895 6896 //============================================================================== 6897 6898 6899 //============================================================================== 6900 // WDTCON Bits 6901 6902 extern __at(0x0FD1) __sfr WDTCON; 6903 6904 typedef union 6905 { 6906 struct 6907 { 6908 unsigned SWDTEN : 1; 6909 unsigned : 1; 6910 unsigned : 1; 6911 unsigned : 1; 6912 unsigned : 1; 6913 unsigned : 1; 6914 unsigned : 1; 6915 unsigned : 1; 6916 }; 6917 6918 struct 6919 { 6920 unsigned SWDTE : 1; 6921 unsigned : 1; 6922 unsigned : 1; 6923 unsigned : 1; 6924 unsigned : 1; 6925 unsigned : 1; 6926 unsigned : 1; 6927 unsigned : 1; 6928 }; 6929 } __WDTCONbits_t; 6930 6931 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits; 6932 6933 #define _SWDTEN 0x01 6934 #define _SWDTE 0x01 6935 6936 //============================================================================== 6937 6938 6939 //============================================================================== 6940 // OSCCON2 Bits 6941 6942 extern __at(0x0FD2) __sfr OSCCON2; 6943 6944 typedef struct 6945 { 6946 unsigned LFIOFS : 1; 6947 unsigned MFIOFS : 1; 6948 unsigned PRISD : 1; 6949 unsigned SOSCGO : 1; 6950 unsigned MFIOSEL : 1; 6951 unsigned : 1; 6952 unsigned SOSCRUN : 1; 6953 unsigned PLLRDY : 1; 6954 } __OSCCON2bits_t; 6955 6956 extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits; 6957 6958 #define _LFIOFS 0x01 6959 #define _MFIOFS 0x02 6960 #define _PRISD 0x04 6961 #define _SOSCGO 0x08 6962 #define _MFIOSEL 0x10 6963 #define _SOSCRUN 0x40 6964 #define _PLLRDY 0x80 6965 6966 //============================================================================== 6967 6968 6969 //============================================================================== 6970 // OSCCON Bits 6971 6972 extern __at(0x0FD3) __sfr OSCCON; 6973 6974 typedef union 6975 { 6976 struct 6977 { 6978 unsigned SCS0 : 1; 6979 unsigned SCS1 : 1; 6980 unsigned HFIOFS : 1; 6981 unsigned OSTS : 1; 6982 unsigned IRCF0 : 1; 6983 unsigned IRCF1 : 1; 6984 unsigned IRCF2 : 1; 6985 unsigned IDLEN : 1; 6986 }; 6987 6988 struct 6989 { 6990 unsigned : 1; 6991 unsigned : 1; 6992 unsigned IOFS : 1; 6993 unsigned : 1; 6994 unsigned : 1; 6995 unsigned : 1; 6996 unsigned : 1; 6997 unsigned : 1; 6998 }; 6999 7000 struct 7001 { 7002 unsigned SCS : 2; 7003 unsigned : 6; 7004 }; 7005 7006 struct 7007 { 7008 unsigned : 4; 7009 unsigned IRCF : 3; 7010 unsigned : 1; 7011 }; 7012 } __OSCCONbits_t; 7013 7014 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits; 7015 7016 #define _SCS0 0x01 7017 #define _SCS1 0x02 7018 #define _HFIOFS 0x04 7019 #define _IOFS 0x04 7020 #define _OSTS 0x08 7021 #define _IRCF0 0x10 7022 #define _IRCF1 0x20 7023 #define _IRCF2 0x40 7024 #define _IDLEN 0x80 7025 7026 //============================================================================== 7027 7028 7029 //============================================================================== 7030 // T0CON Bits 7031 7032 extern __at(0x0FD5) __sfr T0CON; 7033 7034 typedef union 7035 { 7036 struct 7037 { 7038 unsigned T0PS0 : 1; 7039 unsigned T0PS1 : 1; 7040 unsigned T0PS2 : 1; 7041 unsigned PSA : 1; 7042 unsigned T0SE : 1; 7043 unsigned T0CS : 1; 7044 unsigned T08BIT : 1; 7045 unsigned TMR0ON : 1; 7046 }; 7047 7048 struct 7049 { 7050 unsigned T0PS : 3; 7051 unsigned : 5; 7052 }; 7053 } __T0CONbits_t; 7054 7055 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits; 7056 7057 #define _T0PS0 0x01 7058 #define _T0PS1 0x02 7059 #define _T0PS2 0x04 7060 #define _PSA 0x08 7061 #define _T0SE 0x10 7062 #define _T0CS 0x20 7063 #define _T08BIT 0x40 7064 #define _TMR0ON 0x80 7065 7066 //============================================================================== 7067 7068 extern __at(0x0FD6) __sfr TMR0; 7069 extern __at(0x0FD6) __sfr TMR0L; 7070 extern __at(0x0FD7) __sfr TMR0H; 7071 7072 //============================================================================== 7073 // STATUS Bits 7074 7075 extern __at(0x0FD8) __sfr STATUS; 7076 7077 typedef struct 7078 { 7079 unsigned C : 1; 7080 unsigned DC : 1; 7081 unsigned Z : 1; 7082 unsigned OV : 1; 7083 unsigned N : 1; 7084 unsigned : 1; 7085 unsigned : 1; 7086 unsigned : 1; 7087 } __STATUSbits_t; 7088 7089 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits; 7090 7091 #define _C 0x01 7092 #define _DC 0x02 7093 #define _Z 0x04 7094 #define _OV 0x08 7095 #define _N 0x10 7096 7097 //============================================================================== 7098 7099 extern __at(0x0FD9) __sfr FSR2L; 7100 extern __at(0x0FDA) __sfr FSR2H; 7101 extern __at(0x0FDB) __sfr PLUSW2; 7102 extern __at(0x0FDC) __sfr PREINC2; 7103 extern __at(0x0FDD) __sfr POSTDEC2; 7104 extern __at(0x0FDE) __sfr POSTINC2; 7105 extern __at(0x0FDF) __sfr INDF2; 7106 extern __at(0x0FE0) __sfr BSR; 7107 extern __at(0x0FE1) __sfr FSR1L; 7108 extern __at(0x0FE2) __sfr FSR1H; 7109 extern __at(0x0FE3) __sfr PLUSW1; 7110 extern __at(0x0FE4) __sfr PREINC1; 7111 extern __at(0x0FE5) __sfr POSTDEC1; 7112 extern __at(0x0FE6) __sfr POSTINC1; 7113 extern __at(0x0FE7) __sfr INDF1; 7114 extern __at(0x0FE8) __sfr WREG; 7115 extern __at(0x0FE9) __sfr FSR0L; 7116 extern __at(0x0FEA) __sfr FSR0H; 7117 extern __at(0x0FEB) __sfr PLUSW0; 7118 extern __at(0x0FEC) __sfr PREINC0; 7119 extern __at(0x0FED) __sfr POSTDEC0; 7120 extern __at(0x0FEE) __sfr POSTINC0; 7121 extern __at(0x0FEF) __sfr INDF0; 7122 7123 //============================================================================== 7124 // INTCON3 Bits 7125 7126 extern __at(0x0FF0) __sfr INTCON3; 7127 7128 typedef union 7129 { 7130 struct 7131 { 7132 unsigned INT1IF : 1; 7133 unsigned INT2IF : 1; 7134 unsigned : 1; 7135 unsigned INT1IE : 1; 7136 unsigned INT2IE : 1; 7137 unsigned : 1; 7138 unsigned INT1IP : 1; 7139 unsigned INT2IP : 1; 7140 }; 7141 7142 struct 7143 { 7144 unsigned INT1F : 1; 7145 unsigned INT2F : 1; 7146 unsigned : 1; 7147 unsigned INT1E : 1; 7148 unsigned INT2E : 1; 7149 unsigned : 1; 7150 unsigned INT1P : 1; 7151 unsigned INT2P : 1; 7152 }; 7153 } __INTCON3bits_t; 7154 7155 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits; 7156 7157 #define _INT1IF 0x01 7158 #define _INT1F 0x01 7159 #define _INT2IF 0x02 7160 #define _INT2F 0x02 7161 #define _INT1IE 0x08 7162 #define _INT1E 0x08 7163 #define _INT2IE 0x10 7164 #define _INT2E 0x10 7165 #define _INT1IP 0x40 7166 #define _INT1P 0x40 7167 #define _INT2IP 0x80 7168 #define _INT2P 0x80 7169 7170 //============================================================================== 7171 7172 7173 //============================================================================== 7174 // INTCON2 Bits 7175 7176 extern __at(0x0FF1) __sfr INTCON2; 7177 7178 typedef union 7179 { 7180 struct 7181 { 7182 unsigned RBIP : 1; 7183 unsigned : 1; 7184 unsigned TMR0IP : 1; 7185 unsigned : 1; 7186 unsigned INTEDG2 : 1; 7187 unsigned INTEDG1 : 1; 7188 unsigned INTEDG0 : 1; 7189 unsigned NOT_RBPU : 1; 7190 }; 7191 7192 struct 7193 { 7194 unsigned : 1; 7195 unsigned : 1; 7196 unsigned : 1; 7197 unsigned : 1; 7198 unsigned : 1; 7199 unsigned : 1; 7200 unsigned : 1; 7201 unsigned RBPU : 1; 7202 }; 7203 } __INTCON2bits_t; 7204 7205 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits; 7206 7207 #define _RBIP 0x01 7208 #define _TMR0IP 0x04 7209 #define _INTEDG2 0x10 7210 #define _INTEDG1 0x20 7211 #define _INTEDG0 0x40 7212 #define _NOT_RBPU 0x80 7213 #define _RBPU 0x80 7214 7215 //============================================================================== 7216 7217 7218 //============================================================================== 7219 // INTCON Bits 7220 7221 extern __at(0x0FF2) __sfr INTCON; 7222 7223 typedef union 7224 { 7225 struct 7226 { 7227 unsigned RBIF : 1; 7228 unsigned INT0IF : 1; 7229 unsigned TMR0IF : 1; 7230 unsigned RBIE : 1; 7231 unsigned INT0IE : 1; 7232 unsigned TMR0IE : 1; 7233 unsigned PEIE_GIEL : 1; 7234 unsigned GIE_GIEH : 1; 7235 }; 7236 7237 struct 7238 { 7239 unsigned : 1; 7240 unsigned INT0F : 1; 7241 unsigned T0IF : 1; 7242 unsigned : 1; 7243 unsigned INT0E : 1; 7244 unsigned T0IE : 1; 7245 unsigned PEIE : 1; 7246 unsigned GIE : 1; 7247 }; 7248 7249 struct 7250 { 7251 unsigned : 1; 7252 unsigned : 1; 7253 unsigned : 1; 7254 unsigned : 1; 7255 unsigned : 1; 7256 unsigned : 1; 7257 unsigned GIEL : 1; 7258 unsigned GIEH : 1; 7259 }; 7260 } __INTCONbits_t; 7261 7262 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits; 7263 7264 #define _RBIF 0x01 7265 #define _INT0IF 0x02 7266 #define _INT0F 0x02 7267 #define _TMR0IF 0x04 7268 #define _T0IF 0x04 7269 #define _RBIE 0x08 7270 #define _INT0IE 0x10 7271 #define _INT0E 0x10 7272 #define _TMR0IE 0x20 7273 #define _T0IE 0x20 7274 #define _PEIE_GIEL 0x40 7275 #define _PEIE 0x40 7276 #define _GIEL 0x40 7277 #define _GIE_GIEH 0x80 7278 #define _GIE 0x80 7279 #define _GIEH 0x80 7280 7281 //============================================================================== 7282 7283 extern __at(0x0FF3) __sfr PROD; 7284 extern __at(0x0FF3) __sfr PRODL; 7285 extern __at(0x0FF4) __sfr PRODH; 7286 extern __at(0x0FF5) __sfr TABLAT; 7287 extern __at(0x0FF6) __sfr TBLPTR; 7288 extern __at(0x0FF6) __sfr TBLPTRL; 7289 extern __at(0x0FF7) __sfr TBLPTRH; 7290 extern __at(0x0FF8) __sfr TBLPTRU; 7291 extern __at(0x0FF9) __sfr PC; 7292 extern __at(0x0FF9) __sfr PCL; 7293 extern __at(0x0FFA) __sfr PCLATH; 7294 extern __at(0x0FFB) __sfr PCLATU; 7295 7296 //============================================================================== 7297 // STKPTR Bits 7298 7299 extern __at(0x0FFC) __sfr STKPTR; 7300 7301 typedef union 7302 { 7303 struct 7304 { 7305 unsigned STKPTR0 : 1; 7306 unsigned STKPTR1 : 1; 7307 unsigned STKPTR2 : 1; 7308 unsigned STKPTR3 : 1; 7309 unsigned STKPTR4 : 1; 7310 unsigned : 1; 7311 unsigned STKUNF : 1; 7312 unsigned STKFUL : 1; 7313 }; 7314 7315 struct 7316 { 7317 unsigned SP0 : 1; 7318 unsigned SP1 : 1; 7319 unsigned SP2 : 1; 7320 unsigned SP3 : 1; 7321 unsigned SP4 : 1; 7322 unsigned : 1; 7323 unsigned : 1; 7324 unsigned STKOVF : 1; 7325 }; 7326 7327 struct 7328 { 7329 unsigned SP : 5; 7330 unsigned : 3; 7331 }; 7332 7333 struct 7334 { 7335 unsigned STKPTR : 5; 7336 unsigned : 3; 7337 }; 7338 } __STKPTRbits_t; 7339 7340 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits; 7341 7342 #define _STKPTR0 0x01 7343 #define _SP0 0x01 7344 #define _STKPTR1 0x02 7345 #define _SP1 0x02 7346 #define _STKPTR2 0x04 7347 #define _SP2 0x04 7348 #define _STKPTR3 0x08 7349 #define _SP3 0x08 7350 #define _STKPTR4 0x10 7351 #define _SP4 0x10 7352 #define _STKUNF 0x40 7353 #define _STKFUL 0x80 7354 #define _STKOVF 0x80 7355 7356 //============================================================================== 7357 7358 extern __at(0x0FFD) __sfr TOS; 7359 extern __at(0x0FFD) __sfr TOSL; 7360 extern __at(0x0FFE) __sfr TOSH; 7361 extern __at(0x0FFF) __sfr TOSU; 7362 7363 //============================================================================== 7364 // 7365 // Configuration Bits 7366 // 7367 //============================================================================== 7368 7369 #define __CONFIG1H 0x300001 7370 #define __CONFIG2L 0x300002 7371 #define __CONFIG2H 0x300003 7372 #define __CONFIG3H 0x300005 7373 #define __CONFIG4L 0x300006 7374 #define __CONFIG5L 0x300008 7375 #define __CONFIG5H 0x300009 7376 #define __CONFIG6L 0x30000A 7377 #define __CONFIG6H 0x30000B 7378 #define __CONFIG7L 0x30000C 7379 #define __CONFIG7H 0x30000D 7380 7381 //----------------------------- CONFIG1H Options ------------------------------- 7382 7383 #define _FOSC_LP_1H 0xF0 // LP oscillator. 7384 #define _FOSC_XT_1H 0xF1 // XT oscillator. 7385 #define _FOSC_HSHP_1H 0xF2 // HS oscillator (high power > 16 MHz). 7386 #define _FOSC_HSMP_1H 0xF3 // HS oscillator (medium power 4-16 MHz). 7387 #define _FOSC_ECHP_1H 0xF4 // EC oscillator, CLKOUT function on OSC2 (high power, >16 MHz). 7388 #define _FOSC_ECHPIO6_1H 0xF5 // EC oscillator (high power, >16 MHz). 7389 #define _FOSC_RC_1H 0xF6 // External RC oscillator, CLKOUT function on OSC2. 7390 #define _FOSC_RCIO6_1H 0xF7 // External RC oscillator. 7391 #define _FOSC_INTIO67_1H 0xF8 // Internal oscillator block. 7392 #define _FOSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKOUT function on OSC2. 7393 #define _FOSC_ECMP_1H 0xFA // EC oscillator, CLKOUT function on OSC2 (medium power, 500 kHz-16 MHz). 7394 #define _FOSC_ECMPIO6_1H 0xFB // EC oscillator (medium power, 500 kHz-16 MHz). 7395 #define _FOSC_ECLP_1H 0xFC // EC oscillator, CLKOUT function on OSC2 (low power, <500 kHz). 7396 #define _FOSC_ECLPIO6_1H 0xFD // EC oscillator (low power, <500 kHz). 7397 #define _PLLCFG_OFF_1H 0xEF // Oscillator used directly. 7398 #define _PLLCFG_ON_1H 0xFF // Oscillator multiplied by 4. 7399 #define _PRICLKEN_OFF_1H 0xDF // Primary clock can be disabled by software. 7400 #define _PRICLKEN_ON_1H 0xFF // Primary clock is always enabled. 7401 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled. 7402 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled. 7403 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled. 7404 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled. 7405 7406 //----------------------------- CONFIG2L Options ------------------------------- 7407 7408 #define _PWRTEN_ON_2L 0xFE // Power up timer enabled. 7409 #define _PWRTEN_OFF_2L 0xFF // Power up timer disabled. 7410 #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software. 7411 #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled). 7412 #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled). 7413 #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled). 7414 #define _BORV_285_2L 0xE7 // VBOR set to 2.85 V nominal. 7415 #define _BORV_250_2L 0xEF // VBOR set to 2.50 V nominal. 7416 #define _BORV_220_2L 0xF7 // VBOR set to 2.20 V nominal. 7417 #define _BORV_190_2L 0xFF // VBOR set to 1.90 V nominal. 7418 7419 //----------------------------- CONFIG2H Options ------------------------------- 7420 7421 #define _WDTEN_OFF_2H 0xFC // Watch dog timer is always disabled. SWDTEN has no effect. 7422 #define _WDTEN_NOSLP_2H 0xFD // WDT is disabled in sleep, otherwise enabled. SWDTEN bit has no effect. 7423 #define _WDTEN_SWON_2H 0xFE // WDT is controlled by SWDTEN bit of the WDTCON register. 7424 #define _WDTEN_ON_2H 0xFF // WDT is always enabled. SWDTEN bit has no effect. 7425 #define _WDTPS_1_2H 0xC3 // 1:1. 7426 #define _WDTPS_2_2H 0xC7 // 1:2. 7427 #define _WDTPS_4_2H 0xCB // 1:4. 7428 #define _WDTPS_8_2H 0xCF // 1:8. 7429 #define _WDTPS_16_2H 0xD3 // 1:16. 7430 #define _WDTPS_32_2H 0xD7 // 1:32. 7431 #define _WDTPS_64_2H 0xDB // 1:64. 7432 #define _WDTPS_128_2H 0xDF // 1:128. 7433 #define _WDTPS_256_2H 0xE3 // 1:256. 7434 #define _WDTPS_512_2H 0xE7 // 1:512. 7435 #define _WDTPS_1024_2H 0xEB // 1:1024. 7436 #define _WDTPS_2048_2H 0xEF // 1:2048. 7437 #define _WDTPS_4096_2H 0xF3 // 1:4096. 7438 #define _WDTPS_8192_2H 0xF7 // 1:8192. 7439 #define _WDTPS_16384_2H 0xFB // 1:16384. 7440 #define _WDTPS_32768_2H 0xFF // 1:32768. 7441 7442 //----------------------------- CONFIG3H Options ------------------------------- 7443 7444 #define _CCP2MX_PORTB3_3H 0xFE // CCP2 input/output is multiplexed with RB3. 7445 #define _CCP2MX_PORTC1_3H 0xFF // CCP2 input/output is multiplexed with RC1. 7446 #define _PBADEN_OFF_3H 0xFD // PORTB<5:0> pins are configured as digital I/O on Reset. 7447 #define _PBADEN_ON_3H 0xFF // PORTB<5:0> pins are configured as analog input channels on Reset. 7448 #define _CCP3MX_PORTE0_3H 0xFB // P3A/CCP3 input/output is mulitplexed with RE0. 7449 #define _CCP3MX_PORTB5_3H 0xFF // P3A/CCP3 input/output is multiplexed with RB5. 7450 #define _HFOFST_OFF_3H 0xF7 // HFINTOSC output and ready status are delayed by the oscillator stable status. 7451 #define _HFOFST_ON_3H 0xFF // HFINTOSC output and ready status are not delayed by the oscillator stable status. 7452 #define _T3CMX_PORTB5_3H 0xEF // T3CKI is on RB5. 7453 #define _T3CMX_PORTC0_3H 0xFF // T3CKI is on RC0. 7454 #define _P2BMX_PORTC0_3H 0xDF // P2B is on RC0. 7455 #define _P2BMX_PORTD2_3H 0xFF // P2B is on RD2. 7456 #define _MCLRE_INTMCLR_3H 0x7F // RE3 input pin enabled; MCLR disabled. 7457 #define _MCLRE_EXTMCLR_3H 0xFF // MCLR pin enabled, RE3 input pin disabled. 7458 7459 //----------------------------- CONFIG4L Options ------------------------------- 7460 7461 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset. 7462 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset. 7463 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled. 7464 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled if MCLRE is also 1. 7465 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode). 7466 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled. 7467 #define _DEBUG_ON_4L 0x7F // Enabled. 7468 #define _DEBUG_OFF_4L 0xFF // Disabled. 7469 7470 //----------------------------- CONFIG5L Options ------------------------------- 7471 7472 #define _CP0_ON_5L 0xFE // Block 0 (000200-000FFFh) code-protected. 7473 #define _CP0_OFF_5L 0xFF // Block 0 (000200-000FFFh) not code-protected. 7474 #define _CP1_ON_5L 0xFD // Block 1 (001000-001FFFh) code-protected. 7475 #define _CP1_OFF_5L 0xFF // Block 1 (001000-001FFFh) not code-protected. 7476 7477 //----------------------------- CONFIG5H Options ------------------------------- 7478 7479 #define _CPB_ON_5H 0xBF // Boot block (000000-0001FFh) code-protected. 7480 #define _CPB_OFF_5H 0xFF // Boot block (000000-0001FFh) not code-protected. 7481 #define _CPD_ON_5H 0x7F // Data EEPROM code-protected. 7482 #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected. 7483 7484 //----------------------------- CONFIG6L Options ------------------------------- 7485 7486 #define _WRT0_ON_6L 0xFE // Block 0 (000200-000FFFh) write-protected. 7487 #define _WRT0_OFF_6L 0xFF // Block 0 (000200-000FFFh) not write-protected. 7488 #define _WRT1_ON_6L 0xFD // Block 1 (001000-001FFFh) write-protected. 7489 #define _WRT1_OFF_6L 0xFF // Block 1 (001000-001FFFh) not write-protected. 7490 7491 //----------------------------- CONFIG6H Options ------------------------------- 7492 7493 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) write-protected. 7494 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) not write-protected. 7495 #define _WRTB_ON_6H 0xBF // Boot Block (000000-0001FFh) write-protected. 7496 #define _WRTB_OFF_6H 0xFF // Boot Block (000000-0001FFh) not write-protected. 7497 #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected. 7498 #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected. 7499 7500 //----------------------------- CONFIG7L Options ------------------------------- 7501 7502 #define _EBTR0_ON_7L 0xFE // Block 0 (000200-000FFFh) protected from table reads executed in other blocks. 7503 #define _EBTR0_OFF_7L 0xFF // Block 0 (000200-000FFFh) not protected from table reads executed in other blocks. 7504 #define _EBTR1_ON_7L 0xFD // Block 1 (001000-001FFFh) protected from table reads executed in other blocks. 7505 #define _EBTR1_OFF_7L 0xFF // Block 1 (001000-001FFFh) not protected from table reads executed in other blocks. 7506 7507 //----------------------------- CONFIG7H Options ------------------------------- 7508 7509 #define _EBTRB_ON_7H 0xBF // Boot Block (000000-0001FFh) protected from table reads executed in other blocks. 7510 #define _EBTRB_OFF_7H 0xFF // Boot Block (000000-0001FFh) not protected from table reads executed in other blocks. 7511 7512 //============================================================================== 7513 7514 #define __DEVID1 0x3FFFFE 7515 #define __DEVID2 0x3FFFFF 7516 7517 #define __IDLOC0 0x200000 7518 #define __IDLOC1 0x200001 7519 #define __IDLOC2 0x200002 7520 #define __IDLOC3 0x200003 7521 #define __IDLOC4 0x200004 7522 #define __IDLOC5 0x200005 7523 #define __IDLOC6 0x200006 7524 #define __IDLOC7 0x200007 7525 7526 #endif // #ifndef __PIC18F43K22_H__ 7527