Go to the documentation of this file. 25 #ifndef PA0_INPUT_ENABLE 26 #define PA0_INPUT_ENABLE 0 28 #ifndef PA1_INPUT_ENABLE 29 #define PA1_INPUT_ENABLE 0 31 #ifndef PA2_INPUT_ENABLE 32 #define PA2_INPUT_ENABLE 0 34 #ifndef PA3_INPUT_ENABLE 35 #define PA3_INPUT_ENABLE 0 37 #ifndef PA4_INPUT_ENABLE 38 #define PA4_INPUT_ENABLE 0 40 #ifndef PA5_INPUT_ENABLE 41 #define PA5_INPUT_ENABLE 0 //USB 43 #ifndef PA6_INPUT_ENABLE 44 #define PA6_INPUT_ENABLE 0 //USB 46 #ifndef PA7_INPUT_ENABLE 47 #define PA7_INPUT_ENABLE 1 //SWS 49 #ifndef PA0_OUTPUT_ENABLE 50 #define PA0_OUTPUT_ENABLE 0 52 #ifndef PA1_OUTPUT_ENABLE 53 #define PA1_OUTPUT_ENABLE 0 55 #ifndef PA2_OUTPUT_ENABLE 56 #define PA2_OUTPUT_ENABLE 0 58 #ifndef PA3_OUTPUT_ENABLE 59 #define PA3_OUTPUT_ENABLE 0 61 #ifndef PA4_OUTPUT_ENABLE 62 #define PA4_OUTPUT_ENABLE 0 64 #ifndef PA5_OUTPUT_ENABLE 65 #define PA5_OUTPUT_ENABLE 0 67 #ifndef PA6_OUTPUT_ENABLE 68 #define PA6_OUTPUT_ENABLE 0 70 #ifndef PA7_OUTPUT_ENABLE 71 #define PA7_OUTPUT_ENABLE 0 73 #ifndef PA0_DATA_STRENGTH 74 #define PA0_DATA_STRENGTH 1 76 #ifndef PA1_DATA_STRENGTH 77 #define PA1_DATA_STRENGTH 1 79 #ifndef PA2_DATA_STRENGTH 80 #define PA2_DATA_STRENGTH 1 82 #ifndef PA3_DATA_STRENGTH 83 #define PA3_DATA_STRENGTH 1 85 #ifndef PA4_DATA_STRENGTH 86 #define PA4_DATA_STRENGTH 1 88 #ifndef PA5_DATA_STRENGTH 89 #define PA5_DATA_STRENGTH 1 91 #ifndef PA6_DATA_STRENGTH 92 #define PA6_DATA_STRENGTH 1 94 #ifndef PA7_DATA_STRENGTH 95 #define PA7_DATA_STRENGTH 1 98 #define PA0_DATA_OUT 0 101 #define PA1_DATA_OUT 0 104 #define PA2_DATA_OUT 0 107 #define PA3_DATA_OUT 0 110 #define PA4_DATA_OUT 0 113 #define PA5_DATA_OUT 0 116 #define PA6_DATA_OUT 0 119 #define PA7_DATA_OUT 0 122 #define PA0_FUNC AS_GPIO 125 #define PA1_FUNC AS_GPIO 128 #define PA2_FUNC AS_GPIO 131 #define PA3_FUNC AS_GPIO 134 #define PA4_FUNC AS_GPIO 137 #define PA5_FUNC AS_GPIO 140 #define PA6_FUNC AS_GPIO 143 #define PA7_FUNC AS_SWIRE 145 #ifndef PULL_WAKEUP_SRC_PA0 146 #define PULL_WAKEUP_SRC_PA0 0 148 #ifndef PULL_WAKEUP_SRC_PA1 149 #define PULL_WAKEUP_SRC_PA1 0 151 #ifndef PULL_WAKEUP_SRC_PA2 152 #define PULL_WAKEUP_SRC_PA2 0 154 #ifndef PULL_WAKEUP_SRC_PA3 155 #define PULL_WAKEUP_SRC_PA3 0 157 #ifndef PULL_WAKEUP_SRC_PA4 158 #define PULL_WAKEUP_SRC_PA4 0 160 #ifndef PULL_WAKEUP_SRC_PA5 161 #define PULL_WAKEUP_SRC_PA5 0 163 #ifndef PULL_WAKEUP_SRC_PA6 164 #define PULL_WAKEUP_SRC_PA6 0 166 #ifndef PULL_WAKEUP_SRC_PA7 167 #define PULL_WAKEUP_SRC_PA7 PM_PIN_PULLUP_1M //sws pullup 171 #ifndef PB0_INPUT_ENABLE 172 #define PB0_INPUT_ENABLE 0 174 #ifndef PB1_INPUT_ENABLE 175 #define PB1_INPUT_ENABLE 0 177 #ifndef PB2_INPUT_ENABLE 178 #define PB2_INPUT_ENABLE 0 180 #ifndef PB3_INPUT_ENABLE 181 #define PB3_INPUT_ENABLE 0 183 #ifndef PB4_INPUT_ENABLE 184 #define PB4_INPUT_ENABLE 0 186 #ifndef PB5_INPUT_ENABLE 187 #define PB5_INPUT_ENABLE 0 189 #ifndef PB6_INPUT_ENABLE 190 #define PB6_INPUT_ENABLE 0 192 #ifndef PB7_INPUT_ENABLE 193 #define PB7_INPUT_ENABLE 0 195 #ifndef PB0_OUTPUT_ENABLE 196 #define PB0_OUTPUT_ENABLE 0 198 #ifndef PB1_OUTPUT_ENABLE 199 #define PB1_OUTPUT_ENABLE 0 201 #ifndef PB2_OUTPUT_ENABLE 202 #define PB2_OUTPUT_ENABLE 0 204 #ifndef PB3_OUTPUT_ENABLE 205 #define PB3_OUTPUT_ENABLE 0 207 #ifndef PB4_OUTPUT_ENABLE 208 #define PB4_OUTPUT_ENABLE 0 210 #ifndef PB5_OUTPUT_ENABLE 211 #define PB5_OUTPUT_ENABLE 0 213 #ifndef PB6_OUTPUT_ENABLE 214 #define PB6_OUTPUT_ENABLE 0 216 #ifndef PB7_OUTPUT_ENABLE 217 #define PB7_OUTPUT_ENABLE 0 219 #ifndef PB0_DATA_STRENGTH 220 #define PB0_DATA_STRENGTH 1 222 #ifndef PB1_DATA_STRENGTH 223 #define PB1_DATA_STRENGTH 1 225 #ifndef PB2_DATA_STRENGTH 226 #define PB2_DATA_STRENGTH 1 228 #ifndef PB3_DATA_STRENGTH 229 #define PB3_DATA_STRENGTH 1 231 #ifndef PB4_DATA_STRENGTH 232 #define PB4_DATA_STRENGTH 1 234 #ifndef PB5_DATA_STRENGTH 235 #define PB5_DATA_STRENGTH 1 237 #ifndef PB6_DATA_STRENGTH 238 #define PB6_DATA_STRENGTH 1 240 #ifndef PB7_DATA_STRENGTH 241 #define PB7_DATA_STRENGTH 1 244 #define PB0_DATA_OUT 0 247 #define PB1_DATA_OUT 0 250 #define PB2_DATA_OUT 0 253 #define PB3_DATA_OUT 0 256 #define PB4_DATA_OUT 0 259 #define PB5_DATA_OUT 0 262 #define PB6_DATA_OUT 0 265 #define PB7_DATA_OUT 0 268 #define PB0_FUNC AS_GPIO 271 #define PB1_FUNC AS_GPIO 274 #define PB2_FUNC AS_GPIO 277 #define PB3_FUNC AS_GPIO 280 #define PB4_FUNC AS_GPIO 283 #define PB5_FUNC AS_GPIO 286 #define PB6_FUNC AS_GPIO 289 #define PB7_FUNC AS_GPIO 291 #ifndef PULL_WAKEUP_SRC_PB0 292 #define PULL_WAKEUP_SRC_PB0 0 294 #ifndef PULL_WAKEUP_SRC_PB1 295 #define PULL_WAKEUP_SRC_PB1 0 297 #ifndef PULL_WAKEUP_SRC_PB2 298 #define PULL_WAKEUP_SRC_PB2 0 300 #ifndef PULL_WAKEUP_SRC_PB3 301 #define PULL_WAKEUP_SRC_PB3 0 303 #ifndef PULL_WAKEUP_SRC_PB4 304 #define PULL_WAKEUP_SRC_PB4 0 306 #ifndef PULL_WAKEUP_SRC_PB5 307 #define PULL_WAKEUP_SRC_PB5 0 309 #ifndef PULL_WAKEUP_SRC_PB6 310 #define PULL_WAKEUP_SRC_PB6 0 312 #ifndef PULL_WAKEUP_SRC_PB7 313 #define PULL_WAKEUP_SRC_PB7 0 317 #ifndef PC0_INPUT_ENABLE 318 #define PC0_INPUT_ENABLE 0 320 #ifndef PC1_INPUT_ENABLE 321 #define PC1_INPUT_ENABLE 0 323 #ifndef PC2_INPUT_ENABLE 324 #define PC2_INPUT_ENABLE 0 326 #ifndef PC3_INPUT_ENABLE 327 #define PC3_INPUT_ENABLE 0 329 #ifndef PC4_INPUT_ENABLE 330 #define PC4_INPUT_ENABLE 0 332 #ifndef PC5_INPUT_ENABLE 333 #define PC5_INPUT_ENABLE 0 335 #ifndef PC6_INPUT_ENABLE 336 #define PC6_INPUT_ENABLE 0 338 #ifndef PC7_INPUT_ENABLE 339 #define PC7_INPUT_ENABLE 0 341 #ifndef PC0_OUTPUT_ENABLE 342 #define PC0_OUTPUT_ENABLE 0 344 #ifndef PC1_OUTPUT_ENABLE 345 #define PC1_OUTPUT_ENABLE 0 347 #ifndef PC2_OUTPUT_ENABLE 348 #define PC2_OUTPUT_ENABLE 0 350 #ifndef PC3_OUTPUT_ENABLE 351 #define PC3_OUTPUT_ENABLE 0 353 #ifndef PC4_OUTPUT_ENABLE 354 #define PC4_OUTPUT_ENABLE 0 356 #ifndef PC5_OUTPUT_ENABLE 357 #define PC5_OUTPUT_ENABLE 0 359 #ifndef PC6_OUTPUT_ENABLE 360 #define PC6_OUTPUT_ENABLE 0 362 #ifndef PC7_OUTPUT_ENABLE 363 #define PC7_OUTPUT_ENABLE 0 365 #ifndef PC0_DATA_STRENGTH 366 #define PC0_DATA_STRENGTH 1 368 #ifndef PC1_DATA_STRENGTH 369 #define PC1_DATA_STRENGTH 1 371 #ifndef PC2_DATA_STRENGTH 372 #define PC2_DATA_STRENGTH 1 374 #ifndef PC3_DATA_STRENGTH 375 #define PC3_DATA_STRENGTH 1 377 #ifndef PC4_DATA_STRENGTH 378 #define PC4_DATA_STRENGTH 1 380 #ifndef PC5_DATA_STRENGTH 381 #define PC5_DATA_STRENGTH 1 383 #ifndef PC6_DATA_STRENGTH 384 #define PC6_DATA_STRENGTH 1 386 #ifndef PC7_DATA_STRENGTH 387 #define PC7_DATA_STRENGTH 1 390 #define PC0_DATA_OUT 0 393 #define PC1_DATA_OUT 0 396 #define PC2_DATA_OUT 0 399 #define PC3_DATA_OUT 0 402 #define PC4_DATA_OUT 0 405 #define PC5_DATA_OUT 0 408 #define PC6_DATA_OUT 0 411 #define PC7_DATA_OUT 0 414 #define PC0_FUNC AS_GPIO 417 #define PC1_FUNC AS_GPIO 420 #define PC2_FUNC AS_GPIO 423 #define PC3_FUNC AS_GPIO 426 #define PC4_FUNC AS_GPIO 429 #define PC5_FUNC AS_GPIO 432 #define PC6_FUNC AS_GPIO 435 #define PC7_FUNC AS_GPIO 437 #ifndef PULL_WAKEUP_SRC_PC0 438 #define PULL_WAKEUP_SRC_PC0 0 440 #ifndef PULL_WAKEUP_SRC_PC1 441 #define PULL_WAKEUP_SRC_PC1 0 443 #ifndef PULL_WAKEUP_SRC_PC2 444 #define PULL_WAKEUP_SRC_PC2 0 446 #ifndef PULL_WAKEUP_SRC_PC3 447 #define PULL_WAKEUP_SRC_PC3 0 449 #ifndef PULL_WAKEUP_SRC_PC4 450 #define PULL_WAKEUP_SRC_PC4 0 452 #ifndef PULL_WAKEUP_SRC_PC5 453 #define PULL_WAKEUP_SRC_PC5 0 455 #ifndef PULL_WAKEUP_SRC_PC6 456 #define PULL_WAKEUP_SRC_PC6 0 458 #ifndef PULL_WAKEUP_SRC_PC7 459 #define PULL_WAKEUP_SRC_PC7 0 463 #ifndef PD0_INPUT_ENABLE 464 #define PD0_INPUT_ENABLE 0 466 #ifndef PD1_INPUT_ENABLE 467 #define PD1_INPUT_ENABLE 0 469 #ifndef PD2_INPUT_ENABLE 470 #define PD2_INPUT_ENABLE 0 472 #ifndef PD3_INPUT_ENABLE 473 #define PD3_INPUT_ENABLE 0 475 #ifndef PD4_INPUT_ENABLE 476 #define PD4_INPUT_ENABLE 0 478 #ifndef PD5_INPUT_ENABLE 479 #define PD5_INPUT_ENABLE 0 481 #ifndef PD6_INPUT_ENABLE 482 #define PD6_INPUT_ENABLE 0 484 #ifndef PD7_INPUT_ENABLE 485 #define PD7_INPUT_ENABLE 0 487 #ifndef PD0_OUTPUT_ENABLE 488 #define PD0_OUTPUT_ENABLE 0 490 #ifndef PD1_OUTPUT_ENABLE 491 #define PD1_OUTPUT_ENABLE 0 493 #ifndef PD2_OUTPUT_ENABLE 494 #define PD2_OUTPUT_ENABLE 0 496 #ifndef PD3_OUTPUT_ENABLE 497 #define PD3_OUTPUT_ENABLE 0 499 #ifndef PD4_OUTPUT_ENABLE 500 #define PD4_OUTPUT_ENABLE 0 502 #ifndef PD5_OUTPUT_ENABLE 503 #define PD5_OUTPUT_ENABLE 0 505 #ifndef PD6_OUTPUT_ENABLE 506 #define PD6_OUTPUT_ENABLE 0 508 #ifndef PD7_OUTPUT_ENABLE 509 #define PD7_OUTPUT_ENABLE 0 511 #ifndef PD0_DATA_STRENGTH 512 #define PD0_DATA_STRENGTH 1 514 #ifndef PD1_DATA_STRENGTH 515 #define PD1_DATA_STRENGTH 1 517 #ifndef PD2_DATA_STRENGTH 518 #define PD2_DATA_STRENGTH 1 520 #ifndef PD3_DATA_STRENGTH 521 #define PD3_DATA_STRENGTH 1 523 #ifndef PD4_DATA_STRENGTH 524 #define PD4_DATA_STRENGTH 1 526 #ifndef PD5_DATA_STRENGTH 527 #define PD5_DATA_STRENGTH 1 529 #ifndef PD6_DATA_STRENGTH 530 #define PD6_DATA_STRENGTH 1 532 #ifndef PD7_DATA_STRENGTH 533 #define PD7_DATA_STRENGTH 1 536 #define PD0_DATA_OUT 0 539 #define PD1_DATA_OUT 0 542 #define PD2_DATA_OUT 0 545 #define PD3_DATA_OUT 0 548 #define PD4_DATA_OUT 0 551 #define PD5_DATA_OUT 0 554 #define PD6_DATA_OUT 0 557 #define PD7_DATA_OUT 0 560 #define PD0_FUNC AS_GPIO 563 #define PD1_FUNC AS_GPIO 566 #define PD2_FUNC AS_GPIO 569 #define PD3_FUNC AS_GPIO 572 #define PD4_FUNC AS_GPIO 575 #define PD5_FUNC AS_GPIO 578 #define PD6_FUNC AS_GPIO 581 #define PD7_FUNC AS_GPIO 583 #ifndef PULL_WAKEUP_SRC_PD0 584 #define PULL_WAKEUP_SRC_PD0 0 586 #ifndef PULL_WAKEUP_SRC_PD1 587 #define PULL_WAKEUP_SRC_PD1 0 589 #ifndef PULL_WAKEUP_SRC_PD2 590 #define PULL_WAKEUP_SRC_PD2 0 592 #ifndef PULL_WAKEUP_SRC_PD3 593 #define PULL_WAKEUP_SRC_PD3 0 595 #ifndef PULL_WAKEUP_SRC_PD4 596 #define PULL_WAKEUP_SRC_PD4 0 598 #ifndef PULL_WAKEUP_SRC_PD5 599 #define PULL_WAKEUP_SRC_PD5 0 601 #ifndef PULL_WAKEUP_SRC_PD6 602 #define PULL_WAKEUP_SRC_PD6 0 604 #ifndef PULL_WAKEUP_SRC_PD7 605 #define PULL_WAKEUP_SRC_PD7 0 609 #ifndef PE0_INPUT_ENABLE 610 #define PE0_INPUT_ENABLE 1 //MSPI 612 #ifndef PE1_INPUT_ENABLE 613 #define PE1_INPUT_ENABLE 1 //MSPI 615 #ifndef PE2_INPUT_ENABLE 616 #define PE2_INPUT_ENABLE 1 //MSPI 618 #ifndef PE3_INPUT_ENABLE 619 #define PE3_INPUT_ENABLE 1 //MSPI 621 #ifndef PE0_OUTPUT_ENABLE 622 #define PE0_OUTPUT_ENABLE 0 624 #ifndef PE1_OUTPUT_ENABLE 625 #define PE1_OUTPUT_ENABLE 0 627 #ifndef PE2_OUTPUT_ENABLE 628 #define PE2_OUTPUT_ENABLE 0 630 #ifndef PE3_OUTPUT_ENABLE 631 #define PE3_OUTPUT_ENABLE 0 634 #ifndef PE0_DATA_STRENGTH 635 #define PE0_DATA_STRENGTH 1 637 #ifndef PE1_DATA_STRENGTH 638 #define PE1_DATA_STRENGTH 1 640 #ifndef PE2_DATA_STRENGTH 641 #define PE2_DATA_STRENGTH 1 643 #ifndef PE3_DATA_STRENGTH 644 #define PE3_DATA_STRENGTH 1 648 #define PE0_DATA_OUT 0 651 #define PE1_DATA_OUT 0 654 #define PE2_DATA_OUT 0 657 #define PE3_DATA_OUT 0 661 #define PE0_FUNC AS_MSPI 664 #define PE1_FUNC AS_MSPI 667 #define PE2_FUNC AS_MSPI 670 #define PE3_FUNC AS_MSPI 678 #define GPIO_PA0_PULL_FLOAT do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val &= ~0x03; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 679 #define GPIO_PA0_PULL_UP_1M do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val &= ~0x02; val |= 0x01; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 680 #define GPIO_PA0_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val |= 0x02; val &= ~0x01; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 681 #define GPIO_PA0_PULL_UP_10K do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val |= 0x03; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 682 #define GPIO_PA0_PULL_TOGGLE do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val ^= 0x01; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 686 #define GPIO_PA1_PULL_FLOAT do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val &= ~0x0C; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 687 #define GPIO_PA1_PULL_UP_1M do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val &= ~0x08; val |= 0x04; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 688 #define GPIO_PA1_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val |= 0x08; val &= ~0x04; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 689 #define GPIO_PA1_PULL_UP_10K do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val |= 0x0C; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 690 #define GPIO_PA1_PULL_TOGGLE do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val ^= 0x04; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 693 #define GPIO_PA2_PULL_FLOAT do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val &= ~0x30; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 694 #define GPIO_PA2_PULL_UP_1M do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val &= ~0x20; val |= 0x10; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 695 #define GPIO_PA2_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val |= 0x20; val &= ~0x10; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 696 #define GPIO_PA2_PULL_UP_10K do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val |= 0x30; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 697 #define GPIO_PA2_PULL_TOGGLE do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val ^= 0x10; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 700 #define GPIO_PA3_PULL_FLOAT do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val &= ~0xC0; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 701 #define GPIO_PA3_PULL_UP_1M do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val &= ~0x80; val |= 0x40; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 702 #define GPIO_PA3_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val |= 0x80; val &= ~0x40; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 703 #define GPIO_PA3_PULL_UP_10K do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val |= 0xC0; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 704 #define GPIO_PA3_PULL_TOGGLE do{ unsigned char val = analog_read(areg_0e_pa0_pa3_pull); val ^= 0x40; analog_write(areg_0e_pa0_pa3_pull, val); }while(0) 706 #define GPIO_PA4_PULL_FLOAT do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val &= ~0x03; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 707 #define GPIO_PA4_PULL_UP_1M do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val &= ~0x02; val |= 0x01; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 708 #define GPIO_PA4_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val |= 0x02; val &= ~0x01; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 709 #define GPIO_PA4_PULL_UP_10K do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val |= 0x03; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 710 #define GPIO_PA4_PULL_TOGGLE do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val ^= 0x01; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 713 #define GPIO_PA5_PULL_FLOAT do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val &= ~0x0C; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 714 #define GPIO_PA5_PULL_UP_1M do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val &= ~0x08; val |= 0x04; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 715 #define GPIO_PA5_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val |= 0x08; val &= ~0x04; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 716 #define GPIO_PA5_PULL_UP_10K do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val |= 0x0C; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 717 #define GPIO_PA5_PULL_TOGGLE do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val ^= 0x04; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 719 #define GPIO_PA6_PULL_FLOAT do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val &= ~0x30; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 720 #define GPIO_PA6_PULL_UP_1M do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val &= ~0x20; val |= 0x10; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 721 #define GPIO_PA6_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val |= 0x20; val &= ~0x10; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 722 #define GPIO_PA6_PULL_UP_10K do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val |= 0x30; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 723 #define GPIO_PA6_PULL_TOGGLE do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val ^= 0x10; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 725 #define GPIO_PA7_PULL_FLOAT do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val &= ~0xC0; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 726 #define GPIO_PA7_PULL_UP_1M do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val &= ~0x80; val |= 0x40; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 727 #define GPIO_PA7_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val |= 0x80; val &= ~0x40; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 728 #define GPIO_PA7_PULL_UP_10K do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val |= 0xC0; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 729 #define GPIO_PA7_PULL_TOGGLE do{ unsigned char val = analog_read(areg_0f_pa4_pa7_pull); val ^= 0x40; analog_write(areg_0f_pa4_pa7_pull, val); }while(0) 736 #define GPIO_PB0_PULL_FLOAT do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val &= ~0x03; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 737 #define GPIO_PB0_PULL_UP_1M do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val &= ~0x02; val |= 0x01; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 738 #define GPIO_PB0_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val |= 0x02; val &= ~0x01; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 739 #define GPIO_PB0_PULL_UP_10K do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val |= 0x03; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 740 #define GPIO_PB0_PULL_TOGGLE do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val ^= 0x01; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 744 #define GPIO_PB1_PULL_FLOAT do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val &= ~0x0C; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 745 #define GPIO_PB1_PULL_UP_1M do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val &= ~0x08; val |= 0x04; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 746 #define GPIO_PB1_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val |= 0x08; val &= ~0x04; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 747 #define GPIO_PB1_PULL_UP_10K do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val |= 0x0C; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 748 #define GPIO_PB1_PULL_TOGGLE do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val ^= 0x04; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 751 #define GPIO_PB2_PULL_FLOAT do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val &= ~0x30; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 752 #define GPIO_PB2_PULL_UP_1M do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val &= ~0x20; val |= 0x10; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 753 #define GPIO_PB2_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val |= 0x20; val &= ~0x10; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 754 #define GPIO_PB2_PULL_UP_10K do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val |= 0x30; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 755 #define GPIO_PB2_PULL_TOGGLE do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val ^= 0x10; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 758 #define GPIO_PB3_PULL_FLOAT do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val &= ~0xC0; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 759 #define GPIO_PB3_PULL_UP_1M do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val &= ~0x80; val |= 0x40; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 760 #define GPIO_PB3_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val |= 0x80; val &= ~0x40; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 761 #define GPIO_PB3_PULL_UP_10K do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val |= 0xC0; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 762 #define GPIO_PB3_PULL_TOGGLE do{ unsigned char val = analog_read(areg_10_pb0_pb3_pull); val ^= 0x40; analog_write(areg_10_pb0_pb3_pull, val); }while(0) 764 #define GPIO_PB4_PULL_FLOAT do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val &= ~0x03; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 765 #define GPIO_PB4_PULL_UP_1M do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val &= ~0x02; val |= 0x01; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 766 #define GPIO_PB4_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val |= 0x02; val &= ~0x01; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 767 #define GPIO_PB4_PULL_UP_10K do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val |= 0x03; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 768 #define GPIO_PB4_PULL_TOGGLE do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val ^= 0x01; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 771 #define GPIO_PB5_PULL_FLOAT do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val &= ~0x0C; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 772 #define GPIO_PB5_PULL_UP_1M do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val &= ~0x08; val |= 0x04; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 773 #define GPIO_PB5_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val |= 0x08; val &= ~0x04; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 774 #define GPIO_PB5_PULL_UP_10K do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val |= 0x0C; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 775 #define GPIO_PB5_PULL_TOGGLE do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val ^= 0x04; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 777 #define GPIO_PB6_PULL_FLOAT do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val &= ~0x30; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 778 #define GPIO_PB6_PULL_UP_1M do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val &= ~0x20; val |= 0x10; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 779 #define GPIO_PB6_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val |= 0x20; val &= ~0x10; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 780 #define GPIO_PB6_PULL_UP_10K do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val |= 0x30; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 781 #define GPIO_PB6_PULL_TOGGLE do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val ^= 0x10; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 783 #define GPIO_PB7_PULL_FLOAT do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val &= ~0xC0; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 784 #define GPIO_PB7_PULL_UP_1M do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val &= ~0x80; val |= 0x40; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 785 #define GPIO_PB7_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val |= 0x80; val &= ~0x40; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 786 #define GPIO_PB7_PULL_UP_10K do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val |= 0xC0; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 787 #define GPIO_PB7_PULL_TOGGLE do{ unsigned char val = analog_read(areg_11_pb4_pb7_pull); val ^= 0x40; analog_write(areg_11_pb4_pb7_pull, val); }while(0) 791 #define GPIO_PC0_PULL_FLOAT do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val &= ~0x03; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 792 #define GPIO_PC0_PULL_UP_1M do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val &= ~0x02; val |= 0x01; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 793 #define GPIO_PC0_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val |= 0x02; val &= ~0x01; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 794 #define GPIO_PC0_PULL_UP_10K do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val |= 0x03; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 795 #define GPIO_PC0_PULL_TOGGLE do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val ^= 0x01; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 799 #define GPIO_PC1_PULL_FLOAT do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val &= ~0x0C; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 800 #define GPIO_PC1_PULL_UP_1M do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val &= ~0x08; val |= 0x04; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 801 #define GPIO_PC1_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val |= 0x08; val &= ~0x04; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 802 #define GPIO_PC1_PULL_UP_10K do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val |= 0x0C; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 803 #define GPIO_PC1_PULL_TOGGLE do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val ^= 0x04; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 806 #define GPIO_PC2_PULL_FLOAT do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val &= ~0x30; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 807 #define GPIO_PC2_PULL_UP_1M do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val &= ~0x20; val |= 0x10; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 808 #define GPIO_PC2_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val |= 0x20; val &= ~0x10; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 809 #define GPIO_PC2_PULL_UP_10K do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val |= 0x30; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 810 #define GPIO_PC2_PULL_TOGGLE do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val ^= 0x10; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 813 #define GPIO_PC3_PULL_FLOAT do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val &= ~0xC0; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 814 #define GPIO_PC3_PULL_UP_1M do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val &= ~0x80; val |= 0x40; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 815 #define GPIO_PC3_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val |= 0x80; val &= ~0x40; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 816 #define GPIO_PC3_PULL_UP_10K do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val |= 0xC0; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 817 #define GPIO_PC3_PULL_TOGGLE do{ unsigned char val = analog_read(areg_12_pc0_pc3_pull); val ^= 0x40; analog_write(areg_12_pc0_pc3_pull, val); }while(0) 819 #define GPIO_PC4_PULL_FLOAT do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val &= ~0x03; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 820 #define GPIO_PC4_PULL_UP_1M do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val &= ~0x02; val |= 0x01; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 821 #define GPIO_PC4_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val |= 0x02; val &= ~0x01; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 822 #define GPIO_PC4_PULL_UP_10K do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val |= 0x03; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 823 #define GPIO_PC4_PULL_TOGGLE do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val ^= 0x01; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 826 #define GPIO_PC5_PULL_FLOAT do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val &= ~0x0C; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 827 #define GPIO_PC5_PULL_UP_1M do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val &= ~0x08; val |= 0x04; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 828 #define GPIO_PC5_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val |= 0x08; val &= ~0x04; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 829 #define GPIO_PC5_PULL_UP_10K do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val |= 0x0C; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 830 #define GPIO_PC5_PULL_TOGGLE do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val ^= 0x04; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 832 #define GPIO_PC6_PULL_FLOAT do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val &= ~0x30; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 833 #define GPIO_PC6_PULL_UP_1M do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val &= ~0x20; val |= 0x10; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 834 #define GPIO_PC6_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val |= 0x20; val &= ~0x10; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 835 #define GPIO_PC6_PULL_UP_10K do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val |= 0x30; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 836 #define GPIO_PC6_PULL_TOGGLE do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val ^= 0x10; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 838 #define GPIO_PC7_PULL_FLOAT do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val &= ~0xC0; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 839 #define GPIO_PC7_PULL_UP_1M do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val &= ~0x80; val |= 0x40; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 840 #define GPIO_PC7_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val |= 0x80; val &= ~0x40; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 841 #define GPIO_PC7_PULL_UP_10K do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val |= 0xC0; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 842 #define GPIO_PC7_PULL_TOGGLE do{ unsigned char val = analog_read(areg_13_pc4_pc7_pull); val ^= 0x40; analog_write(areg_13_pc4_pc7_pull, val); }while(0) 846 #define GPIO_PD0_PULL_FLOAT do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val &= ~0x03; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 847 #define GPIO_PD0_PULL_UP_1M do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val &= ~0x02; val |= 0x01; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 848 #define GPIO_PD0_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val |= 0x02; val &= ~0x01; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 849 #define GPIO_PD0_PULL_UP_10K do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val |= 0x03; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 850 #define GPIO_PD0_PULL_TOGGLE do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val ^= 0x01; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 854 #define GPIO_PD1_PULL_FLOAT do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val &= ~0x0C; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 855 #define GPIO_PD1_PULL_UP_1M do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val &= ~0x08; val |= 0x04; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 856 #define GPIO_PD1_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val |= 0x08; val &= ~0x04; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 857 #define GPIO_PD1_PULL_UP_10K do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val |= 0x0C; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 858 #define GPIO_PD1_PULL_TOGGLE do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val ^= 0x04; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 861 #define GPIO_PD2_PULL_FLOAT do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val &= ~0x30; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 862 #define GPIO_PD2_PULL_UP_1M do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val &= ~0x20; val |= 0x10; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 863 #define GPIO_PD2_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val |= 0x20; val &= ~0x10; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 864 #define GPIO_PD2_PULL_UP_10K do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val |= 0x30; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 865 #define GPIO_PD2_PULL_TOGGLE do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val ^= 0x10; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 868 #define GPIO_PD3_PULL_FLOAT do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val &= ~0xC0; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 869 #define GPIO_PD3_PULL_UP_1M do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val &= ~0x80; val |= 0x40; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 870 #define GPIO_PD3_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val |= 0x80; val &= ~0x40; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 871 #define GPIO_PD3_PULL_UP_10K do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val |= 0xC0; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 872 #define GPIO_PD3_PULL_TOGGLE do{ unsigned char val = analog_read(areg_14_pd0_pd3_pull); val ^= 0x40; analog_write(areg_14_pd0_pd3_pull, val); }while(0) 874 #define GPIO_PD4_PULL_FLOAT do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val &= ~0x03; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 875 #define GPIO_PD4_PULL_UP_1M do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val &= ~0x02; val |= 0x01; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 876 #define GPIO_PD4_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val |= 0x02; val &= ~0x01; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 877 #define GPIO_PD4_PULL_UP_10K do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val |= 0x03; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 878 #define GPIO_PD4_PULL_TOGGLE do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val ^= 0x01; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 881 #define GPIO_PD5_PULL_FLOAT do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val &= ~0x0C; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 882 #define GPIO_PD5_PULL_UP_1M do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val &= ~0x08; val |= 0x04; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 883 #define GPIO_PD5_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val |= 0x08; val &= ~0x04; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 884 #define GPIO_PD5_PULL_UP_10K do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val |= 0x0C; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 885 #define GPIO_PD5_PULL_TOGGLE do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val ^= 0x04; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 887 #define GPIO_PD6_PULL_FLOAT do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val &= ~0x30; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 888 #define GPIO_PD6_PULL_UP_1M do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val &= ~0x20; val |= 0x10; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 889 #define GPIO_PD6_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val |= 0x20; val &= ~0x10; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 890 #define GPIO_PD6_PULL_UP_10K do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val |= 0x30; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 891 #define GPIO_PD6_PULL_TOGGLE do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val ^= 0x10; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 893 #define GPIO_PD7_PULL_FLOAT do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val &= ~0xC0; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 894 #define GPIO_PD7_PULL_UP_1M do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val &= ~0x80; val |= 0x40; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 895 #define GPIO_PD7_PULL_DOWN_100K do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val |= 0x80; val &= ~0x40; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 896 #define GPIO_PD7_PULL_UP_10K do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val |= 0xC0; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 897 #define GPIO_PD7_PULL_TOGGLE do{ unsigned char val = analog_read(areg_15_pd4_pd7_pull); val ^= 0x40; analog_write(areg_15_pd4_pd7_pull, val); }while(0) 900 #define GPIO_PA0_OUTPUT_LOW ( (*(volatile unsigned char *)0x800583) &= (~0x01) ) 901 #define GPIO_PA0_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800583) |= 0x01 ) 902 #define GPIO_PA0_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800583) ^= 0x01 ) 903 #define GPIO_PA1_OUTPUT_LOW ( (*(volatile unsigned char *)0x800583) &= (~0x02) ) 904 #define GPIO_PA1_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800583) |= 0x02 ) 905 #define GPIO_PA1_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800583) ^= 0x02 ) 906 #define GPIO_PA2_OUTPUT_LOW ( (*(volatile unsigned char *)0x800583) &= (~0x04) ) 907 #define GPIO_PA2_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800583) |= 0x04 ) 908 #define GPIO_PA2_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800583) ^= 0x04 ) 909 #define GPIO_PA3_OUTPUT_LOW ( (*(volatile unsigned char *)0x800583) &= (~0x08) ) 910 #define GPIO_PA3_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800583) |= 0x08 ) 911 #define GPIO_PA3_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800583) ^= 0x08 ) 912 #define GPIO_PA4_OUTPUT_LOW ( (*(volatile unsigned char *)0x800583) &= (~0x10) ) 913 #define GPIO_PA4_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800583) |= 0x10 ) 914 #define GPIO_PA4_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800583) ^= 0x10 ) 915 #define GPIO_PA5_OUTPUT_LOW ( (*(volatile unsigned char *)0x800583) &= (~0x20) ) 916 #define GPIO_PA5_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800583) |= 0x20 ) 917 #define GPIO_PA5_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800583) ^= 0x20 ) 918 #define GPIO_PA6_OUTPUT_LOW ( (*(volatile unsigned char *)0x800583) &= (~0x40) ) 919 #define GPIO_PA6_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800583) |= 0x40 ) 920 #define GPIO_PA6_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800583) ^= 0x40 ) 921 #define GPIO_PA7_OUTPUT_LOW ( (*(volatile unsigned char *)0x800583) &= (~0x80) ) 922 #define GPIO_PA7_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800583) |= 0x80 ) 923 #define GPIO_PA7_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800583) ^= 0x80 ) 925 #define GPIO_PB0_OUTPUT_LOW ( (*(volatile unsigned char *)0x80058b) &= (~0x01) ) 926 #define GPIO_PB0_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80058b) |= 0x01 ) 927 #define GPIO_PB0_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80058b) ^= 0x01 ) 928 #define GPIO_PB1_OUTPUT_LOW ( (*(volatile unsigned char *)0x80058b) &= (~0x02) ) 929 #define GPIO_PB1_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80058b) |= 0x02 ) 930 #define GPIO_PB1_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80058b) ^= 0x02 ) 931 #define GPIO_PB2_OUTPUT_LOW ( (*(volatile unsigned char *)0x80058b) &= (~0x04) ) 932 #define GPIO_PB2_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80058b) |= 0x04 ) 933 #define GPIO_PB2_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80058b) ^= 0x04 ) 934 #define GPIO_PB3_OUTPUT_LOW ( (*(volatile unsigned char *)0x80058b) &= (~0x08) ) 935 #define GPIO_PB3_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80058b) |= 0x08 ) 936 #define GPIO_PB3_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80058b) ^= 0x08 ) 937 #define GPIO_PB4_OUTPUT_LOW ( (*(volatile unsigned char *)0x80058b) &= (~0x10) ) 938 #define GPIO_PB4_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80058b) |= 0x10 ) 939 #define GPIO_PB4_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80058b) ^= 0x10 ) 940 #define GPIO_PB5_OUTPUT_LOW ( (*(volatile unsigned char *)0x80058b) &= (~0x20) ) 941 #define GPIO_PB5_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80058b) |= 0x20 ) 942 #define GPIO_PB5_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80058b) ^= 0x20 ) 943 #define GPIO_PB6_OUTPUT_LOW ( (*(volatile unsigned char *)0x80058b) &= (~0x40) ) 944 #define GPIO_PB6_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80058b) |= 0x40 ) 945 #define GPIO_PB6_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80058b) ^= 0x40 ) 946 #define GPIO_PB7_OUTPUT_LOW ( (*(volatile unsigned char *)0x80058b) &= (~0x80) ) 947 #define GPIO_PB7_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80058b) |= 0x80 ) 948 #define GPIO_PB7_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80058b) ^= 0x80 ) 950 #define GPIO_PC0_OUTPUT_LOW ( (*(volatile unsigned char *)0x800593) &= (~0x01) ) 951 #define GPIO_PC0_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800593) |= 0x01 ) 952 #define GPIO_PC0_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800593) ^= 0x01 ) 953 #define GPIO_PC1_OUTPUT_LOW ( (*(volatile unsigned char *)0x800593) &= (~0x02) ) 954 #define GPIO_PC1_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800593) |= 0x02 ) 955 #define GPIO_PC1_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800593) ^= 0x02 ) 956 #define GPIO_PC2_OUTPUT_LOW ( (*(volatile unsigned char *)0x800593) &= (~0x04) ) 957 #define GPIO_PC2_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800593) |= 0x04 ) 958 #define GPIO_PC2_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800593) ^= 0x04 ) 959 #define GPIO_PC3_OUTPUT_LOW ( (*(volatile unsigned char *)0x800593) &= (~0x08) ) 960 #define GPIO_PC3_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800593) |= 0x08 ) 961 #define GPIO_PC3_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800593) ^= 0x08 ) 962 #define GPIO_PC4_OUTPUT_LOW ( (*(volatile unsigned char *)0x800593) &= (~0x10) ) 963 #define GPIO_PC4_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800593) |= 0x10 ) 964 #define GPIO_PC4_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800593) ^= 0x10 ) 965 #define GPIO_PC5_OUTPUT_LOW ( (*(volatile unsigned char *)0x800593) &= (~0x20) ) 966 #define GPIO_PC5_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800593) |= 0x20 ) 967 #define GPIO_PC5_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800593) ^= 0x20 ) 968 #define GPIO_PC6_OUTPUT_LOW ( (*(volatile unsigned char *)0x800593) &= (~0x40) ) 969 #define GPIO_PC6_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800593) |= 0x40 ) 970 #define GPIO_PC6_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800593) ^= 0x40 ) 971 #define GPIO_PC7_OUTPUT_LOW ( (*(volatile unsigned char *)0x800593) &= (~0x80) ) 972 #define GPIO_PC7_OUTPUT_HIGH ( (*(volatile unsigned char *)0x800593) |= 0x80 ) 973 #define GPIO_PC7_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x800593) ^= 0x80 ) 975 #define GPIO_PD0_OUTPUT_LOW ( (*(volatile unsigned char *)0x80059b) &= (~0x01) ) 976 #define GPIO_PD0_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80059b) |= 0x01 ) 977 #define GPIO_PD0_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80059b) ^= 0x01 ) 978 #define GPIO_PD1_OUTPUT_LOW ( (*(volatile unsigned char *)0x80059b) &= (~0x02) ) 979 #define GPIO_PD1_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80059b) |= 0x02 ) 980 #define GPIO_PD1_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80059b) ^= 0x02 ) 981 #define GPIO_PD2_OUTPUT_LOW ( (*(volatile unsigned char *)0x80059b) &= (~0x04) ) 982 #define GPIO_PD2_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80059b) |= 0x04 ) 983 #define GPIO_PD2_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80059b) ^= 0x04 ) 984 #define GPIO_PD3_OUTPUT_LOW ( (*(volatile unsigned char *)0x80059b) &= (~0x08) ) 985 #define GPIO_PD3_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80059b) |= 0x08 ) 986 #define GPIO_PD3_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80059b) ^= 0x08 ) 987 #define GPIO_PD4_OUTPUT_LOW ( (*(volatile unsigned char *)0x80059b) &= (~0x10) ) 988 #define GPIO_PD4_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80059b) |= 0x10 ) 989 #define GPIO_PD4_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80059b) ^= 0x10 ) 990 #define GPIO_PD5_OUTPUT_LOW ( (*(volatile unsigned char *)0x80059b) &= (~0x20) ) 991 #define GPIO_PD5_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80059b) |= 0x20 ) 992 #define GPIO_PD5_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80059b) ^= 0x20 ) 993 #define GPIO_PD6_OUTPUT_LOW ( (*(volatile unsigned char *)0x80059b) &= (~0x40) ) 994 #define GPIO_PD6_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80059b) |= 0x40 ) 995 #define GPIO_PD6_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80059b) ^= 0x40 ) 996 #define GPIO_PD7_OUTPUT_LOW ( (*(volatile unsigned char *)0x80059b) &= (~0x80) ) 997 #define GPIO_PD7_OUTPUT_HIGH ( (*(volatile unsigned char *)0x80059b) |= 0x80 ) 998 #define GPIO_PD7_OUTPUT_TOGGLE ( (*(volatile unsigned char *)0x80059b) ^= 0x80 )