1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870
use crate::generic::*; #[doc = "Master Control register 1"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Ctrlr1(pub u32); impl Ctrlr1 { #[doc = "Number of data frames"] pub const fn ndf(&self) -> u16 { let val = (self.0 >> 0u32) & 0xffff; val as u16 } #[doc = "Number of data frames"] pub fn set_ndf(&mut self, val: u16) { self.0 = (self.0 & !(0xffff << 0u32)) | (((val as u32) & 0xffff) << 0u32); } } impl Default for Ctrlr1 { fn default() -> Ctrlr1 { Ctrlr1(0) } } #[doc = "TX FIFO overflow interrupt clear"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Txoicr(pub u32); impl Txoicr { #[doc = "Clear-on-read transmit FIFO overflow interrupt"] pub const fn txoicr(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "Clear-on-read transmit FIFO overflow interrupt"] pub fn set_txoicr(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Txoicr { fn default() -> Txoicr { Txoicr(0) } } #[doc = "DMA RX data level"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Dmardlr(pub u32); impl Dmardlr { #[doc = "Receive data watermark level (DMARDLR+1)"] pub const fn dmardl(&self) -> u8 { let val = (self.0 >> 0u32) & 0xff; val as u8 } #[doc = "Receive data watermark level (DMARDLR+1)"] pub fn set_dmardl(&mut self, val: u8) { self.0 = (self.0 & !(0xff << 0u32)) | (((val as u32) & 0xff) << 0u32); } } impl Default for Dmardlr { fn default() -> Dmardlr { Dmardlr(0) } } #[doc = "Control register 0"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Ctrlr0(pub u32); impl Ctrlr0 { #[doc = "Slave select toggle enable"] pub const fn sste(&self) -> bool { let val = (self.0 >> 24u32) & 0x01; val != 0 } #[doc = "Slave select toggle enable"] pub fn set_sste(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 24u32)) | (((val as u32) & 0x01) << 24u32); } #[doc = "SPI frame format"] pub const fn spi_frf(&self) -> super::vals::Ctrlr0SpiFrf { let val = (self.0 >> 21u32) & 0x03; super::vals::Ctrlr0SpiFrf(val as u8) } #[doc = "SPI frame format"] pub fn set_spi_frf(&mut self, val: super::vals::Ctrlr0SpiFrf) { self.0 = (self.0 & !(0x03 << 21u32)) | (((val.0 as u32) & 0x03) << 21u32); } #[doc = "Data frame size in 32b transfer mode Value of n -> n+1 clocks per frame."] pub const fn dfs_32(&self) -> u8 { let val = (self.0 >> 16u32) & 0x1f; val as u8 } #[doc = "Data frame size in 32b transfer mode Value of n -> n+1 clocks per frame."] pub fn set_dfs_32(&mut self, val: u8) { self.0 = (self.0 & !(0x1f << 16u32)) | (((val as u32) & 0x1f) << 16u32); } #[doc = "Control frame size Value of n -> n+1 clocks per frame."] pub const fn cfs(&self) -> u8 { let val = (self.0 >> 12u32) & 0x0f; val as u8 } #[doc = "Control frame size Value of n -> n+1 clocks per frame."] pub fn set_cfs(&mut self, val: u8) { self.0 = (self.0 & !(0x0f << 12u32)) | (((val as u32) & 0x0f) << 12u32); } #[doc = "Shift register loop (test mode)"] pub const fn srl(&self) -> bool { let val = (self.0 >> 11u32) & 0x01; val != 0 } #[doc = "Shift register loop (test mode)"] pub fn set_srl(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 11u32)) | (((val as u32) & 0x01) << 11u32); } #[doc = "Slave output enable"] pub const fn slv_oe(&self) -> bool { let val = (self.0 >> 10u32) & 0x01; val != 0 } #[doc = "Slave output enable"] pub fn set_slv_oe(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 10u32)) | (((val as u32) & 0x01) << 10u32); } #[doc = "Transfer mode"] pub const fn tmod(&self) -> super::vals::Ctrlr0Tmod { let val = (self.0 >> 8u32) & 0x03; super::vals::Ctrlr0Tmod(val as u8) } #[doc = "Transfer mode"] pub fn set_tmod(&mut self, val: super::vals::Ctrlr0Tmod) { self.0 = (self.0 & !(0x03 << 8u32)) | (((val.0 as u32) & 0x03) << 8u32); } #[doc = "Serial clock polarity"] pub const fn scpol(&self) -> bool { let val = (self.0 >> 7u32) & 0x01; val != 0 } #[doc = "Serial clock polarity"] pub fn set_scpol(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 7u32)) | (((val as u32) & 0x01) << 7u32); } #[doc = "Serial clock phase"] pub const fn scph(&self) -> bool { let val = (self.0 >> 6u32) & 0x01; val != 0 } #[doc = "Serial clock phase"] pub fn set_scph(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 6u32)) | (((val as u32) & 0x01) << 6u32); } #[doc = "Frame format"] pub const fn frf(&self) -> u8 { let val = (self.0 >> 4u32) & 0x03; val as u8 } #[doc = "Frame format"] pub fn set_frf(&mut self, val: u8) { self.0 = (self.0 & !(0x03 << 4u32)) | (((val as u32) & 0x03) << 4u32); } #[doc = "Data frame size"] pub const fn dfs(&self) -> u8 { let val = (self.0 >> 0u32) & 0x0f; val as u8 } #[doc = "Data frame size"] pub fn set_dfs(&mut self, val: u8) { self.0 = (self.0 & !(0x0f << 0u32)) | (((val as u32) & 0x0f) << 0u32); } } impl Default for Ctrlr0 { fn default() -> Ctrlr0 { Ctrlr0(0) } } #[doc = "Raw interrupt status"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Risr(pub u32); impl Risr { #[doc = "Multi-master contention raw interrupt status"] pub const fn mstir(&self) -> bool { let val = (self.0 >> 5u32) & 0x01; val != 0 } #[doc = "Multi-master contention raw interrupt status"] pub fn set_mstir(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 5u32)) | (((val as u32) & 0x01) << 5u32); } #[doc = "Receive FIFO full raw interrupt status"] pub const fn rxfir(&self) -> bool { let val = (self.0 >> 4u32) & 0x01; val != 0 } #[doc = "Receive FIFO full raw interrupt status"] pub fn set_rxfir(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4u32)) | (((val as u32) & 0x01) << 4u32); } #[doc = "Receive FIFO overflow raw interrupt status"] pub const fn rxoir(&self) -> bool { let val = (self.0 >> 3u32) & 0x01; val != 0 } #[doc = "Receive FIFO overflow raw interrupt status"] pub fn set_rxoir(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 3u32)) | (((val as u32) & 0x01) << 3u32); } #[doc = "Receive FIFO underflow raw interrupt status"] pub const fn rxuir(&self) -> bool { let val = (self.0 >> 2u32) & 0x01; val != 0 } #[doc = "Receive FIFO underflow raw interrupt status"] pub fn set_rxuir(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 2u32)) | (((val as u32) & 0x01) << 2u32); } #[doc = "Transmit FIFO overflow raw interrupt status"] pub const fn txoir(&self) -> bool { let val = (self.0 >> 1u32) & 0x01; val != 0 } #[doc = "Transmit FIFO overflow raw interrupt status"] pub fn set_txoir(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 1u32)) | (((val as u32) & 0x01) << 1u32); } #[doc = "Transmit FIFO empty raw interrupt status"] pub const fn txeir(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "Transmit FIFO empty raw interrupt status"] pub fn set_txeir(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Risr { fn default() -> Risr { Risr(0) } } #[doc = "Interrupt clear"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Icr(pub u32); impl Icr { #[doc = "Clear-on-read all active interrupts"] pub const fn icr(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "Clear-on-read all active interrupts"] pub fn set_icr(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Icr { fn default() -> Icr { Icr(0) } } #[doc = "Slave enable"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Ser(pub u32); impl Ser { #[doc = "For each bit: 0 -> slave not selected 1 -> slave selected"] pub const fn ser(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "For each bit: 0 -> slave not selected 1 -> slave selected"] pub fn set_ser(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Ser { fn default() -> Ser { Ser(0) } } #[doc = "RX FIFO overflow interrupt clear"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Rxoicr(pub u32); impl Rxoicr { #[doc = "Clear-on-read receive FIFO overflow interrupt"] pub const fn rxoicr(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "Clear-on-read receive FIFO overflow interrupt"] pub fn set_rxoicr(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Rxoicr { fn default() -> Rxoicr { Rxoicr(0) } } #[doc = "Microwire Control"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Mwcr(pub u32); impl Mwcr { #[doc = "Microwire handshaking"] pub const fn mhs(&self) -> bool { let val = (self.0 >> 2u32) & 0x01; val != 0 } #[doc = "Microwire handshaking"] pub fn set_mhs(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 2u32)) | (((val as u32) & 0x01) << 2u32); } #[doc = "Microwire control"] pub const fn mdd(&self) -> bool { let val = (self.0 >> 1u32) & 0x01; val != 0 } #[doc = "Microwire control"] pub fn set_mdd(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 1u32)) | (((val as u32) & 0x01) << 1u32); } #[doc = "Microwire transfer mode"] pub const fn mwmod(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "Microwire transfer mode"] pub fn set_mwmod(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Mwcr { fn default() -> Mwcr { Mwcr(0) } } #[doc = "TX drive edge"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct TxdDriveEdge(pub u32); impl TxdDriveEdge { #[doc = "TXD drive edge"] pub const fn tde(&self) -> u8 { let val = (self.0 >> 0u32) & 0xff; val as u8 } #[doc = "TXD drive edge"] pub fn set_tde(&mut self, val: u8) { self.0 = (self.0 & !(0xff << 0u32)) | (((val as u32) & 0xff) << 0u32); } } impl Default for TxdDriveEdge { fn default() -> TxdDriveEdge { TxdDriveEdge(0) } } #[doc = "RX FIFO underflow interrupt clear"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Rxuicr(pub u32); impl Rxuicr { #[doc = "Clear-on-read receive FIFO underflow interrupt"] pub const fn rxuicr(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "Clear-on-read receive FIFO underflow interrupt"] pub fn set_rxuicr(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Rxuicr { fn default() -> Rxuicr { Rxuicr(0) } } #[doc = "RX sample delay"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct RxSampleDly(pub u32); impl RxSampleDly { #[doc = "RXD sample delay (in SCLK cycles)"] pub const fn rsd(&self) -> u8 { let val = (self.0 >> 0u32) & 0xff; val as u8 } #[doc = "RXD sample delay (in SCLK cycles)"] pub fn set_rsd(&mut self, val: u8) { self.0 = (self.0 & !(0xff << 0u32)) | (((val as u32) & 0xff) << 0u32); } } impl Default for RxSampleDly { fn default() -> RxSampleDly { RxSampleDly(0) } } #[doc = "RX FIFO threshold level"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Rxftlr(pub u32); impl Rxftlr { #[doc = "Receive FIFO threshold"] pub const fn rft(&self) -> u8 { let val = (self.0 >> 0u32) & 0xff; val as u8 } #[doc = "Receive FIFO threshold"] pub fn set_rft(&mut self, val: u8) { self.0 = (self.0 & !(0xff << 0u32)) | (((val as u32) & 0xff) << 0u32); } } impl Default for Rxftlr { fn default() -> Rxftlr { Rxftlr(0) } } #[doc = "Multi-master interrupt clear"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Msticr(pub u32); impl Msticr { #[doc = "Clear-on-read multi-master contention interrupt"] pub const fn msticr(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "Clear-on-read multi-master contention interrupt"] pub fn set_msticr(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Msticr { fn default() -> Msticr { Msticr(0) } } #[doc = "SSI Enable"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Ssienr(pub u32); impl Ssienr { #[doc = "SSI enable"] pub const fn ssi_en(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "SSI enable"] pub fn set_ssi_en(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Ssienr { fn default() -> Ssienr { Ssienr(0) } } #[doc = "SPI control"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct SpiCtrlr0(pub u32); impl SpiCtrlr0 { #[doc = "SPI Command to send in XIP mode (INST_L = 8-bit) or to append to Address (INST_L = 0-bit)"] pub const fn xip_cmd(&self) -> u8 { let val = (self.0 >> 24u32) & 0xff; val as u8 } #[doc = "SPI Command to send in XIP mode (INST_L = 8-bit) or to append to Address (INST_L = 0-bit)"] pub fn set_xip_cmd(&mut self, val: u8) { self.0 = (self.0 & !(0xff << 24u32)) | (((val as u32) & 0xff) << 24u32); } #[doc = "Read data strobe enable"] pub const fn spi_rxds_en(&self) -> bool { let val = (self.0 >> 18u32) & 0x01; val != 0 } #[doc = "Read data strobe enable"] pub fn set_spi_rxds_en(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 18u32)) | (((val as u32) & 0x01) << 18u32); } #[doc = "Instruction DDR transfer enable"] pub const fn inst_ddr_en(&self) -> bool { let val = (self.0 >> 17u32) & 0x01; val != 0 } #[doc = "Instruction DDR transfer enable"] pub fn set_inst_ddr_en(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 17u32)) | (((val as u32) & 0x01) << 17u32); } #[doc = "SPI DDR transfer enable"] pub const fn spi_ddr_en(&self) -> bool { let val = (self.0 >> 16u32) & 0x01; val != 0 } #[doc = "SPI DDR transfer enable"] pub fn set_spi_ddr_en(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 16u32)) | (((val as u32) & 0x01) << 16u32); } #[doc = "Wait cycles between control frame transmit and data reception (in SCLK cycles)"] pub const fn wait_cycles(&self) -> u8 { let val = (self.0 >> 11u32) & 0x1f; val as u8 } #[doc = "Wait cycles between control frame transmit and data reception (in SCLK cycles)"] pub fn set_wait_cycles(&mut self, val: u8) { self.0 = (self.0 & !(0x1f << 11u32)) | (((val as u32) & 0x1f) << 11u32); } #[doc = "Instruction length (0/4/8/16b)"] pub const fn inst_l(&self) -> super::vals::SpiCtrlr0InstL { let val = (self.0 >> 8u32) & 0x03; super::vals::SpiCtrlr0InstL(val as u8) } #[doc = "Instruction length (0/4/8/16b)"] pub fn set_inst_l(&mut self, val: super::vals::SpiCtrlr0InstL) { self.0 = (self.0 & !(0x03 << 8u32)) | (((val.0 as u32) & 0x03) << 8u32); } #[doc = "Address length (0b-60b in 4b increments)"] pub const fn addr_l(&self) -> u8 { let val = (self.0 >> 2u32) & 0x0f; val as u8 } #[doc = "Address length (0b-60b in 4b increments)"] pub fn set_addr_l(&mut self, val: u8) { self.0 = (self.0 & !(0x0f << 2u32)) | (((val as u32) & 0x0f) << 2u32); } #[doc = "Address and instruction transfer format"] pub const fn trans_type(&self) -> super::vals::SpiCtrlr0TransType { let val = (self.0 >> 0u32) & 0x03; super::vals::SpiCtrlr0TransType(val as u8) } #[doc = "Address and instruction transfer format"] pub fn set_trans_type(&mut self, val: super::vals::SpiCtrlr0TransType) { self.0 = (self.0 & !(0x03 << 0u32)) | (((val.0 as u32) & 0x03) << 0u32); } } impl Default for SpiCtrlr0 { fn default() -> SpiCtrlr0 { SpiCtrlr0(0) } } #[doc = "Interrupt mask"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Imr(pub u32); impl Imr { #[doc = "Multi-master contention interrupt mask"] pub const fn mstim(&self) -> bool { let val = (self.0 >> 5u32) & 0x01; val != 0 } #[doc = "Multi-master contention interrupt mask"] pub fn set_mstim(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 5u32)) | (((val as u32) & 0x01) << 5u32); } #[doc = "Receive FIFO full interrupt mask"] pub const fn rxfim(&self) -> bool { let val = (self.0 >> 4u32) & 0x01; val != 0 } #[doc = "Receive FIFO full interrupt mask"] pub fn set_rxfim(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4u32)) | (((val as u32) & 0x01) << 4u32); } #[doc = "Receive FIFO overflow interrupt mask"] pub const fn rxoim(&self) -> bool { let val = (self.0 >> 3u32) & 0x01; val != 0 } #[doc = "Receive FIFO overflow interrupt mask"] pub fn set_rxoim(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 3u32)) | (((val as u32) & 0x01) << 3u32); } #[doc = "Receive FIFO underflow interrupt mask"] pub const fn rxuim(&self) -> bool { let val = (self.0 >> 2u32) & 0x01; val != 0 } #[doc = "Receive FIFO underflow interrupt mask"] pub fn set_rxuim(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 2u32)) | (((val as u32) & 0x01) << 2u32); } #[doc = "Transmit FIFO overflow interrupt mask"] pub const fn txoim(&self) -> bool { let val = (self.0 >> 1u32) & 0x01; val != 0 } #[doc = "Transmit FIFO overflow interrupt mask"] pub fn set_txoim(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 1u32)) | (((val as u32) & 0x01) << 1u32); } #[doc = "Transmit FIFO empty interrupt mask"] pub const fn txeim(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "Transmit FIFO empty interrupt mask"] pub fn set_txeim(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Imr { fn default() -> Imr { Imr(0) } } #[doc = "RX FIFO level"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Rxflr(pub u32); impl Rxflr { #[doc = "Receive FIFO level"] pub const fn rxtfl(&self) -> u8 { let val = (self.0 >> 0u32) & 0xff; val as u8 } #[doc = "Receive FIFO level"] pub fn set_rxtfl(&mut self, val: u8) { self.0 = (self.0 & !(0xff << 0u32)) | (((val as u32) & 0xff) << 0u32); } } impl Default for Rxflr { fn default() -> Rxflr { Rxflr(0) } } #[doc = "TX FIFO threshold level"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Txftlr(pub u32); impl Txftlr { #[doc = "Transmit FIFO threshold"] pub const fn tft(&self) -> u8 { let val = (self.0 >> 0u32) & 0xff; val as u8 } #[doc = "Transmit FIFO threshold"] pub fn set_tft(&mut self, val: u8) { self.0 = (self.0 & !(0xff << 0u32)) | (((val as u32) & 0xff) << 0u32); } } impl Default for Txftlr { fn default() -> Txftlr { Txftlr(0) } } #[doc = "Baud rate"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Baudr(pub u32); impl Baudr { #[doc = "SSI clock divider"] pub const fn sckdv(&self) -> u16 { let val = (self.0 >> 0u32) & 0xffff; val as u16 } #[doc = "SSI clock divider"] pub fn set_sckdv(&mut self, val: u16) { self.0 = (self.0 & !(0xffff << 0u32)) | (((val as u32) & 0xffff) << 0u32); } } impl Default for Baudr { fn default() -> Baudr { Baudr(0) } } #[doc = "DMA control"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Dmacr(pub u32); impl Dmacr { #[doc = "Transmit DMA enable"] pub const fn tdmae(&self) -> bool { let val = (self.0 >> 1u32) & 0x01; val != 0 } #[doc = "Transmit DMA enable"] pub fn set_tdmae(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 1u32)) | (((val as u32) & 0x01) << 1u32); } #[doc = "Receive DMA enable"] pub const fn rdmae(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "Receive DMA enable"] pub fn set_rdmae(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Dmacr { fn default() -> Dmacr { Dmacr(0) } } #[doc = "DMA TX data level"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Dmatdlr(pub u32); impl Dmatdlr { #[doc = "Transmit data watermark level"] pub const fn dmatdl(&self) -> u8 { let val = (self.0 >> 0u32) & 0xff; val as u8 } #[doc = "Transmit data watermark level"] pub fn set_dmatdl(&mut self, val: u8) { self.0 = (self.0 & !(0xff << 0u32)) | (((val as u32) & 0xff) << 0u32); } } impl Default for Dmatdlr { fn default() -> Dmatdlr { Dmatdlr(0) } } #[doc = "Status register"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Sr(pub u32); impl Sr { #[doc = "Data collision error"] pub const fn dcol(&self) -> bool { let val = (self.0 >> 6u32) & 0x01; val != 0 } #[doc = "Data collision error"] pub fn set_dcol(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 6u32)) | (((val as u32) & 0x01) << 6u32); } #[doc = "Transmission error"] pub const fn txe(&self) -> bool { let val = (self.0 >> 5u32) & 0x01; val != 0 } #[doc = "Transmission error"] pub fn set_txe(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 5u32)) | (((val as u32) & 0x01) << 5u32); } #[doc = "Receive FIFO full"] pub const fn rff(&self) -> bool { let val = (self.0 >> 4u32) & 0x01; val != 0 } #[doc = "Receive FIFO full"] pub fn set_rff(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4u32)) | (((val as u32) & 0x01) << 4u32); } #[doc = "Receive FIFO not empty"] pub const fn rfne(&self) -> bool { let val = (self.0 >> 3u32) & 0x01; val != 0 } #[doc = "Receive FIFO not empty"] pub fn set_rfne(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 3u32)) | (((val as u32) & 0x01) << 3u32); } #[doc = "Transmit FIFO empty"] pub const fn tfe(&self) -> bool { let val = (self.0 >> 2u32) & 0x01; val != 0 } #[doc = "Transmit FIFO empty"] pub fn set_tfe(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 2u32)) | (((val as u32) & 0x01) << 2u32); } #[doc = "Transmit FIFO not full"] pub const fn tfnf(&self) -> bool { let val = (self.0 >> 1u32) & 0x01; val != 0 } #[doc = "Transmit FIFO not full"] pub fn set_tfnf(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 1u32)) | (((val as u32) & 0x01) << 1u32); } #[doc = "SSI busy flag"] pub const fn busy(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "SSI busy flag"] pub fn set_busy(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Sr { fn default() -> Sr { Sr(0) } } #[doc = "Interrupt status"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Isr(pub u32); impl Isr { #[doc = "Multi-master contention interrupt status"] pub const fn mstis(&self) -> bool { let val = (self.0 >> 5u32) & 0x01; val != 0 } #[doc = "Multi-master contention interrupt status"] pub fn set_mstis(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 5u32)) | (((val as u32) & 0x01) << 5u32); } #[doc = "Receive FIFO full interrupt status"] pub const fn rxfis(&self) -> bool { let val = (self.0 >> 4u32) & 0x01; val != 0 } #[doc = "Receive FIFO full interrupt status"] pub fn set_rxfis(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 4u32)) | (((val as u32) & 0x01) << 4u32); } #[doc = "Receive FIFO overflow interrupt status"] pub const fn rxois(&self) -> bool { let val = (self.0 >> 3u32) & 0x01; val != 0 } #[doc = "Receive FIFO overflow interrupt status"] pub fn set_rxois(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 3u32)) | (((val as u32) & 0x01) << 3u32); } #[doc = "Receive FIFO underflow interrupt status"] pub const fn rxuis(&self) -> bool { let val = (self.0 >> 2u32) & 0x01; val != 0 } #[doc = "Receive FIFO underflow interrupt status"] pub fn set_rxuis(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 2u32)) | (((val as u32) & 0x01) << 2u32); } #[doc = "Transmit FIFO overflow interrupt status"] pub const fn txois(&self) -> bool { let val = (self.0 >> 1u32) & 0x01; val != 0 } #[doc = "Transmit FIFO overflow interrupt status"] pub fn set_txois(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 1u32)) | (((val as u32) & 0x01) << 1u32); } #[doc = "Transmit FIFO empty interrupt status"] pub const fn txeis(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "Transmit FIFO empty interrupt status"] pub fn set_txeis(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Isr { fn default() -> Isr { Isr(0) } } #[doc = "TX FIFO level"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Txflr(pub u32); impl Txflr { #[doc = "Transmit FIFO level"] pub const fn tftfl(&self) -> u8 { let val = (self.0 >> 0u32) & 0xff; val as u8 } #[doc = "Transmit FIFO level"] pub fn set_tftfl(&mut self, val: u8) { self.0 = (self.0 & !(0xff << 0u32)) | (((val as u32) & 0xff) << 0u32); } } impl Default for Txflr { fn default() -> Txflr { Txflr(0) } }