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