1 /* 2 * This declarations of the PIC18F66J16 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:33 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 __PIC18F66J16_H__ 26 #define __PIC18F66J16_H__ 27 28 //============================================================================== 29 30 //============================================================================== 31 // 32 // Register Definitions 33 // 34 //============================================================================== 35 36 extern __at(0x0F5A) __sfr PMSTAT; 37 38 //============================================================================== 39 // PMSTATL Bits 40 41 extern __at(0x0F5A) __sfr PMSTATL; 42 43 typedef struct 44 { 45 unsigned OB0E : 1; 46 unsigned OB1E : 1; 47 unsigned OB2E : 1; 48 unsigned OB3E : 1; 49 unsigned : 1; 50 unsigned : 1; 51 unsigned OBUF : 1; 52 unsigned OBE : 1; 53 } __PMSTATLbits_t; 54 55 extern __at(0x0F5A) volatile __PMSTATLbits_t PMSTATLbits; 56 57 #define _OB0E 0x01 58 #define _OB1E 0x02 59 #define _OB2E 0x04 60 #define _OB3E 0x08 61 #define _OBUF 0x40 62 #define _OBE 0x80 63 64 //============================================================================== 65 66 67 //============================================================================== 68 // PMSTATH Bits 69 70 extern __at(0x0F5B) __sfr PMSTATH; 71 72 typedef struct 73 { 74 unsigned IB0F : 1; 75 unsigned IB1F : 1; 76 unsigned IB2F : 1; 77 unsigned IB3F : 1; 78 unsigned : 1; 79 unsigned : 1; 80 unsigned IBOV : 1; 81 unsigned IBF : 1; 82 } __PMSTATHbits_t; 83 84 extern __at(0x0F5B) volatile __PMSTATHbits_t PMSTATHbits; 85 86 #define _IB0F 0x01 87 #define _IB1F 0x02 88 #define _IB2F 0x04 89 #define _IB3F 0x08 90 #define _IBOV 0x40 91 #define _IBF 0x80 92 93 //============================================================================== 94 95 96 //============================================================================== 97 // PMEL Bits 98 99 extern __at(0x0F5C) __sfr PMEL; 100 101 typedef struct 102 { 103 unsigned PTEN0 : 1; 104 unsigned PTEN1 : 1; 105 unsigned PTEN2 : 1; 106 unsigned PTEN3 : 1; 107 unsigned PTEN4 : 1; 108 unsigned PTEN5 : 1; 109 unsigned PTEN6 : 1; 110 unsigned PTEN7 : 1; 111 } __PMELbits_t; 112 113 extern __at(0x0F5C) volatile __PMELbits_t PMELbits; 114 115 #define _PTEN0 0x01 116 #define _PTEN1 0x02 117 #define _PTEN2 0x04 118 #define _PTEN3 0x08 119 #define _PTEN4 0x10 120 #define _PTEN5 0x20 121 #define _PTEN6 0x40 122 #define _PTEN7 0x80 123 124 //============================================================================== 125 126 extern __at(0x0F5C) __sfr PMEN; 127 128 //============================================================================== 129 // PMEH Bits 130 131 extern __at(0x0F5D) __sfr PMEH; 132 133 typedef struct 134 { 135 unsigned PTEN8 : 1; 136 unsigned PTEN9 : 1; 137 unsigned PTEN10 : 1; 138 unsigned PTEN11 : 1; 139 unsigned PTEN12 : 1; 140 unsigned PTEN13 : 1; 141 unsigned PTEN14 : 1; 142 unsigned PTEN15 : 1; 143 } __PMEHbits_t; 144 145 extern __at(0x0F5D) volatile __PMEHbits_t PMEHbits; 146 147 #define _PTEN8 0x01 148 #define _PTEN9 0x02 149 #define _PTEN10 0x04 150 #define _PTEN11 0x08 151 #define _PTEN12 0x10 152 #define _PTEN13 0x20 153 #define _PTEN14 0x40 154 #define _PTEN15 0x80 155 156 //============================================================================== 157 158 extern __at(0x0F5E) __sfr PMDIN2; 159 extern __at(0x0F5E) __sfr PMDIN2L; 160 extern __at(0x0F5F) __sfr PMDIN2H; 161 extern __at(0x0F60) __sfr PMDOUT2; 162 extern __at(0x0F60) __sfr PMDOUT2L; 163 extern __at(0x0F61) __sfr PMDOUT2H; 164 extern __at(0x0F62) __sfr PMMODE; 165 166 //============================================================================== 167 // PMMODEL Bits 168 169 extern __at(0x0F62) __sfr PMMODEL; 170 171 typedef union 172 { 173 struct 174 { 175 unsigned WAITE0 : 1; 176 unsigned WAITE1 : 1; 177 unsigned WAITM0 : 1; 178 unsigned WAITM1 : 1; 179 unsigned WAITM2 : 1; 180 unsigned WAITM3 : 1; 181 unsigned WAITB0 : 1; 182 unsigned WAITB1 : 1; 183 }; 184 185 struct 186 { 187 unsigned WAITE : 2; 188 unsigned : 6; 189 }; 190 191 struct 192 { 193 unsigned : 2; 194 unsigned WAITM : 4; 195 unsigned : 2; 196 }; 197 198 struct 199 { 200 unsigned : 6; 201 unsigned WAITB : 2; 202 }; 203 } __PMMODELbits_t; 204 205 extern __at(0x0F62) volatile __PMMODELbits_t PMMODELbits; 206 207 #define _WAITE0 0x01 208 #define _WAITE1 0x02 209 #define _WAITM0 0x04 210 #define _WAITM1 0x08 211 #define _WAITM2 0x10 212 #define _WAITM3 0x20 213 #define _WAITB0 0x40 214 #define _WAITB1 0x80 215 216 //============================================================================== 217 218 219 //============================================================================== 220 // PMMODEH Bits 221 222 extern __at(0x0F63) __sfr PMMODEH; 223 224 typedef union 225 { 226 struct 227 { 228 unsigned MODE0 : 1; 229 unsigned MODE1 : 1; 230 unsigned MODE16 : 1; 231 unsigned INCM0 : 1; 232 unsigned INCM1 : 1; 233 unsigned IRQM0 : 1; 234 unsigned IRQM1 : 1; 235 unsigned BUSY : 1; 236 }; 237 238 struct 239 { 240 unsigned : 3; 241 unsigned INCM : 2; 242 unsigned : 3; 243 }; 244 245 struct 246 { 247 unsigned : 5; 248 unsigned IRQM : 2; 249 unsigned : 1; 250 }; 251 } __PMMODEHbits_t; 252 253 extern __at(0x0F63) volatile __PMMODEHbits_t PMMODEHbits; 254 255 #define _MODE0 0x01 256 #define _MODE1 0x02 257 #define _MODE16 0x04 258 #define _INCM0 0x08 259 #define _INCM1 0x10 260 #define _IRQM0 0x20 261 #define _IRQM1 0x40 262 #define _BUSY 0x80 263 264 //============================================================================== 265 266 extern __at(0x0F64) __sfr PMCON; 267 268 //============================================================================== 269 // PMCONL Bits 270 271 extern __at(0x0F64) __sfr PMCONL; 272 273 typedef union 274 { 275 struct 276 { 277 unsigned RDSP : 1; 278 unsigned WRSP : 1; 279 unsigned BEP : 1; 280 unsigned CS1P : 1; 281 unsigned CS2P : 1; 282 unsigned ALP : 1; 283 unsigned CSF0 : 1; 284 unsigned CSF1 : 1; 285 }; 286 287 struct 288 { 289 unsigned : 6; 290 unsigned CSF : 2; 291 }; 292 } __PMCONLbits_t; 293 294 extern __at(0x0F64) volatile __PMCONLbits_t PMCONLbits; 295 296 #define _RDSP 0x01 297 #define _WRSP 0x02 298 #define _BEP 0x04 299 #define _CS1P 0x08 300 #define _CS2P 0x10 301 #define _ALP 0x20 302 #define _CSF0 0x40 303 #define _CSF1 0x80 304 305 //============================================================================== 306 307 308 //============================================================================== 309 // PMCONH Bits 310 311 extern __at(0x0F65) __sfr PMCONH; 312 313 typedef union 314 { 315 struct 316 { 317 unsigned PTRDEN : 1; 318 unsigned PTWREN : 1; 319 unsigned PTBEEN : 1; 320 unsigned ADRMUX0 : 1; 321 unsigned ADRMUX1 : 1; 322 unsigned PSIDL : 1; 323 unsigned : 1; 324 unsigned PMPEN : 1; 325 }; 326 327 struct 328 { 329 unsigned : 3; 330 unsigned ADRMUX : 2; 331 unsigned : 3; 332 }; 333 } __PMCONHbits_t; 334 335 extern __at(0x0F65) volatile __PMCONHbits_t PMCONHbits; 336 337 #define _PTRDEN 0x01 338 #define _PTWREN 0x02 339 #define _PTBEEN 0x04 340 #define _ADRMUX0 0x08 341 #define _ADRMUX1 0x10 342 #define _PSIDL 0x20 343 #define _PMPEN 0x80 344 345 //============================================================================== 346 347 extern __at(0x0F66) __sfr PMDIN1; 348 extern __at(0x0F66) __sfr PMDIN1L; 349 extern __at(0x0F67) __sfr PMDIN1H; 350 extern __at(0x0F68) __sfr PMADDR; 351 extern __at(0x0F68) __sfr PMADDRL; 352 extern __at(0x0F68) __sfr PMDOUT1; 353 extern __at(0x0F68) __sfr PMDOUT1L; 354 355 //============================================================================== 356 // PMADDRH Bits 357 358 extern __at(0x0F69) __sfr PMADDRH; 359 360 typedef struct 361 { 362 unsigned : 1; 363 unsigned : 1; 364 unsigned : 1; 365 unsigned : 1; 366 unsigned : 1; 367 unsigned : 1; 368 unsigned CS1 : 1; 369 unsigned CS2 : 1; 370 } __PMADDRHbits_t; 371 372 extern __at(0x0F69) volatile __PMADDRHbits_t PMADDRHbits; 373 374 #define _CS1 0x40 375 #define _CS2 0x80 376 377 //============================================================================== 378 379 extern __at(0x0F69) __sfr PMDOUT1H; 380 381 //============================================================================== 382 // CMSTAT Bits 383 384 extern __at(0x0F6A) __sfr CMSTAT; 385 386 typedef struct 387 { 388 unsigned COUT1 : 1; 389 unsigned COUT2 : 1; 390 unsigned : 1; 391 unsigned : 1; 392 unsigned : 1; 393 unsigned : 1; 394 unsigned : 1; 395 unsigned : 1; 396 } __CMSTATbits_t; 397 398 extern __at(0x0F6A) volatile __CMSTATbits_t CMSTATbits; 399 400 #define _COUT1 0x01 401 #define _COUT2 0x02 402 403 //============================================================================== 404 405 406 //============================================================================== 407 // CMSTATUS Bits 408 409 extern __at(0x0F6A) __sfr CMSTATUS; 410 411 typedef struct 412 { 413 unsigned COUT1 : 1; 414 unsigned COUT2 : 1; 415 unsigned : 1; 416 unsigned : 1; 417 unsigned : 1; 418 unsigned : 1; 419 unsigned : 1; 420 unsigned : 1; 421 } __CMSTATUSbits_t; 422 423 extern __at(0x0F6A) volatile __CMSTATUSbits_t CMSTATUSbits; 424 425 #define _CMSTATUS_COUT1 0x01 426 #define _CMSTATUS_COUT2 0x02 427 428 //============================================================================== 429 430 431 //============================================================================== 432 // SSP2CON2 Bits 433 434 extern __at(0x0F6B) __sfr SSP2CON2; 435 436 typedef union 437 { 438 struct 439 { 440 unsigned SEN : 1; 441 unsigned RSEN : 1; 442 unsigned PEN : 1; 443 unsigned RCEN : 1; 444 unsigned ACKEN : 1; 445 unsigned ACKDT : 1; 446 unsigned ACKSTAT : 1; 447 unsigned GCEN : 1; 448 }; 449 450 struct 451 { 452 unsigned : 1; 453 unsigned ADMSK1 : 1; 454 unsigned ADMSK2 : 1; 455 unsigned ADMSK3 : 1; 456 unsigned ADMSK4 : 1; 457 unsigned ADMSK5 : 1; 458 unsigned : 1; 459 unsigned : 1; 460 }; 461 } __SSP2CON2bits_t; 462 463 extern __at(0x0F6B) volatile __SSP2CON2bits_t SSP2CON2bits; 464 465 #define _SSP2CON2_SEN 0x01 466 #define _SSP2CON2_RSEN 0x02 467 #define _SSP2CON2_ADMSK1 0x02 468 #define _SSP2CON2_PEN 0x04 469 #define _SSP2CON2_ADMSK2 0x04 470 #define _SSP2CON2_RCEN 0x08 471 #define _SSP2CON2_ADMSK3 0x08 472 #define _SSP2CON2_ACKEN 0x10 473 #define _SSP2CON2_ADMSK4 0x10 474 #define _SSP2CON2_ACKDT 0x20 475 #define _SSP2CON2_ADMSK5 0x20 476 #define _SSP2CON2_ACKSTAT 0x40 477 #define _SSP2CON2_GCEN 0x80 478 479 //============================================================================== 480 481 482 //============================================================================== 483 // SSP2CON1 Bits 484 485 extern __at(0x0F6C) __sfr SSP2CON1; 486 487 typedef union 488 { 489 struct 490 { 491 unsigned SSPM0 : 1; 492 unsigned SSPM1 : 1; 493 unsigned SSPM2 : 1; 494 unsigned SSPM3 : 1; 495 unsigned CKP : 1; 496 unsigned SSPEN : 1; 497 unsigned SSPOV : 1; 498 unsigned WCOL : 1; 499 }; 500 501 struct 502 { 503 unsigned SSPM : 4; 504 unsigned : 4; 505 }; 506 } __SSP2CON1bits_t; 507 508 extern __at(0x0F6C) volatile __SSP2CON1bits_t SSP2CON1bits; 509 510 #define _SSP2CON1_SSPM0 0x01 511 #define _SSP2CON1_SSPM1 0x02 512 #define _SSP2CON1_SSPM2 0x04 513 #define _SSP2CON1_SSPM3 0x08 514 #define _SSP2CON1_CKP 0x10 515 #define _SSP2CON1_SSPEN 0x20 516 #define _SSP2CON1_SSPOV 0x40 517 #define _SSP2CON1_WCOL 0x80 518 519 //============================================================================== 520 521 522 //============================================================================== 523 // SSP2STAT Bits 524 525 extern __at(0x0F6D) __sfr SSP2STAT; 526 527 typedef union 528 { 529 struct 530 { 531 unsigned BF : 1; 532 unsigned UA : 1; 533 unsigned R_NOT_W : 1; 534 unsigned S : 1; 535 unsigned P : 1; 536 unsigned D_NOT_A : 1; 537 unsigned CKE : 1; 538 unsigned SMP : 1; 539 }; 540 541 struct 542 { 543 unsigned : 1; 544 unsigned : 1; 545 unsigned R_W : 1; 546 unsigned I2C_START : 1; 547 unsigned I2C_STOP : 1; 548 unsigned D_A : 1; 549 unsigned : 1; 550 unsigned : 1; 551 }; 552 553 struct 554 { 555 unsigned : 1; 556 unsigned : 1; 557 unsigned I2C_READ : 1; 558 unsigned : 1; 559 unsigned : 1; 560 unsigned I2C_DAT : 1; 561 unsigned : 1; 562 unsigned : 1; 563 }; 564 565 struct 566 { 567 unsigned : 1; 568 unsigned : 1; 569 unsigned NOT_W : 1; 570 unsigned : 1; 571 unsigned : 1; 572 unsigned NOT_A : 1; 573 unsigned : 1; 574 unsigned : 1; 575 }; 576 577 struct 578 { 579 unsigned : 1; 580 unsigned : 1; 581 unsigned NOT_WRITE : 1; 582 unsigned : 1; 583 unsigned : 1; 584 unsigned NOT_ADDRESS : 1; 585 unsigned : 1; 586 unsigned : 1; 587 }; 588 589 struct 590 { 591 unsigned : 1; 592 unsigned : 1; 593 unsigned READ_WRITE : 1; 594 unsigned : 1; 595 unsigned : 1; 596 unsigned DATA_ADDRESS : 1; 597 unsigned : 1; 598 unsigned : 1; 599 }; 600 601 struct 602 { 603 unsigned : 1; 604 unsigned : 1; 605 unsigned R : 1; 606 unsigned : 1; 607 unsigned : 1; 608 unsigned D : 1; 609 unsigned : 1; 610 unsigned : 1; 611 }; 612 } __SSP2STATbits_t; 613 614 extern __at(0x0F6D) volatile __SSP2STATbits_t SSP2STATbits; 615 616 #define _SSP2STAT_BF 0x01 617 #define _SSP2STAT_UA 0x02 618 #define _SSP2STAT_R_NOT_W 0x04 619 #define _SSP2STAT_R_W 0x04 620 #define _SSP2STAT_I2C_READ 0x04 621 #define _SSP2STAT_NOT_W 0x04 622 #define _SSP2STAT_NOT_WRITE 0x04 623 #define _SSP2STAT_READ_WRITE 0x04 624 #define _SSP2STAT_R 0x04 625 #define _SSP2STAT_S 0x08 626 #define _SSP2STAT_I2C_START 0x08 627 #define _SSP2STAT_P 0x10 628 #define _SSP2STAT_I2C_STOP 0x10 629 #define _SSP2STAT_D_NOT_A 0x20 630 #define _SSP2STAT_D_A 0x20 631 #define _SSP2STAT_I2C_DAT 0x20 632 #define _SSP2STAT_NOT_A 0x20 633 #define _SSP2STAT_NOT_ADDRESS 0x20 634 #define _SSP2STAT_DATA_ADDRESS 0x20 635 #define _SSP2STAT_D 0x20 636 #define _SSP2STAT_CKE 0x40 637 #define _SSP2STAT_SMP 0x80 638 639 //============================================================================== 640 641 extern __at(0x0F6E) __sfr SSP2ADD; 642 643 //============================================================================== 644 // SSP2MSK Bits 645 646 extern __at(0x0F6E) __sfr SSP2MSK; 647 648 typedef struct 649 { 650 unsigned MSK0 : 1; 651 unsigned MSK1 : 1; 652 unsigned MSK2 : 1; 653 unsigned MSK3 : 1; 654 unsigned MSK4 : 1; 655 unsigned MSK5 : 1; 656 unsigned MSK6 : 1; 657 unsigned MSK7 : 1; 658 } __SSP2MSKbits_t; 659 660 extern __at(0x0F6E) volatile __SSP2MSKbits_t SSP2MSKbits; 661 662 #define _SSP2MSK_MSK0 0x01 663 #define _SSP2MSK_MSK1 0x02 664 #define _SSP2MSK_MSK2 0x04 665 #define _SSP2MSK_MSK3 0x08 666 #define _SSP2MSK_MSK4 0x10 667 #define _SSP2MSK_MSK5 0x20 668 #define _SSP2MSK_MSK6 0x40 669 #define _SSP2MSK_MSK7 0x80 670 671 //============================================================================== 672 673 extern __at(0x0F6F) __sfr SSP2BUF; 674 675 //============================================================================== 676 // CCP5CON Bits 677 678 extern __at(0x0F70) __sfr CCP5CON; 679 680 typedef union 681 { 682 struct 683 { 684 unsigned CCP5M0 : 1; 685 unsigned CCP5M1 : 1; 686 unsigned CCP5M2 : 1; 687 unsigned CCP5M3 : 1; 688 unsigned DC5B0 : 1; 689 unsigned DC5B1 : 1; 690 unsigned : 1; 691 unsigned : 1; 692 }; 693 694 struct 695 { 696 unsigned : 1; 697 unsigned : 1; 698 unsigned : 1; 699 unsigned : 1; 700 unsigned DCCP5Y : 1; 701 unsigned DCCP5X : 1; 702 unsigned : 1; 703 unsigned : 1; 704 }; 705 706 struct 707 { 708 unsigned CCP5M : 4; 709 unsigned : 4; 710 }; 711 712 struct 713 { 714 unsigned : 4; 715 unsigned DC5B : 2; 716 unsigned : 2; 717 }; 718 } __CCP5CONbits_t; 719 720 extern __at(0x0F70) volatile __CCP5CONbits_t CCP5CONbits; 721 722 #define _CCP5M0 0x01 723 #define _CCP5M1 0x02 724 #define _CCP5M2 0x04 725 #define _CCP5M3 0x08 726 #define _DC5B0 0x10 727 #define _DCCP5Y 0x10 728 #define _DC5B1 0x20 729 #define _DCCP5X 0x20 730 731 //============================================================================== 732 733 extern __at(0x0F71) __sfr CCPR5; 734 extern __at(0x0F71) __sfr CCPR5L; 735 extern __at(0x0F72) __sfr CCPR5H; 736 737 //============================================================================== 738 // CCP4CON Bits 739 740 extern __at(0x0F73) __sfr CCP4CON; 741 742 typedef union 743 { 744 struct 745 { 746 unsigned CCP4M0 : 1; 747 unsigned CCP4M1 : 1; 748 unsigned CCP4M2 : 1; 749 unsigned CCP4M3 : 1; 750 unsigned DC4B0 : 1; 751 unsigned DC4B1 : 1; 752 unsigned : 1; 753 unsigned : 1; 754 }; 755 756 struct 757 { 758 unsigned : 1; 759 unsigned : 1; 760 unsigned : 1; 761 unsigned : 1; 762 unsigned DCCP4Y : 1; 763 unsigned DCCP4X : 1; 764 unsigned : 1; 765 unsigned : 1; 766 }; 767 768 struct 769 { 770 unsigned CCP4M : 4; 771 unsigned : 4; 772 }; 773 774 struct 775 { 776 unsigned : 4; 777 unsigned DC4B : 2; 778 unsigned : 2; 779 }; 780 } __CCP4CONbits_t; 781 782 extern __at(0x0F73) volatile __CCP4CONbits_t CCP4CONbits; 783 784 #define _CCP4M0 0x01 785 #define _CCP4M1 0x02 786 #define _CCP4M2 0x04 787 #define _CCP4M3 0x08 788 #define _DC4B0 0x10 789 #define _DCCP4Y 0x10 790 #define _DC4B1 0x20 791 #define _DCCP4X 0x20 792 793 //============================================================================== 794 795 extern __at(0x0F74) __sfr CCPR4; 796 extern __at(0x0F74) __sfr CCPR4L; 797 extern __at(0x0F75) __sfr CCPR4H; 798 799 //============================================================================== 800 // T4CON Bits 801 802 extern __at(0x0F76) __sfr T4CON; 803 804 typedef union 805 { 806 struct 807 { 808 unsigned T4CKPS0 : 1; 809 unsigned T4CKPS1 : 1; 810 unsigned TMR4ON : 1; 811 unsigned T4OUTPS0 : 1; 812 unsigned T4OUTPS1 : 1; 813 unsigned T4OUTPS2 : 1; 814 unsigned T4OUTPS3 : 1; 815 unsigned : 1; 816 }; 817 818 struct 819 { 820 unsigned T4CKPS : 2; 821 unsigned : 6; 822 }; 823 824 struct 825 { 826 unsigned : 3; 827 unsigned T4OUTPS : 4; 828 unsigned : 1; 829 }; 830 } __T4CONbits_t; 831 832 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits; 833 834 #define _T4CKPS0 0x01 835 #define _T4CKPS1 0x02 836 #define _TMR4ON 0x04 837 #define _T4OUTPS0 0x08 838 #define _T4OUTPS1 0x10 839 #define _T4OUTPS2 0x20 840 #define _T4OUTPS3 0x40 841 842 //============================================================================== 843 844 845 //============================================================================== 846 // CVRCON Bits 847 848 extern __at(0x0F77) __sfr CVRCON; 849 850 typedef union 851 { 852 struct 853 { 854 unsigned CVR0 : 1; 855 unsigned CVR1 : 1; 856 unsigned CVR2 : 1; 857 unsigned CVR3 : 1; 858 unsigned CVRSS : 1; 859 unsigned CVRR : 1; 860 unsigned CVROE : 1; 861 unsigned CVREN : 1; 862 }; 863 864 struct 865 { 866 unsigned CVR : 4; 867 unsigned : 4; 868 }; 869 } __CVRCONbits_t; 870 871 extern __at(0x0F77) volatile __CVRCONbits_t CVRCONbits; 872 873 #define _CVR0 0x01 874 #define _CVR1 0x02 875 #define _CVR2 0x04 876 #define _CVR3 0x08 877 #define _CVRSS 0x10 878 #define _CVRR 0x20 879 #define _CVROE 0x40 880 #define _CVREN 0x80 881 882 //============================================================================== 883 884 extern __at(0x0F77) __sfr PR4; 885 extern __at(0x0F78) __sfr TMR4; 886 887 //============================================================================== 888 // T3CON Bits 889 890 extern __at(0x0F79) __sfr T3CON; 891 892 typedef union 893 { 894 struct 895 { 896 unsigned TMR3ON : 1; 897 unsigned TMR3CS : 1; 898 unsigned NOT_T3SYNC : 1; 899 unsigned T3CCP1 : 1; 900 unsigned T3CKPS0 : 1; 901 unsigned T3CKPS1 : 1; 902 unsigned T3CCP2 : 1; 903 unsigned RD16 : 1; 904 }; 905 906 struct 907 { 908 unsigned : 1; 909 unsigned : 1; 910 unsigned T3SYNC : 1; 911 unsigned : 1; 912 unsigned : 1; 913 unsigned : 1; 914 unsigned : 1; 915 unsigned : 1; 916 }; 917 918 struct 919 { 920 unsigned : 1; 921 unsigned : 1; 922 unsigned T3INSYNC : 1; 923 unsigned : 1; 924 unsigned : 1; 925 unsigned : 1; 926 unsigned : 1; 927 unsigned : 1; 928 }; 929 930 struct 931 { 932 unsigned : 4; 933 unsigned T3CKPS : 2; 934 unsigned : 2; 935 }; 936 } __T3CONbits_t; 937 938 extern __at(0x0F79) volatile __T3CONbits_t T3CONbits; 939 940 #define _T3CON_TMR3ON 0x01 941 #define _T3CON_TMR3CS 0x02 942 #define _T3CON_NOT_T3SYNC 0x04 943 #define _T3CON_T3SYNC 0x04 944 #define _T3CON_T3INSYNC 0x04 945 #define _T3CON_T3CCP1 0x08 946 #define _T3CON_T3CKPS0 0x10 947 #define _T3CON_T3CKPS1 0x20 948 #define _T3CON_T3CCP2 0x40 949 #define _T3CON_RD16 0x80 950 951 //============================================================================== 952 953 extern __at(0x0F7A) __sfr TMR3; 954 extern __at(0x0F7A) __sfr TMR3L; 955 extern __at(0x0F7B) __sfr TMR3H; 956 957 //============================================================================== 958 // BAUDCON2 Bits 959 960 extern __at(0x0F7C) __sfr BAUDCON2; 961 962 typedef union 963 { 964 struct 965 { 966 unsigned ABDEN : 1; 967 unsigned WUE : 1; 968 unsigned : 1; 969 unsigned BRG16 : 1; 970 unsigned TXCKP : 1; 971 unsigned RXDTP : 1; 972 unsigned RCIDL : 1; 973 unsigned ABDOVF : 1; 974 }; 975 976 struct 977 { 978 unsigned : 1; 979 unsigned : 1; 980 unsigned : 1; 981 unsigned : 1; 982 unsigned SCKP : 1; 983 unsigned DTRXP : 1; 984 unsigned RCMT : 1; 985 unsigned : 1; 986 }; 987 } __BAUDCON2bits_t; 988 989 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits; 990 991 #define _BAUDCON2_ABDEN 0x01 992 #define _BAUDCON2_WUE 0x02 993 #define _BAUDCON2_BRG16 0x08 994 #define _BAUDCON2_TXCKP 0x10 995 #define _BAUDCON2_SCKP 0x10 996 #define _BAUDCON2_RXDTP 0x20 997 #define _BAUDCON2_DTRXP 0x20 998 #define _BAUDCON2_RCIDL 0x40 999 #define _BAUDCON2_RCMT 0x40 1000 #define _BAUDCON2_ABDOVF 0x80 1001 1002 //============================================================================== 1003 1004 extern __at(0x0F7D) __sfr SPBRGH2; 1005 1006 //============================================================================== 1007 // BAUDCON Bits 1008 1009 extern __at(0x0F7E) __sfr BAUDCON; 1010 1011 typedef union 1012 { 1013 struct 1014 { 1015 unsigned ABDEN : 1; 1016 unsigned WUE : 1; 1017 unsigned : 1; 1018 unsigned BRG16 : 1; 1019 unsigned TXCKP : 1; 1020 unsigned RXDTP : 1; 1021 unsigned RCIDL : 1; 1022 unsigned ABDOVF : 1; 1023 }; 1024 1025 struct 1026 { 1027 unsigned : 1; 1028 unsigned : 1; 1029 unsigned : 1; 1030 unsigned : 1; 1031 unsigned SCKP : 1; 1032 unsigned DTRXP : 1; 1033 unsigned RCMT : 1; 1034 unsigned : 1; 1035 }; 1036 } __BAUDCONbits_t; 1037 1038 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits; 1039 1040 #define _ABDEN 0x01 1041 #define _WUE 0x02 1042 #define _BRG16 0x08 1043 #define _TXCKP 0x10 1044 #define _SCKP 0x10 1045 #define _RXDTP 0x20 1046 #define _DTRXP 0x20 1047 #define _RCIDL 0x40 1048 #define _RCMT 0x40 1049 #define _ABDOVF 0x80 1050 1051 //============================================================================== 1052 1053 1054 //============================================================================== 1055 // BAUDCON1 Bits 1056 1057 extern __at(0x0F7E) __sfr BAUDCON1; 1058 1059 typedef union 1060 { 1061 struct 1062 { 1063 unsigned ABDEN : 1; 1064 unsigned WUE : 1; 1065 unsigned : 1; 1066 unsigned BRG16 : 1; 1067 unsigned TXCKP : 1; 1068 unsigned RXDTP : 1; 1069 unsigned RCIDL : 1; 1070 unsigned ABDOVF : 1; 1071 }; 1072 1073 struct 1074 { 1075 unsigned : 1; 1076 unsigned : 1; 1077 unsigned : 1; 1078 unsigned : 1; 1079 unsigned SCKP : 1; 1080 unsigned DTRXP : 1; 1081 unsigned RCMT : 1; 1082 unsigned : 1; 1083 }; 1084 } __BAUDCON1bits_t; 1085 1086 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits; 1087 1088 #define _BAUDCON1_ABDEN 0x01 1089 #define _BAUDCON1_WUE 0x02 1090 #define _BAUDCON1_BRG16 0x08 1091 #define _BAUDCON1_TXCKP 0x10 1092 #define _BAUDCON1_SCKP 0x10 1093 #define _BAUDCON1_RXDTP 0x20 1094 #define _BAUDCON1_DTRXP 0x20 1095 #define _BAUDCON1_RCIDL 0x40 1096 #define _BAUDCON1_RCMT 0x40 1097 #define _BAUDCON1_ABDOVF 0x80 1098 1099 //============================================================================== 1100 1101 extern __at(0x0F7F) __sfr SPBRGH1; 1102 1103 //============================================================================== 1104 // PORTA Bits 1105 1106 extern __at(0x0F80) __sfr PORTA; 1107 1108 typedef union 1109 { 1110 struct 1111 { 1112 unsigned RA0 : 1; 1113 unsigned RA1 : 1; 1114 unsigned RA2 : 1; 1115 unsigned RA3 : 1; 1116 unsigned RA4 : 1; 1117 unsigned RA5 : 1; 1118 unsigned RA6 : 1; 1119 unsigned RA7 : 1; 1120 }; 1121 1122 struct 1123 { 1124 unsigned AN0 : 1; 1125 unsigned AN1 : 1; 1126 unsigned AN2 : 1; 1127 unsigned AN3 : 1; 1128 unsigned T0CKI : 1; 1129 unsigned AN4 : 1; 1130 unsigned OSC2 : 1; 1131 unsigned : 1; 1132 }; 1133 1134 struct 1135 { 1136 unsigned : 1; 1137 unsigned : 1; 1138 unsigned VREFM : 1; 1139 unsigned VREFP : 1; 1140 unsigned : 1; 1141 unsigned : 1; 1142 unsigned CLKO : 1; 1143 unsigned : 1; 1144 }; 1145 } __PORTAbits_t; 1146 1147 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits; 1148 1149 #define _PORTA_RA0 0x01 1150 #define _PORTA_AN0 0x01 1151 #define _PORTA_RA1 0x02 1152 #define _PORTA_AN1 0x02 1153 #define _PORTA_RA2 0x04 1154 #define _PORTA_AN2 0x04 1155 #define _PORTA_VREFM 0x04 1156 #define _PORTA_RA3 0x08 1157 #define _PORTA_AN3 0x08 1158 #define _PORTA_VREFP 0x08 1159 #define _PORTA_RA4 0x10 1160 #define _PORTA_T0CKI 0x10 1161 #define _PORTA_RA5 0x20 1162 #define _PORTA_AN4 0x20 1163 #define _PORTA_RA6 0x40 1164 #define _PORTA_OSC2 0x40 1165 #define _PORTA_CLKO 0x40 1166 #define _PORTA_RA7 0x80 1167 1168 //============================================================================== 1169 1170 1171 //============================================================================== 1172 // PORTB Bits 1173 1174 extern __at(0x0F81) __sfr PORTB; 1175 1176 typedef union 1177 { 1178 struct 1179 { 1180 unsigned RB0 : 1; 1181 unsigned RB1 : 1; 1182 unsigned RB2 : 1; 1183 unsigned RB3 : 1; 1184 unsigned RB4 : 1; 1185 unsigned RB5 : 1; 1186 unsigned RB6 : 1; 1187 unsigned RB7 : 1; 1188 }; 1189 1190 struct 1191 { 1192 unsigned INT0 : 1; 1193 unsigned INT1 : 1; 1194 unsigned INT2 : 1; 1195 unsigned INT3 : 1; 1196 unsigned KBI0 : 1; 1197 unsigned KBI1 : 1; 1198 unsigned KBI2 : 1; 1199 unsigned KBI3 : 1; 1200 }; 1201 1202 struct 1203 { 1204 unsigned FLT0 : 1; 1205 unsigned PMA4 : 1; 1206 unsigned PMA3 : 1; 1207 unsigned PMA2 : 1; 1208 unsigned PMA1 : 1; 1209 unsigned PMA0 : 1; 1210 unsigned PGC : 1; 1211 unsigned PGD : 1; 1212 }; 1213 1214 struct 1215 { 1216 unsigned INT : 4; 1217 unsigned : 4; 1218 }; 1219 1220 struct 1221 { 1222 unsigned : 4; 1223 unsigned KBI : 4; 1224 }; 1225 } __PORTBbits_t; 1226 1227 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits; 1228 1229 #define _PORTB_RB0 0x01 1230 #define _PORTB_INT0 0x01 1231 #define _PORTB_FLT0 0x01 1232 #define _PORTB_RB1 0x02 1233 #define _PORTB_INT1 0x02 1234 #define _PORTB_PMA4 0x02 1235 #define _PORTB_RB2 0x04 1236 #define _PORTB_INT2 0x04 1237 #define _PORTB_PMA3 0x04 1238 #define _PORTB_RB3 0x08 1239 #define _PORTB_INT3 0x08 1240 #define _PORTB_PMA2 0x08 1241 #define _PORTB_RB4 0x10 1242 #define _PORTB_KBI0 0x10 1243 #define _PORTB_PMA1 0x10 1244 #define _PORTB_RB5 0x20 1245 #define _PORTB_KBI1 0x20 1246 #define _PORTB_PMA0 0x20 1247 #define _PORTB_RB6 0x40 1248 #define _PORTB_KBI2 0x40 1249 #define _PORTB_PGC 0x40 1250 #define _PORTB_RB7 0x80 1251 #define _PORTB_KBI3 0x80 1252 #define _PORTB_PGD 0x80 1253 1254 //============================================================================== 1255 1256 1257 //============================================================================== 1258 // PORTC Bits 1259 1260 extern __at(0x0F82) __sfr PORTC; 1261 1262 typedef union 1263 { 1264 struct 1265 { 1266 unsigned RC0 : 1; 1267 unsigned RC1 : 1; 1268 unsigned RC2 : 1; 1269 unsigned RC3 : 1; 1270 unsigned RC4 : 1; 1271 unsigned RC5 : 1; 1272 unsigned RC6 : 1; 1273 unsigned RC7 : 1; 1274 }; 1275 1276 struct 1277 { 1278 unsigned T1OSO : 1; 1279 unsigned T1OSI : 1; 1280 unsigned CCP1 : 1; 1281 unsigned SCK : 1; 1282 unsigned SDI : 1; 1283 unsigned SDO : 1; 1284 unsigned TX : 1; 1285 unsigned RX : 1; 1286 }; 1287 1288 struct 1289 { 1290 unsigned T13CKI : 1; 1291 unsigned CCP2 : 1; 1292 unsigned : 1; 1293 unsigned SCL : 1; 1294 unsigned SDA : 1; 1295 unsigned : 1; 1296 unsigned CK : 1; 1297 unsigned : 1; 1298 }; 1299 } __PORTCbits_t; 1300 1301 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits; 1302 1303 #define _PORTC_RC0 0x01 1304 #define _PORTC_T1OSO 0x01 1305 #define _PORTC_T13CKI 0x01 1306 #define _PORTC_RC1 0x02 1307 #define _PORTC_T1OSI 0x02 1308 #define _PORTC_CCP2 0x02 1309 #define _PORTC_RC2 0x04 1310 #define _PORTC_CCP1 0x04 1311 #define _PORTC_RC3 0x08 1312 #define _PORTC_SCK 0x08 1313 #define _PORTC_SCL 0x08 1314 #define _PORTC_RC4 0x10 1315 #define _PORTC_SDI 0x10 1316 #define _PORTC_SDA 0x10 1317 #define _PORTC_RC5 0x20 1318 #define _PORTC_SDO 0x20 1319 #define _PORTC_RC6 0x40 1320 #define _PORTC_TX 0x40 1321 #define _PORTC_CK 0x40 1322 #define _PORTC_RC7 0x80 1323 #define _PORTC_RX 0x80 1324 1325 //============================================================================== 1326 1327 1328 //============================================================================== 1329 // PORTD Bits 1330 1331 extern __at(0x0F83) __sfr PORTD; 1332 1333 typedef union 1334 { 1335 struct 1336 { 1337 unsigned RD0 : 1; 1338 unsigned RD1 : 1; 1339 unsigned RD2 : 1; 1340 unsigned RD3 : 1; 1341 unsigned RD4 : 1; 1342 unsigned RD5 : 1; 1343 unsigned RD6 : 1; 1344 unsigned RD7 : 1; 1345 }; 1346 1347 struct 1348 { 1349 unsigned PMD0 : 1; 1350 unsigned PMD1 : 1; 1351 unsigned PMD2 : 1; 1352 unsigned PMD3 : 1; 1353 unsigned PMD4 : 1; 1354 unsigned PMD5 : 1; 1355 unsigned PMD6 : 1; 1356 unsigned PMD7 : 1; 1357 }; 1358 1359 struct 1360 { 1361 unsigned : 1; 1362 unsigned : 1; 1363 unsigned : 1; 1364 unsigned : 1; 1365 unsigned SDO2 : 1; 1366 unsigned SDA2 : 1; 1367 unsigned SCL2 : 1; 1368 unsigned SS2 : 1; 1369 }; 1370 1371 struct 1372 { 1373 unsigned : 1; 1374 unsigned : 1; 1375 unsigned : 1; 1376 unsigned : 1; 1377 unsigned : 1; 1378 unsigned SDI2 : 1; 1379 unsigned SCK2 : 1; 1380 unsigned : 1; 1381 }; 1382 } __PORTDbits_t; 1383 1384 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits; 1385 1386 #define _PORTD_RD0 0x01 1387 #define _PORTD_PMD0 0x01 1388 #define _PORTD_RD1 0x02 1389 #define _PORTD_PMD1 0x02 1390 #define _PORTD_RD2 0x04 1391 #define _PORTD_PMD2 0x04 1392 #define _PORTD_RD3 0x08 1393 #define _PORTD_PMD3 0x08 1394 #define _PORTD_RD4 0x10 1395 #define _PORTD_PMD4 0x10 1396 #define _PORTD_SDO2 0x10 1397 #define _PORTD_RD5 0x20 1398 #define _PORTD_PMD5 0x20 1399 #define _PORTD_SDA2 0x20 1400 #define _PORTD_SDI2 0x20 1401 #define _PORTD_RD6 0x40 1402 #define _PORTD_PMD6 0x40 1403 #define _PORTD_SCL2 0x40 1404 #define _PORTD_SCK2 0x40 1405 #define _PORTD_RD7 0x80 1406 #define _PORTD_PMD7 0x80 1407 #define _PORTD_SS2 0x80 1408 1409 //============================================================================== 1410 1411 1412 //============================================================================== 1413 // PORTE Bits 1414 1415 extern __at(0x0F84) __sfr PORTE; 1416 1417 typedef union 1418 { 1419 struct 1420 { 1421 unsigned RE0 : 1; 1422 unsigned RE1 : 1; 1423 unsigned RE2 : 1; 1424 unsigned RE3 : 1; 1425 unsigned RE4 : 1; 1426 unsigned RE5 : 1; 1427 unsigned RE6 : 1; 1428 unsigned RE7 : 1; 1429 }; 1430 1431 struct 1432 { 1433 unsigned PMRD : 1; 1434 unsigned PMWR : 1; 1435 unsigned PMBE : 1; 1436 unsigned PMA13 : 1; 1437 unsigned PMA12 : 1; 1438 unsigned PMA11 : 1; 1439 unsigned PMA10 : 1; 1440 unsigned PMA9 : 1; 1441 }; 1442 1443 struct 1444 { 1445 unsigned : 1; 1446 unsigned : 1; 1447 unsigned : 1; 1448 unsigned REFO : 1; 1449 unsigned : 1; 1450 unsigned : 1; 1451 unsigned : 1; 1452 unsigned CCP2 : 1; 1453 }; 1454 } __PORTEbits_t; 1455 1456 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits; 1457 1458 #define _PORTE_RE0 0x01 1459 #define _PORTE_PMRD 0x01 1460 #define _PORTE_RE1 0x02 1461 #define _PORTE_PMWR 0x02 1462 #define _PORTE_RE2 0x04 1463 #define _PORTE_PMBE 0x04 1464 #define _PORTE_RE3 0x08 1465 #define _PORTE_PMA13 0x08 1466 #define _PORTE_REFO 0x08 1467 #define _PORTE_RE4 0x10 1468 #define _PORTE_PMA12 0x10 1469 #define _PORTE_RE5 0x20 1470 #define _PORTE_PMA11 0x20 1471 #define _PORTE_RE6 0x40 1472 #define _PORTE_PMA10 0x40 1473 #define _PORTE_RE7 0x80 1474 #define _PORTE_PMA9 0x80 1475 #define _PORTE_CCP2 0x80 1476 1477 //============================================================================== 1478 1479 1480 //============================================================================== 1481 // PORTF Bits 1482 1483 extern __at(0x0F85) __sfr PORTF; 1484 1485 typedef union 1486 { 1487 struct 1488 { 1489 unsigned : 1; 1490 unsigned RF1 : 1; 1491 unsigned RF2 : 1; 1492 unsigned RF3 : 1; 1493 unsigned RF4 : 1; 1494 unsigned RF5 : 1; 1495 unsigned RF6 : 1; 1496 unsigned RF7 : 1; 1497 }; 1498 1499 struct 1500 { 1501 unsigned : 1; 1502 unsigned AN6 : 1; 1503 unsigned AN7 : 1; 1504 unsigned AN8 : 1; 1505 unsigned AN9 : 1; 1506 unsigned AN10 : 1; 1507 unsigned AN11 : 1; 1508 unsigned SS : 1; 1509 }; 1510 1511 struct 1512 { 1513 unsigned : 1; 1514 unsigned C2OUT : 1; 1515 unsigned C1OUT : 1; 1516 unsigned C2INB : 1; 1517 unsigned C2INA : 1; 1518 unsigned CVREF : 1; 1519 unsigned C1INA : 1; 1520 unsigned : 1; 1521 }; 1522 1523 struct 1524 { 1525 unsigned : 1; 1526 unsigned : 1; 1527 unsigned PMA5 : 1; 1528 unsigned : 1; 1529 unsigned : 1; 1530 unsigned C1INB : 1; 1531 unsigned : 1; 1532 unsigned : 1; 1533 }; 1534 } __PORTFbits_t; 1535 1536 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits; 1537 1538 #define _PORTF_RF1 0x02 1539 #define _PORTF_AN6 0x02 1540 #define _PORTF_C2OUT 0x02 1541 #define _PORTF_RF2 0x04 1542 #define _PORTF_AN7 0x04 1543 #define _PORTF_C1OUT 0x04 1544 #define _PORTF_PMA5 0x04 1545 #define _PORTF_RF3 0x08 1546 #define _PORTF_AN8 0x08 1547 #define _PORTF_C2INB 0x08 1548 #define _PORTF_RF4 0x10 1549 #define _PORTF_AN9 0x10 1550 #define _PORTF_C2INA 0x10 1551 #define _PORTF_RF5 0x20 1552 #define _PORTF_AN10 0x20 1553 #define _PORTF_CVREF 0x20 1554 #define _PORTF_C1INB 0x20 1555 #define _PORTF_RF6 0x40 1556 #define _PORTF_AN11 0x40 1557 #define _PORTF_C1INA 0x40 1558 #define _PORTF_RF7 0x80 1559 #define _PORTF_SS 0x80 1560 1561 //============================================================================== 1562 1563 1564 //============================================================================== 1565 // PORTG Bits 1566 1567 extern __at(0x0F86) __sfr PORTG; 1568 1569 typedef union 1570 { 1571 struct 1572 { 1573 unsigned RG0 : 1; 1574 unsigned RG1 : 1; 1575 unsigned RG2 : 1; 1576 unsigned RG3 : 1; 1577 unsigned RG4 : 1; 1578 unsigned : 1; 1579 unsigned REPU : 1; 1580 unsigned RDPU : 1; 1581 }; 1582 1583 struct 1584 { 1585 unsigned CCP3 : 1; 1586 unsigned TX2 : 1; 1587 unsigned RX2 : 1; 1588 unsigned CCP4 : 1; 1589 unsigned CCP5 : 1; 1590 unsigned : 1; 1591 unsigned : 1; 1592 unsigned : 1; 1593 }; 1594 1595 struct 1596 { 1597 unsigned PMA8 : 1; 1598 unsigned CK2 : 1; 1599 unsigned DT2 : 1; 1600 unsigned PMCS1 : 1; 1601 unsigned PMCS2 : 1; 1602 unsigned : 1; 1603 unsigned : 1; 1604 unsigned : 1; 1605 }; 1606 1607 struct 1608 { 1609 unsigned : 1; 1610 unsigned PMA7 : 1; 1611 unsigned PMA6 : 1; 1612 unsigned : 1; 1613 unsigned : 1; 1614 unsigned : 1; 1615 unsigned : 1; 1616 unsigned : 1; 1617 }; 1618 1619 struct 1620 { 1621 unsigned RG : 5; 1622 unsigned : 3; 1623 }; 1624 } __PORTGbits_t; 1625 1626 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits; 1627 1628 #define _PORTG_RG0 0x01 1629 #define _PORTG_CCP3 0x01 1630 #define _PORTG_PMA8 0x01 1631 #define _PORTG_RG1 0x02 1632 #define _PORTG_TX2 0x02 1633 #define _PORTG_CK2 0x02 1634 #define _PORTG_PMA7 0x02 1635 #define _PORTG_RG2 0x04 1636 #define _PORTG_RX2 0x04 1637 #define _PORTG_DT2 0x04 1638 #define _PORTG_PMA6 0x04 1639 #define _PORTG_RG3 0x08 1640 #define _PORTG_CCP4 0x08 1641 #define _PORTG_PMCS1 0x08 1642 #define _PORTG_RG4 0x10 1643 #define _PORTG_CCP5 0x10 1644 #define _PORTG_PMCS2 0x10 1645 #define _PORTG_REPU 0x40 1646 #define _PORTG_RDPU 0x80 1647 1648 //============================================================================== 1649 1650 1651 //============================================================================== 1652 // LATA Bits 1653 1654 extern __at(0x0F89) __sfr LATA; 1655 1656 typedef struct 1657 { 1658 unsigned LATA0 : 1; 1659 unsigned LATA1 : 1; 1660 unsigned LATA2 : 1; 1661 unsigned LATA3 : 1; 1662 unsigned LATA4 : 1; 1663 unsigned LATA5 : 1; 1664 unsigned LATA6 : 1; 1665 unsigned LATA7 : 1; 1666 } __LATAbits_t; 1667 1668 extern __at(0x0F89) volatile __LATAbits_t LATAbits; 1669 1670 #define _LATA0 0x01 1671 #define _LATA1 0x02 1672 #define _LATA2 0x04 1673 #define _LATA3 0x08 1674 #define _LATA4 0x10 1675 #define _LATA5 0x20 1676 #define _LATA6 0x40 1677 #define _LATA7 0x80 1678 1679 //============================================================================== 1680 1681 1682 //============================================================================== 1683 // LATB Bits 1684 1685 extern __at(0x0F8A) __sfr LATB; 1686 1687 typedef struct 1688 { 1689 unsigned LATB0 : 1; 1690 unsigned LATB1 : 1; 1691 unsigned LATB2 : 1; 1692 unsigned LATB3 : 1; 1693 unsigned LATB4 : 1; 1694 unsigned LATB5 : 1; 1695 unsigned LATB6 : 1; 1696 unsigned LATB7 : 1; 1697 } __LATBbits_t; 1698 1699 extern __at(0x0F8A) volatile __LATBbits_t LATBbits; 1700 1701 #define _LATB0 0x01 1702 #define _LATB1 0x02 1703 #define _LATB2 0x04 1704 #define _LATB3 0x08 1705 #define _LATB4 0x10 1706 #define _LATB5 0x20 1707 #define _LATB6 0x40 1708 #define _LATB7 0x80 1709 1710 //============================================================================== 1711 1712 1713 //============================================================================== 1714 // LATC Bits 1715 1716 extern __at(0x0F8B) __sfr LATC; 1717 1718 typedef struct 1719 { 1720 unsigned LATC0 : 1; 1721 unsigned LATC1 : 1; 1722 unsigned LATC2 : 1; 1723 unsigned LATC3 : 1; 1724 unsigned LATC4 : 1; 1725 unsigned LATC5 : 1; 1726 unsigned LATC6 : 1; 1727 unsigned LATC7 : 1; 1728 } __LATCbits_t; 1729 1730 extern __at(0x0F8B) volatile __LATCbits_t LATCbits; 1731 1732 #define _LATC0 0x01 1733 #define _LATC1 0x02 1734 #define _LATC2 0x04 1735 #define _LATC3 0x08 1736 #define _LATC4 0x10 1737 #define _LATC5 0x20 1738 #define _LATC6 0x40 1739 #define _LATC7 0x80 1740 1741 //============================================================================== 1742 1743 1744 //============================================================================== 1745 // LATD Bits 1746 1747 extern __at(0x0F8C) __sfr LATD; 1748 1749 typedef struct 1750 { 1751 unsigned LATD0 : 1; 1752 unsigned LATD1 : 1; 1753 unsigned LATD2 : 1; 1754 unsigned LATD3 : 1; 1755 unsigned LATD4 : 1; 1756 unsigned LATD5 : 1; 1757 unsigned LATD6 : 1; 1758 unsigned LATD7 : 1; 1759 } __LATDbits_t; 1760 1761 extern __at(0x0F8C) volatile __LATDbits_t LATDbits; 1762 1763 #define _LATD0 0x01 1764 #define _LATD1 0x02 1765 #define _LATD2 0x04 1766 #define _LATD3 0x08 1767 #define _LATD4 0x10 1768 #define _LATD5 0x20 1769 #define _LATD6 0x40 1770 #define _LATD7 0x80 1771 1772 //============================================================================== 1773 1774 1775 //============================================================================== 1776 // LATE Bits 1777 1778 extern __at(0x0F8D) __sfr LATE; 1779 1780 typedef struct 1781 { 1782 unsigned LATE0 : 1; 1783 unsigned LATE1 : 1; 1784 unsigned LATE2 : 1; 1785 unsigned LATE3 : 1; 1786 unsigned LATE4 : 1; 1787 unsigned LATE5 : 1; 1788 unsigned LATE6 : 1; 1789 unsigned LATE7 : 1; 1790 } __LATEbits_t; 1791 1792 extern __at(0x0F8D) volatile __LATEbits_t LATEbits; 1793 1794 #define _LATE0 0x01 1795 #define _LATE1 0x02 1796 #define _LATE2 0x04 1797 #define _LATE3 0x08 1798 #define _LATE4 0x10 1799 #define _LATE5 0x20 1800 #define _LATE6 0x40 1801 #define _LATE7 0x80 1802 1803 //============================================================================== 1804 1805 1806 //============================================================================== 1807 // LATF Bits 1808 1809 extern __at(0x0F8E) __sfr LATF; 1810 1811 typedef struct 1812 { 1813 unsigned : 1; 1814 unsigned LATF1 : 1; 1815 unsigned LATF2 : 1; 1816 unsigned LATF3 : 1; 1817 unsigned LATF4 : 1; 1818 unsigned LATF5 : 1; 1819 unsigned LATF6 : 1; 1820 unsigned LATF7 : 1; 1821 } __LATFbits_t; 1822 1823 extern __at(0x0F8E) volatile __LATFbits_t LATFbits; 1824 1825 #define _LATF1 0x02 1826 #define _LATF2 0x04 1827 #define _LATF3 0x08 1828 #define _LATF4 0x10 1829 #define _LATF5 0x20 1830 #define _LATF6 0x40 1831 #define _LATF7 0x80 1832 1833 //============================================================================== 1834 1835 1836 //============================================================================== 1837 // LATG Bits 1838 1839 extern __at(0x0F8F) __sfr LATG; 1840 1841 typedef union 1842 { 1843 struct 1844 { 1845 unsigned LATG0 : 1; 1846 unsigned LATG1 : 1; 1847 unsigned LATG2 : 1; 1848 unsigned LATG3 : 1; 1849 unsigned LATG4 : 1; 1850 unsigned : 1; 1851 unsigned : 1; 1852 unsigned : 1; 1853 }; 1854 1855 struct 1856 { 1857 unsigned LATG : 5; 1858 unsigned : 3; 1859 }; 1860 } __LATGbits_t; 1861 1862 extern __at(0x0F8F) volatile __LATGbits_t LATGbits; 1863 1864 #define _LATG0 0x01 1865 #define _LATG1 0x02 1866 #define _LATG2 0x04 1867 #define _LATG3 0x08 1868 #define _LATG4 0x10 1869 1870 //============================================================================== 1871 1872 1873 //============================================================================== 1874 // DDRA Bits 1875 1876 extern __at(0x0F92) __sfr DDRA; 1877 1878 typedef union 1879 { 1880 struct 1881 { 1882 unsigned TRISA0 : 1; 1883 unsigned TRISA1 : 1; 1884 unsigned TRISA2 : 1; 1885 unsigned TRISA3 : 1; 1886 unsigned TRISA4 : 1; 1887 unsigned TRISA5 : 1; 1888 unsigned TRISA6 : 1; 1889 unsigned TRISA7 : 1; 1890 }; 1891 1892 struct 1893 { 1894 unsigned RA0 : 1; 1895 unsigned RA1 : 1; 1896 unsigned RA2 : 1; 1897 unsigned RA3 : 1; 1898 unsigned RA4 : 1; 1899 unsigned RA5 : 1; 1900 unsigned RA6 : 1; 1901 unsigned RA7 : 1; 1902 }; 1903 } __DDRAbits_t; 1904 1905 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits; 1906 1907 #define _TRISA0 0x01 1908 #define _RA0 0x01 1909 #define _TRISA1 0x02 1910 #define _RA1 0x02 1911 #define _TRISA2 0x04 1912 #define _RA2 0x04 1913 #define _TRISA3 0x08 1914 #define _RA3 0x08 1915 #define _TRISA4 0x10 1916 #define _RA4 0x10 1917 #define _TRISA5 0x20 1918 #define _RA5 0x20 1919 #define _TRISA6 0x40 1920 #define _RA6 0x40 1921 #define _TRISA7 0x80 1922 #define _RA7 0x80 1923 1924 //============================================================================== 1925 1926 1927 //============================================================================== 1928 // TRISA Bits 1929 1930 extern __at(0x0F92) __sfr TRISA; 1931 1932 typedef union 1933 { 1934 struct 1935 { 1936 unsigned TRISA0 : 1; 1937 unsigned TRISA1 : 1; 1938 unsigned TRISA2 : 1; 1939 unsigned TRISA3 : 1; 1940 unsigned TRISA4 : 1; 1941 unsigned TRISA5 : 1; 1942 unsigned TRISA6 : 1; 1943 unsigned TRISA7 : 1; 1944 }; 1945 1946 struct 1947 { 1948 unsigned RA0 : 1; 1949 unsigned RA1 : 1; 1950 unsigned RA2 : 1; 1951 unsigned RA3 : 1; 1952 unsigned RA4 : 1; 1953 unsigned RA5 : 1; 1954 unsigned RA6 : 1; 1955 unsigned RA7 : 1; 1956 }; 1957 } __TRISAbits_t; 1958 1959 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits; 1960 1961 #define _TRISA_TRISA0 0x01 1962 #define _TRISA_RA0 0x01 1963 #define _TRISA_TRISA1 0x02 1964 #define _TRISA_RA1 0x02 1965 #define _TRISA_TRISA2 0x04 1966 #define _TRISA_RA2 0x04 1967 #define _TRISA_TRISA3 0x08 1968 #define _TRISA_RA3 0x08 1969 #define _TRISA_TRISA4 0x10 1970 #define _TRISA_RA4 0x10 1971 #define _TRISA_TRISA5 0x20 1972 #define _TRISA_RA5 0x20 1973 #define _TRISA_TRISA6 0x40 1974 #define _TRISA_RA6 0x40 1975 #define _TRISA_TRISA7 0x80 1976 #define _TRISA_RA7 0x80 1977 1978 //============================================================================== 1979 1980 1981 //============================================================================== 1982 // DDRB Bits 1983 1984 extern __at(0x0F93) __sfr DDRB; 1985 1986 typedef union 1987 { 1988 struct 1989 { 1990 unsigned TRISB0 : 1; 1991 unsigned TRISB1 : 1; 1992 unsigned TRISB2 : 1; 1993 unsigned TRISB3 : 1; 1994 unsigned TRISB4 : 1; 1995 unsigned TRISB5 : 1; 1996 unsigned TRISB6 : 1; 1997 unsigned TRISB7 : 1; 1998 }; 1999 2000 struct 2001 { 2002 unsigned RB0 : 1; 2003 unsigned RB1 : 1; 2004 unsigned RB2 : 1; 2005 unsigned RB3 : 1; 2006 unsigned RB4 : 1; 2007 unsigned RB5 : 1; 2008 unsigned RB6 : 1; 2009 unsigned RB7 : 1; 2010 }; 2011 } __DDRBbits_t; 2012 2013 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits; 2014 2015 #define _TRISB0 0x01 2016 #define _RB0 0x01 2017 #define _TRISB1 0x02 2018 #define _RB1 0x02 2019 #define _TRISB2 0x04 2020 #define _RB2 0x04 2021 #define _TRISB3 0x08 2022 #define _RB3 0x08 2023 #define _TRISB4 0x10 2024 #define _RB4 0x10 2025 #define _TRISB5 0x20 2026 #define _RB5 0x20 2027 #define _TRISB6 0x40 2028 #define _RB6 0x40 2029 #define _TRISB7 0x80 2030 #define _RB7 0x80 2031 2032 //============================================================================== 2033 2034 2035 //============================================================================== 2036 // TRISB Bits 2037 2038 extern __at(0x0F93) __sfr TRISB; 2039 2040 typedef union 2041 { 2042 struct 2043 { 2044 unsigned TRISB0 : 1; 2045 unsigned TRISB1 : 1; 2046 unsigned TRISB2 : 1; 2047 unsigned TRISB3 : 1; 2048 unsigned TRISB4 : 1; 2049 unsigned TRISB5 : 1; 2050 unsigned TRISB6 : 1; 2051 unsigned TRISB7 : 1; 2052 }; 2053 2054 struct 2055 { 2056 unsigned RB0 : 1; 2057 unsigned RB1 : 1; 2058 unsigned RB2 : 1; 2059 unsigned RB3 : 1; 2060 unsigned RB4 : 1; 2061 unsigned RB5 : 1; 2062 unsigned RB6 : 1; 2063 unsigned RB7 : 1; 2064 }; 2065 } __TRISBbits_t; 2066 2067 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits; 2068 2069 #define _TRISB_TRISB0 0x01 2070 #define _TRISB_RB0 0x01 2071 #define _TRISB_TRISB1 0x02 2072 #define _TRISB_RB1 0x02 2073 #define _TRISB_TRISB2 0x04 2074 #define _TRISB_RB2 0x04 2075 #define _TRISB_TRISB3 0x08 2076 #define _TRISB_RB3 0x08 2077 #define _TRISB_TRISB4 0x10 2078 #define _TRISB_RB4 0x10 2079 #define _TRISB_TRISB5 0x20 2080 #define _TRISB_RB5 0x20 2081 #define _TRISB_TRISB6 0x40 2082 #define _TRISB_RB6 0x40 2083 #define _TRISB_TRISB7 0x80 2084 #define _TRISB_RB7 0x80 2085 2086 //============================================================================== 2087 2088 2089 //============================================================================== 2090 // DDRC Bits 2091 2092 extern __at(0x0F94) __sfr DDRC; 2093 2094 typedef union 2095 { 2096 struct 2097 { 2098 unsigned TRISC0 : 1; 2099 unsigned TRISC1 : 1; 2100 unsigned TRISC2 : 1; 2101 unsigned TRISC3 : 1; 2102 unsigned TRISC4 : 1; 2103 unsigned TRISC5 : 1; 2104 unsigned TRISC6 : 1; 2105 unsigned TRISC7 : 1; 2106 }; 2107 2108 struct 2109 { 2110 unsigned RC0 : 1; 2111 unsigned RC1 : 1; 2112 unsigned RC2 : 1; 2113 unsigned RC3 : 1; 2114 unsigned RC4 : 1; 2115 unsigned RC5 : 1; 2116 unsigned RC6 : 1; 2117 unsigned RC7 : 1; 2118 }; 2119 } __DDRCbits_t; 2120 2121 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits; 2122 2123 #define _TRISC0 0x01 2124 #define _RC0 0x01 2125 #define _TRISC1 0x02 2126 #define _RC1 0x02 2127 #define _TRISC2 0x04 2128 #define _RC2 0x04 2129 #define _TRISC3 0x08 2130 #define _RC3 0x08 2131 #define _TRISC4 0x10 2132 #define _RC4 0x10 2133 #define _TRISC5 0x20 2134 #define _RC5 0x20 2135 #define _TRISC6 0x40 2136 #define _RC6 0x40 2137 #define _TRISC7 0x80 2138 #define _RC7 0x80 2139 2140 //============================================================================== 2141 2142 2143 //============================================================================== 2144 // TRISC Bits 2145 2146 extern __at(0x0F94) __sfr TRISC; 2147 2148 typedef union 2149 { 2150 struct 2151 { 2152 unsigned TRISC0 : 1; 2153 unsigned TRISC1 : 1; 2154 unsigned TRISC2 : 1; 2155 unsigned TRISC3 : 1; 2156 unsigned TRISC4 : 1; 2157 unsigned TRISC5 : 1; 2158 unsigned TRISC6 : 1; 2159 unsigned TRISC7 : 1; 2160 }; 2161 2162 struct 2163 { 2164 unsigned RC0 : 1; 2165 unsigned RC1 : 1; 2166 unsigned RC2 : 1; 2167 unsigned RC3 : 1; 2168 unsigned RC4 : 1; 2169 unsigned RC5 : 1; 2170 unsigned RC6 : 1; 2171 unsigned RC7 : 1; 2172 }; 2173 } __TRISCbits_t; 2174 2175 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits; 2176 2177 #define _TRISC_TRISC0 0x01 2178 #define _TRISC_RC0 0x01 2179 #define _TRISC_TRISC1 0x02 2180 #define _TRISC_RC1 0x02 2181 #define _TRISC_TRISC2 0x04 2182 #define _TRISC_RC2 0x04 2183 #define _TRISC_TRISC3 0x08 2184 #define _TRISC_RC3 0x08 2185 #define _TRISC_TRISC4 0x10 2186 #define _TRISC_RC4 0x10 2187 #define _TRISC_TRISC5 0x20 2188 #define _TRISC_RC5 0x20 2189 #define _TRISC_TRISC6 0x40 2190 #define _TRISC_RC6 0x40 2191 #define _TRISC_TRISC7 0x80 2192 #define _TRISC_RC7 0x80 2193 2194 //============================================================================== 2195 2196 2197 //============================================================================== 2198 // DDRD Bits 2199 2200 extern __at(0x0F95) __sfr DDRD; 2201 2202 typedef union 2203 { 2204 struct 2205 { 2206 unsigned TRISD0 : 1; 2207 unsigned TRISD1 : 1; 2208 unsigned TRISD2 : 1; 2209 unsigned TRISD3 : 1; 2210 unsigned TRISD4 : 1; 2211 unsigned TRISD5 : 1; 2212 unsigned TRISD6 : 1; 2213 unsigned TRISD7 : 1; 2214 }; 2215 2216 struct 2217 { 2218 unsigned RD0 : 1; 2219 unsigned RD1 : 1; 2220 unsigned RD2 : 1; 2221 unsigned RD3 : 1; 2222 unsigned RD4 : 1; 2223 unsigned RD5 : 1; 2224 unsigned RD6 : 1; 2225 unsigned RD7 : 1; 2226 }; 2227 } __DDRDbits_t; 2228 2229 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits; 2230 2231 #define _TRISD0 0x01 2232 #define _RD0 0x01 2233 #define _TRISD1 0x02 2234 #define _RD1 0x02 2235 #define _TRISD2 0x04 2236 #define _RD2 0x04 2237 #define _TRISD3 0x08 2238 #define _RD3 0x08 2239 #define _TRISD4 0x10 2240 #define _RD4 0x10 2241 #define _TRISD5 0x20 2242 #define _RD5 0x20 2243 #define _TRISD6 0x40 2244 #define _RD6 0x40 2245 #define _TRISD7 0x80 2246 #define _RD7 0x80 2247 2248 //============================================================================== 2249 2250 2251 //============================================================================== 2252 // TRISD Bits 2253 2254 extern __at(0x0F95) __sfr TRISD; 2255 2256 typedef union 2257 { 2258 struct 2259 { 2260 unsigned TRISD0 : 1; 2261 unsigned TRISD1 : 1; 2262 unsigned TRISD2 : 1; 2263 unsigned TRISD3 : 1; 2264 unsigned TRISD4 : 1; 2265 unsigned TRISD5 : 1; 2266 unsigned TRISD6 : 1; 2267 unsigned TRISD7 : 1; 2268 }; 2269 2270 struct 2271 { 2272 unsigned RD0 : 1; 2273 unsigned RD1 : 1; 2274 unsigned RD2 : 1; 2275 unsigned RD3 : 1; 2276 unsigned RD4 : 1; 2277 unsigned RD5 : 1; 2278 unsigned RD6 : 1; 2279 unsigned RD7 : 1; 2280 }; 2281 } __TRISDbits_t; 2282 2283 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits; 2284 2285 #define _TRISD_TRISD0 0x01 2286 #define _TRISD_RD0 0x01 2287 #define _TRISD_TRISD1 0x02 2288 #define _TRISD_RD1 0x02 2289 #define _TRISD_TRISD2 0x04 2290 #define _TRISD_RD2 0x04 2291 #define _TRISD_TRISD3 0x08 2292 #define _TRISD_RD3 0x08 2293 #define _TRISD_TRISD4 0x10 2294 #define _TRISD_RD4 0x10 2295 #define _TRISD_TRISD5 0x20 2296 #define _TRISD_RD5 0x20 2297 #define _TRISD_TRISD6 0x40 2298 #define _TRISD_RD6 0x40 2299 #define _TRISD_TRISD7 0x80 2300 #define _TRISD_RD7 0x80 2301 2302 //============================================================================== 2303 2304 2305 //============================================================================== 2306 // DDRE Bits 2307 2308 extern __at(0x0F96) __sfr DDRE; 2309 2310 typedef union 2311 { 2312 struct 2313 { 2314 unsigned TRISE0 : 1; 2315 unsigned TRISE1 : 1; 2316 unsigned TRISE2 : 1; 2317 unsigned TRISE3 : 1; 2318 unsigned TRISE4 : 1; 2319 unsigned TRISE5 : 1; 2320 unsigned TRISE6 : 1; 2321 unsigned TRISE7 : 1; 2322 }; 2323 2324 struct 2325 { 2326 unsigned RE0 : 1; 2327 unsigned RE1 : 1; 2328 unsigned RE2 : 1; 2329 unsigned RE3 : 1; 2330 unsigned RE4 : 1; 2331 unsigned RE5 : 1; 2332 unsigned RE6 : 1; 2333 unsigned RE7 : 1; 2334 }; 2335 } __DDREbits_t; 2336 2337 extern __at(0x0F96) volatile __DDREbits_t DDREbits; 2338 2339 #define _TRISE0 0x01 2340 #define _RE0 0x01 2341 #define _TRISE1 0x02 2342 #define _RE1 0x02 2343 #define _TRISE2 0x04 2344 #define _RE2 0x04 2345 #define _TRISE3 0x08 2346 #define _RE3 0x08 2347 #define _TRISE4 0x10 2348 #define _RE4 0x10 2349 #define _TRISE5 0x20 2350 #define _RE5 0x20 2351 #define _TRISE6 0x40 2352 #define _RE6 0x40 2353 #define _TRISE7 0x80 2354 #define _RE7 0x80 2355 2356 //============================================================================== 2357 2358 2359 //============================================================================== 2360 // TRISE Bits 2361 2362 extern __at(0x0F96) __sfr TRISE; 2363 2364 typedef union 2365 { 2366 struct 2367 { 2368 unsigned TRISE0 : 1; 2369 unsigned TRISE1 : 1; 2370 unsigned TRISE2 : 1; 2371 unsigned TRISE3 : 1; 2372 unsigned TRISE4 : 1; 2373 unsigned TRISE5 : 1; 2374 unsigned TRISE6 : 1; 2375 unsigned TRISE7 : 1; 2376 }; 2377 2378 struct 2379 { 2380 unsigned RE0 : 1; 2381 unsigned RE1 : 1; 2382 unsigned RE2 : 1; 2383 unsigned RE3 : 1; 2384 unsigned RE4 : 1; 2385 unsigned RE5 : 1; 2386 unsigned RE6 : 1; 2387 unsigned RE7 : 1; 2388 }; 2389 } __TRISEbits_t; 2390 2391 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits; 2392 2393 #define _TRISE_TRISE0 0x01 2394 #define _TRISE_RE0 0x01 2395 #define _TRISE_TRISE1 0x02 2396 #define _TRISE_RE1 0x02 2397 #define _TRISE_TRISE2 0x04 2398 #define _TRISE_RE2 0x04 2399 #define _TRISE_TRISE3 0x08 2400 #define _TRISE_RE3 0x08 2401 #define _TRISE_TRISE4 0x10 2402 #define _TRISE_RE4 0x10 2403 #define _TRISE_TRISE5 0x20 2404 #define _TRISE_RE5 0x20 2405 #define _TRISE_TRISE6 0x40 2406 #define _TRISE_RE6 0x40 2407 #define _TRISE_TRISE7 0x80 2408 #define _TRISE_RE7 0x80 2409 2410 //============================================================================== 2411 2412 2413 //============================================================================== 2414 // DDRF Bits 2415 2416 extern __at(0x0F97) __sfr DDRF; 2417 2418 typedef union 2419 { 2420 struct 2421 { 2422 unsigned : 1; 2423 unsigned TRISF1 : 1; 2424 unsigned TRISF2 : 1; 2425 unsigned TRISF3 : 1; 2426 unsigned TRISF4 : 1; 2427 unsigned TRISF5 : 1; 2428 unsigned TRISF6 : 1; 2429 unsigned TRISF7 : 1; 2430 }; 2431 2432 struct 2433 { 2434 unsigned : 1; 2435 unsigned RF1 : 1; 2436 unsigned RF2 : 1; 2437 unsigned RF3 : 1; 2438 unsigned RF4 : 1; 2439 unsigned RF5 : 1; 2440 unsigned RF6 : 1; 2441 unsigned RF7 : 1; 2442 }; 2443 } __DDRFbits_t; 2444 2445 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits; 2446 2447 #define _TRISF1 0x02 2448 #define _RF1 0x02 2449 #define _TRISF2 0x04 2450 #define _RF2 0x04 2451 #define _TRISF3 0x08 2452 #define _RF3 0x08 2453 #define _TRISF4 0x10 2454 #define _RF4 0x10 2455 #define _TRISF5 0x20 2456 #define _RF5 0x20 2457 #define _TRISF6 0x40 2458 #define _RF6 0x40 2459 #define _TRISF7 0x80 2460 #define _RF7 0x80 2461 2462 //============================================================================== 2463 2464 2465 //============================================================================== 2466 // TRISF Bits 2467 2468 extern __at(0x0F97) __sfr TRISF; 2469 2470 typedef union 2471 { 2472 struct 2473 { 2474 unsigned : 1; 2475 unsigned TRISF1 : 1; 2476 unsigned TRISF2 : 1; 2477 unsigned TRISF3 : 1; 2478 unsigned TRISF4 : 1; 2479 unsigned TRISF5 : 1; 2480 unsigned TRISF6 : 1; 2481 unsigned TRISF7 : 1; 2482 }; 2483 2484 struct 2485 { 2486 unsigned : 1; 2487 unsigned RF1 : 1; 2488 unsigned RF2 : 1; 2489 unsigned RF3 : 1; 2490 unsigned RF4 : 1; 2491 unsigned RF5 : 1; 2492 unsigned RF6 : 1; 2493 unsigned RF7 : 1; 2494 }; 2495 } __TRISFbits_t; 2496 2497 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits; 2498 2499 #define _TRISF_TRISF1 0x02 2500 #define _TRISF_RF1 0x02 2501 #define _TRISF_TRISF2 0x04 2502 #define _TRISF_RF2 0x04 2503 #define _TRISF_TRISF3 0x08 2504 #define _TRISF_RF3 0x08 2505 #define _TRISF_TRISF4 0x10 2506 #define _TRISF_RF4 0x10 2507 #define _TRISF_TRISF5 0x20 2508 #define _TRISF_RF5 0x20 2509 #define _TRISF_TRISF6 0x40 2510 #define _TRISF_RF6 0x40 2511 #define _TRISF_TRISF7 0x80 2512 #define _TRISF_RF7 0x80 2513 2514 //============================================================================== 2515 2516 2517 //============================================================================== 2518 // DDRG Bits 2519 2520 extern __at(0x0F98) __sfr DDRG; 2521 2522 typedef union 2523 { 2524 struct 2525 { 2526 unsigned TRISG0 : 1; 2527 unsigned TRISG1 : 1; 2528 unsigned TRISG2 : 1; 2529 unsigned TRISG3 : 1; 2530 unsigned TRISG4 : 1; 2531 unsigned : 1; 2532 unsigned : 1; 2533 unsigned : 1; 2534 }; 2535 2536 struct 2537 { 2538 unsigned RG0 : 1; 2539 unsigned RG1 : 1; 2540 unsigned RG2 : 1; 2541 unsigned RG3 : 1; 2542 unsigned RG4 : 1; 2543 unsigned : 1; 2544 unsigned : 1; 2545 unsigned : 1; 2546 }; 2547 2548 struct 2549 { 2550 unsigned TRISG : 5; 2551 unsigned : 3; 2552 }; 2553 2554 struct 2555 { 2556 unsigned RG : 5; 2557 unsigned : 3; 2558 }; 2559 } __DDRGbits_t; 2560 2561 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits; 2562 2563 #define _TRISG0 0x01 2564 #define _RG0 0x01 2565 #define _TRISG1 0x02 2566 #define _RG1 0x02 2567 #define _TRISG2 0x04 2568 #define _RG2 0x04 2569 #define _TRISG3 0x08 2570 #define _RG3 0x08 2571 #define _TRISG4 0x10 2572 #define _RG4 0x10 2573 2574 //============================================================================== 2575 2576 2577 //============================================================================== 2578 // TRISG Bits 2579 2580 extern __at(0x0F98) __sfr TRISG; 2581 2582 typedef union 2583 { 2584 struct 2585 { 2586 unsigned TRISG0 : 1; 2587 unsigned TRISG1 : 1; 2588 unsigned TRISG2 : 1; 2589 unsigned TRISG3 : 1; 2590 unsigned TRISG4 : 1; 2591 unsigned : 1; 2592 unsigned : 1; 2593 unsigned : 1; 2594 }; 2595 2596 struct 2597 { 2598 unsigned RG0 : 1; 2599 unsigned RG1 : 1; 2600 unsigned RG2 : 1; 2601 unsigned RG3 : 1; 2602 unsigned RG4 : 1; 2603 unsigned : 1; 2604 unsigned : 1; 2605 unsigned : 1; 2606 }; 2607 2608 struct 2609 { 2610 unsigned TRISG : 5; 2611 unsigned : 3; 2612 }; 2613 2614 struct 2615 { 2616 unsigned RG : 5; 2617 unsigned : 3; 2618 }; 2619 } __TRISGbits_t; 2620 2621 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits; 2622 2623 #define _TRISG_TRISG0 0x01 2624 #define _TRISG_RG0 0x01 2625 #define _TRISG_TRISG1 0x02 2626 #define _TRISG_RG1 0x02 2627 #define _TRISG_TRISG2 0x04 2628 #define _TRISG_RG2 0x04 2629 #define _TRISG_TRISG3 0x08 2630 #define _TRISG_RG3 0x08 2631 #define _TRISG_TRISG4 0x10 2632 #define _TRISG_RG4 0x10 2633 2634 //============================================================================== 2635 2636 2637 //============================================================================== 2638 // OSCTUNE Bits 2639 2640 extern __at(0x0F9B) __sfr OSCTUNE; 2641 2642 typedef union 2643 { 2644 struct 2645 { 2646 unsigned TUN0 : 1; 2647 unsigned TUN1 : 1; 2648 unsigned TUN2 : 1; 2649 unsigned TUN3 : 1; 2650 unsigned TUN4 : 1; 2651 unsigned TUN5 : 1; 2652 unsigned PLLEN : 1; 2653 unsigned INTSRC : 1; 2654 }; 2655 2656 struct 2657 { 2658 unsigned TUN : 6; 2659 unsigned : 2; 2660 }; 2661 } __OSCTUNEbits_t; 2662 2663 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits; 2664 2665 #define _TUN0 0x01 2666 #define _TUN1 0x02 2667 #define _TUN2 0x04 2668 #define _TUN3 0x08 2669 #define _TUN4 0x10 2670 #define _TUN5 0x20 2671 #define _PLLEN 0x40 2672 #define _INTSRC 0x80 2673 2674 //============================================================================== 2675 2676 2677 //============================================================================== 2678 // RCSTA2 Bits 2679 2680 extern __at(0x0F9C) __sfr RCSTA2; 2681 2682 typedef union 2683 { 2684 struct 2685 { 2686 unsigned RX9D : 1; 2687 unsigned OERR : 1; 2688 unsigned FERR : 1; 2689 unsigned ADDEN : 1; 2690 unsigned CREN : 1; 2691 unsigned SREN : 1; 2692 unsigned RX9 : 1; 2693 unsigned SPEN : 1; 2694 }; 2695 2696 struct 2697 { 2698 unsigned RCD8 : 1; 2699 unsigned OERR2 : 1; 2700 unsigned FERR2 : 1; 2701 unsigned ADDEN2 : 1; 2702 unsigned CREN2 : 1; 2703 unsigned SREN2 : 1; 2704 unsigned RC9 : 1; 2705 unsigned SPEN2 : 1; 2706 }; 2707 2708 struct 2709 { 2710 unsigned RX9D2 : 1; 2711 unsigned : 1; 2712 unsigned : 1; 2713 unsigned : 1; 2714 unsigned : 1; 2715 unsigned : 1; 2716 unsigned NOT_RC8 : 1; 2717 unsigned : 1; 2718 }; 2719 2720 struct 2721 { 2722 unsigned : 1; 2723 unsigned : 1; 2724 unsigned : 1; 2725 unsigned : 1; 2726 unsigned : 1; 2727 unsigned : 1; 2728 unsigned RC8_9 : 1; 2729 unsigned : 1; 2730 }; 2731 2732 struct 2733 { 2734 unsigned : 1; 2735 unsigned : 1; 2736 unsigned : 1; 2737 unsigned : 1; 2738 unsigned : 1; 2739 unsigned : 1; 2740 unsigned RX92 : 1; 2741 unsigned : 1; 2742 }; 2743 } __RCSTA2bits_t; 2744 2745 extern __at(0x0F9C) volatile __RCSTA2bits_t RCSTA2bits; 2746 2747 #define _RCSTA2_RX9D 0x01 2748 #define _RCSTA2_RCD8 0x01 2749 #define _RCSTA2_RX9D2 0x01 2750 #define _RCSTA2_OERR 0x02 2751 #define _RCSTA2_OERR2 0x02 2752 #define _RCSTA2_FERR 0x04 2753 #define _RCSTA2_FERR2 0x04 2754 #define _RCSTA2_ADDEN 0x08 2755 #define _RCSTA2_ADDEN2 0x08 2756 #define _RCSTA2_CREN 0x10 2757 #define _RCSTA2_CREN2 0x10 2758 #define _RCSTA2_SREN 0x20 2759 #define _RCSTA2_SREN2 0x20 2760 #define _RCSTA2_RX9 0x40 2761 #define _RCSTA2_RC9 0x40 2762 #define _RCSTA2_NOT_RC8 0x40 2763 #define _RCSTA2_RC8_9 0x40 2764 #define _RCSTA2_RX92 0x40 2765 #define _RCSTA2_SPEN 0x80 2766 #define _RCSTA2_SPEN2 0x80 2767 2768 //============================================================================== 2769 2770 2771 //============================================================================== 2772 // PIE1 Bits 2773 2774 extern __at(0x0F9D) __sfr PIE1; 2775 2776 typedef union 2777 { 2778 struct 2779 { 2780 unsigned TMR1IE : 1; 2781 unsigned TMR2IE : 1; 2782 unsigned CCP1IE : 1; 2783 unsigned SSP1IE : 1; 2784 unsigned TX1IE : 1; 2785 unsigned RC1IE : 1; 2786 unsigned ADIE : 1; 2787 unsigned PMPIE : 1; 2788 }; 2789 2790 struct 2791 { 2792 unsigned : 1; 2793 unsigned : 1; 2794 unsigned : 1; 2795 unsigned SSPIE : 1; 2796 unsigned TXIE : 1; 2797 unsigned RCIE : 1; 2798 unsigned : 1; 2799 unsigned : 1; 2800 }; 2801 } __PIE1bits_t; 2802 2803 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits; 2804 2805 #define _TMR1IE 0x01 2806 #define _TMR2IE 0x02 2807 #define _CCP1IE 0x04 2808 #define _SSP1IE 0x08 2809 #define _SSPIE 0x08 2810 #define _TX1IE 0x10 2811 #define _TXIE 0x10 2812 #define _RC1IE 0x20 2813 #define _RCIE 0x20 2814 #define _ADIE 0x40 2815 #define _PMPIE 0x80 2816 2817 //============================================================================== 2818 2819 2820 //============================================================================== 2821 // PIR1 Bits 2822 2823 extern __at(0x0F9E) __sfr PIR1; 2824 2825 typedef union 2826 { 2827 struct 2828 { 2829 unsigned TMR1IF : 1; 2830 unsigned TMR2IF : 1; 2831 unsigned CCP1IF : 1; 2832 unsigned SSP1IF : 1; 2833 unsigned TX1IF : 1; 2834 unsigned RC1IF : 1; 2835 unsigned ADIF : 1; 2836 unsigned PMPIF : 1; 2837 }; 2838 2839 struct 2840 { 2841 unsigned : 1; 2842 unsigned : 1; 2843 unsigned : 1; 2844 unsigned SSPIF : 1; 2845 unsigned TXIF : 1; 2846 unsigned RCIF : 1; 2847 unsigned : 1; 2848 unsigned : 1; 2849 }; 2850 } __PIR1bits_t; 2851 2852 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits; 2853 2854 #define _TMR1IF 0x01 2855 #define _TMR2IF 0x02 2856 #define _CCP1IF 0x04 2857 #define _SSP1IF 0x08 2858 #define _SSPIF 0x08 2859 #define _TX1IF 0x10 2860 #define _TXIF 0x10 2861 #define _RC1IF 0x20 2862 #define _RCIF 0x20 2863 #define _ADIF 0x40 2864 #define _PMPIF 0x80 2865 2866 //============================================================================== 2867 2868 2869 //============================================================================== 2870 // IPR1 Bits 2871 2872 extern __at(0x0F9F) __sfr IPR1; 2873 2874 typedef union 2875 { 2876 struct 2877 { 2878 unsigned TMR1IP : 1; 2879 unsigned TMR2IP : 1; 2880 unsigned CCP1IP : 1; 2881 unsigned SSP1IP : 1; 2882 unsigned TX1IP : 1; 2883 unsigned RC1IP : 1; 2884 unsigned ADIP : 1; 2885 unsigned PMPIP : 1; 2886 }; 2887 2888 struct 2889 { 2890 unsigned : 1; 2891 unsigned : 1; 2892 unsigned : 1; 2893 unsigned SSPIP : 1; 2894 unsigned TXIP : 1; 2895 unsigned RCIP : 1; 2896 unsigned : 1; 2897 unsigned : 1; 2898 }; 2899 } __IPR1bits_t; 2900 2901 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits; 2902 2903 #define _TMR1IP 0x01 2904 #define _TMR2IP 0x02 2905 #define _CCP1IP 0x04 2906 #define _SSP1IP 0x08 2907 #define _SSPIP 0x08 2908 #define _TX1IP 0x10 2909 #define _TXIP 0x10 2910 #define _RC1IP 0x20 2911 #define _RCIP 0x20 2912 #define _ADIP 0x40 2913 #define _PMPIP 0x80 2914 2915 //============================================================================== 2916 2917 2918 //============================================================================== 2919 // PIE2 Bits 2920 2921 extern __at(0x0FA0) __sfr PIE2; 2922 2923 typedef union 2924 { 2925 struct 2926 { 2927 unsigned CCP2IE : 1; 2928 unsigned TMR3IE : 1; 2929 unsigned LVDIE : 1; 2930 unsigned BCL1IE : 1; 2931 unsigned : 1; 2932 unsigned CM1IE : 1; 2933 unsigned CM2IE : 1; 2934 unsigned OSCFIE : 1; 2935 }; 2936 2937 struct 2938 { 2939 unsigned : 1; 2940 unsigned : 1; 2941 unsigned : 1; 2942 unsigned BCLIE : 1; 2943 unsigned : 1; 2944 unsigned : 1; 2945 unsigned : 1; 2946 unsigned : 1; 2947 }; 2948 } __PIE2bits_t; 2949 2950 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits; 2951 2952 #define _CCP2IE 0x01 2953 #define _TMR3IE 0x02 2954 #define _LVDIE 0x04 2955 #define _BCL1IE 0x08 2956 #define _BCLIE 0x08 2957 #define _CM1IE 0x20 2958 #define _CM2IE 0x40 2959 #define _OSCFIE 0x80 2960 2961 //============================================================================== 2962 2963 2964 //============================================================================== 2965 // PIR2 Bits 2966 2967 extern __at(0x0FA1) __sfr PIR2; 2968 2969 typedef union 2970 { 2971 struct 2972 { 2973 unsigned CCP2IF : 1; 2974 unsigned TMR3IF : 1; 2975 unsigned LVDIF : 1; 2976 unsigned BCL1IF : 1; 2977 unsigned : 1; 2978 unsigned CM1IF : 1; 2979 unsigned CM2IF : 1; 2980 unsigned OSCFIF : 1; 2981 }; 2982 2983 struct 2984 { 2985 unsigned : 1; 2986 unsigned : 1; 2987 unsigned : 1; 2988 unsigned BCLIF : 1; 2989 unsigned : 1; 2990 unsigned : 1; 2991 unsigned : 1; 2992 unsigned : 1; 2993 }; 2994 } __PIR2bits_t; 2995 2996 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits; 2997 2998 #define _CCP2IF 0x01 2999 #define _TMR3IF 0x02 3000 #define _LVDIF 0x04 3001 #define _BCL1IF 0x08 3002 #define _BCLIF 0x08 3003 #define _CM1IF 0x20 3004 #define _CM2IF 0x40 3005 #define _OSCFIF 0x80 3006 3007 //============================================================================== 3008 3009 3010 //============================================================================== 3011 // IPR2 Bits 3012 3013 extern __at(0x0FA2) __sfr IPR2; 3014 3015 typedef union 3016 { 3017 struct 3018 { 3019 unsigned CCP2IP : 1; 3020 unsigned TMR3IP : 1; 3021 unsigned LVDIP : 1; 3022 unsigned BCL1IP : 1; 3023 unsigned : 1; 3024 unsigned CM1IP : 1; 3025 unsigned CM2IP : 1; 3026 unsigned OSCFIP : 1; 3027 }; 3028 3029 struct 3030 { 3031 unsigned : 1; 3032 unsigned : 1; 3033 unsigned : 1; 3034 unsigned BCLIP : 1; 3035 unsigned : 1; 3036 unsigned : 1; 3037 unsigned : 1; 3038 unsigned : 1; 3039 }; 3040 } __IPR2bits_t; 3041 3042 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits; 3043 3044 #define _CCP2IP 0x01 3045 #define _TMR3IP 0x02 3046 #define _LVDIP 0x04 3047 #define _BCL1IP 0x08 3048 #define _BCLIP 0x08 3049 #define _CM1IP 0x20 3050 #define _CM2IP 0x40 3051 #define _OSCFIP 0x80 3052 3053 //============================================================================== 3054 3055 3056 //============================================================================== 3057 // PIE3 Bits 3058 3059 extern __at(0x0FA3) __sfr PIE3; 3060 3061 typedef struct 3062 { 3063 unsigned CCP3IE : 1; 3064 unsigned CCP4IE : 1; 3065 unsigned CCP5IE : 1; 3066 unsigned TMR4IE : 1; 3067 unsigned TX2IE : 1; 3068 unsigned RC2IE : 1; 3069 unsigned BCL2IE : 1; 3070 unsigned SSP2IE : 1; 3071 } __PIE3bits_t; 3072 3073 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits; 3074 3075 #define _CCP3IE 0x01 3076 #define _CCP4IE 0x02 3077 #define _CCP5IE 0x04 3078 #define _TMR4IE 0x08 3079 #define _TX2IE 0x10 3080 #define _RC2IE 0x20 3081 #define _BCL2IE 0x40 3082 #define _SSP2IE 0x80 3083 3084 //============================================================================== 3085 3086 3087 //============================================================================== 3088 // PIR3 Bits 3089 3090 extern __at(0x0FA4) __sfr PIR3; 3091 3092 typedef struct 3093 { 3094 unsigned CCP3IF : 1; 3095 unsigned CCP4IF : 1; 3096 unsigned CCP5IF : 1; 3097 unsigned TMR4IF : 1; 3098 unsigned TX2IF : 1; 3099 unsigned RC2IF : 1; 3100 unsigned BCL2IF : 1; 3101 unsigned SSP2IF : 1; 3102 } __PIR3bits_t; 3103 3104 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits; 3105 3106 #define _CCP3IF 0x01 3107 #define _CCP4IF 0x02 3108 #define _CCP5IF 0x04 3109 #define _TMR4IF 0x08 3110 #define _TX2IF 0x10 3111 #define _RC2IF 0x20 3112 #define _BCL2IF 0x40 3113 #define _SSP2IF 0x80 3114 3115 //============================================================================== 3116 3117 3118 //============================================================================== 3119 // IPR3 Bits 3120 3121 extern __at(0x0FA5) __sfr IPR3; 3122 3123 typedef struct 3124 { 3125 unsigned CCP3IP : 1; 3126 unsigned CCP4IP : 1; 3127 unsigned CCP5IP : 1; 3128 unsigned TMR4IP : 1; 3129 unsigned TX2IP : 1; 3130 unsigned RC2IP : 1; 3131 unsigned BCL2IP : 1; 3132 unsigned SSP2IP : 1; 3133 } __IPR3bits_t; 3134 3135 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits; 3136 3137 #define _CCP3IP 0x01 3138 #define _CCP4IP 0x02 3139 #define _CCP5IP 0x04 3140 #define _TMR4IP 0x08 3141 #define _TX2IP 0x10 3142 #define _RC2IP 0x20 3143 #define _BCL2IP 0x40 3144 #define _SSP2IP 0x80 3145 3146 //============================================================================== 3147 3148 3149 //============================================================================== 3150 // EECON1 Bits 3151 3152 extern __at(0x0FA6) __sfr EECON1; 3153 3154 typedef struct 3155 { 3156 unsigned : 1; 3157 unsigned WR : 1; 3158 unsigned WREN : 1; 3159 unsigned WRERR : 1; 3160 unsigned FREE : 1; 3161 unsigned WPROG : 1; 3162 unsigned : 1; 3163 unsigned : 1; 3164 } __EECON1bits_t; 3165 3166 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits; 3167 3168 #define _WR 0x02 3169 #define _WREN 0x04 3170 #define _WRERR 0x08 3171 #define _FREE 0x10 3172 #define _WPROG 0x20 3173 3174 //============================================================================== 3175 3176 extern __at(0x0FA7) __sfr EECON2; 3177 3178 //============================================================================== 3179 // TXSTA2 Bits 3180 3181 extern __at(0x0FA8) __sfr TXSTA2; 3182 3183 typedef union 3184 { 3185 struct 3186 { 3187 unsigned TX9D : 1; 3188 unsigned TRMT : 1; 3189 unsigned BRGH : 1; 3190 unsigned SENDB : 1; 3191 unsigned SYNC : 1; 3192 unsigned TXEN : 1; 3193 unsigned TX9 : 1; 3194 unsigned CSRC : 1; 3195 }; 3196 3197 struct 3198 { 3199 unsigned TXD8 : 1; 3200 unsigned TRMT2 : 1; 3201 unsigned BRGH2 : 1; 3202 unsigned SENDB2 : 1; 3203 unsigned SYNC2 : 1; 3204 unsigned TXEN2 : 1; 3205 unsigned TX8_9 : 1; 3206 unsigned CSRC2 : 1; 3207 }; 3208 3209 struct 3210 { 3211 unsigned TX9D2 : 1; 3212 unsigned : 1; 3213 unsigned : 1; 3214 unsigned : 1; 3215 unsigned : 1; 3216 unsigned : 1; 3217 unsigned NOT_TX8 : 1; 3218 unsigned : 1; 3219 }; 3220 3221 struct 3222 { 3223 unsigned : 1; 3224 unsigned : 1; 3225 unsigned : 1; 3226 unsigned : 1; 3227 unsigned : 1; 3228 unsigned : 1; 3229 unsigned TX92 : 1; 3230 unsigned : 1; 3231 }; 3232 } __TXSTA2bits_t; 3233 3234 extern __at(0x0FA8) volatile __TXSTA2bits_t TXSTA2bits; 3235 3236 #define _TXSTA2_TX9D 0x01 3237 #define _TXSTA2_TXD8 0x01 3238 #define _TXSTA2_TX9D2 0x01 3239 #define _TXSTA2_TRMT 0x02 3240 #define _TXSTA2_TRMT2 0x02 3241 #define _TXSTA2_BRGH 0x04 3242 #define _TXSTA2_BRGH2 0x04 3243 #define _TXSTA2_SENDB 0x08 3244 #define _TXSTA2_SENDB2 0x08 3245 #define _TXSTA2_SYNC 0x10 3246 #define _TXSTA2_SYNC2 0x10 3247 #define _TXSTA2_TXEN 0x20 3248 #define _TXSTA2_TXEN2 0x20 3249 #define _TXSTA2_TX9 0x40 3250 #define _TXSTA2_TX8_9 0x40 3251 #define _TXSTA2_NOT_TX8 0x40 3252 #define _TXSTA2_TX92 0x40 3253 #define _TXSTA2_CSRC 0x80 3254 #define _TXSTA2_CSRC2 0x80 3255 3256 //============================================================================== 3257 3258 extern __at(0x0FA9) __sfr TXREG2; 3259 extern __at(0x0FAA) __sfr RCREG2; 3260 extern __at(0x0FAB) __sfr SPBRG2; 3261 3262 //============================================================================== 3263 // RCSTA Bits 3264 3265 extern __at(0x0FAC) __sfr RCSTA; 3266 3267 typedef union 3268 { 3269 struct 3270 { 3271 unsigned RX9D : 1; 3272 unsigned OERR : 1; 3273 unsigned FERR : 1; 3274 unsigned ADDEN : 1; 3275 unsigned CREN : 1; 3276 unsigned SREN : 1; 3277 unsigned RX9 : 1; 3278 unsigned SPEN : 1; 3279 }; 3280 3281 struct 3282 { 3283 unsigned RCD8 : 1; 3284 unsigned OERR1 : 1; 3285 unsigned FERR1 : 1; 3286 unsigned ADDEN1 : 1; 3287 unsigned CREN1 : 1; 3288 unsigned SREN1 : 1; 3289 unsigned RC9 : 1; 3290 unsigned SPEN1 : 1; 3291 }; 3292 3293 struct 3294 { 3295 unsigned RX9D1 : 1; 3296 unsigned : 1; 3297 unsigned : 1; 3298 unsigned : 1; 3299 unsigned : 1; 3300 unsigned : 1; 3301 unsigned NOT_RC8 : 1; 3302 unsigned : 1; 3303 }; 3304 3305 struct 3306 { 3307 unsigned : 1; 3308 unsigned : 1; 3309 unsigned : 1; 3310 unsigned : 1; 3311 unsigned : 1; 3312 unsigned : 1; 3313 unsigned RC8_9 : 1; 3314 unsigned : 1; 3315 }; 3316 3317 struct 3318 { 3319 unsigned : 1; 3320 unsigned : 1; 3321 unsigned : 1; 3322 unsigned : 1; 3323 unsigned : 1; 3324 unsigned : 1; 3325 unsigned RX91 : 1; 3326 unsigned : 1; 3327 }; 3328 } __RCSTAbits_t; 3329 3330 extern __at(0x0FAC) volatile __RCSTAbits_t RCSTAbits; 3331 3332 #define _RX9D 0x01 3333 #define _RCD8 0x01 3334 #define _RX9D1 0x01 3335 #define _OERR 0x02 3336 #define _OERR1 0x02 3337 #define _FERR 0x04 3338 #define _FERR1 0x04 3339 #define _ADDEN 0x08 3340 #define _ADDEN1 0x08 3341 #define _CREN 0x10 3342 #define _CREN1 0x10 3343 #define _SREN 0x20 3344 #define _SREN1 0x20 3345 #define _RX9 0x40 3346 #define _RC9 0x40 3347 #define _NOT_RC8 0x40 3348 #define _RC8_9 0x40 3349 #define _RX91 0x40 3350 #define _SPEN 0x80 3351 #define _SPEN1 0x80 3352 3353 //============================================================================== 3354 3355 3356 //============================================================================== 3357 // RCSTA1 Bits 3358 3359 extern __at(0x0FAC) __sfr RCSTA1; 3360 3361 typedef union 3362 { 3363 struct 3364 { 3365 unsigned RX9D : 1; 3366 unsigned OERR : 1; 3367 unsigned FERR : 1; 3368 unsigned ADDEN : 1; 3369 unsigned CREN : 1; 3370 unsigned SREN : 1; 3371 unsigned RX9 : 1; 3372 unsigned SPEN : 1; 3373 }; 3374 3375 struct 3376 { 3377 unsigned RCD8 : 1; 3378 unsigned OERR1 : 1; 3379 unsigned FERR1 : 1; 3380 unsigned ADDEN1 : 1; 3381 unsigned CREN1 : 1; 3382 unsigned SREN1 : 1; 3383 unsigned RC9 : 1; 3384 unsigned SPEN1 : 1; 3385 }; 3386 3387 struct 3388 { 3389 unsigned RX9D1 : 1; 3390 unsigned : 1; 3391 unsigned : 1; 3392 unsigned : 1; 3393 unsigned : 1; 3394 unsigned : 1; 3395 unsigned NOT_RC8 : 1; 3396 unsigned : 1; 3397 }; 3398 3399 struct 3400 { 3401 unsigned : 1; 3402 unsigned : 1; 3403 unsigned : 1; 3404 unsigned : 1; 3405 unsigned : 1; 3406 unsigned : 1; 3407 unsigned RC8_9 : 1; 3408 unsigned : 1; 3409 }; 3410 3411 struct 3412 { 3413 unsigned : 1; 3414 unsigned : 1; 3415 unsigned : 1; 3416 unsigned : 1; 3417 unsigned : 1; 3418 unsigned : 1; 3419 unsigned RX91 : 1; 3420 unsigned : 1; 3421 }; 3422 } __RCSTA1bits_t; 3423 3424 extern __at(0x0FAC) volatile __RCSTA1bits_t RCSTA1bits; 3425 3426 #define _RCSTA1_RX9D 0x01 3427 #define _RCSTA1_RCD8 0x01 3428 #define _RCSTA1_RX9D1 0x01 3429 #define _RCSTA1_OERR 0x02 3430 #define _RCSTA1_OERR1 0x02 3431 #define _RCSTA1_FERR 0x04 3432 #define _RCSTA1_FERR1 0x04 3433 #define _RCSTA1_ADDEN 0x08 3434 #define _RCSTA1_ADDEN1 0x08 3435 #define _RCSTA1_CREN 0x10 3436 #define _RCSTA1_CREN1 0x10 3437 #define _RCSTA1_SREN 0x20 3438 #define _RCSTA1_SREN1 0x20 3439 #define _RCSTA1_RX9 0x40 3440 #define _RCSTA1_RC9 0x40 3441 #define _RCSTA1_NOT_RC8 0x40 3442 #define _RCSTA1_RC8_9 0x40 3443 #define _RCSTA1_RX91 0x40 3444 #define _RCSTA1_SPEN 0x80 3445 #define _RCSTA1_SPEN1 0x80 3446 3447 //============================================================================== 3448 3449 3450 //============================================================================== 3451 // TXSTA Bits 3452 3453 extern __at(0x0FAD) __sfr TXSTA; 3454 3455 typedef union 3456 { 3457 struct 3458 { 3459 unsigned TX9D : 1; 3460 unsigned TRMT : 1; 3461 unsigned BRGH : 1; 3462 unsigned SENDB : 1; 3463 unsigned SYNC : 1; 3464 unsigned TXEN : 1; 3465 unsigned TX9 : 1; 3466 unsigned CSRC : 1; 3467 }; 3468 3469 struct 3470 { 3471 unsigned TXD8 : 1; 3472 unsigned TRMT1 : 1; 3473 unsigned BRGH1 : 1; 3474 unsigned SENDB1 : 1; 3475 unsigned SYNC1 : 1; 3476 unsigned TXEN1 : 1; 3477 unsigned TX8_9 : 1; 3478 unsigned CSRC1 : 1; 3479 }; 3480 3481 struct 3482 { 3483 unsigned TX9D1 : 1; 3484 unsigned : 1; 3485 unsigned : 1; 3486 unsigned : 1; 3487 unsigned : 1; 3488 unsigned : 1; 3489 unsigned NOT_TX8 : 1; 3490 unsigned : 1; 3491 }; 3492 3493 struct 3494 { 3495 unsigned : 1; 3496 unsigned : 1; 3497 unsigned : 1; 3498 unsigned : 1; 3499 unsigned : 1; 3500 unsigned : 1; 3501 unsigned TX91 : 1; 3502 unsigned : 1; 3503 }; 3504 } __TXSTAbits_t; 3505 3506 extern __at(0x0FAD) volatile __TXSTAbits_t TXSTAbits; 3507 3508 #define _TX9D 0x01 3509 #define _TXD8 0x01 3510 #define _TX9D1 0x01 3511 #define _TRMT 0x02 3512 #define _TRMT1 0x02 3513 #define _BRGH 0x04 3514 #define _BRGH1 0x04 3515 #define _SENDB 0x08 3516 #define _SENDB1 0x08 3517 #define _SYNC 0x10 3518 #define _SYNC1 0x10 3519 #define _TXEN 0x20 3520 #define _TXEN1 0x20 3521 #define _TX9 0x40 3522 #define _TX8_9 0x40 3523 #define _NOT_TX8 0x40 3524 #define _TX91 0x40 3525 #define _CSRC 0x80 3526 #define _CSRC1 0x80 3527 3528 //============================================================================== 3529 3530 3531 //============================================================================== 3532 // TXSTA1 Bits 3533 3534 extern __at(0x0FAD) __sfr TXSTA1; 3535 3536 typedef union 3537 { 3538 struct 3539 { 3540 unsigned TX9D : 1; 3541 unsigned TRMT : 1; 3542 unsigned BRGH : 1; 3543 unsigned SENDB : 1; 3544 unsigned SYNC : 1; 3545 unsigned TXEN : 1; 3546 unsigned TX9 : 1; 3547 unsigned CSRC : 1; 3548 }; 3549 3550 struct 3551 { 3552 unsigned TXD8 : 1; 3553 unsigned TRMT1 : 1; 3554 unsigned BRGH1 : 1; 3555 unsigned SENDB1 : 1; 3556 unsigned SYNC1 : 1; 3557 unsigned TXEN1 : 1; 3558 unsigned TX8_9 : 1; 3559 unsigned CSRC1 : 1; 3560 }; 3561 3562 struct 3563 { 3564 unsigned TX9D1 : 1; 3565 unsigned : 1; 3566 unsigned : 1; 3567 unsigned : 1; 3568 unsigned : 1; 3569 unsigned : 1; 3570 unsigned NOT_TX8 : 1; 3571 unsigned : 1; 3572 }; 3573 3574 struct 3575 { 3576 unsigned : 1; 3577 unsigned : 1; 3578 unsigned : 1; 3579 unsigned : 1; 3580 unsigned : 1; 3581 unsigned : 1; 3582 unsigned TX91 : 1; 3583 unsigned : 1; 3584 }; 3585 } __TXSTA1bits_t; 3586 3587 extern __at(0x0FAD) volatile __TXSTA1bits_t TXSTA1bits; 3588 3589 #define _TXSTA1_TX9D 0x01 3590 #define _TXSTA1_TXD8 0x01 3591 #define _TXSTA1_TX9D1 0x01 3592 #define _TXSTA1_TRMT 0x02 3593 #define _TXSTA1_TRMT1 0x02 3594 #define _TXSTA1_BRGH 0x04 3595 #define _TXSTA1_BRGH1 0x04 3596 #define _TXSTA1_SENDB 0x08 3597 #define _TXSTA1_SENDB1 0x08 3598 #define _TXSTA1_SYNC 0x10 3599 #define _TXSTA1_SYNC1 0x10 3600 #define _TXSTA1_TXEN 0x20 3601 #define _TXSTA1_TXEN1 0x20 3602 #define _TXSTA1_TX9 0x40 3603 #define _TXSTA1_TX8_9 0x40 3604 #define _TXSTA1_NOT_TX8 0x40 3605 #define _TXSTA1_TX91 0x40 3606 #define _TXSTA1_CSRC 0x80 3607 #define _TXSTA1_CSRC1 0x80 3608 3609 //============================================================================== 3610 3611 extern __at(0x0FAE) __sfr TXREG; 3612 extern __at(0x0FAE) __sfr TXREG1; 3613 extern __at(0x0FAF) __sfr RCREG; 3614 extern __at(0x0FAF) __sfr RCREG1; 3615 extern __at(0x0FB0) __sfr SPBRG; 3616 extern __at(0x0FB0) __sfr SPBRG1; 3617 3618 //============================================================================== 3619 // CCP3CON Bits 3620 3621 extern __at(0x0FB1) __sfr CCP3CON; 3622 3623 typedef union 3624 { 3625 struct 3626 { 3627 unsigned CCP3M0 : 1; 3628 unsigned CCP3M1 : 1; 3629 unsigned CCP3M2 : 1; 3630 unsigned CCP3M3 : 1; 3631 unsigned DC3B0 : 1; 3632 unsigned DC3B1 : 1; 3633 unsigned P3M0 : 1; 3634 unsigned P3M1 : 1; 3635 }; 3636 3637 struct 3638 { 3639 unsigned : 1; 3640 unsigned : 1; 3641 unsigned : 1; 3642 unsigned : 1; 3643 unsigned CCP3Y : 1; 3644 unsigned CCP3X : 1; 3645 unsigned : 1; 3646 unsigned : 1; 3647 }; 3648 3649 struct 3650 { 3651 unsigned CCP3M : 4; 3652 unsigned : 4; 3653 }; 3654 3655 struct 3656 { 3657 unsigned : 4; 3658 unsigned DC3B : 2; 3659 unsigned : 2; 3660 }; 3661 3662 struct 3663 { 3664 unsigned : 6; 3665 unsigned P3M : 2; 3666 }; 3667 } __CCP3CONbits_t; 3668 3669 extern __at(0x0FB1) volatile __CCP3CONbits_t CCP3CONbits; 3670 3671 #define _CCP3M0 0x01 3672 #define _CCP3M1 0x02 3673 #define _CCP3M2 0x04 3674 #define _CCP3M3 0x08 3675 #define _DC3B0 0x10 3676 #define _CCP3Y 0x10 3677 #define _DC3B1 0x20 3678 #define _CCP3X 0x20 3679 #define _P3M0 0x40 3680 #define _P3M1 0x80 3681 3682 //============================================================================== 3683 3684 3685 //============================================================================== 3686 // ECCP3CON Bits 3687 3688 extern __at(0x0FB1) __sfr ECCP3CON; 3689 3690 typedef union 3691 { 3692 struct 3693 { 3694 unsigned CCP3M0 : 1; 3695 unsigned CCP3M1 : 1; 3696 unsigned CCP3M2 : 1; 3697 unsigned CCP3M3 : 1; 3698 unsigned DC3B0 : 1; 3699 unsigned DC3B1 : 1; 3700 unsigned P3M0 : 1; 3701 unsigned P3M1 : 1; 3702 }; 3703 3704 struct 3705 { 3706 unsigned : 1; 3707 unsigned : 1; 3708 unsigned : 1; 3709 unsigned : 1; 3710 unsigned CCP3Y : 1; 3711 unsigned CCP3X : 1; 3712 unsigned : 1; 3713 unsigned : 1; 3714 }; 3715 3716 struct 3717 { 3718 unsigned CCP3M : 4; 3719 unsigned : 4; 3720 }; 3721 3722 struct 3723 { 3724 unsigned : 4; 3725 unsigned DC3B : 2; 3726 unsigned : 2; 3727 }; 3728 3729 struct 3730 { 3731 unsigned : 6; 3732 unsigned P3M : 2; 3733 }; 3734 } __ECCP3CONbits_t; 3735 3736 extern __at(0x0FB1) volatile __ECCP3CONbits_t ECCP3CONbits; 3737 3738 #define _ECCP3CON_CCP3M0 0x01 3739 #define _ECCP3CON_CCP3M1 0x02 3740 #define _ECCP3CON_CCP3M2 0x04 3741 #define _ECCP3CON_CCP3M3 0x08 3742 #define _ECCP3CON_DC3B0 0x10 3743 #define _ECCP3CON_CCP3Y 0x10 3744 #define _ECCP3CON_DC3B1 0x20 3745 #define _ECCP3CON_CCP3X 0x20 3746 #define _ECCP3CON_P3M0 0x40 3747 #define _ECCP3CON_P3M1 0x80 3748 3749 //============================================================================== 3750 3751 extern __at(0x0FB2) __sfr CCPR3; 3752 extern __at(0x0FB2) __sfr CCPR3L; 3753 extern __at(0x0FB3) __sfr CCPR3H; 3754 3755 //============================================================================== 3756 // ECCP3DEL Bits 3757 3758 extern __at(0x0FB4) __sfr ECCP3DEL; 3759 3760 typedef union 3761 { 3762 struct 3763 { 3764 unsigned PDC0 : 1; 3765 unsigned PDC1 : 1; 3766 unsigned PDC2 : 1; 3767 unsigned PDC3 : 1; 3768 unsigned PDC4 : 1; 3769 unsigned PDC5 : 1; 3770 unsigned PDC6 : 1; 3771 unsigned PRSEN : 1; 3772 }; 3773 3774 struct 3775 { 3776 unsigned P3DC0 : 1; 3777 unsigned P3DC1 : 1; 3778 unsigned P3DC2 : 1; 3779 unsigned P3DC3 : 1; 3780 unsigned P3DC4 : 1; 3781 unsigned P3DC5 : 1; 3782 unsigned P3DC6 : 1; 3783 unsigned P3RSEN : 1; 3784 }; 3785 3786 struct 3787 { 3788 unsigned PDC : 7; 3789 unsigned : 1; 3790 }; 3791 3792 struct 3793 { 3794 unsigned P3DC : 7; 3795 unsigned : 1; 3796 }; 3797 } __ECCP3DELbits_t; 3798 3799 extern __at(0x0FB4) volatile __ECCP3DELbits_t ECCP3DELbits; 3800 3801 #define _ECCP3DEL_PDC0 0x01 3802 #define _ECCP3DEL_P3DC0 0x01 3803 #define _ECCP3DEL_PDC1 0x02 3804 #define _ECCP3DEL_P3DC1 0x02 3805 #define _ECCP3DEL_PDC2 0x04 3806 #define _ECCP3DEL_P3DC2 0x04 3807 #define _ECCP3DEL_PDC3 0x08 3808 #define _ECCP3DEL_P3DC3 0x08 3809 #define _ECCP3DEL_PDC4 0x10 3810 #define _ECCP3DEL_P3DC4 0x10 3811 #define _ECCP3DEL_PDC5 0x20 3812 #define _ECCP3DEL_P3DC5 0x20 3813 #define _ECCP3DEL_PDC6 0x40 3814 #define _ECCP3DEL_P3DC6 0x40 3815 #define _ECCP3DEL_PRSEN 0x80 3816 #define _ECCP3DEL_P3RSEN 0x80 3817 3818 //============================================================================== 3819 3820 3821 //============================================================================== 3822 // ECCP3AS Bits 3823 3824 extern __at(0x0FB5) __sfr ECCP3AS; 3825 3826 typedef union 3827 { 3828 struct 3829 { 3830 unsigned PSSBD0 : 1; 3831 unsigned PSSBD1 : 1; 3832 unsigned PSSAC0 : 1; 3833 unsigned PSSAC1 : 1; 3834 unsigned ECCPAS0 : 1; 3835 unsigned ECCPAS1 : 1; 3836 unsigned ECCPAS2 : 1; 3837 unsigned ECCPASE : 1; 3838 }; 3839 3840 struct 3841 { 3842 unsigned PSS3BD0 : 1; 3843 unsigned PSS3BD1 : 1; 3844 unsigned PSS3AC0 : 1; 3845 unsigned PSS3AC1 : 1; 3846 unsigned ECCP3AS0 : 1; 3847 unsigned ECCP3AS1 : 1; 3848 unsigned ECCP3AS2 : 1; 3849 unsigned ECCP3ASE : 1; 3850 }; 3851 3852 struct 3853 { 3854 unsigned PSSBD : 2; 3855 unsigned : 6; 3856 }; 3857 3858 struct 3859 { 3860 unsigned PSS3BD : 2; 3861 unsigned : 6; 3862 }; 3863 3864 struct 3865 { 3866 unsigned : 2; 3867 unsigned PSSAC : 2; 3868 unsigned : 4; 3869 }; 3870 3871 struct 3872 { 3873 unsigned : 2; 3874 unsigned PSS3AC : 2; 3875 unsigned : 4; 3876 }; 3877 3878 struct 3879 { 3880 unsigned : 4; 3881 unsigned ECCPAS : 3; 3882 unsigned : 1; 3883 }; 3884 3885 struct 3886 { 3887 unsigned : 4; 3888 unsigned ECCP3AS : 3; 3889 unsigned : 1; 3890 }; 3891 } __ECCP3ASbits_t; 3892 3893 extern __at(0x0FB5) volatile __ECCP3ASbits_t ECCP3ASbits; 3894 3895 #define _ECCP3AS_PSSBD0 0x01 3896 #define _ECCP3AS_PSS3BD0 0x01 3897 #define _ECCP3AS_PSSBD1 0x02 3898 #define _ECCP3AS_PSS3BD1 0x02 3899 #define _ECCP3AS_PSSAC0 0x04 3900 #define _ECCP3AS_PSS3AC0 0x04 3901 #define _ECCP3AS_PSSAC1 0x08 3902 #define _ECCP3AS_PSS3AC1 0x08 3903 #define _ECCP3AS_ECCPAS0 0x10 3904 #define _ECCP3AS_ECCP3AS0 0x10 3905 #define _ECCP3AS_ECCPAS1 0x20 3906 #define _ECCP3AS_ECCP3AS1 0x20 3907 #define _ECCP3AS_ECCPAS2 0x40 3908 #define _ECCP3AS_ECCP3AS2 0x40 3909 #define _ECCP3AS_ECCPASE 0x80 3910 #define _ECCP3AS_ECCP3ASE 0x80 3911 3912 //============================================================================== 3913 3914 3915 //============================================================================== 3916 // CCP2CON Bits 3917 3918 extern __at(0x0FB6) __sfr CCP2CON; 3919 3920 typedef union 3921 { 3922 struct 3923 { 3924 unsigned CCP2M0 : 1; 3925 unsigned CCP2M1 : 1; 3926 unsigned CCP2M2 : 1; 3927 unsigned CCP2M3 : 1; 3928 unsigned DC2B0 : 1; 3929 unsigned DC2B1 : 1; 3930 unsigned P2M0 : 1; 3931 unsigned P2M1 : 1; 3932 }; 3933 3934 struct 3935 { 3936 unsigned : 1; 3937 unsigned : 1; 3938 unsigned : 1; 3939 unsigned : 1; 3940 unsigned CCP2Y : 1; 3941 unsigned CCP2X : 1; 3942 unsigned : 1; 3943 unsigned : 1; 3944 }; 3945 3946 struct 3947 { 3948 unsigned CCP2M : 4; 3949 unsigned : 4; 3950 }; 3951 3952 struct 3953 { 3954 unsigned : 4; 3955 unsigned DC2B : 2; 3956 unsigned : 2; 3957 }; 3958 3959 struct 3960 { 3961 unsigned : 6; 3962 unsigned P2M : 2; 3963 }; 3964 } __CCP2CONbits_t; 3965 3966 extern __at(0x0FB6) volatile __CCP2CONbits_t CCP2CONbits; 3967 3968 #define _CCP2M0 0x01 3969 #define _CCP2M1 0x02 3970 #define _CCP2M2 0x04 3971 #define _CCP2M3 0x08 3972 #define _DC2B0 0x10 3973 #define _CCP2Y 0x10 3974 #define _DC2B1 0x20 3975 #define _CCP2X 0x20 3976 #define _P2M0 0x40 3977 #define _P2M1 0x80 3978 3979 //============================================================================== 3980 3981 3982 //============================================================================== 3983 // ECCP2CON Bits 3984 3985 extern __at(0x0FB6) __sfr ECCP2CON; 3986 3987 typedef union 3988 { 3989 struct 3990 { 3991 unsigned CCP2M0 : 1; 3992 unsigned CCP2M1 : 1; 3993 unsigned CCP2M2 : 1; 3994 unsigned CCP2M3 : 1; 3995 unsigned DC2B0 : 1; 3996 unsigned DC2B1 : 1; 3997 unsigned P2M0 : 1; 3998 unsigned P2M1 : 1; 3999 }; 4000 4001 struct 4002 { 4003 unsigned : 1; 4004 unsigned : 1; 4005 unsigned : 1; 4006 unsigned : 1; 4007 unsigned CCP2Y : 1; 4008 unsigned CCP2X : 1; 4009 unsigned : 1; 4010 unsigned : 1; 4011 }; 4012 4013 struct 4014 { 4015 unsigned CCP2M : 4; 4016 unsigned : 4; 4017 }; 4018 4019 struct 4020 { 4021 unsigned : 4; 4022 unsigned DC2B : 2; 4023 unsigned : 2; 4024 }; 4025 4026 struct 4027 { 4028 unsigned : 6; 4029 unsigned P2M : 2; 4030 }; 4031 } __ECCP2CONbits_t; 4032 4033 extern __at(0x0FB6) volatile __ECCP2CONbits_t ECCP2CONbits; 4034 4035 #define _ECCP2CON_CCP2M0 0x01 4036 #define _ECCP2CON_CCP2M1 0x02 4037 #define _ECCP2CON_CCP2M2 0x04 4038 #define _ECCP2CON_CCP2M3 0x08 4039 #define _ECCP2CON_DC2B0 0x10 4040 #define _ECCP2CON_CCP2Y 0x10 4041 #define _ECCP2CON_DC2B1 0x20 4042 #define _ECCP2CON_CCP2X 0x20 4043 #define _ECCP2CON_P2M0 0x40 4044 #define _ECCP2CON_P2M1 0x80 4045 4046 //============================================================================== 4047 4048 extern __at(0x0FB7) __sfr CCPR2; 4049 extern __at(0x0FB7) __sfr CCPR2L; 4050 extern __at(0x0FB8) __sfr CCPR2H; 4051 4052 //============================================================================== 4053 // ECCP2DEL Bits 4054 4055 extern __at(0x0FB9) __sfr ECCP2DEL; 4056 4057 typedef union 4058 { 4059 struct 4060 { 4061 unsigned PDC0 : 1; 4062 unsigned PDC1 : 1; 4063 unsigned PDC2 : 1; 4064 unsigned PDC3 : 1; 4065 unsigned PDC4 : 1; 4066 unsigned PDC5 : 1; 4067 unsigned PDC6 : 1; 4068 unsigned PRSEN : 1; 4069 }; 4070 4071 struct 4072 { 4073 unsigned P2DC0 : 1; 4074 unsigned P2DC1 : 1; 4075 unsigned P2DC2 : 1; 4076 unsigned P2DC3 : 1; 4077 unsigned P2DC4 : 1; 4078 unsigned P2DC5 : 1; 4079 unsigned P2DC6 : 1; 4080 unsigned P2RSEN : 1; 4081 }; 4082 4083 struct 4084 { 4085 unsigned PDC : 7; 4086 unsigned : 1; 4087 }; 4088 4089 struct 4090 { 4091 unsigned P2DC : 7; 4092 unsigned : 1; 4093 }; 4094 } __ECCP2DELbits_t; 4095 4096 extern __at(0x0FB9) volatile __ECCP2DELbits_t ECCP2DELbits; 4097 4098 #define _ECCP2DEL_PDC0 0x01 4099 #define _ECCP2DEL_P2DC0 0x01 4100 #define _ECCP2DEL_PDC1 0x02 4101 #define _ECCP2DEL_P2DC1 0x02 4102 #define _ECCP2DEL_PDC2 0x04 4103 #define _ECCP2DEL_P2DC2 0x04 4104 #define _ECCP2DEL_PDC3 0x08 4105 #define _ECCP2DEL_P2DC3 0x08 4106 #define _ECCP2DEL_PDC4 0x10 4107 #define _ECCP2DEL_P2DC4 0x10 4108 #define _ECCP2DEL_PDC5 0x20 4109 #define _ECCP2DEL_P2DC5 0x20 4110 #define _ECCP2DEL_PDC6 0x40 4111 #define _ECCP2DEL_P2DC6 0x40 4112 #define _ECCP2DEL_PRSEN 0x80 4113 #define _ECCP2DEL_P2RSEN 0x80 4114 4115 //============================================================================== 4116 4117 4118 //============================================================================== 4119 // ECCP2AS Bits 4120 4121 extern __at(0x0FBA) __sfr ECCP2AS; 4122 4123 typedef union 4124 { 4125 struct 4126 { 4127 unsigned PSSBD0 : 1; 4128 unsigned PSSBD1 : 1; 4129 unsigned PSSAC0 : 1; 4130 unsigned PSSAC1 : 1; 4131 unsigned ECCPAS0 : 1; 4132 unsigned ECCPAS1 : 1; 4133 unsigned ECCPAS2 : 1; 4134 unsigned ECCPASE : 1; 4135 }; 4136 4137 struct 4138 { 4139 unsigned PSS2BD0 : 1; 4140 unsigned PSS2BD1 : 1; 4141 unsigned PSS2AC0 : 1; 4142 unsigned PSS2AC1 : 1; 4143 unsigned ECCP2AS0 : 1; 4144 unsigned ECCP2AS1 : 1; 4145 unsigned ECCP2AS2 : 1; 4146 unsigned ECCP2ASE : 1; 4147 }; 4148 4149 struct 4150 { 4151 unsigned PSS2BD : 2; 4152 unsigned : 6; 4153 }; 4154 4155 struct 4156 { 4157 unsigned PSSBD : 2; 4158 unsigned : 6; 4159 }; 4160 4161 struct 4162 { 4163 unsigned : 2; 4164 unsigned PSSAC : 2; 4165 unsigned : 4; 4166 }; 4167 4168 struct 4169 { 4170 unsigned : 2; 4171 unsigned PSS2AC : 2; 4172 unsigned : 4; 4173 }; 4174 4175 struct 4176 { 4177 unsigned : 4; 4178 unsigned ECCPAS : 3; 4179 unsigned : 1; 4180 }; 4181 4182 struct 4183 { 4184 unsigned : 4; 4185 unsigned ECCP2AS : 3; 4186 unsigned : 1; 4187 }; 4188 } __ECCP2ASbits_t; 4189 4190 extern __at(0x0FBA) volatile __ECCP2ASbits_t ECCP2ASbits; 4191 4192 #define _ECCP2AS_PSSBD0 0x01 4193 #define _ECCP2AS_PSS2BD0 0x01 4194 #define _ECCP2AS_PSSBD1 0x02 4195 #define _ECCP2AS_PSS2BD1 0x02 4196 #define _ECCP2AS_PSSAC0 0x04 4197 #define _ECCP2AS_PSS2AC0 0x04 4198 #define _ECCP2AS_PSSAC1 0x08 4199 #define _ECCP2AS_PSS2AC1 0x08 4200 #define _ECCP2AS_ECCPAS0 0x10 4201 #define _ECCP2AS_ECCP2AS0 0x10 4202 #define _ECCP2AS_ECCPAS1 0x20 4203 #define _ECCP2AS_ECCP2AS1 0x20 4204 #define _ECCP2AS_ECCPAS2 0x40 4205 #define _ECCP2AS_ECCP2AS2 0x40 4206 #define _ECCP2AS_ECCPASE 0x80 4207 #define _ECCP2AS_ECCP2ASE 0x80 4208 4209 //============================================================================== 4210 4211 4212 //============================================================================== 4213 // CCP1CON Bits 4214 4215 extern __at(0x0FBB) __sfr CCP1CON; 4216 4217 typedef union 4218 { 4219 struct 4220 { 4221 unsigned CCP1M0 : 1; 4222 unsigned CCP1M1 : 1; 4223 unsigned CCP1M2 : 1; 4224 unsigned CCP1M3 : 1; 4225 unsigned DC1B0 : 1; 4226 unsigned DC1B1 : 1; 4227 unsigned P1M0 : 1; 4228 unsigned P1M1 : 1; 4229 }; 4230 4231 struct 4232 { 4233 unsigned : 1; 4234 unsigned : 1; 4235 unsigned : 1; 4236 unsigned : 1; 4237 unsigned CCP1Y : 1; 4238 unsigned CCP1X : 1; 4239 unsigned : 1; 4240 unsigned : 1; 4241 }; 4242 4243 struct 4244 { 4245 unsigned CCP1M : 4; 4246 unsigned : 4; 4247 }; 4248 4249 struct 4250 { 4251 unsigned : 4; 4252 unsigned DC1B : 2; 4253 unsigned : 2; 4254 }; 4255 4256 struct 4257 { 4258 unsigned : 6; 4259 unsigned P1M : 2; 4260 }; 4261 } __CCP1CONbits_t; 4262 4263 extern __at(0x0FBB) volatile __CCP1CONbits_t CCP1CONbits; 4264 4265 #define _CCP1M0 0x01 4266 #define _CCP1M1 0x02 4267 #define _CCP1M2 0x04 4268 #define _CCP1M3 0x08 4269 #define _DC1B0 0x10 4270 #define _CCP1Y 0x10 4271 #define _DC1B1 0x20 4272 #define _CCP1X 0x20 4273 #define _P1M0 0x40 4274 #define _P1M1 0x80 4275 4276 //============================================================================== 4277 4278 4279 //============================================================================== 4280 // ECCP1CON Bits 4281 4282 extern __at(0x0FBB) __sfr ECCP1CON; 4283 4284 typedef union 4285 { 4286 struct 4287 { 4288 unsigned CCP1M0 : 1; 4289 unsigned CCP1M1 : 1; 4290 unsigned CCP1M2 : 1; 4291 unsigned CCP1M3 : 1; 4292 unsigned DC1B0 : 1; 4293 unsigned DC1B1 : 1; 4294 unsigned P1M0 : 1; 4295 unsigned P1M1 : 1; 4296 }; 4297 4298 struct 4299 { 4300 unsigned : 1; 4301 unsigned : 1; 4302 unsigned : 1; 4303 unsigned : 1; 4304 unsigned CCP1Y : 1; 4305 unsigned CCP1X : 1; 4306 unsigned : 1; 4307 unsigned : 1; 4308 }; 4309 4310 struct 4311 { 4312 unsigned CCP1M : 4; 4313 unsigned : 4; 4314 }; 4315 4316 struct 4317 { 4318 unsigned : 4; 4319 unsigned DC1B : 2; 4320 unsigned : 2; 4321 }; 4322 4323 struct 4324 { 4325 unsigned : 6; 4326 unsigned P1M : 2; 4327 }; 4328 } __ECCP1CONbits_t; 4329 4330 extern __at(0x0FBB) volatile __ECCP1CONbits_t ECCP1CONbits; 4331 4332 #define _ECCP1CON_CCP1M0 0x01 4333 #define _ECCP1CON_CCP1M1 0x02 4334 #define _ECCP1CON_CCP1M2 0x04 4335 #define _ECCP1CON_CCP1M3 0x08 4336 #define _ECCP1CON_DC1B0 0x10 4337 #define _ECCP1CON_CCP1Y 0x10 4338 #define _ECCP1CON_DC1B1 0x20 4339 #define _ECCP1CON_CCP1X 0x20 4340 #define _ECCP1CON_P1M0 0x40 4341 #define _ECCP1CON_P1M1 0x80 4342 4343 //============================================================================== 4344 4345 extern __at(0x0FBC) __sfr CCPR1; 4346 extern __at(0x0FBC) __sfr CCPR1L; 4347 extern __at(0x0FBD) __sfr CCPR1H; 4348 4349 //============================================================================== 4350 // ECCP1DEL Bits 4351 4352 extern __at(0x0FBE) __sfr ECCP1DEL; 4353 4354 typedef union 4355 { 4356 struct 4357 { 4358 unsigned PDC0 : 1; 4359 unsigned PDC1 : 1; 4360 unsigned PDC2 : 1; 4361 unsigned PDC3 : 1; 4362 unsigned PDC4 : 1; 4363 unsigned PDC5 : 1; 4364 unsigned PDC6 : 1; 4365 unsigned PRSEN : 1; 4366 }; 4367 4368 struct 4369 { 4370 unsigned P1DC0 : 1; 4371 unsigned P1DC1 : 1; 4372 unsigned P1DC2 : 1; 4373 unsigned P1DC3 : 1; 4374 unsigned P1DC4 : 1; 4375 unsigned P1DC5 : 1; 4376 unsigned P1DC6 : 1; 4377 unsigned P1RSEN : 1; 4378 }; 4379 4380 struct 4381 { 4382 unsigned PDC : 7; 4383 unsigned : 1; 4384 }; 4385 4386 struct 4387 { 4388 unsigned P1DC : 7; 4389 unsigned : 1; 4390 }; 4391 } __ECCP1DELbits_t; 4392 4393 extern __at(0x0FBE) volatile __ECCP1DELbits_t ECCP1DELbits; 4394 4395 #define _PDC0 0x01 4396 #define _P1DC0 0x01 4397 #define _PDC1 0x02 4398 #define _P1DC1 0x02 4399 #define _PDC2 0x04 4400 #define _P1DC2 0x04 4401 #define _PDC3 0x08 4402 #define _P1DC3 0x08 4403 #define _PDC4 0x10 4404 #define _P1DC4 0x10 4405 #define _PDC5 0x20 4406 #define _P1DC5 0x20 4407 #define _PDC6 0x40 4408 #define _P1DC6 0x40 4409 #define _PRSEN 0x80 4410 #define _P1RSEN 0x80 4411 4412 //============================================================================== 4413 4414 4415 //============================================================================== 4416 // ECCP1AS Bits 4417 4418 extern __at(0x0FBF) __sfr ECCP1AS; 4419 4420 typedef union 4421 { 4422 struct 4423 { 4424 unsigned PSSBD0 : 1; 4425 unsigned PSSBD1 : 1; 4426 unsigned PSSAC0 : 1; 4427 unsigned PSSAC1 : 1; 4428 unsigned ECCPAS0 : 1; 4429 unsigned ECCPAS1 : 1; 4430 unsigned ECCPAS2 : 1; 4431 unsigned ECCPASE : 1; 4432 }; 4433 4434 struct 4435 { 4436 unsigned PSS1BD0 : 1; 4437 unsigned PSS1BD1 : 1; 4438 unsigned PSS1AC0 : 1; 4439 unsigned PSS1AC1 : 1; 4440 unsigned ECCP1AS0 : 1; 4441 unsigned ECCP1AS1 : 1; 4442 unsigned ECCP1AS2 : 1; 4443 unsigned ECCP1ASE : 1; 4444 }; 4445 4446 struct 4447 { 4448 unsigned PSS1BD : 2; 4449 unsigned : 6; 4450 }; 4451 4452 struct 4453 { 4454 unsigned PSSBD : 2; 4455 unsigned : 6; 4456 }; 4457 4458 struct 4459 { 4460 unsigned : 2; 4461 unsigned PSS1AC : 2; 4462 unsigned : 4; 4463 }; 4464 4465 struct 4466 { 4467 unsigned : 2; 4468 unsigned PSSAC : 2; 4469 unsigned : 4; 4470 }; 4471 4472 struct 4473 { 4474 unsigned : 4; 4475 unsigned ECCP1AS : 3; 4476 unsigned : 1; 4477 }; 4478 4479 struct 4480 { 4481 unsigned : 4; 4482 unsigned ECCPAS : 3; 4483 unsigned : 1; 4484 }; 4485 } __ECCP1ASbits_t; 4486 4487 extern __at(0x0FBF) volatile __ECCP1ASbits_t ECCP1ASbits; 4488 4489 #define _PSSBD0 0x01 4490 #define _PSS1BD0 0x01 4491 #define _PSSBD1 0x02 4492 #define _PSS1BD1 0x02 4493 #define _PSSAC0 0x04 4494 #define _PSS1AC0 0x04 4495 #define _PSSAC1 0x08 4496 #define _PSS1AC1 0x08 4497 #define _ECCPAS0 0x10 4498 #define _ECCP1AS0 0x10 4499 #define _ECCPAS1 0x20 4500 #define _ECCP1AS1 0x20 4501 #define _ECCPAS2 0x40 4502 #define _ECCP1AS2 0x40 4503 #define _ECCPASE 0x80 4504 #define _ECCP1ASE 0x80 4505 4506 //============================================================================== 4507 4508 4509 //============================================================================== 4510 // WDTCON Bits 4511 4512 extern __at(0x0FC0) __sfr WDTCON; 4513 4514 typedef union 4515 { 4516 struct 4517 { 4518 unsigned SWDTEN : 1; 4519 unsigned : 1; 4520 unsigned : 1; 4521 unsigned : 1; 4522 unsigned ADSHR : 1; 4523 unsigned : 1; 4524 unsigned LVDSTAT : 1; 4525 unsigned REGSLP : 1; 4526 }; 4527 4528 struct 4529 { 4530 unsigned SWDTE : 1; 4531 unsigned : 1; 4532 unsigned : 1; 4533 unsigned : 1; 4534 unsigned DEVCFG : 1; 4535 unsigned : 1; 4536 unsigned : 1; 4537 unsigned : 1; 4538 }; 4539 } __WDTCONbits_t; 4540 4541 extern __at(0x0FC0) volatile __WDTCONbits_t WDTCONbits; 4542 4543 #define _SWDTEN 0x01 4544 #define _SWDTE 0x01 4545 #define _ADSHR 0x10 4546 #define _DEVCFG 0x10 4547 #define _LVDSTAT 0x40 4548 #define _REGSLP 0x80 4549 4550 //============================================================================== 4551 4552 4553 //============================================================================== 4554 // ADCON1 Bits 4555 4556 extern __at(0x0FC1) __sfr ADCON1; 4557 4558 typedef union 4559 { 4560 struct 4561 { 4562 unsigned ADCS0 : 1; 4563 unsigned ADCS1 : 1; 4564 unsigned ADCS2 : 1; 4565 unsigned ACQT0 : 1; 4566 unsigned ACQT1 : 1; 4567 unsigned ACQT2 : 1; 4568 unsigned ADCAL : 1; 4569 unsigned ADFM : 1; 4570 }; 4571 4572 struct 4573 { 4574 unsigned ADCS : 3; 4575 unsigned : 5; 4576 }; 4577 4578 struct 4579 { 4580 unsigned : 3; 4581 unsigned ACQT : 3; 4582 unsigned : 2; 4583 }; 4584 } __ADCON1bits_t; 4585 4586 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits; 4587 4588 #define _ADCS0 0x01 4589 #define _ADCS1 0x02 4590 #define _ADCS2 0x04 4591 #define _ACQT0 0x08 4592 #define _ACQT1 0x10 4593 #define _ACQT2 0x20 4594 #define _ADCAL 0x40 4595 #define _ADFM 0x80 4596 4597 //============================================================================== 4598 4599 4600 //============================================================================== 4601 // ANCON0 Bits 4602 4603 extern __at(0x0FC1) __sfr ANCON0; 4604 4605 typedef struct 4606 { 4607 unsigned PCFG0 : 1; 4608 unsigned PCFG1 : 1; 4609 unsigned PCFG2 : 1; 4610 unsigned PCFG3 : 1; 4611 unsigned PCFG4 : 1; 4612 unsigned : 1; 4613 unsigned PCFG6 : 1; 4614 unsigned PCFG7 : 1; 4615 } __ANCON0bits_t; 4616 4617 extern __at(0x0FC1) volatile __ANCON0bits_t ANCON0bits; 4618 4619 #define _PCFG0 0x01 4620 #define _PCFG1 0x02 4621 #define _PCFG2 0x04 4622 #define _PCFG3 0x08 4623 #define _PCFG4 0x10 4624 #define _PCFG6 0x40 4625 #define _PCFG7 0x80 4626 4627 //============================================================================== 4628 4629 4630 //============================================================================== 4631 // ADCON0 Bits 4632 4633 extern __at(0x0FC2) __sfr ADCON0; 4634 4635 typedef union 4636 { 4637 struct 4638 { 4639 unsigned ADON : 1; 4640 unsigned GO_NOT_DONE : 1; 4641 unsigned CHS0 : 1; 4642 unsigned CHS1 : 1; 4643 unsigned CHS2 : 1; 4644 unsigned CHS3 : 1; 4645 unsigned VCFG0 : 1; 4646 unsigned VCFG1 : 1; 4647 }; 4648 4649 struct 4650 { 4651 unsigned : 1; 4652 unsigned DONE : 1; 4653 unsigned : 1; 4654 unsigned : 1; 4655 unsigned : 1; 4656 unsigned : 1; 4657 unsigned : 1; 4658 unsigned : 1; 4659 }; 4660 4661 struct 4662 { 4663 unsigned : 1; 4664 unsigned GO_DONE : 1; 4665 unsigned : 1; 4666 unsigned : 1; 4667 unsigned : 1; 4668 unsigned : 1; 4669 unsigned : 1; 4670 unsigned : 1; 4671 }; 4672 4673 struct 4674 { 4675 unsigned : 1; 4676 unsigned GO : 1; 4677 unsigned : 1; 4678 unsigned : 1; 4679 unsigned : 1; 4680 unsigned : 1; 4681 unsigned : 1; 4682 unsigned : 1; 4683 }; 4684 4685 struct 4686 { 4687 unsigned : 1; 4688 unsigned NOT_DONE : 1; 4689 unsigned : 1; 4690 unsigned : 1; 4691 unsigned : 1; 4692 unsigned : 1; 4693 unsigned : 1; 4694 unsigned : 1; 4695 }; 4696 4697 struct 4698 { 4699 unsigned : 2; 4700 unsigned CHS : 4; 4701 unsigned : 2; 4702 }; 4703 4704 struct 4705 { 4706 unsigned : 6; 4707 unsigned VCFG : 2; 4708 }; 4709 } __ADCON0bits_t; 4710 4711 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits; 4712 4713 #define _ADON 0x01 4714 #define _GO_NOT_DONE 0x02 4715 #define _DONE 0x02 4716 #define _GO_DONE 0x02 4717 #define _GO 0x02 4718 #define _NOT_DONE 0x02 4719 #define _CHS0 0x04 4720 #define _CHS1 0x08 4721 #define _CHS2 0x10 4722 #define _CHS3 0x20 4723 #define _VCFG0 0x40 4724 #define _VCFG1 0x80 4725 4726 //============================================================================== 4727 4728 4729 //============================================================================== 4730 // ANCON1 Bits 4731 4732 extern __at(0x0FC2) __sfr ANCON1; 4733 4734 typedef struct 4735 { 4736 unsigned PCFG8 : 1; 4737 unsigned PCFG9 : 1; 4738 unsigned PCFG10 : 1; 4739 unsigned PCFG11 : 1; 4740 unsigned PCFG12 : 1; 4741 unsigned PCFG13 : 1; 4742 unsigned PCFG14 : 1; 4743 unsigned PCFG15 : 1; 4744 } __ANCON1bits_t; 4745 4746 extern __at(0x0FC2) volatile __ANCON1bits_t ANCON1bits; 4747 4748 #define _PCFG8 0x01 4749 #define _PCFG9 0x02 4750 #define _PCFG10 0x04 4751 #define _PCFG11 0x08 4752 #define _PCFG12 0x10 4753 #define _PCFG13 0x20 4754 #define _PCFG14 0x40 4755 #define _PCFG15 0x80 4756 4757 //============================================================================== 4758 4759 extern __at(0x0FC3) __sfr ADRES; 4760 extern __at(0x0FC3) __sfr ADRESL; 4761 extern __at(0x0FC4) __sfr ADRESH; 4762 4763 //============================================================================== 4764 // SSP1CON2 Bits 4765 4766 extern __at(0x0FC5) __sfr SSP1CON2; 4767 4768 typedef union 4769 { 4770 struct 4771 { 4772 unsigned SEN : 1; 4773 unsigned RSEN : 1; 4774 unsigned PEN : 1; 4775 unsigned RCEN : 1; 4776 unsigned ACKEN : 1; 4777 unsigned ACKDT : 1; 4778 unsigned ACKSTAT : 1; 4779 unsigned GCEN : 1; 4780 }; 4781 4782 struct 4783 { 4784 unsigned : 1; 4785 unsigned ADMSK1 : 1; 4786 unsigned ADMSK2 : 1; 4787 unsigned ADMSK3 : 1; 4788 unsigned ADMSK4 : 1; 4789 unsigned ADMSK5 : 1; 4790 unsigned : 1; 4791 unsigned : 1; 4792 }; 4793 } __SSP1CON2bits_t; 4794 4795 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits; 4796 4797 #define _SEN 0x01 4798 #define _RSEN 0x02 4799 #define _ADMSK1 0x02 4800 #define _PEN 0x04 4801 #define _ADMSK2 0x04 4802 #define _RCEN 0x08 4803 #define _ADMSK3 0x08 4804 #define _ACKEN 0x10 4805 #define _ADMSK4 0x10 4806 #define _ACKDT 0x20 4807 #define _ADMSK5 0x20 4808 #define _ACKSTAT 0x40 4809 #define _GCEN 0x80 4810 4811 //============================================================================== 4812 4813 4814 //============================================================================== 4815 // SSPCON2 Bits 4816 4817 extern __at(0x0FC5) __sfr SSPCON2; 4818 4819 typedef union 4820 { 4821 struct 4822 { 4823 unsigned SEN : 1; 4824 unsigned RSEN : 1; 4825 unsigned PEN : 1; 4826 unsigned RCEN : 1; 4827 unsigned ACKEN : 1; 4828 unsigned ACKDT : 1; 4829 unsigned ACKSTAT : 1; 4830 unsigned GCEN : 1; 4831 }; 4832 4833 struct 4834 { 4835 unsigned : 1; 4836 unsigned ADMSK1 : 1; 4837 unsigned ADMSK2 : 1; 4838 unsigned ADMSK3 : 1; 4839 unsigned ADMSK4 : 1; 4840 unsigned ADMSK5 : 1; 4841 unsigned : 1; 4842 unsigned : 1; 4843 }; 4844 } __SSPCON2bits_t; 4845 4846 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits; 4847 4848 #define _SSPCON2_SEN 0x01 4849 #define _SSPCON2_RSEN 0x02 4850 #define _SSPCON2_ADMSK1 0x02 4851 #define _SSPCON2_PEN 0x04 4852 #define _SSPCON2_ADMSK2 0x04 4853 #define _SSPCON2_RCEN 0x08 4854 #define _SSPCON2_ADMSK3 0x08 4855 #define _SSPCON2_ACKEN 0x10 4856 #define _SSPCON2_ADMSK4 0x10 4857 #define _SSPCON2_ACKDT 0x20 4858 #define _SSPCON2_ADMSK5 0x20 4859 #define _SSPCON2_ACKSTAT 0x40 4860 #define _SSPCON2_GCEN 0x80 4861 4862 //============================================================================== 4863 4864 4865 //============================================================================== 4866 // SSP1CON1 Bits 4867 4868 extern __at(0x0FC6) __sfr SSP1CON1; 4869 4870 typedef union 4871 { 4872 struct 4873 { 4874 unsigned SSPM0 : 1; 4875 unsigned SSPM1 : 1; 4876 unsigned SSPM2 : 1; 4877 unsigned SSPM3 : 1; 4878 unsigned CKP : 1; 4879 unsigned SSPEN : 1; 4880 unsigned SSPOV : 1; 4881 unsigned WCOL : 1; 4882 }; 4883 4884 struct 4885 { 4886 unsigned SSPM : 4; 4887 unsigned : 4; 4888 }; 4889 } __SSP1CON1bits_t; 4890 4891 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits; 4892 4893 #define _SSPM0 0x01 4894 #define _SSPM1 0x02 4895 #define _SSPM2 0x04 4896 #define _SSPM3 0x08 4897 #define _CKP 0x10 4898 #define _SSPEN 0x20 4899 #define _SSPOV 0x40 4900 #define _WCOL 0x80 4901 4902 //============================================================================== 4903 4904 4905 //============================================================================== 4906 // SSPCON1 Bits 4907 4908 extern __at(0x0FC6) __sfr SSPCON1; 4909 4910 typedef union 4911 { 4912 struct 4913 { 4914 unsigned SSPM0 : 1; 4915 unsigned SSPM1 : 1; 4916 unsigned SSPM2 : 1; 4917 unsigned SSPM3 : 1; 4918 unsigned CKP : 1; 4919 unsigned SSPEN : 1; 4920 unsigned SSPOV : 1; 4921 unsigned WCOL : 1; 4922 }; 4923 4924 struct 4925 { 4926 unsigned SSPM : 4; 4927 unsigned : 4; 4928 }; 4929 } __SSPCON1bits_t; 4930 4931 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits; 4932 4933 #define _SSPCON1_SSPM0 0x01 4934 #define _SSPCON1_SSPM1 0x02 4935 #define _SSPCON1_SSPM2 0x04 4936 #define _SSPCON1_SSPM3 0x08 4937 #define _SSPCON1_CKP 0x10 4938 #define _SSPCON1_SSPEN 0x20 4939 #define _SSPCON1_SSPOV 0x40 4940 #define _SSPCON1_WCOL 0x80 4941 4942 //============================================================================== 4943 4944 4945 //============================================================================== 4946 // SSP1STAT Bits 4947 4948 extern __at(0x0FC7) __sfr SSP1STAT; 4949 4950 typedef union 4951 { 4952 struct 4953 { 4954 unsigned BF : 1; 4955 unsigned UA : 1; 4956 unsigned R_NOT_W : 1; 4957 unsigned S : 1; 4958 unsigned P : 1; 4959 unsigned D_NOT_A : 1; 4960 unsigned CKE : 1; 4961 unsigned SMP : 1; 4962 }; 4963 4964 struct 4965 { 4966 unsigned : 1; 4967 unsigned : 1; 4968 unsigned R_W : 1; 4969 unsigned I2C_START : 1; 4970 unsigned I2C_STOP : 1; 4971 unsigned D_A : 1; 4972 unsigned : 1; 4973 unsigned : 1; 4974 }; 4975 4976 struct 4977 { 4978 unsigned : 1; 4979 unsigned : 1; 4980 unsigned I2C_READ : 1; 4981 unsigned : 1; 4982 unsigned : 1; 4983 unsigned I2C_DAT : 1; 4984 unsigned : 1; 4985 unsigned : 1; 4986 }; 4987 4988 struct 4989 { 4990 unsigned : 1; 4991 unsigned : 1; 4992 unsigned NOT_W : 1; 4993 unsigned : 1; 4994 unsigned : 1; 4995 unsigned NOT_A : 1; 4996 unsigned : 1; 4997 unsigned : 1; 4998 }; 4999 5000 struct 5001 { 5002 unsigned : 1; 5003 unsigned : 1; 5004 unsigned NOT_WRITE : 1; 5005 unsigned : 1; 5006 unsigned : 1; 5007 unsigned NOT_ADDRESS : 1; 5008 unsigned : 1; 5009 unsigned : 1; 5010 }; 5011 5012 struct 5013 { 5014 unsigned : 1; 5015 unsigned : 1; 5016 unsigned READ_WRITE : 1; 5017 unsigned : 1; 5018 unsigned : 1; 5019 unsigned DATA_ADDRESS : 1; 5020 unsigned : 1; 5021 unsigned : 1; 5022 }; 5023 5024 struct 5025 { 5026 unsigned : 1; 5027 unsigned : 1; 5028 unsigned R : 1; 5029 unsigned : 1; 5030 unsigned : 1; 5031 unsigned D : 1; 5032 unsigned : 1; 5033 unsigned : 1; 5034 }; 5035 } __SSP1STATbits_t; 5036 5037 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits; 5038 5039 #define _BF 0x01 5040 #define _UA 0x02 5041 #define _R_NOT_W 0x04 5042 #define _R_W 0x04 5043 #define _I2C_READ 0x04 5044 #define _NOT_W 0x04 5045 #define _NOT_WRITE 0x04 5046 #define _READ_WRITE 0x04 5047 #define _R 0x04 5048 #define _S 0x08 5049 #define _I2C_START 0x08 5050 #define _P 0x10 5051 #define _I2C_STOP 0x10 5052 #define _D_NOT_A 0x20 5053 #define _D_A 0x20 5054 #define _I2C_DAT 0x20 5055 #define _NOT_A 0x20 5056 #define _NOT_ADDRESS 0x20 5057 #define _DATA_ADDRESS 0x20 5058 #define _D 0x20 5059 #define _CKE 0x40 5060 #define _SMP 0x80 5061 5062 //============================================================================== 5063 5064 5065 //============================================================================== 5066 // SSPSTAT Bits 5067 5068 extern __at(0x0FC7) __sfr SSPSTAT; 5069 5070 typedef union 5071 { 5072 struct 5073 { 5074 unsigned BF : 1; 5075 unsigned UA : 1; 5076 unsigned R_NOT_W : 1; 5077 unsigned S : 1; 5078 unsigned P : 1; 5079 unsigned D_NOT_A : 1; 5080 unsigned CKE : 1; 5081 unsigned SMP : 1; 5082 }; 5083 5084 struct 5085 { 5086 unsigned : 1; 5087 unsigned : 1; 5088 unsigned R_W : 1; 5089 unsigned I2C_START : 1; 5090 unsigned I2C_STOP : 1; 5091 unsigned D_A : 1; 5092 unsigned : 1; 5093 unsigned : 1; 5094 }; 5095 5096 struct 5097 { 5098 unsigned : 1; 5099 unsigned : 1; 5100 unsigned I2C_READ : 1; 5101 unsigned : 1; 5102 unsigned : 1; 5103 unsigned I2C_DAT : 1; 5104 unsigned : 1; 5105 unsigned : 1; 5106 }; 5107 5108 struct 5109 { 5110 unsigned : 1; 5111 unsigned : 1; 5112 unsigned NOT_W : 1; 5113 unsigned : 1; 5114 unsigned : 1; 5115 unsigned NOT_A : 1; 5116 unsigned : 1; 5117 unsigned : 1; 5118 }; 5119 5120 struct 5121 { 5122 unsigned : 1; 5123 unsigned : 1; 5124 unsigned NOT_WRITE : 1; 5125 unsigned : 1; 5126 unsigned : 1; 5127 unsigned NOT_ADDRESS : 1; 5128 unsigned : 1; 5129 unsigned : 1; 5130 }; 5131 5132 struct 5133 { 5134 unsigned : 1; 5135 unsigned : 1; 5136 unsigned READ_WRITE : 1; 5137 unsigned : 1; 5138 unsigned : 1; 5139 unsigned DATA_ADDRESS : 1; 5140 unsigned : 1; 5141 unsigned : 1; 5142 }; 5143 5144 struct 5145 { 5146 unsigned : 1; 5147 unsigned : 1; 5148 unsigned R : 1; 5149 unsigned : 1; 5150 unsigned : 1; 5151 unsigned D : 1; 5152 unsigned : 1; 5153 unsigned : 1; 5154 }; 5155 } __SSPSTATbits_t; 5156 5157 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits; 5158 5159 #define _SSPSTAT_BF 0x01 5160 #define _SSPSTAT_UA 0x02 5161 #define _SSPSTAT_R_NOT_W 0x04 5162 #define _SSPSTAT_R_W 0x04 5163 #define _SSPSTAT_I2C_READ 0x04 5164 #define _SSPSTAT_NOT_W 0x04 5165 #define _SSPSTAT_NOT_WRITE 0x04 5166 #define _SSPSTAT_READ_WRITE 0x04 5167 #define _SSPSTAT_R 0x04 5168 #define _SSPSTAT_S 0x08 5169 #define _SSPSTAT_I2C_START 0x08 5170 #define _SSPSTAT_P 0x10 5171 #define _SSPSTAT_I2C_STOP 0x10 5172 #define _SSPSTAT_D_NOT_A 0x20 5173 #define _SSPSTAT_D_A 0x20 5174 #define _SSPSTAT_I2C_DAT 0x20 5175 #define _SSPSTAT_NOT_A 0x20 5176 #define _SSPSTAT_NOT_ADDRESS 0x20 5177 #define _SSPSTAT_DATA_ADDRESS 0x20 5178 #define _SSPSTAT_D 0x20 5179 #define _SSPSTAT_CKE 0x40 5180 #define _SSPSTAT_SMP 0x80 5181 5182 //============================================================================== 5183 5184 extern __at(0x0FC8) __sfr SSP1ADD; 5185 5186 //============================================================================== 5187 // SSP1MSK Bits 5188 5189 extern __at(0x0FC8) __sfr SSP1MSK; 5190 5191 typedef struct 5192 { 5193 unsigned MSK0 : 1; 5194 unsigned MSK1 : 1; 5195 unsigned MSK2 : 1; 5196 unsigned MSK3 : 1; 5197 unsigned MSK4 : 1; 5198 unsigned MSK5 : 1; 5199 unsigned MSK6 : 1; 5200 unsigned MSK7 : 1; 5201 } __SSP1MSKbits_t; 5202 5203 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits; 5204 5205 #define _MSK0 0x01 5206 #define _MSK1 0x02 5207 #define _MSK2 0x04 5208 #define _MSK3 0x08 5209 #define _MSK4 0x10 5210 #define _MSK5 0x20 5211 #define _MSK6 0x40 5212 #define _MSK7 0x80 5213 5214 //============================================================================== 5215 5216 extern __at(0x0FC8) __sfr SSPADD; 5217 extern __at(0x0FC9) __sfr SSP1BUF; 5218 extern __at(0x0FC9) __sfr SSPBUF; 5219 5220 //============================================================================== 5221 // T2CON Bits 5222 5223 extern __at(0x0FCA) __sfr T2CON; 5224 5225 typedef union 5226 { 5227 struct 5228 { 5229 unsigned T2CKPS0 : 1; 5230 unsigned T2CKPS1 : 1; 5231 unsigned TMR2ON : 1; 5232 unsigned T2OUTPS0 : 1; 5233 unsigned T2OUTPS1 : 1; 5234 unsigned T2OUTPS2 : 1; 5235 unsigned T2OUTPS3 : 1; 5236 unsigned : 1; 5237 }; 5238 5239 struct 5240 { 5241 unsigned T2CKPS : 2; 5242 unsigned : 6; 5243 }; 5244 5245 struct 5246 { 5247 unsigned : 3; 5248 unsigned T2OUTPS : 4; 5249 unsigned : 1; 5250 }; 5251 } __T2CONbits_t; 5252 5253 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits; 5254 5255 #define _T2CKPS0 0x01 5256 #define _T2CKPS1 0x02 5257 #define _TMR2ON 0x04 5258 #define _T2OUTPS0 0x08 5259 #define _T2OUTPS1 0x10 5260 #define _T2OUTPS2 0x20 5261 #define _T2OUTPS3 0x40 5262 5263 //============================================================================== 5264 5265 extern __at(0x0FCB) __sfr PR2; 5266 5267 //============================================================================== 5268 // PADCFG1 Bits 5269 5270 extern __at(0x0FCC) __sfr PADCFG1; 5271 5272 typedef union 5273 { 5274 struct 5275 { 5276 unsigned PMPTL : 1; 5277 unsigned : 1; 5278 unsigned : 1; 5279 unsigned : 1; 5280 unsigned : 1; 5281 unsigned : 1; 5282 unsigned : 1; 5283 unsigned : 1; 5284 }; 5285 5286 struct 5287 { 5288 unsigned PMPTTL : 1; 5289 unsigned : 1; 5290 unsigned : 1; 5291 unsigned : 1; 5292 unsigned : 1; 5293 unsigned : 1; 5294 unsigned : 1; 5295 unsigned : 1; 5296 }; 5297 } __PADCFG1bits_t; 5298 5299 extern __at(0x0FCC) volatile __PADCFG1bits_t PADCFG1bits; 5300 5301 #define _PMPTL 0x01 5302 #define _PMPTTL 0x01 5303 5304 //============================================================================== 5305 5306 extern __at(0x0FCC) __sfr TMR2; 5307 5308 //============================================================================== 5309 // ODCON3 Bits 5310 5311 extern __at(0x0FCD) __sfr ODCON3; 5312 5313 typedef struct 5314 { 5315 unsigned SPI1OD : 1; 5316 unsigned SPI2OD : 1; 5317 unsigned : 1; 5318 unsigned : 1; 5319 unsigned : 1; 5320 unsigned : 1; 5321 unsigned : 1; 5322 unsigned : 1; 5323 } __ODCON3bits_t; 5324 5325 extern __at(0x0FCD) volatile __ODCON3bits_t ODCON3bits; 5326 5327 #define _SPI1OD 0x01 5328 #define _SPI2OD 0x02 5329 5330 //============================================================================== 5331 5332 5333 //============================================================================== 5334 // T1CON Bits 5335 5336 extern __at(0x0FCD) __sfr T1CON; 5337 5338 typedef union 5339 { 5340 struct 5341 { 5342 unsigned TMR1ON : 1; 5343 unsigned TMR1CS : 1; 5344 unsigned NOT_T1SYNC : 1; 5345 unsigned T1OSCEN : 1; 5346 unsigned T1CKPS0 : 1; 5347 unsigned T1CKPS1 : 1; 5348 unsigned T1RUN : 1; 5349 unsigned RD16 : 1; 5350 }; 5351 5352 struct 5353 { 5354 unsigned : 1; 5355 unsigned : 1; 5356 unsigned T1SYNC : 1; 5357 unsigned : 1; 5358 unsigned : 1; 5359 unsigned : 1; 5360 unsigned : 1; 5361 unsigned : 1; 5362 }; 5363 5364 struct 5365 { 5366 unsigned : 1; 5367 unsigned : 1; 5368 unsigned T1INSYNC : 1; 5369 unsigned : 1; 5370 unsigned : 1; 5371 unsigned : 1; 5372 unsigned : 1; 5373 unsigned : 1; 5374 }; 5375 5376 struct 5377 { 5378 unsigned : 4; 5379 unsigned T1CKPS : 2; 5380 unsigned : 2; 5381 }; 5382 } __T1CONbits_t; 5383 5384 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits; 5385 5386 #define _TMR1ON 0x01 5387 #define _TMR1CS 0x02 5388 #define _NOT_T1SYNC 0x04 5389 #define _T1SYNC 0x04 5390 #define _T1INSYNC 0x04 5391 #define _T1OSCEN 0x08 5392 #define _T1CKPS0 0x10 5393 #define _T1CKPS1 0x20 5394 #define _T1RUN 0x40 5395 #define _RD16 0x80 5396 5397 //============================================================================== 5398 5399 5400 //============================================================================== 5401 // ODCON2 Bits 5402 5403 extern __at(0x0FCE) __sfr ODCON2; 5404 5405 typedef union 5406 { 5407 struct 5408 { 5409 unsigned USART1OD : 1; 5410 unsigned USART2OD : 1; 5411 unsigned : 1; 5412 unsigned : 1; 5413 unsigned : 1; 5414 unsigned : 1; 5415 unsigned : 1; 5416 unsigned : 1; 5417 }; 5418 5419 struct 5420 { 5421 unsigned U1OD : 1; 5422 unsigned U2OD : 1; 5423 unsigned : 1; 5424 unsigned : 1; 5425 unsigned : 1; 5426 unsigned : 1; 5427 unsigned : 1; 5428 unsigned : 1; 5429 }; 5430 } __ODCON2bits_t; 5431 5432 extern __at(0x0FCE) volatile __ODCON2bits_t ODCON2bits; 5433 5434 #define _USART1OD 0x01 5435 #define _U1OD 0x01 5436 #define _USART2OD 0x02 5437 #define _U2OD 0x02 5438 5439 //============================================================================== 5440 5441 extern __at(0x0FCE) __sfr TMR1; 5442 extern __at(0x0FCE) __sfr TMR1L; 5443 5444 //============================================================================== 5445 // ODCON1 Bits 5446 5447 extern __at(0x0FCF) __sfr ODCON1; 5448 5449 typedef struct 5450 { 5451 unsigned ECCP1OD : 1; 5452 unsigned ECCP2OD : 1; 5453 unsigned ECCP3OD : 1; 5454 unsigned CCP4OD : 1; 5455 unsigned CCP5OD : 1; 5456 unsigned : 1; 5457 unsigned : 1; 5458 unsigned : 1; 5459 } __ODCON1bits_t; 5460 5461 extern __at(0x0FCF) volatile __ODCON1bits_t ODCON1bits; 5462 5463 #define _ECCP1OD 0x01 5464 #define _ECCP2OD 0x02 5465 #define _ECCP3OD 0x04 5466 #define _CCP4OD 0x08 5467 #define _CCP5OD 0x10 5468 5469 //============================================================================== 5470 5471 extern __at(0x0FCF) __sfr TMR1H; 5472 5473 //============================================================================== 5474 // RCON Bits 5475 5476 extern __at(0x0FD0) __sfr RCON; 5477 5478 typedef union 5479 { 5480 struct 5481 { 5482 unsigned NOT_BOR : 1; 5483 unsigned NOT_POR : 1; 5484 unsigned NOT_PD : 1; 5485 unsigned NOT_TO : 1; 5486 unsigned NOT_RI : 1; 5487 unsigned NOT_CM : 1; 5488 unsigned : 1; 5489 unsigned IPEN : 1; 5490 }; 5491 5492 struct 5493 { 5494 unsigned BOR : 1; 5495 unsigned POR : 1; 5496 unsigned PD : 1; 5497 unsigned TO : 1; 5498 unsigned RI : 1; 5499 unsigned CM : 1; 5500 unsigned : 1; 5501 unsigned : 1; 5502 }; 5503 } __RCONbits_t; 5504 5505 extern __at(0x0FD0) volatile __RCONbits_t RCONbits; 5506 5507 #define _NOT_BOR 0x01 5508 #define _BOR 0x01 5509 #define _NOT_POR 0x02 5510 #define _POR 0x02 5511 #define _NOT_PD 0x04 5512 #define _PD 0x04 5513 #define _NOT_TO 0x08 5514 #define _TO 0x08 5515 #define _NOT_RI 0x10 5516 #define _RI 0x10 5517 #define _NOT_CM 0x20 5518 #define _CM 0x20 5519 #define _IPEN 0x80 5520 5521 //============================================================================== 5522 5523 5524 //============================================================================== 5525 // CM2CON Bits 5526 5527 extern __at(0x0FD1) __sfr CM2CON; 5528 5529 typedef union 5530 { 5531 struct 5532 { 5533 unsigned C1CH0 : 1; 5534 unsigned C1CH1 : 1; 5535 unsigned CREF : 1; 5536 unsigned EVPOL0 : 1; 5537 unsigned EVPOL1 : 1; 5538 unsigned CPOL : 1; 5539 unsigned COE : 1; 5540 unsigned CON : 1; 5541 }; 5542 5543 struct 5544 { 5545 unsigned CCH0 : 1; 5546 unsigned CCH1 : 1; 5547 unsigned : 1; 5548 unsigned : 1; 5549 unsigned : 1; 5550 unsigned : 1; 5551 unsigned : 1; 5552 unsigned : 1; 5553 }; 5554 5555 struct 5556 { 5557 unsigned CCH : 2; 5558 unsigned : 6; 5559 }; 5560 5561 struct 5562 { 5563 unsigned C1CH : 2; 5564 unsigned : 6; 5565 }; 5566 5567 struct 5568 { 5569 unsigned : 3; 5570 unsigned EVPOL : 2; 5571 unsigned : 3; 5572 }; 5573 } __CM2CONbits_t; 5574 5575 extern __at(0x0FD1) volatile __CM2CONbits_t CM2CONbits; 5576 5577 #define _CM2CON_C1CH0 0x01 5578 #define _CM2CON_CCH0 0x01 5579 #define _CM2CON_C1CH1 0x02 5580 #define _CM2CON_CCH1 0x02 5581 #define _CM2CON_CREF 0x04 5582 #define _CM2CON_EVPOL0 0x08 5583 #define _CM2CON_EVPOL1 0x10 5584 #define _CM2CON_CPOL 0x20 5585 #define _CM2CON_COE 0x40 5586 #define _CM2CON_CON 0x80 5587 5588 //============================================================================== 5589 5590 5591 //============================================================================== 5592 // CM2CON1 Bits 5593 5594 extern __at(0x0FD1) __sfr CM2CON1; 5595 5596 typedef union 5597 { 5598 struct 5599 { 5600 unsigned C1CH0 : 1; 5601 unsigned C1CH1 : 1; 5602 unsigned CREF : 1; 5603 unsigned EVPOL0 : 1; 5604 unsigned EVPOL1 : 1; 5605 unsigned CPOL : 1; 5606 unsigned COE : 1; 5607 unsigned CON : 1; 5608 }; 5609 5610 struct 5611 { 5612 unsigned CCH0 : 1; 5613 unsigned CCH1 : 1; 5614 unsigned : 1; 5615 unsigned : 1; 5616 unsigned : 1; 5617 unsigned : 1; 5618 unsigned : 1; 5619 unsigned : 1; 5620 }; 5621 5622 struct 5623 { 5624 unsigned CCH : 2; 5625 unsigned : 6; 5626 }; 5627 5628 struct 5629 { 5630 unsigned C1CH : 2; 5631 unsigned : 6; 5632 }; 5633 5634 struct 5635 { 5636 unsigned : 3; 5637 unsigned EVPOL : 2; 5638 unsigned : 3; 5639 }; 5640 } __CM2CON1bits_t; 5641 5642 extern __at(0x0FD1) volatile __CM2CON1bits_t CM2CON1bits; 5643 5644 #define _CM2CON1_C1CH0 0x01 5645 #define _CM2CON1_CCH0 0x01 5646 #define _CM2CON1_C1CH1 0x02 5647 #define _CM2CON1_CCH1 0x02 5648 #define _CM2CON1_CREF 0x04 5649 #define _CM2CON1_EVPOL0 0x08 5650 #define _CM2CON1_EVPOL1 0x10 5651 #define _CM2CON1_CPOL 0x20 5652 #define _CM2CON1_COE 0x40 5653 #define _CM2CON1_CON 0x80 5654 5655 //============================================================================== 5656 5657 5658 //============================================================================== 5659 // CM1CON Bits 5660 5661 extern __at(0x0FD2) __sfr CM1CON; 5662 5663 typedef union 5664 { 5665 struct 5666 { 5667 unsigned C1CH0 : 1; 5668 unsigned C1CH1 : 1; 5669 unsigned CREF : 1; 5670 unsigned EVPOL0 : 1; 5671 unsigned EVPOL1 : 1; 5672 unsigned CPOL : 1; 5673 unsigned COE : 1; 5674 unsigned CON : 1; 5675 }; 5676 5677 struct 5678 { 5679 unsigned CCH0 : 1; 5680 unsigned CCH1 : 1; 5681 unsigned : 1; 5682 unsigned : 1; 5683 unsigned : 1; 5684 unsigned : 1; 5685 unsigned : 1; 5686 unsigned : 1; 5687 }; 5688 5689 struct 5690 { 5691 unsigned C1CH : 2; 5692 unsigned : 6; 5693 }; 5694 5695 struct 5696 { 5697 unsigned CCH : 2; 5698 unsigned : 6; 5699 }; 5700 5701 struct 5702 { 5703 unsigned : 3; 5704 unsigned EVPOL : 2; 5705 unsigned : 3; 5706 }; 5707 } __CM1CONbits_t; 5708 5709 extern __at(0x0FD2) volatile __CM1CONbits_t CM1CONbits; 5710 5711 #define _C1CH0 0x01 5712 #define _CCH0 0x01 5713 #define _C1CH1 0x02 5714 #define _CCH1 0x02 5715 #define _CREF 0x04 5716 #define _EVPOL0 0x08 5717 #define _EVPOL1 0x10 5718 #define _CPOL 0x20 5719 #define _COE 0x40 5720 #define _CON 0x80 5721 5722 //============================================================================== 5723 5724 5725 //============================================================================== 5726 // CM1CON1 Bits 5727 5728 extern __at(0x0FD2) __sfr CM1CON1; 5729 5730 typedef union 5731 { 5732 struct 5733 { 5734 unsigned C1CH0 : 1; 5735 unsigned C1CH1 : 1; 5736 unsigned CREF : 1; 5737 unsigned EVPOL0 : 1; 5738 unsigned EVPOL1 : 1; 5739 unsigned CPOL : 1; 5740 unsigned COE : 1; 5741 unsigned CON : 1; 5742 }; 5743 5744 struct 5745 { 5746 unsigned CCH0 : 1; 5747 unsigned CCH1 : 1; 5748 unsigned : 1; 5749 unsigned : 1; 5750 unsigned : 1; 5751 unsigned : 1; 5752 unsigned : 1; 5753 unsigned : 1; 5754 }; 5755 5756 struct 5757 { 5758 unsigned CCH : 2; 5759 unsigned : 6; 5760 }; 5761 5762 struct 5763 { 5764 unsigned C1CH : 2; 5765 unsigned : 6; 5766 }; 5767 5768 struct 5769 { 5770 unsigned : 3; 5771 unsigned EVPOL : 2; 5772 unsigned : 3; 5773 }; 5774 } __CM1CON1bits_t; 5775 5776 extern __at(0x0FD2) volatile __CM1CON1bits_t CM1CON1bits; 5777 5778 #define _CM1CON1_C1CH0 0x01 5779 #define _CM1CON1_CCH0 0x01 5780 #define _CM1CON1_C1CH1 0x02 5781 #define _CM1CON1_CCH1 0x02 5782 #define _CM1CON1_CREF 0x04 5783 #define _CM1CON1_EVPOL0 0x08 5784 #define _CM1CON1_EVPOL1 0x10 5785 #define _CM1CON1_CPOL 0x20 5786 #define _CM1CON1_COE 0x40 5787 #define _CM1CON1_CON 0x80 5788 5789 //============================================================================== 5790 5791 5792 //============================================================================== 5793 // OSCCON Bits 5794 5795 extern __at(0x0FD3) __sfr OSCCON; 5796 5797 typedef union 5798 { 5799 struct 5800 { 5801 unsigned SCS0 : 1; 5802 unsigned SCS1 : 1; 5803 unsigned : 1; 5804 unsigned OSTS : 1; 5805 unsigned IRCF0 : 1; 5806 unsigned IRCF1 : 1; 5807 unsigned IRCF2 : 1; 5808 unsigned IDLEN : 1; 5809 }; 5810 5811 struct 5812 { 5813 unsigned SCS : 2; 5814 unsigned : 6; 5815 }; 5816 5817 struct 5818 { 5819 unsigned : 4; 5820 unsigned IRCF : 3; 5821 unsigned : 1; 5822 }; 5823 } __OSCCONbits_t; 5824 5825 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits; 5826 5827 #define _SCS0 0x01 5828 #define _SCS1 0x02 5829 #define _OSTS 0x08 5830 #define _IRCF0 0x10 5831 #define _IRCF1 0x20 5832 #define _IRCF2 0x40 5833 #define _IDLEN 0x80 5834 5835 //============================================================================== 5836 5837 5838 //============================================================================== 5839 // REFOCON Bits 5840 5841 extern __at(0x0FD3) __sfr REFOCON; 5842 5843 typedef union 5844 { 5845 struct 5846 { 5847 unsigned RODIV0 : 1; 5848 unsigned RODIV1 : 1; 5849 unsigned RODIV2 : 1; 5850 unsigned RODIV3 : 1; 5851 unsigned ROSEL : 1; 5852 unsigned ROSSLP : 1; 5853 unsigned : 1; 5854 unsigned ROON : 1; 5855 }; 5856 5857 struct 5858 { 5859 unsigned RODIV : 4; 5860 unsigned : 4; 5861 }; 5862 } __REFOCONbits_t; 5863 5864 extern __at(0x0FD3) volatile __REFOCONbits_t REFOCONbits; 5865 5866 #define _RODIV0 0x01 5867 #define _RODIV1 0x02 5868 #define _RODIV2 0x04 5869 #define _RODIV3 0x08 5870 #define _ROSEL 0x10 5871 #define _ROSSLP 0x20 5872 #define _ROON 0x80 5873 5874 //============================================================================== 5875 5876 5877 //============================================================================== 5878 // T0CON Bits 5879 5880 extern __at(0x0FD5) __sfr T0CON; 5881 5882 typedef union 5883 { 5884 struct 5885 { 5886 unsigned T0PS0 : 1; 5887 unsigned T0PS1 : 1; 5888 unsigned T0PS2 : 1; 5889 unsigned PSA : 1; 5890 unsigned T0SE : 1; 5891 unsigned T0CS : 1; 5892 unsigned T08BIT : 1; 5893 unsigned TMR0ON : 1; 5894 }; 5895 5896 struct 5897 { 5898 unsigned : 1; 5899 unsigned : 1; 5900 unsigned : 1; 5901 unsigned T0PS3 : 1; 5902 unsigned : 1; 5903 unsigned : 1; 5904 unsigned : 1; 5905 unsigned : 1; 5906 }; 5907 5908 struct 5909 { 5910 unsigned T0PS : 4; 5911 unsigned : 4; 5912 }; 5913 } __T0CONbits_t; 5914 5915 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits; 5916 5917 #define _T0PS0 0x01 5918 #define _T0PS1 0x02 5919 #define _T0PS2 0x04 5920 #define _PSA 0x08 5921 #define _T0PS3 0x08 5922 #define _T0SE 0x10 5923 #define _T0CS 0x20 5924 #define _T08BIT 0x40 5925 #define _TMR0ON 0x80 5926 5927 //============================================================================== 5928 5929 extern __at(0x0FD6) __sfr TMR0; 5930 extern __at(0x0FD6) __sfr TMR0L; 5931 extern __at(0x0FD7) __sfr TMR0H; 5932 5933 //============================================================================== 5934 // STATUS Bits 5935 5936 extern __at(0x0FD8) __sfr STATUS; 5937 5938 typedef struct 5939 { 5940 unsigned C : 1; 5941 unsigned DC : 1; 5942 unsigned Z : 1; 5943 unsigned OV : 1; 5944 unsigned N : 1; 5945 unsigned : 1; 5946 unsigned : 1; 5947 unsigned : 1; 5948 } __STATUSbits_t; 5949 5950 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits; 5951 5952 #define _C 0x01 5953 #define _DC 0x02 5954 #define _Z 0x04 5955 #define _OV 0x08 5956 #define _N 0x10 5957 5958 //============================================================================== 5959 5960 extern __at(0x0FD9) __sfr FSR2L; 5961 extern __at(0x0FDA) __sfr FSR2H; 5962 extern __at(0x0FDB) __sfr PLUSW2; 5963 extern __at(0x0FDC) __sfr PREINC2; 5964 extern __at(0x0FDD) __sfr POSTDEC2; 5965 extern __at(0x0FDE) __sfr POSTINC2; 5966 extern __at(0x0FDF) __sfr INDF2; 5967 extern __at(0x0FE0) __sfr BSR; 5968 extern __at(0x0FE1) __sfr FSR1L; 5969 extern __at(0x0FE2) __sfr FSR1H; 5970 extern __at(0x0FE3) __sfr PLUSW1; 5971 extern __at(0x0FE4) __sfr PREINC1; 5972 extern __at(0x0FE5) __sfr POSTDEC1; 5973 extern __at(0x0FE6) __sfr POSTINC1; 5974 extern __at(0x0FE7) __sfr INDF1; 5975 extern __at(0x0FE8) __sfr WREG; 5976 extern __at(0x0FE9) __sfr FSR0L; 5977 extern __at(0x0FEA) __sfr FSR0H; 5978 extern __at(0x0FEB) __sfr PLUSW0; 5979 extern __at(0x0FEC) __sfr PREINC0; 5980 extern __at(0x0FED) __sfr POSTDEC0; 5981 extern __at(0x0FEE) __sfr POSTINC0; 5982 extern __at(0x0FEF) __sfr INDF0; 5983 5984 //============================================================================== 5985 // INTCON3 Bits 5986 5987 extern __at(0x0FF0) __sfr INTCON3; 5988 5989 typedef union 5990 { 5991 struct 5992 { 5993 unsigned INT1IF : 1; 5994 unsigned INT2IF : 1; 5995 unsigned INT3IF : 1; 5996 unsigned INT1IE : 1; 5997 unsigned INT2IE : 1; 5998 unsigned INT3IE : 1; 5999 unsigned INT1IP : 1; 6000 unsigned INT2IP : 1; 6001 }; 6002 6003 struct 6004 { 6005 unsigned INT1F : 1; 6006 unsigned INT2F : 1; 6007 unsigned INT3F : 1; 6008 unsigned INT1E : 1; 6009 unsigned INT2E : 1; 6010 unsigned INT3E : 1; 6011 unsigned INT1P : 1; 6012 unsigned INT2P : 1; 6013 }; 6014 } __INTCON3bits_t; 6015 6016 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits; 6017 6018 #define _INT1IF 0x01 6019 #define _INT1F 0x01 6020 #define _INT2IF 0x02 6021 #define _INT2F 0x02 6022 #define _INT3IF 0x04 6023 #define _INT3F 0x04 6024 #define _INT1IE 0x08 6025 #define _INT1E 0x08 6026 #define _INT2IE 0x10 6027 #define _INT2E 0x10 6028 #define _INT3IE 0x20 6029 #define _INT3E 0x20 6030 #define _INT1IP 0x40 6031 #define _INT1P 0x40 6032 #define _INT2IP 0x80 6033 #define _INT2P 0x80 6034 6035 //============================================================================== 6036 6037 6038 //============================================================================== 6039 // INTCON2 Bits 6040 6041 extern __at(0x0FF1) __sfr INTCON2; 6042 6043 typedef union 6044 { 6045 struct 6046 { 6047 unsigned RBIP : 1; 6048 unsigned INT3IP : 1; 6049 unsigned TMR0IP : 1; 6050 unsigned INTEDG3 : 1; 6051 unsigned INTEDG2 : 1; 6052 unsigned INTEDG1 : 1; 6053 unsigned INTEDG0 : 1; 6054 unsigned NOT_RBPU : 1; 6055 }; 6056 6057 struct 6058 { 6059 unsigned : 1; 6060 unsigned INT3P : 1; 6061 unsigned T0IP : 1; 6062 unsigned : 1; 6063 unsigned : 1; 6064 unsigned : 1; 6065 unsigned : 1; 6066 unsigned RBPU : 1; 6067 }; 6068 } __INTCON2bits_t; 6069 6070 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits; 6071 6072 #define _RBIP 0x01 6073 #define _INT3IP 0x02 6074 #define _INT3P 0x02 6075 #define _TMR0IP 0x04 6076 #define _T0IP 0x04 6077 #define _INTEDG3 0x08 6078 #define _INTEDG2 0x10 6079 #define _INTEDG1 0x20 6080 #define _INTEDG0 0x40 6081 #define _NOT_RBPU 0x80 6082 #define _RBPU 0x80 6083 6084 //============================================================================== 6085 6086 6087 //============================================================================== 6088 // INTCON Bits 6089 6090 extern __at(0x0FF2) __sfr INTCON; 6091 6092 typedef union 6093 { 6094 struct 6095 { 6096 unsigned RBIF : 1; 6097 unsigned INT0IF : 1; 6098 unsigned TMR0IF : 1; 6099 unsigned RBIE : 1; 6100 unsigned INT0IE : 1; 6101 unsigned TMR0IE : 1; 6102 unsigned PEIE_GIEL : 1; 6103 unsigned GIE_GIEH : 1; 6104 }; 6105 6106 struct 6107 { 6108 unsigned : 1; 6109 unsigned INT0F : 1; 6110 unsigned T0IF : 1; 6111 unsigned : 1; 6112 unsigned INT0E : 1; 6113 unsigned T0IE : 1; 6114 unsigned PEIE : 1; 6115 unsigned GIE : 1; 6116 }; 6117 6118 struct 6119 { 6120 unsigned : 1; 6121 unsigned : 1; 6122 unsigned : 1; 6123 unsigned : 1; 6124 unsigned : 1; 6125 unsigned : 1; 6126 unsigned GIEL : 1; 6127 unsigned GIEH : 1; 6128 }; 6129 } __INTCONbits_t; 6130 6131 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits; 6132 6133 #define _RBIF 0x01 6134 #define _INT0IF 0x02 6135 #define _INT0F 0x02 6136 #define _TMR0IF 0x04 6137 #define _T0IF 0x04 6138 #define _RBIE 0x08 6139 #define _INT0IE 0x10 6140 #define _INT0E 0x10 6141 #define _TMR0IE 0x20 6142 #define _T0IE 0x20 6143 #define _PEIE_GIEL 0x40 6144 #define _PEIE 0x40 6145 #define _GIEL 0x40 6146 #define _GIE_GIEH 0x80 6147 #define _GIE 0x80 6148 #define _GIEH 0x80 6149 6150 //============================================================================== 6151 6152 extern __at(0x0FF3) __sfr PROD; 6153 extern __at(0x0FF3) __sfr PRODL; 6154 extern __at(0x0FF4) __sfr PRODH; 6155 extern __at(0x0FF5) __sfr TABLAT; 6156 extern __at(0x0FF6) __sfr TBLPTR; 6157 extern __at(0x0FF6) __sfr TBLPTRL; 6158 extern __at(0x0FF7) __sfr TBLPTRH; 6159 extern __at(0x0FF8) __sfr TBLPTRU; 6160 extern __at(0x0FF9) __sfr PC; 6161 extern __at(0x0FF9) __sfr PCL; 6162 extern __at(0x0FFA) __sfr PCLATH; 6163 extern __at(0x0FFB) __sfr PCLATU; 6164 6165 //============================================================================== 6166 // STKPTR Bits 6167 6168 extern __at(0x0FFC) __sfr STKPTR; 6169 6170 typedef union 6171 { 6172 struct 6173 { 6174 unsigned STKPTR0 : 1; 6175 unsigned STKPTR1 : 1; 6176 unsigned STKPTR2 : 1; 6177 unsigned STKPTR3 : 1; 6178 unsigned STKPTR4 : 1; 6179 unsigned : 1; 6180 unsigned STKUNF : 1; 6181 unsigned STKFUL : 1; 6182 }; 6183 6184 struct 6185 { 6186 unsigned SP0 : 1; 6187 unsigned SP1 : 1; 6188 unsigned SP2 : 1; 6189 unsigned SP3 : 1; 6190 unsigned SP4 : 1; 6191 unsigned : 1; 6192 unsigned : 1; 6193 unsigned STKOVF : 1; 6194 }; 6195 6196 struct 6197 { 6198 unsigned SP : 5; 6199 unsigned : 3; 6200 }; 6201 6202 struct 6203 { 6204 unsigned STKPTR : 5; 6205 unsigned : 3; 6206 }; 6207 } __STKPTRbits_t; 6208 6209 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits; 6210 6211 #define _STKPTR0 0x01 6212 #define _SP0 0x01 6213 #define _STKPTR1 0x02 6214 #define _SP1 0x02 6215 #define _STKPTR2 0x04 6216 #define _SP2 0x04 6217 #define _STKPTR3 0x08 6218 #define _SP3 0x08 6219 #define _STKPTR4 0x10 6220 #define _SP4 0x10 6221 #define _STKUNF 0x40 6222 #define _STKFUL 0x80 6223 #define _STKOVF 0x80 6224 6225 //============================================================================== 6226 6227 extern __at(0x0FFD) __sfr TOS; 6228 extern __at(0x0FFD) __sfr TOSL; 6229 extern __at(0x0FFE) __sfr TOSH; 6230 extern __at(0x0FFF) __sfr TOSU; 6231 6232 //============================================================================== 6233 // 6234 // Configuration Addresses 6235 // 6236 //============================================================================== 6237 6238 #define __CONFIG1L 0x017FF8 6239 #define __CONFIG1H 0x017FF9 6240 #define __CONFIG2L 0x017FFA 6241 #define __CONFIG2H 0x017FFB 6242 #define __CONFIG3L 0x017FFC 6243 #define __CONFIG3H 0x017FFD 6244 6245 //============================================================================== 6246 6247 #endif // #ifndef __PIC18F66J16_H__ 6248